FINERACT-835: Upgrade Swagger Annotations to Annotations 2.0 (#1101)
Co-authored-by: Michael Vorburger ⛑️ <mike@vorburger.ch>
This commit is contained in:
co-authored by
Michael Vorburger ⛑️
parent
dff6109c81
commit
d9df7fe245
+1
-1
@@ -74,6 +74,6 @@ script:
|
|||||||
# and Docker test does not run if integration test fails, which makes PR failure easier to understand.
|
# and Docker test does not run if integration test fails, which makes PR failure easier to understand.
|
||||||
# @see https://docs.travis-ci.com/user/job-lifecycle/#customizing-the-build-phase
|
# @see https://docs.travis-ci.com/user/job-lifecycle/#customizing-the-build-phase
|
||||||
# NOTE: Sleep after docker-compose increased to 60 seconds as often Travis would fail to get Docker up in 30 seconds
|
# NOTE: Sleep after docker-compose increased to 60 seconds as often Travis would fail to get Docker up in 30 seconds
|
||||||
- ./gradlew --console=plain licenseMain licenseTest licenseIntegrationTest check && ./gradlew --console=plain integrationTest --fail-fast && sudo service mysql stop && docker-compose build && docker-compose up -d && sleep 30s && http --verify=no --timeout 240 --check-status get https://localhost:8443/fineract-provider/actuator/health && (( $(http --verify=no --timeout 30 --check-status --body get https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 ))
|
- ./gradlew --console=plain -q licenseMain licenseTest licenseIntegrationTest check && ./gradlew --console=plain integrationTest --fail-fast && sudo service mysql stop && docker-compose build && docker-compose up -d && sleep 60s && http --verify=no --timeout 240 --check-status get https://localhost:8443/fineract-provider/actuator/health && (( $(http --verify=no --timeout 30 --check-status --body get https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 ))
|
||||||
# We stop the mysql system service when running the Docker test to avoid port 3306 conflicts (unless we run the mysql in docker-compose on another port; req. FINERACT-773)
|
# We stop the mysql system service when running the Docker test to avoid port 3306 conflicts (unless we run the mysql in docker-compose on another port; req. FINERACT-773)
|
||||||
# The fany /actuator/info test makes sure that has more than 100 characters of JSON to test that the git.properties worked (see FINERACT-983)
|
# The fany /actuator/info test makes sure that has more than 100 characters of JSON to test that the git.properties worked (see FINERACT-983)
|
||||||
|
|||||||
+2
-2
@@ -22,7 +22,7 @@ RUN apt-get update -qq && apt-get install -y wget
|
|||||||
COPY . fineract
|
COPY . fineract
|
||||||
WORKDIR /fineract
|
WORKDIR /fineract
|
||||||
|
|
||||||
RUN ./gradlew --no-daemon -x rat -x test bootJar
|
RUN ./gradlew --no-daemon -q -x rat -x test bootJar
|
||||||
|
|
||||||
WORKDIR /fineract/target
|
WORKDIR /fineract/target
|
||||||
RUN jar -xf /fineract/build/libs/fineract-provider.jar
|
RUN jar -xf /fineract/build/libs/fineract-provider.jar
|
||||||
@@ -33,7 +33,7 @@ RUN jar -xf /fineract/build/libs/fineract-provider.jar
|
|||||||
# allowing implementations to switch the driver used by changing start-up parameters (for both tenants and each tenant DB)
|
# allowing implementations to switch the driver used by changing start-up parameters (for both tenants and each tenant DB)
|
||||||
# The commented out lines in the docker-compose.yml illustrate how to do this.
|
# The commented out lines in the docker-compose.yml illustrate how to do this.
|
||||||
WORKDIR /fineract/target/BOOT-INF/lib
|
WORKDIR /fineract/target/BOOT-INF/lib
|
||||||
RUN wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.20/mysql-connector-java-8.0.20.jar
|
RUN wget -q https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.20/mysql-connector-java-8.0.20.jar
|
||||||
|
|
||||||
# =========================================
|
# =========================================
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ dependencyManagement {
|
|||||||
dependency 'com.jayway.jsonpath:json-path:2.4.0'
|
dependency 'com.jayway.jsonpath:json-path:2.4.0'
|
||||||
dependency 'org.apache.tika:tika-core:1.24.1'
|
dependency 'org.apache.tika:tika-core:1.24.1'
|
||||||
dependency 'org.apache.httpcomponents:httpclient:4.5.12'
|
dependency 'org.apache.httpcomponents:httpclient:4.5.12'
|
||||||
dependency 'io.swagger:swagger-jersey-jaxrs:1.6.1'
|
dependency 'io.swagger.core.v3:swagger-annotations:2.1.2'
|
||||||
dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4'
|
dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4'
|
||||||
dependency 'jakarta.jms:jakarta.jms-api:2.0.3'
|
dependency 'jakarta.jms:jakarta.jms-api:2.0.3'
|
||||||
dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
|
dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
|
||||||
@@ -179,6 +179,8 @@ eclipse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.setProperty("openjpa.Log", "commons")
|
||||||
|
|
||||||
openjpa {
|
openjpa {
|
||||||
includes = ['**/AbstractPersistableCustom.class', '**/domain/*.class']
|
includes = ['**/AbstractPersistableCustom.class', '**/domain/*.class']
|
||||||
enhance {
|
enhance {
|
||||||
@@ -189,6 +191,7 @@ openjpa {
|
|||||||
// Configuration for Swagger documentation generation task
|
// Configuration for Swagger documentation generation task
|
||||||
// https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-gradle-plugin
|
// https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-gradle-plugin
|
||||||
resolve {
|
resolve {
|
||||||
|
logging.captureStandardOutput LogLevel.INFO
|
||||||
outputFileName = 'fineract'
|
outputFileName = 'fineract'
|
||||||
outputFormat = 'JSON'
|
outputFormat = 'JSON'
|
||||||
prettyPrint = 'TRUE'
|
prettyPrint = 'TRUE'
|
||||||
@@ -626,6 +629,7 @@ cargoRunLocal.dependsOn bootWar
|
|||||||
cargoStartLocal.dependsOn bootWar
|
cargoStartLocal.dependsOn bootWar
|
||||||
cargoStartLocal.mustRunAfter "integrationTestClasses"
|
cargoStartLocal.mustRunAfter "integrationTestClasses"
|
||||||
cargoStartLocal.mustRunAfter "enhance"
|
cargoStartLocal.mustRunAfter "enhance"
|
||||||
|
cargoStartLocal.mustRunAfter "resolve"
|
||||||
|
|
||||||
/* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
|
/* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
|
||||||
sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir
|
sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir
|
||||||
|
|||||||
@@ -76,11 +76,9 @@ dependencies {
|
|||||||
|
|
||||||
'javax.cache:cache-api',
|
'javax.cache:cache-api',
|
||||||
|
|
||||||
'com.github.spotbugs:spotbugs-annotations'
|
'com.github.spotbugs:spotbugs-annotations',
|
||||||
|
'io.swagger.core.v3:swagger-annotations'
|
||||||
)
|
)
|
||||||
implementation ('io.swagger:swagger-jersey-jaxrs') {
|
|
||||||
exclude group: 'javax.validation'
|
|
||||||
}
|
|
||||||
implementation ('org.apache.activemq:activemq-broker') {
|
implementation ('org.apache.activemq:activemq-broker') {
|
||||||
exclude group: 'org.apache.geronimo.specs'
|
exclude group: 'org.apache.geronimo.specs'
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-19
@@ -18,15 +18,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.accrual.api;
|
package org.apache.fineract.accounting.accrual.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.ApiResponses;
|
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.POST;
|
import javax.ws.rs.POST;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
@@ -44,9 +41,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/runaccruals")
|
@Path("/runaccruals")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Periodic Accrual Accounting" })
|
@Tag(name = "Periodic Accrual Accounting", description = "Periodic Accrual is to accrue the loan income till the specific date or till batch job scheduled time.\n")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Periodic Accrual Accounting", description = "Periodic Accrual is to accrue the loan income till the specific date or till batch job scheduled time.\n") })
|
|
||||||
public class AccrualAccountingApiResource {
|
public class AccrualAccountingApiResource {
|
||||||
|
|
||||||
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
||||||
@@ -63,13 +58,11 @@ public class AccrualAccountingApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Executes Periodic Accrual Accounting", httpMethod = "POST", notes = "Mandatory Fields\n" + "\n" + "tillDate\n")
|
@Operation(summary = "Executes Periodic Accrual Accounting", method = "POST", description = "Mandatory Fields\n" + "\n" + "tillDate\n")
|
||||||
@ApiImplicitParams({
|
@Parameter(required = true, schema = @Schema(implementation = AccrualAccountingApiResourceSwagger.PostRunaccrualsRequest.class, description = "Request Body\n"
|
||||||
@ApiImplicitParam(paramType = "body", required = true, type = "body", dataTypeClass = AccrualAccountingApiResourceSwagger.PostRunaccrualsRequest.class, value = "Request Body\n"
|
+ "\n" + "Field Descriptions: \n" + "tillDate: \n" + "which specifies periodic accruals should happen till the given Date"))
|
||||||
+ "\n" + "Field Descriptions: \n" + "tillDate: \n"
|
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") })
|
||||||
+ "which specifies periodic accruals should happen till the given Date") })
|
public String executePeriodicAccrualAccounting(@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK") })
|
|
||||||
public String executePeriodicAccrualAccounting(@ApiParam(hidden = true) final String jsonRequestBody) {
|
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().excuteAccrualAccounting().withJson(jsonRequestBody).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().excuteAccrualAccounting().withJson(jsonRequestBody).build();
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.accrual.api;
|
package org.apache.fineract.accounting.accrual.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sanyam on 24/7/17.
|
* Created by sanyam on 24/7/17.
|
||||||
@@ -30,18 +29,18 @@ final class AccrualAccountingApiResourceSwagger {
|
|||||||
// don't allow to instantiate; use only for live API documentation
|
// don't allow to instantiate; use only for live API documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "runaccrualsRequest")
|
@Schema(description = "runaccrualsRequest")
|
||||||
public static final class PostRunaccrualsRequest {
|
public static final class PostRunaccrualsRequest {
|
||||||
|
|
||||||
private PostRunaccrualsRequest() {
|
private PostRunaccrualsRequest() {
|
||||||
// don't allow to instantiate; use only for live API documentation
|
// don't allow to instantiate; use only for live API documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "04 June 2014", notes = "which specifies periodic accruals should happen till the given Date", required = true)
|
@Schema(example = "04 June 2014", description = "which specifies periodic accruals should happen till the given Date", required = true)
|
||||||
public String tillDate;
|
public String tillDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+36
-35
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.closure.api;
|
package org.apache.fineract.accounting.closure.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -61,12 +61,11 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/glclosures")
|
@Path("/glclosures")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Accounting Closure" })
|
@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"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n" + "Field Descriptions\n" + "closingDate\n" + "The date for which the accounting closure is defined\n" + "officeId\n"
|
||||||
@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"
|
+ "The identifer of the branch for which accounting has been closed\n" + "comments\n"
|
||||||
+ "\n" + "Field Descriptions\n" + "closingDate\n" + "The date for which the accounting closure is defined\n" + "officeId\n"
|
+ "Description associated with an Accounting closure")
|
||||||
+ "The identifer of the branch for which accounting has been closed\n" + "comments\n"
|
|
||||||
+ "Description associated with an Accounting closure") })
|
|
||||||
public class GLClosuresApiResource {
|
public class GLClosuresApiResource {
|
||||||
|
|
||||||
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
@@ -98,11 +97,11 @@ public class GLClosuresApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Accounting closures", notes = "Example Requests:\n" + "\n" + "glclosures")
|
@Operation(summary = "List Accounting closures", description = "Example Requests:\n" + "\n" + "glclosures")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, response = GLClosuresApiResourceSwagger.GetGlClosureResponse.class, message = "", responseContainer = "list") })
|
@ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class, description = "")))) })
|
||||||
public String retrieveAllClosures(@Context final UriInfo uriInfo,
|
public String retrieveAllClosures(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId) {
|
@QueryParam("officeId") @Parameter(name = "officeId") final Long officeId) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||||
final List<GLClosureData> glClosureDatas = this.glClosureReadPlatformService.retrieveAllGLClosures(officeId);
|
final List<GLClosureData> glClosureDatas = this.glClosureReadPlatformService.retrieveAllGLClosures(officeId);
|
||||||
@@ -115,10 +114,11 @@ public class GLClosuresApiResource {
|
|||||||
@Path("{glClosureId}")
|
@Path("{glClosureId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve an Accounting Closure", notes = "Example Requests:\n" + "\n" + "glclosures/1\n" + "\n" + "\n"
|
@Operation(summary = "Retrieve an Accounting Closure", description = "Example Requests:\n" + "\n" + "glclosures/1\n" + "\n" + "\n"
|
||||||
+ "/glclosures/1?fields=officeName,closingDate")
|
+ "/glclosures/1?fields=officeName,closingDate")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = GLClosuresApiResourceSwagger.GetGlClosureResponse.class) })
|
@ApiResponses({
|
||||||
public String retreiveClosure(@PathParam("glClosureId") @ApiParam(value = "glClosureId") final Long glClosureId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class))) })
|
||||||
|
public String retreiveClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||||
@@ -137,11 +137,11 @@ public class GLClosuresApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create an Accounting Closure", notes = "Mandatory Fields\n" + "officeId,closingDate")
|
@Operation(summary = "Create an Accounting Closure", description = "Mandatory Fields\n" + "officeId,closingDate")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PostGlClosuresRequest.class, description = "Request Body")))
|
||||||
@ApiImplicitParam(paramType = "body", required = true, type = "body", dataTypeClass = GLClosuresApiResourceSwagger.PostGlClosuresRequest.class, value = "Request Body") })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = GLClosuresApiResourceSwagger.PostGlClosuresResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PostGlClosuresResponse.class))) })
|
||||||
public String createGLClosure(@ApiParam(hidden = true) final String jsonRequestBody) {
|
public String createGLClosure(@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createGLClosure().withJson(jsonRequestBody).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createGLClosure().withJson(jsonRequestBody).build();
|
||||||
|
|
||||||
@@ -154,12 +154,12 @@ public class GLClosuresApiResource {
|
|||||||
@Path("{glClosureId}")
|
@Path("{glClosureId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update an Accounting closure", notes = "Once an accounting closure is created, only the comments associated with it may be edited")
|
@Operation(summary = "Update an Accounting closure", description = "Once an accounting closure is created, only the comments associated with it may be edited")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresRequest.class, required = true)))
|
||||||
@ApiImplicitParam(paramType = "body", value = "Request body", dataType = "body", dataTypeClass = GLClosuresApiResourceSwagger.PutGlClosuresRequest.class, required = true) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = GLClosuresApiResourceSwagger.PutGlClosuresResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresResponse.class))) })
|
||||||
public String updateGLClosure(@PathParam("glClosureId") @ApiParam(value = "glClosureId") final Long glClosureId,
|
public String updateGLClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId,
|
||||||
@ApiParam(hidden = true) final String jsonRequestBody) {
|
@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGLClosure(glClosureId).withJson(jsonRequestBody).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGLClosure(glClosureId).withJson(jsonRequestBody).build();
|
||||||
|
|
||||||
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
@@ -171,9 +171,10 @@ public class GLClosuresApiResource {
|
|||||||
@Path("{glClosureId}")
|
@Path("{glClosureId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete an accounting closure", notes = "Note: Only the latest accounting closure associated with a branch may be deleted.")
|
@Operation(summary = "Delete an accounting closure", description = "Note: Only the latest accounting closure associated with a branch may be deleted.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = GLClosuresApiResourceSwagger.DeleteGlClosuresResponse.class) })
|
@ApiResponses({
|
||||||
public String deleteGLClosure(@PathParam("glClosureId") @ApiParam(value = "glclosureId") final Long glClosureId) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.DeleteGlClosuresResponse.class))) })
|
||||||
|
public String deleteGLClosure(@PathParam("glClosureId") @Parameter(description = "glclosureId") final Long glClosureId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGLClosure(glClosureId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGLClosure(glClosureId).build();
|
||||||
|
|
||||||
|
|||||||
+32
-33
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.closure.api;
|
package org.apache.fineract.accounting.closure.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
final class GLClosuresApiResourceSwagger {
|
final class GLClosuresApiResourceSwagger {
|
||||||
@@ -33,108 +32,108 @@ final class GLClosuresApiResourceSwagger {
|
|||||||
*/
|
*/
|
||||||
// Check !!
|
// Check !!
|
||||||
|
|
||||||
@ApiModel(value = "GetGLClosureResponse")
|
@Schema(description = "GetGLClosureResponse")
|
||||||
public static final class GetGlClosureResponse {
|
public static final class GetGlClosureResponse {
|
||||||
|
|
||||||
private GetGlClosureResponse() {
|
private GetGlClosureResponse() {
|
||||||
// dont allow to initiatiate
|
// dont allow to initiatiate
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "7")
|
@Schema(example = "7")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
@ApiModelProperty(example = "2013,1,2")
|
@Schema(example = "2013,1,2")
|
||||||
public LocalDate closingDate;
|
public LocalDate closingDate;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public boolean deleted;
|
public boolean deleted;
|
||||||
@ApiModelProperty(example = "2013,1,3")
|
@Schema(example = "2013,1,3")
|
||||||
public LocalDate createdDate;
|
public LocalDate createdDate;
|
||||||
@ApiModelProperty(example = "2013,1,3")
|
@Schema(example = "2013,1,3")
|
||||||
public LocalDate lastUpdatedDate;
|
public LocalDate lastUpdatedDate;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long createdByUserId;
|
public Long createdByUserId;
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String createdByUsername;
|
public String createdByUsername;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long lastUpdatedByUserId;
|
public Long lastUpdatedByUserId;
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String lastUpdatedByUsername;
|
public String lastUpdatedByUsername;
|
||||||
@ApiModelProperty(example = "closed")
|
@Schema(example = "closed")
|
||||||
public String comments;
|
public String comments;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostGLCLosuresRequest")
|
@Schema(description = "PostGLCLosuresRequest")
|
||||||
public static final class PostGlClosuresRequest {
|
public static final class PostGlClosuresRequest {
|
||||||
|
|
||||||
private PostGlClosuresRequest() {
|
private PostGlClosuresRequest() {
|
||||||
// don't allow to instantiate; use only for live API documentation
|
// don't allow to instantiate; use only for live API documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "06 December 2012")
|
@Schema(example = "06 December 2012")
|
||||||
public LocalDate closingDate;
|
public LocalDate closingDate;
|
||||||
@ApiModelProperty(example = "The accountants are heading for a carribean vacation")
|
@Schema(example = "The accountants are heading for a carribean vacation")
|
||||||
public String comments;
|
public String comments;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostGlClosuresResponse")
|
@Schema(description = "PostGlClosuresResponse")
|
||||||
public static final class PostGlClosuresResponse {
|
public static final class PostGlClosuresResponse {
|
||||||
|
|
||||||
private PostGlClosuresResponse() {
|
private PostGlClosuresResponse() {
|
||||||
// don't allow to instantiate; use only for live API documentation
|
// don't allow to instantiate; use only for live API documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "9")
|
@Schema(example = "9")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutGlClosuresRequest")
|
@Schema(description = "PutGlClosuresRequest")
|
||||||
public static final class PutGlClosuresRequest {
|
public static final class PutGlClosuresRequest {
|
||||||
|
|
||||||
private PutGlClosuresRequest() {
|
private PutGlClosuresRequest() {
|
||||||
// don't allow to instantiate; use only for live API documentation
|
// don't allow to instantiate; use only for live API documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "All transactions verified by Johnny Cash")
|
@Schema(example = "All transactions verified by Johnny Cash")
|
||||||
public String comments;
|
public String comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutGlClosuresResponse")
|
@Schema(description = "PutGlClosuresResponse")
|
||||||
public static final class PutGlClosuresResponse {
|
public static final class PutGlClosuresResponse {
|
||||||
|
|
||||||
private PutGlClosuresResponse() {
|
private PutGlClosuresResponse() {
|
||||||
// don't allow to instantiate; use only for live API documentation
|
// don't allow to instantiate; use only for live API documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "9")
|
@Schema(example = "9")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
@ApiModelProperty(example = "All transactions verified by Johnny Cash")
|
@Schema(example = "All transactions verified by Johnny Cash")
|
||||||
public String comments;
|
public String comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteGlClosuresResponse")
|
@Schema(description = "DeleteGlClosuresResponse")
|
||||||
public static final class DeleteGlClosuresResponse {
|
public static final class DeleteGlClosuresResponse {
|
||||||
|
|
||||||
private DeleteGlClosuresResponse() {
|
private DeleteGlClosuresResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "9")
|
@Schema(example = "9")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+30
-33
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.financialactivityaccount.api;
|
package org.apache.fineract.accounting.financialactivityaccount.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
@@ -56,11 +56,9 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/financialactivityaccounts")
|
@Path("/financialactivityaccounts")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Mapping Financial Activities to Accounts" })
|
@Tag(name = "Mapping Financial Activities to Accounts", description = "Organization Level Financial Activities like Asset and Liability Transfer can be mapped to GL Account. Integrated accounting takes these accounts into consideration when an Account transfer is made between a savings to loan/savings account and vice-versa\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n" + "Field Descriptions\n" + "financialActivityId\n" + "The identifier of the Financial Activity\n" + "glAccountId\n"
|
||||||
@Tag(name = "Mapping Financial Activities to Accounts", description = "Organization Level Financial Activities like Asset and Liability Transfer can be mapped to GL Account. Integrated accounting takes these accounts into consideration when an Account transfer is made between a savings to loan/savings account and vice-versa\n"
|
+ "The identifier of a GL Account ( Ledger Account) which shall be used as the default account for the selected Financial Activity")
|
||||||
+ "\n" + "Field Descriptions\n" + "financialActivityId\n" + "The identifier of the Financial Activity\n" + "glAccountId\n"
|
|
||||||
+ "The identifier of a GL Account ( Ledger Account) which shall be used as the default account for the selected Financial Activity") })
|
|
||||||
public class FinancialActivityAccountsApiResource {
|
public class FinancialActivityAccountsApiResource {
|
||||||
|
|
||||||
private final FinancialActivityAccountReadPlatformService financialActivityAccountReadPlatformService;
|
private final FinancialActivityAccountReadPlatformService financialActivityAccountReadPlatformService;
|
||||||
@@ -101,10 +99,10 @@ public class FinancialActivityAccountsApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Financial Activities to Accounts Mappings", notes = "Example Requests:\n" + "\n"
|
@Operation(summary = "List Financial Activities to Accounts Mappings", description = "Example Requests:\n" + "\n"
|
||||||
+ "financialactivityaccounts")
|
+ "financialactivityaccounts")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = FinancialActivityAccountsApiResourceSwagger.GetFinancialActivityAccountsResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.GetFinancialActivityAccountsResponse.class)))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo) {
|
public String retrieveAll(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(FinancialActivityAccountsConstants.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(FinancialActivityAccountsConstants.resourceNameForPermission);
|
||||||
@@ -119,11 +117,12 @@ public class FinancialActivityAccountsApiResource {
|
|||||||
@Path("{mappingId}")
|
@Path("{mappingId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a Financial Activity to Account Mapping\n", notes = "Example Requests:\n" + "\n"
|
@Operation(summary = "Retrieve a Financial Activity to Account Mapping\n", description = "Example Requests:\n" + "\n"
|
||||||
+ "financialactivityaccounts/1")
|
+ "financialactivityaccounts/1")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = FinancialActivityAccountsApiResourceSwagger.GetFinancialActivityAccountsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.GetFinancialActivityAccountsResponse.class))) })
|
||||||
public String retreive(@PathParam("mappingId") @ApiParam(value = "mappingId") final Long mappingId, @Context final UriInfo uriInfo) {
|
public String retreive(@PathParam("mappingId") @Parameter(description = "mappingId") final Long mappingId,
|
||||||
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(FinancialActivityAccountsConstants.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(FinancialActivityAccountsConstants.resourceNameForPermission);
|
||||||
|
|
||||||
@@ -141,13 +140,12 @@ public class FinancialActivityAccountsApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a new Financial Activity to Accounts Mapping", notes = "Mandatory Fields\n"
|
@Operation(summary = "Create a new Financial Activity to Accounts Mapping", description = "Mandatory Fields\n"
|
||||||
+ "financialActivityId, glAccountId")
|
+ "financialActivityId, glAccountId")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class)))
|
||||||
@ApiImplicitParam(value = "Request body", paramType = "body", dataType = "body", dataTypeClass = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsResponse.class))) })
|
||||||
public String createGLAccount(@ApiParam(hidden = true) final String jsonRequestBody) {
|
public String createGLAccount(@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createOfficeToGLAccountMapping().withJson(jsonRequestBody)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createOfficeToGLAccountMapping().withJson(jsonRequestBody)
|
||||||
.build();
|
.build();
|
||||||
@@ -161,13 +159,12 @@ public class FinancialActivityAccountsApiResource {
|
|||||||
@Path("{mappingId}")
|
@Path("{mappingId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Financial Activity to Account Mapping", notes = "the API updates the Ledger account linked to a Financial Activity \n")
|
@Operation(summary = "Update a Financial Activity to Account Mapping", description = "the API updates the Ledger account linked to a Financial Activity \n")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class)))
|
||||||
@ApiImplicitParam(value = "Request body", dataType = "body", paramType = "body", dataTypeClass = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = FinancialActivityAccountsApiResourceSwagger.PutFinancialActivityAccountsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PutFinancialActivityAccountsResponse.class))) })
|
||||||
public String updateGLAccount(@PathParam("mappingId") @ApiParam(value = "mappingId") final Long mappingId,
|
public String updateGLAccount(@PathParam("mappingId") @Parameter(description = "mappingId") final Long mappingId,
|
||||||
@ApiParam(hidden = true) final String jsonRequestBody) {
|
@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateOfficeToGLAccountMapping(mappingId)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateOfficeToGLAccountMapping(mappingId)
|
||||||
.withJson(jsonRequestBody).build();
|
.withJson(jsonRequestBody).build();
|
||||||
@@ -181,10 +178,10 @@ public class FinancialActivityAccountsApiResource {
|
|||||||
@Path("{mappingId}")
|
@Path("{mappingId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete a Financial Activity to Account Mapping")
|
@Operation(summary = "Delete a Financial Activity to Account Mapping")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = FinancialActivityAccountsApiResourceSwagger.DeleteFinancialActivityAccountsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.DeleteFinancialActivityAccountsResponse.class))) })
|
||||||
public String deleteGLAccount(@PathParam("mappingId") @ApiParam(value = "mappingId") final Long mappingId) {
|
public String deleteGLAccount(@PathParam("mappingId") @Parameter(description = "mappingId") final Long mappingId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteOfficeToGLAccountMapping(mappingId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteOfficeToGLAccountMapping(mappingId).build();
|
||||||
|
|
||||||
|
|||||||
+16
-17
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.financialactivityaccount.api;
|
package org.apache.fineract.accounting.financialactivityaccount.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.apache.fineract.accounting.financialactivityaccount.data.FinancialActivityData;
|
import org.apache.fineract.accounting.financialactivityaccount.data.FinancialActivityData;
|
||||||
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
|
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
|
||||||
|
|
||||||
@@ -30,58 +29,58 @@ final class FinancialActivityAccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private FinancialActivityAccountsApiResourceSwagger() {}
|
private FinancialActivityAccountsApiResourceSwagger() {}
|
||||||
|
|
||||||
@ApiModel(value = "GetFinancialActivityAccountsResponse")
|
@Schema(description = "GetFinancialActivityAccountsResponse")
|
||||||
public static final class GetFinancialActivityAccountsResponse {
|
public static final class GetFinancialActivityAccountsResponse {
|
||||||
|
|
||||||
private GetFinancialActivityAccountsResponse() {
|
private GetFinancialActivityAccountsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
public FinancialActivityData financialActivityData;
|
public FinancialActivityData financialActivityData;
|
||||||
public GLAccountData glAccountData;
|
public GLAccountData glAccountData;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostFinancialActivityAccountsRequest")
|
@Schema(description = "PostFinancialActivityAccountsRequest")
|
||||||
public static final class PostFinancialActivityAccountsRequest {
|
public static final class PostFinancialActivityAccountsRequest {
|
||||||
|
|
||||||
private PostFinancialActivityAccountsRequest() {
|
private PostFinancialActivityAccountsRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "200")
|
@Schema(example = "200")
|
||||||
public Long financialActivityId;
|
public Long financialActivityId;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long glAccountId;
|
public Long glAccountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostFinancialActivityAccountsResponse")
|
@Schema(description = "PostFinancialActivityAccountsResponse")
|
||||||
public static final class PostFinancialActivityAccountsResponse {
|
public static final class PostFinancialActivityAccountsResponse {
|
||||||
|
|
||||||
private PostFinancialActivityAccountsResponse() {
|
private PostFinancialActivityAccountsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutFinancialActivityAccountsRequest")
|
@Schema(description = "PutFinancialActivityAccountsRequest")
|
||||||
public static final class PutFinancialActivityAccountsRequest {
|
public static final class PutFinancialActivityAccountsRequest {
|
||||||
|
|
||||||
private PutFinancialActivityAccountsRequest() {
|
private PutFinancialActivityAccountsRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "200")
|
@Schema(example = "200")
|
||||||
public Long financialActivityId;
|
public Long financialActivityId;
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long glAccountId;
|
public Long glAccountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutFinancialActivityAccountsResponse")
|
@Schema(description = "PutFinancialActivityAccountsResponse")
|
||||||
public static final class PutFinancialActivityAccountsResponse {
|
public static final class PutFinancialActivityAccountsResponse {
|
||||||
|
|
||||||
private PutFinancialActivityAccountsResponse() {
|
private PutFinancialActivityAccountsResponse() {
|
||||||
@@ -92,23 +91,23 @@ final class FinancialActivityAccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private PutFinancialActivityAccountscommentsSwagger() {}
|
private PutFinancialActivityAccountscommentsSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long glAccountId;
|
public Long glAccountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutFinancialActivityAccountscommentsSwagger comments;
|
public PutFinancialActivityAccountscommentsSwagger comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteFinancialActivityAccountsResponse")
|
@Schema(description = "DeleteFinancialActivityAccountsResponse")
|
||||||
public static final class DeleteFinancialActivityAccountsResponse {
|
public static final class DeleteFinancialActivityAccountsResponse {
|
||||||
|
|
||||||
private DeleteFinancialActivityAccountsResponse() {
|
private DeleteFinancialActivityAccountsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+55
-49
@@ -20,15 +20,15 @@ package org.apache.fineract.accounting.glaccount.api;
|
|||||||
|
|
||||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||||
import com.sun.jersey.multipart.FormDataParam;
|
import com.sun.jersey.multipart.FormDataParam;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -75,10 +75,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/glaccounts")
|
@Path("/glaccounts")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "General Ledger Account" })
|
@Tag(name = "General Ledger Account", description = "Ledger accounts represent an Individual account within an Organizations Chart Of Accounts(COA) and are assigned a name and unique number by which they can be identified. \n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "All transactions relating to a company's assets, liabilities, owners' equity, revenue and expenses are recorded against these accounts")
|
||||||
@Tag(name = "General Ledger Account", description = "Ledger accounts represent an Individual account within an Organizations Chart Of Accounts(COA) and are assigned a name and unique number by which they can be identified. \n"
|
|
||||||
+ "All transactions relating to a company's assets, liabilities, owners' equity, revenue and expenses are recorded against these accounts") })
|
|
||||||
public class GLAccountsApiResource {
|
public class GLAccountsApiResource {
|
||||||
|
|
||||||
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "parentId", "glCode", "disabled",
|
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "parentId", "glCode", "disabled",
|
||||||
@@ -121,13 +119,15 @@ public class GLAccountsApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve GL Accounts Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
@Operation(tags = {
|
||||||
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "glaccounts/template\n"
|
"General Ledger Account" }, summary = "Retrieve GL Accounts Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
||||||
+ "glaccounts/template?type=1\n" + "\n" + "type is optional and integer value from 1 to 5.\n" + "\n" + "1.Assets \n"
|
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "glaccounts/template\n"
|
||||||
+ "2.Liabilities \n" + "3.Equity \n" + "4.Income \n" + "5.Expenses")
|
+ "glaccounts/template?type=1\n" + "\n" + "type is optional and integer value from 1 to 5.\n" + "\n" + "1.Assets \n"
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.GetGLAccountsTemplateResponse.class) })
|
+ "2.Liabilities \n" + "3.Equity \n" + "4.Income \n" + "5.Expenses")
|
||||||
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.GetGLAccountsTemplateResponse.class))) })
|
||||||
public String retrieveNewAccountDetails(@Context final UriInfo uriInfo,
|
public String retrieveNewAccountDetails(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("type") @ApiParam(value = "type") final Integer type) {
|
@QueryParam("type") @Parameter(description = "type") final Integer type) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||||
|
|
||||||
@@ -141,18 +141,19 @@ public class GLAccountsApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List General Ledger Accounts", notes = "ARGUMENTS\n"
|
@Operation(tags = { "General Ledger Account" }, summary = "List General Ledger Accounts", description = "ARGUMENTS\n"
|
||||||
+ "type Integer optional manualEntriesAllowed boolean optional usage Integer optional disabled boolean optional parentId Long optional tagId Long optional\n"
|
+ "type Integer optional manualEntriesAllowed boolean optional usage Integer optional disabled boolean optional parentId Long optional tagId Long optional\n"
|
||||||
+ "Example Requests:\n" + "\n" + "glaccounts\n" + "\n" + "\n"
|
+ "Example Requests:\n" + "\n" + "glaccounts\n" + "\n" + "\n"
|
||||||
+ "glaccounts?type=1&manualEntriesAllowed=true&usage=1&disabled=false\n" + "\n" + "glaccounts?fetchRunningBalance=true")
|
+ "glaccounts?type=1&manualEntriesAllowed=true&usage=1&disabled=false\n" + "\n" + "glaccounts?fetchRunningBalance=true")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.GetGLAccountsResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GLAccountsApiResourceSwagger.GetGLAccountsResponse.class)))) })
|
||||||
public String retrieveAllAccounts(@Context final UriInfo uriInfo, @QueryParam("type") @ApiParam(value = "type") final Integer type,
|
public String retrieveAllAccounts(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("searchParam") @ApiParam(value = "searchParam") final String searchParam,
|
@QueryParam("type") @Parameter(description = "type") final Integer type,
|
||||||
@QueryParam("usage") @ApiParam(value = "usage") final Integer usage,
|
@QueryParam("searchParam") @Parameter(description = "searchParam") final String searchParam,
|
||||||
@QueryParam("manualEntriesAllowed") @ApiParam(value = "manualEntriesAllowed") final Boolean manualEntriesAllowed,
|
@QueryParam("usage") @Parameter(description = "usage") final Integer usage,
|
||||||
@QueryParam("disabled") @ApiParam(value = "disabled") final Boolean disabled,
|
@QueryParam("manualEntriesAllowed") @Parameter(description = "manualEntriesAllowed") final Boolean manualEntriesAllowed,
|
||||||
@QueryParam("fetchRunningBalance") @ApiParam(value = "fetchRunningBalance") final boolean runningBalance) {
|
@QueryParam("disabled") @Parameter(description = "disabled") final Boolean disabled,
|
||||||
|
@QueryParam("fetchRunningBalance") @Parameter(description = "fetchRunningBalance") final boolean runningBalance) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||||
JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData(false, runningBalance);
|
JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData(false, runningBalance);
|
||||||
@@ -167,13 +168,14 @@ public class GLAccountsApiResource {
|
|||||||
@Path("{glAccountId}")
|
@Path("{glAccountId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a General Ledger Account", notes = "Example Requests:\n" + "\n" + "glaccounts/1\n" + "\n" + "\n"
|
@Operation(tags = { "General Ledger Account" }, summary = "Retrieve a General Ledger Account", description = "Example Requests:\n"
|
||||||
+ "glaccounts/1?template=true\n" + "\n" + "\n" + "glaccounts/1?fields=name,glCode\n" + "\n" + "\n"
|
+ "\n" + "glaccounts/1\n" + "\n" + "\n" + "glaccounts/1?template=true\n" + "\n" + "\n" + "glaccounts/1?fields=name,glCode\n"
|
||||||
+ "glaccounts/1?fetchRunningBalance=true")
|
+ "\n" + "\n" + "glaccounts/1?fetchRunningBalance=true")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.GetGLAccountsResponse.class) })
|
@ApiResponses({
|
||||||
public String retreiveAccount(@PathParam("glAccountId") @ApiParam(value = "glAccountId") final Long glAccountId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.GetGLAccountsResponse.class))) })
|
||||||
|
public String retreiveAccount(@PathParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId,
|
||||||
@Context final UriInfo uriInfo,
|
@Context final UriInfo uriInfo,
|
||||||
@QueryParam("fetchRunningBalance") @ApiParam(value = "fetchRunningBalance") final boolean runningBalance) {
|
@QueryParam("fetchRunningBalance") @Parameter(description = "fetchRunningBalance") final boolean runningBalance) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||||
|
|
||||||
@@ -190,12 +192,13 @@ public class GLAccountsApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a General Ledger Account", notes = "Note: You may optionally create Hierarchical Chart of Accounts by using the \"parentId\" property of an Account\n"
|
@Operation(tags = {
|
||||||
+ "Mandatory Fields: \n" + "name, glCode, type, usage and manualEntriesAllowed")
|
"General Ledger Account" }, summary = "Create a General Ledger Account", description = "Note: You may optionally create Hierarchical Chart of Accounts by using the \"parentId\" property of an Account\n"
|
||||||
@ApiImplicitParams({
|
+ "Mandatory Fields: \n" + "name, glCode, type, usage and manualEntriesAllowed")
|
||||||
@ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = GLAccountsApiResourceSwagger.PostGLAccountsRequest.class) })
|
@RequestBody(content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PostGLAccountsRequest.class)))
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.PostGLAccountsResponse.class) })
|
@ApiResponses({
|
||||||
public String createGLAccount(@ApiParam(hidden = true) final String jsonRequestBody) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PostGLAccountsResponse.class))) })
|
||||||
|
public String createGLAccount(@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createGLAccount().withJson(jsonRequestBody).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createGLAccount().withJson(jsonRequestBody).build();
|
||||||
|
|
||||||
@@ -208,13 +211,14 @@ public class GLAccountsApiResource {
|
|||||||
@Path("{glAccountId}")
|
@Path("{glAccountId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update an Accounting closure", notes = "Once an accounting closure is created, only the comments associated with it may be edited\n"
|
@Operation(tags = {
|
||||||
+ "\n")
|
"General Ledger Account" }, summary = "Update an Accounting closure", description = "Once an accounting closure is created, only the comments associated with it may be edited\n"
|
||||||
@ApiImplicitParams({
|
+ "\n")
|
||||||
@ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = GLAccountsApiResourceSwagger.PutGLAccountsRequest.class) })
|
@RequestBody(content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PutGLAccountsRequest.class)))
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.PutGLAccountsResponse.class) })
|
@ApiResponses({
|
||||||
public String updateGLAccount(@PathParam("glAccountId") @ApiParam(value = "glAccountId") final Long glAccountId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PutGLAccountsResponse.class))) })
|
||||||
@ApiParam(hidden = true) final String jsonRequestBody) {
|
public String updateGLAccount(@PathParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId,
|
||||||
|
@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGLAccount(glAccountId).withJson(jsonRequestBody).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGLAccount(glAccountId).withJson(jsonRequestBody).build();
|
||||||
|
|
||||||
@@ -227,9 +231,11 @@ public class GLAccountsApiResource {
|
|||||||
@Path("{glAccountId}")
|
@Path("{glAccountId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete an accounting closure", notes = "Note: Only the latest accounting closure associated with a branch may be deleted.")
|
@Operation(tags = {
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.DeleteGLAccountsRequest.class) })
|
"General Ledger Account" }, summary = "Delete an accounting closure", description = "Note: Only the latest accounting closure associated with a branch may be deleted.")
|
||||||
public String deleteGLAccount(@PathParam("glAccountId") @ApiParam(value = "glAccountId") final Long glAccountId) {
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.DeleteGLAccountsRequest.class))) })
|
||||||
|
public String deleteGLAccount(@PathParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGLAccount(glAccountId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGLAccount(glAccountId).build();
|
||||||
|
|
||||||
|
|||||||
+33
-34
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.glaccount.api;
|
package org.apache.fineract.accounting.glaccount.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
|
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
|
||||||
@@ -35,57 +34,57 @@ final class GLAccountsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetGLAccountsResponse")
|
@Schema(description = "GetGLAccountsResponse")
|
||||||
public static final class GetGLAccountsResponse {
|
public static final class GetGLAccountsResponse {
|
||||||
|
|
||||||
private GetGLAccountsResponse() {
|
private GetGLAccountsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "16")
|
@Schema(example = "16")
|
||||||
public Long id;
|
public Long id;
|
||||||
|
|
||||||
@ApiModelProperty(example = "Cash")
|
@Schema(example = "Cash")
|
||||||
public String name;
|
public String name;
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long parentId;
|
public Long parentId;
|
||||||
|
|
||||||
@ApiModelProperty(example = "100001")
|
@Schema(example = "100001")
|
||||||
public String glCode;
|
public String glCode;
|
||||||
|
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean disabled;
|
public Boolean disabled;
|
||||||
|
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean manualEntriesAllowed;
|
public Boolean manualEntriesAllowed;
|
||||||
|
|
||||||
public EnumOptionData type;
|
public EnumOptionData type;
|
||||||
public EnumOptionData usage;
|
public EnumOptionData usage;
|
||||||
|
|
||||||
@ApiModelProperty(example = "Desc")
|
@Schema(example = "Desc")
|
||||||
public String description;
|
public String description;
|
||||||
|
|
||||||
@ApiModelProperty(example = "....Cash")
|
@Schema(example = "....Cash")
|
||||||
public String nameDecorated;
|
public String nameDecorated;
|
||||||
|
|
||||||
public CodeValueData tagId;
|
public CodeValueData tagId;
|
||||||
|
|
||||||
@ApiModelProperty(example = "118437")
|
@Schema(example = "118437")
|
||||||
public Long organizationRunningBalance;
|
public Long organizationRunningBalance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetGLAccountsTemplateResponse")
|
@Schema(description = "GetGLAccountsTemplateResponse")
|
||||||
public static final class GetGLAccountsTemplateResponse {
|
public static final class GetGLAccountsTemplateResponse {
|
||||||
|
|
||||||
private GetGLAccountsTemplateResponse() {
|
private GetGLAccountsTemplateResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean disabled;
|
public Boolean disabled;
|
||||||
|
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean manualEntriesAllowed;
|
public Boolean manualEntriesAllowed;
|
||||||
|
|
||||||
public EnumOptionData type;
|
public EnumOptionData type;
|
||||||
@@ -104,83 +103,83 @@ final class GLAccountsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostGLAccountsRequest")
|
@Schema(description = "PostGLAccountsRequest")
|
||||||
public static final class PostGLAccountsRequest {
|
public static final class PostGLAccountsRequest {
|
||||||
|
|
||||||
private PostGLAccountsRequest() {
|
private PostGLAccountsRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Cash at Bangalore")
|
@Schema(example = "Cash at Bangalore")
|
||||||
public String name;
|
public String name;
|
||||||
|
|
||||||
@ApiModelProperty(example = "100001")
|
@Schema(example = "100001")
|
||||||
public String glCode;
|
public String glCode;
|
||||||
|
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean manualEntriesAllowed;
|
public Boolean manualEntriesAllowed;
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public String type;
|
public String type;
|
||||||
|
|
||||||
@ApiModelProperty(example = "10")
|
@Schema(example = "10")
|
||||||
public String tagId;
|
public String tagId;
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long parentId;
|
public Long parentId;
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public EnumOptionData usage;
|
public EnumOptionData usage;
|
||||||
|
|
||||||
@ApiModelProperty(example = "Desc")
|
@Schema(example = "Desc")
|
||||||
public String description;
|
public String description;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostGLAccountsResponse")
|
@Schema(description = "PostGLAccountsResponse")
|
||||||
public static final class PostGLAccountsResponse {
|
public static final class PostGLAccountsResponse {
|
||||||
|
|
||||||
private PostGLAccountsResponse() {
|
private PostGLAccountsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "22")
|
@Schema(example = "22")
|
||||||
public int resourceId;
|
public int resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutGLAccountsRequest")
|
@Schema(description = "PutGLAccountsRequest")
|
||||||
public static final class PutGLAccountsRequest {
|
public static final class PutGLAccountsRequest {
|
||||||
|
|
||||||
private PutGLAccountsRequest() {
|
private PutGLAccountsRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Cash at Bangalore")
|
@Schema(example = "Cash at Bangalore")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutGLAccountsResponse")
|
@Schema(description = "PutGLAccountsResponse")
|
||||||
public static final class PutGLAccountsResponse {
|
public static final class PutGLAccountsResponse {
|
||||||
|
|
||||||
private PutGLAccountsResponse() {
|
private PutGLAccountsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel
|
@Schema
|
||||||
public static final class PutGLAccountsResponsechangesSwagger {
|
public static final class PutGLAccountsResponsechangesSwagger {
|
||||||
|
|
||||||
private PutGLAccountsResponsechangesSwagger() {}
|
private PutGLAccountsResponsechangesSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Cash at Bangalore")
|
@Schema(example = "Cash at Bangalore")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public int resourceId;
|
public int resourceId;
|
||||||
public PutGLAccountsResponsechangesSwagger changes;
|
public PutGLAccountsResponsechangesSwagger changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteGLAccountsRequest")
|
@Schema(description = "DeleteGLAccountsRequest")
|
||||||
public static final class DeleteGLAccountsRequest {
|
public static final class DeleteGLAccountsRequest {
|
||||||
|
|
||||||
private DeleteGLAccountsRequest() {
|
private DeleteGLAccountsRequest() {
|
||||||
@@ -193,7 +192,7 @@ final class GLAccountsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public int resourceId;
|
public int resourceId;
|
||||||
|
|
||||||
private DeleteGLAccountsRequestchangesSwagger changes;
|
private DeleteGLAccountsRequestchangesSwagger changes;
|
||||||
|
|||||||
+53
-50
@@ -20,15 +20,16 @@ package org.apache.fineract.accounting.journalentry.api;
|
|||||||
|
|
||||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||||
import com.sun.jersey.multipart.FormDataParam;
|
import com.sun.jersey.multipart.FormDataParam;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.Parameters;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -73,10 +74,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/journalentries")
|
@Path("/journalentries")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Journal Entries" })
|
@Tag(name = "Journal Entries", description = "A journal entry refers to the logging of transactions against general ledger accounts. A journal entry may consist of several line items, each of which is either a \"debit\" or a \"credit\". The total amount of the debits must equal the total amount of the credits or the journal entry is said to be \"unbalanced\" \n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n" + "A journal entry directly changes the account balances on the general ledger")
|
||||||
@Tag(name = "Journal Entries", description = "A journal entry refers to the logging of transactions against general ledger accounts. A journal entry may consist of several line items, each of which is either a \"debit\" or a \"credit\". The total amount of the debits must equal the total amount of the credits or the journal entry is said to be \"unbalanced\" \n"
|
|
||||||
+ "\n" + "A journal entry directly changes the account balances on the general ledger") })
|
|
||||||
public class JournalEntriesApiResource {
|
public class JournalEntriesApiResource {
|
||||||
|
|
||||||
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
@@ -113,30 +112,32 @@ public class JournalEntriesApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Journal Entries", notes = "The list capability of journal entries can support pagination and sorting.\n\n"
|
@Operation(summary = "List Journal Entries", description = "The list capability of journal entries can support pagination and sorting.\n\n"
|
||||||
+ "Example Requests:\n" + "\n" + "journalentries\n" + "\n" + "journalentries?transactionId=PB37X8Y21EQUY4S\n" + "\n"
|
+ "Example Requests:\n" + "\n" + "journalentries\n" + "\n" + "journalentries?transactionId=PB37X8Y21EQUY4S\n" + "\n"
|
||||||
+ "journalentries?officeId=1&manualEntriesOnly=true&fromDate=1 July 2013&toDate=15 July 2013&dateFormat=dd MMMM yyyy&locale=en\n"
|
+ "journalentries?officeId=1&manualEntriesOnly=true&fromDate=1 July 2013&toDate=15 July 2013&dateFormat=dd MMMM yyyy&locale=en\n"
|
||||||
+ "\n" + "journalentries?fields=officeName,glAccountName,transactionDate\n" + "\n" + "journalentries?offset=10&limit=50\n"
|
+ "\n" + "journalentries?fields=officeName,glAccountName,transactionDate\n" + "\n" + "journalentries?offset=10&limit=50\n"
|
||||||
+ "\n" + "journalentries?orderBy=transactionId&sortOrder=DESC\n" + "\n" + "journalentries?runningBalance=true\n" + "\n"
|
+ "\n" + "journalentries?orderBy=transactionId&sortOrder=DESC\n" + "\n" + "journalentries?runningBalance=true\n" + "\n"
|
||||||
+ "journalentries?transactionDetails=true\n" + "\n" + "journalentries?loanId=12\n" + "\n" + "journalentries?savingsId=24")
|
+ "journalentries?transactionDetails=true\n" + "\n" + "journalentries?loanId=12\n" + "\n" + "journalentries?savingsId=24")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = JournalEntryData.class, responseContainer = "list") })
|
@ApiResponses({
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = JournalEntryData.class)))) })
|
||||||
@QueryParam("glAccountId") @ApiParam(value = "glAccountId") final Long glAccountId,
|
public String retrieveAll(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("manualEntriesOnly") @ApiParam(value = "manualEntriesOnly") final Boolean onlyManualEntries,
|
@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId,
|
||||||
@QueryParam("fromDate") @ApiParam(value = "fromDate") final DateParam fromDateParam,
|
@QueryParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId,
|
||||||
@QueryParam("toDate") @ApiParam(value = "toDate") final DateParam toDateParam,
|
@QueryParam("manualEntriesOnly") @Parameter(description = "manualEntriesOnly") final Boolean onlyManualEntries,
|
||||||
@QueryParam("transactionId") @ApiParam(value = "transactionId") final String transactionId,
|
@QueryParam("fromDate") @Parameter(description = "fromDate") final DateParam fromDateParam,
|
||||||
@QueryParam("entityType") @ApiParam(value = "entityType") final Integer entityType,
|
@QueryParam("toDate") @Parameter(description = "toDate") final DateParam toDateParam,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("transactionId") @Parameter(description = "transactionId") final String transactionId,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("entityType") @Parameter(description = "entityType") final Integer entityType,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("locale") @ApiParam(value = "locale") final String locale,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("dateFormat") @ApiParam(value = "dateFormat") final String dateFormat,
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder,
|
||||||
@QueryParam("loanId") @ApiParam(value = "loanId") final Long loanId,
|
@QueryParam("locale") @Parameter(description = "locale") final String locale,
|
||||||
@QueryParam("savingsId") @ApiParam(value = "savingsId") final Long savingsId,
|
@QueryParam("dateFormat") @Parameter(description = "dateFormat") final String dateFormat,
|
||||||
@QueryParam("runningBalance") @ApiParam(value = "runningBalance") final boolean runningBalance,
|
@QueryParam("loanId") @Parameter(description = "loanId") final Long loanId,
|
||||||
@QueryParam("transactionDetails") @ApiParam(value = "transactionDetails") final boolean transactionDetails) {
|
@QueryParam("savingsId") @Parameter(description = "savingsId") final Long savingsId,
|
||||||
|
@QueryParam("runningBalance") @Parameter(description = "runningBalance") final boolean runningBalance,
|
||||||
|
@QueryParam("transactionDetails") @Parameter(description = "transactionDetails") final boolean transactionDetails) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||||
|
|
||||||
@@ -164,13 +165,16 @@ public class JournalEntriesApiResource {
|
|||||||
@Path("{journalEntryId}")
|
@Path("{journalEntryId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a single Entry", notes = "Example Requests:\n" + "\n" + "journalentries/1\n" + "\n" + "\n" + "\n"
|
@Operation(summary = "Retrieve a single Entry", description = "Example Requests:\n" + "\n" + "journalentries/1\n" + "\n" + "\n" + "\n"
|
||||||
+ "journalentries/1?fields=officeName,glAccountId,entryType,amount\n" + "\n" + "journalentries/1?runningBalance=true\n" + "\n"
|
+ "journalentries/1?fields=officeName,glAccountId,entryType,amount\n" + "\n" + "journalentries/1?runningBalance=true\n" + "\n"
|
||||||
+ "journalentries/1?transactionDetails=true")
|
+ "journalentries/1?transactionDetails=true")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = JournalEntryData.class) })
|
@ApiResponses({
|
||||||
public String retreiveJournalEntryById(@PathParam("journalEntryId") @ApiParam(value = "journalEntryId") final Long journalEntryId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = JournalEntryData.class))) })
|
||||||
@Context final UriInfo uriInfo, @QueryParam("runningBalance") @ApiParam(value = "runningBalance") final boolean runningBalance,
|
public String retreiveJournalEntryById(
|
||||||
@QueryParam("transactionDetails") @ApiParam(value = "transactionDetails") final boolean transactionDetails) {
|
@PathParam("journalEntryId") @Parameter(description = "journalEntryId") final Long journalEntryId,
|
||||||
|
@Context final UriInfo uriInfo,
|
||||||
|
@QueryParam("runningBalance") @Parameter(description = "runningBalance") final boolean runningBalance,
|
||||||
|
@QueryParam("transactionDetails") @Parameter(description = "transactionDetails") final boolean transactionDetails) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||||
JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData(transactionDetails,
|
JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData(transactionDetails,
|
||||||
@@ -185,16 +189,16 @@ public class JournalEntriesApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create \"Balanced\" Journal Entries", notes = "Note: A Balanced (simple) Journal entry would have atleast one \"Debit\" and one \"Credit\" entry whose amounts are equal \n"
|
@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"
|
||||||
+ "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"
|
+ "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"
|
||||||
+ "\n" + "Mandatory Fields\n" + "officeId, transactionDate\n\n" + "\ncredits- glAccountId, amount, comments\n\n "
|
+ "\n" + "Mandatory Fields\n" + "officeId, transactionDate\n\n" + "\ncredits- glAccountId, amount, comments\n\n "
|
||||||
+ "\ndebits- glAccountId, amount, comments\n\n " + "\n" + "Optional Fields\n"
|
+ "\ndebits- glAccountId, amount, comments\n\n " + "\n" + "Optional Fields\n"
|
||||||
+ "paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber")
|
+ "paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber")
|
||||||
@ApiImplicitParams({
|
@Parameters({ @Parameter(content = @Content(schema = @Schema(implementation = JournalEntryCommand.class))) })
|
||||||
@ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = JournalEntryCommand.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = JournalEntriesApiResourceSwagger.PostJournalEntriesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesResponse.class))) })
|
||||||
public String createGLJournalEntry(@ApiParam(hidden = true) final String jsonRequestBody,
|
public String createGLJournalEntry(@Parameter(hidden = true) final String jsonRequestBody,
|
||||||
@QueryParam("command") @ApiParam(value = "command") final String commandParam) {
|
@QueryParam("command") @Parameter(description = "command") final String commandParam) {
|
||||||
|
|
||||||
CommandProcessingResult result = null;
|
CommandProcessingResult result = null;
|
||||||
if (is(commandParam, "updateRunningBalance")) {
|
if (is(commandParam, "updateRunningBalance")) {
|
||||||
@@ -216,15 +220,14 @@ public class JournalEntriesApiResource {
|
|||||||
@Path("{transactionId}")
|
@Path("{transactionId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update Running balances for Journal Entries", notes = "This API calculates the running balances for office. If office ID not provided this API calculates running balances for all offices. \n"
|
@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"
|
||||||
+ "Mandatory Fields\n" + "officeId")
|
+ "Mandatory Fields\n" + "officeId")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdRequest.class)))
|
||||||
@ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdResponse.class))) })
|
||||||
public String createReversalJournalEntry(@ApiParam(hidden = true) final String jsonRequestBody,
|
public String createReversalJournalEntry(@Parameter(hidden = true) final String jsonRequestBody,
|
||||||
@PathParam("transactionId") @ApiParam(value = "transactionId") final String transactionId,
|
@PathParam("transactionId") @Parameter(description = "transactionId") final String transactionId,
|
||||||
@QueryParam("command") @ApiParam(value = "command") final String commandParam) {
|
@QueryParam("command") @Parameter(description = "command") final String commandParam) {
|
||||||
CommandProcessingResult result = null;
|
CommandProcessingResult result = null;
|
||||||
if (is(commandParam, "reverse")) {
|
if (is(commandParam, "reverse")) {
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().reverseJournalEntry(transactionId).withJson(jsonRequestBody)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().reverseJournalEntry(transactionId).withJson(jsonRequestBody)
|
||||||
|
|||||||
+8
-9
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.journalentry.api;
|
package org.apache.fineract.accounting.journalentry.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sanyam on 25/7/17.
|
* Created by sanyam on 25/7/17.
|
||||||
@@ -28,39 +27,39 @@ final class JournalEntriesApiResourceSwagger {
|
|||||||
|
|
||||||
private JournalEntriesApiResourceSwagger() {}
|
private JournalEntriesApiResourceSwagger() {}
|
||||||
|
|
||||||
@ApiModel(value = "PostJournalEntriesResponse")
|
@Schema(description = "PostJournalEntriesResponse")
|
||||||
public static final class PostJournalEntriesResponse {
|
public static final class PostJournalEntriesResponse {
|
||||||
|
|
||||||
private PostJournalEntriesResponse() {
|
private PostJournalEntriesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(value = "1")
|
@Schema(description = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(value = "RS9MCISID4WK1ZM")
|
@Schema(description = "RS9MCISID4WK1ZM")
|
||||||
public String transactionId;
|
public String transactionId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostJournalEntriesTransactionIdRequest")
|
@Schema(description = "PostJournalEntriesTransactionIdRequest")
|
||||||
public static final class PostJournalEntriesTransactionIdRequest {
|
public static final class PostJournalEntriesTransactionIdRequest {
|
||||||
|
|
||||||
private PostJournalEntriesTransactionIdRequest() {
|
private PostJournalEntriesTransactionIdRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(value = "1")
|
@Schema(description = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostJournalEntriesTransactionIdResponse")
|
@Schema(description = "PostJournalEntriesTransactionIdResponse")
|
||||||
public static final class PostJournalEntriesTransactionIdResponse {
|
public static final class PostJournalEntriesTransactionIdResponse {
|
||||||
|
|
||||||
private PostJournalEntriesTransactionIdResponse() {
|
private PostJournalEntriesTransactionIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(value = "1")
|
@Schema(description = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+34
-35
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.provisioning.api;
|
package org.apache.fineract.accounting.provisioning.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -62,11 +62,9 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/provisioningentries")
|
@Path("/provisioningentries")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Provisioning Entries" })
|
@Tag(name = "Provisioning Entries", description = "This defines the Provisioning Entries for all active loan products\n" + "\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "Field Descriptions\n" + "date\n" + "Date on which day provisioning entries should be created\n" + "createjournalentries\n"
|
||||||
@Tag(name = "Provisioning Entries", description = "This defines the Provisioning Entries for all active loan products\n" + "\n"
|
+ "Boolean variable whether to add journal entries for generated provisioning entries\n")
|
||||||
+ "Field Descriptions\n" + "date\n" + "Date on which day provisioning entries should be created\n"
|
|
||||||
+ "createjournalentries\n" + "Boolean variable whether to add journal entries for generated provisioning entries\n") })
|
|
||||||
public class ProvisioningEntriesApiResource {
|
public class ProvisioningEntriesApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext platformSecurityContext;
|
private final PlatformSecurityContext platformSecurityContext;
|
||||||
@@ -97,13 +95,12 @@ public class ProvisioningEntriesApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create new Provisioning Entries", notes = "Creates a new Provisioning Entries\n" + "\n" + "Mandatory Fields\n"
|
@Operation(summary = "Create new Provisioning Entries", description = "Creates a new Provisioning Entries\n" + "\n"
|
||||||
+ "date\n" + "dateFormat\n" + "locale\n" + "Optional Fields\n" + "createjournalentries")
|
+ "Mandatory Fields\n" + "date\n" + "dateFormat\n" + "locale\n" + "Optional Fields\n" + "createjournalentries")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = ProvisioningEntriesApiResourceSwagger.PostProvisioningEntriesRequest.class)))
|
||||||
@ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = ProvisioningEntriesApiResourceSwagger.PostProvisioningEntriesRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ProvisioningEntriesApiResourceSwagger.PostProvisioningEntriesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningEntriesApiResourceSwagger.PostProvisioningEntriesResponse.class))) })
|
||||||
public String createProvisioningEntries(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createProvisioningEntries(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
CommandWrapper commandWrapper = null;
|
CommandWrapper commandWrapper = null;
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
commandWrapper = new CommandWrapperBuilder().createProvisioningEntries().withJson(apiRequestBodyAsJson).build();
|
commandWrapper = new CommandWrapperBuilder().createProvisioningEntries().withJson(apiRequestBodyAsJson).build();
|
||||||
@@ -115,14 +112,13 @@ public class ProvisioningEntriesApiResource {
|
|||||||
@Path("{entryId}")
|
@Path("{entryId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Recreates Provisioning Entry", notes = "Recreates Provisioning Entry | createjournalentry.")
|
@Operation(summary = "Recreates Provisioning Entry", description = "Recreates Provisioning Entry | createjournalentry.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = ProvisioningEntriesApiResourceSwagger.PutProvisioningEntriesRequest.class)))
|
||||||
@ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = ProvisioningEntriesApiResourceSwagger.PutProvisioningEntriesRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ProvisioningEntriesApiResourceSwagger.PutProvisioningEntriesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningEntriesApiResourceSwagger.PutProvisioningEntriesResponse.class))) })
|
||||||
public String modifyProvisioningEntry(@PathParam("entryId") @ApiParam(value = "entryId") final Long entryId,
|
public String modifyProvisioningEntry(@PathParam("entryId") @Parameter(description = "entryId") final Long entryId,
|
||||||
@QueryParam("command") @ApiParam(value = "command=createjournalentry\ncommand=recreateprovisioningentry") final String commandParam,
|
@QueryParam("command") @Parameter(description = "command=createjournalentry\ncommand=recreateprovisioningentry") final String commandParam,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
CommandWrapper commandWrapper = null;
|
CommandWrapper commandWrapper = null;
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
if ("createjournalentry".equals(commandParam)) {
|
if ("createjournalentry".equals(commandParam)) {
|
||||||
@@ -143,9 +139,10 @@ public class ProvisioningEntriesApiResource {
|
|||||||
@Path("{entryId}")
|
@Path("{entryId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieves a Provisioning Entry", notes = "Returns the details of a generated Provisioning Entry.")
|
@Operation(summary = "Retrieves a Provisioning Entry", description = "Returns the details of a generated Provisioning Entry.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = ProvisioningEntryData.class) })
|
@ApiResponses({
|
||||||
public String retrieveProvisioningEntry(@PathParam("entryId") @ApiParam(value = "entryId") final Long entryId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningEntryData.class))) })
|
||||||
|
public String retrieveProvisioningEntry(@PathParam("entryId") @Parameter(description = "entryId") final Long entryId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
platformSecurityContext.authenticatedUser();
|
platformSecurityContext.authenticatedUser();
|
||||||
ProvisioningEntryData data = this.provisioningEntriesReadPlatformService.retrieveProvisioningEntryData(entryId);
|
ProvisioningEntryData data = this.provisioningEntriesReadPlatformService.retrieveProvisioningEntryData(entryId);
|
||||||
@@ -157,7 +154,8 @@ public class ProvisioningEntriesApiResource {
|
|||||||
@Path("entries")
|
@Path("entries")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = LoanProductProvisioningEntryData.class) })
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = LoanProductProvisioningEntryData.class))) })
|
||||||
public String retrieveProviioningEntries(@QueryParam("entryId") final Long entryId, @QueryParam("offset") final Integer offset,
|
public String retrieveProviioningEntries(@QueryParam("entryId") final Long entryId, @QueryParam("offset") final Integer offset,
|
||||||
@QueryParam("limit") final Integer limit, @QueryParam("officeId") final Long officeId,
|
@QueryParam("limit") final Integer limit, @QueryParam("officeId") final Long officeId,
|
||||||
@QueryParam("productId") final Long productId, @QueryParam("categoryId") final Long categoryId,
|
@QueryParam("productId") final Long productId, @QueryParam("categoryId") final Long categoryId,
|
||||||
@@ -172,10 +170,11 @@ public class ProvisioningEntriesApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List all Provisioning Entries")
|
@Operation(summary = "List all Provisioning Entries")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = ProvisioningEntryData.class, responseContainer = "list") })
|
@ApiResponses({
|
||||||
public String retrieveAllProvisioningEntries(@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProvisioningEntryData.class)))) })
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit, @Context final UriInfo uriInfo) {
|
public String retrieveAllProvisioningEntries(@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit, @Context final UriInfo uriInfo) {
|
||||||
platformSecurityContext.authenticatedUser();
|
platformSecurityContext.authenticatedUser();
|
||||||
Page<ProvisioningEntryData> data = this.provisioningEntriesReadPlatformService.retrieveAllProvisioningEntries(offset, limit);
|
Page<ProvisioningEntryData> data = this.provisioningEntriesReadPlatformService.retrieveAllProvisioningEntries(offset, limit);
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
|||||||
+12
-13
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.provisioning.api;
|
package org.apache.fineract.accounting.provisioning.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sanyam on 25/7/17.
|
* Created by sanyam on 25/7/17.
|
||||||
@@ -30,23 +29,23 @@ final class ProvisioningEntriesApiResourceSwagger {
|
|||||||
// only for Swagger Documentation
|
// only for Swagger Documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostProvisioningEntriesRequest")
|
@Schema(description = "PostProvisioningEntriesRequest")
|
||||||
public static final class PostProvisioningEntriesRequest {
|
public static final class PostProvisioningEntriesRequest {
|
||||||
|
|
||||||
private PostProvisioningEntriesRequest() {
|
private PostProvisioningEntriesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "16 October 2015")
|
@Schema(example = "16 October 2015")
|
||||||
public String date;
|
public String date;
|
||||||
|
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
|
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
|
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public String createjournalentries;
|
public String createjournalentries;
|
||||||
|
|
||||||
public String provisioningentry;
|
public String provisioningentry;
|
||||||
@@ -54,36 +53,36 @@ final class ProvisioningEntriesApiResourceSwagger {
|
|||||||
public String entries;
|
public String entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostProvisioningEntriesResponse")
|
@Schema(description = "PostProvisioningEntriesResponse")
|
||||||
public static final class PostProvisioningEntriesResponse {
|
public static final class PostProvisioningEntriesResponse {
|
||||||
|
|
||||||
private PostProvisioningEntriesResponse() {
|
private PostProvisioningEntriesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutProvisioningEntriesRequest")
|
@Schema(description = "PutProvisioningEntriesRequest")
|
||||||
public static final class PutProvisioningEntriesRequest {
|
public static final class PutProvisioningEntriesRequest {
|
||||||
|
|
||||||
private PutProvisioningEntriesRequest() {
|
private PutProvisioningEntriesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "recreateprovisioningentry")
|
@Schema(example = "recreateprovisioningentry")
|
||||||
public String command;
|
public String command;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutProvisioningEntriesResponse")
|
@Schema(description = "PutProvisioningEntriesResponse")
|
||||||
public static final class PutProvisioningEntriesResponse {
|
public static final class PutProvisioningEntriesResponse {
|
||||||
|
|
||||||
private PutProvisioningEntriesResponse() {
|
private PutProvisioningEntriesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-39
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.rule.api;
|
package org.apache.fineract.accounting.rule.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -73,15 +73,13 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/accountingrules")
|
@Path("/accountingrules")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Accounting Rules" })
|
@Tag(name = "Accounting Rules", description = "It is typical scenario in MFI's that non accountants pass journal entries on a regular basis. For Ex: A branch office might deposit their entire cash at hand to their Bank account at the end of a working day. The branch office users might not understand enough of accounting to figure out which account needs to get credited and which account needs to be debited to represent this transaction.\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n"
|
||||||
@Tag(name = "Accounting Rules", description = "It is typical scenario in MFI's that non accountants pass journal entries on a regular basis. For Ex: A branch office might deposit their entire cash at hand to their Bank account at the end of a working day. The branch office users might not understand enough of accounting to figure out which account needs to get credited and which account needs to be debited to represent this transaction.\n"
|
+ "Enter accounting rules, an abstraction on top of manual Journal entires for enabling simpler data entry. An accounting rule can define any of the following abstractions\n"
|
||||||
+ "\n"
|
+ "\n" + "A Simple journal entry where both the credit and debit account have been preselected\n"
|
||||||
+ "Enter accounting rules, an abstraction on top of manual Journal entires for enabling simpler data entry. An accounting rule can define any of the following abstractions\n"
|
+ "A Simple journal entry where either credit or debit accounts have been limited to a pre-selected list of accounts (Ex: Debit account should be one of \"Bank of America\" of \"JP Morgan\" and credit account should be \"Cash\")\n"
|
||||||
+ "\n" + "A Simple journal entry where both the credit and debit account have been preselected\n"
|
+ "A Compound journal entry where multiple debits and / or multiple credits may be made amongst a set of preselected list of accounts (Ex: Credit account should be either \"Bank Of America\" or \"Cash\" and debit account can be \"Employee Salary\" and/or \"Miscellenous Expenses\")\n"
|
||||||
+ "A Simple journal entry where either credit or debit accounts have been limited to a pre-selected list of accounts (Ex: Debit account should be one of \"Bank of America\" of \"JP Morgan\" and credit account should be \"Cash\")\n"
|
+ "An accounting rule can also be optionally associated with a branch, so that only a particular Branch's users have access to the rule")
|
||||||
+ "A Compound journal entry where multiple debits and / or multiple credits may be made amongst a set of preselected list of accounts (Ex: Credit account should be either \"Bank Of America\" or \"Cash\" and debit account can be \"Employee Salary\" and/or \"Miscellenous Expenses\")\n"
|
|
||||||
+ "An accounting rule can also be optionally associated with a branch, so that only a particular Branch's users have access to the rule") })
|
|
||||||
public class AccountingRuleApiResource {
|
public class AccountingRuleApiResource {
|
||||||
|
|
||||||
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
@@ -121,10 +119,10 @@ public class AccountingRuleApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Accounting Rule Details Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
@Operation(summary = "Retrieve Accounting Rule Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
||||||
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "accountingrules/template")
|
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "accountingrules/template")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.GetAccountRulesTemplateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.GetAccountRulesTemplateResponse.class))) })
|
||||||
public String retrieveTemplate(@Context final UriInfo uriInfo) {
|
public String retrieveTemplate(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||||
@@ -139,10 +137,10 @@ public class AccountingRuleApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Accounting Rules", notes = "Returns the list of defined accounting rules.\n" + "\n"
|
@Operation(summary = "Retrieve Accounting Rules", description = "Returns the list of defined accounting rules.\n" + "\n"
|
||||||
+ "Example Requests:\n" + "\n" + "accountingrules")
|
+ "Example Requests:\n" + "\n" + "accountingrules")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.GetAccountRulesResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.GetAccountRulesResponse.class)))) })
|
||||||
public String retrieveAllAccountingRules(@Context final UriInfo uriInfo) {
|
public String retrieveAllAccountingRules(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
final AppUser currentUser = this.context.authenticatedUser();
|
final AppUser currentUser = this.context.authenticatedUser();
|
||||||
@@ -171,10 +169,12 @@ public class AccountingRuleApiResource {
|
|||||||
@Path("{accountingRuleId}")
|
@Path("{accountingRuleId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a Accounting rule", notes = "Returns the details of a defined Accounting rule.\n" + "\n"
|
@Operation(summary = "Retrieve a Accounting rule", description = "Returns the details of a defined Accounting rule.\n" + "\n"
|
||||||
+ "Example Requests:\n" + "\n" + "accountingrules/1")
|
+ "Example Requests:\n" + "\n" + "accountingrules/1")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = AccountingRuleData.class) })
|
@ApiResponses({
|
||||||
public String retreiveAccountingRule(@PathParam("accountingRuleId") @ApiParam(value = "accountingRuleId") final Long accountingRuleId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleData.class))) })
|
||||||
|
public String retreiveAccountingRule(
|
||||||
|
@PathParam("accountingRuleId") @Parameter(description = "accountingRuleId") final Long accountingRuleId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||||
@@ -191,13 +191,13 @@ public class AccountingRuleApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create/Define a Accounting rule", notes = "Define a new Accounting rule.\n" + "\n" + "Mandatory Fields\n"
|
@Operation(summary = "Create/Define a Accounting rule", description = "Define a new Accounting rule.\n" + "\n" + "Mandatory Fields\n"
|
||||||
+ "name, officeId,\n" + "accountToDebit OR debitTags,\n" + "accountToCredit OR creditTags.\n" + "\n" + "Optional Fields\n"
|
+ "name, officeId,\n" + "accountToDebit OR debitTags,\n" + "accountToCredit OR creditTags.\n" + "\n" + "Optional Fields\n"
|
||||||
+ "description")
|
+ "description")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.PostAccountingRulesRequest.class)))
|
||||||
@ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = AccountingRuleApiResourceSwagger.PostAccountingRulesRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.PostAccountingRulesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.PostAccountingRulesResponse.class))) })
|
||||||
public String createAccountingRule(@ApiParam(hidden = true) final String jsonRequestBody) {
|
public String createAccountingRule(@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createAccountingRule().withJson(jsonRequestBody).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createAccountingRule().withJson(jsonRequestBody).build();
|
||||||
|
|
||||||
@@ -210,12 +210,13 @@ public class AccountingRuleApiResource {
|
|||||||
@Path("{accountingRuleId}")
|
@Path("{accountingRuleId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Accounting Rule", notes = "Updates the details of a Accounting rule.")
|
@Operation(summary = "Update a Accounting Rule", description = "Updates the details of a Accounting rule.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.PutAccountingRulesRequest.class)))
|
||||||
@ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = AccountingRuleApiResourceSwagger.PutAccountingRulesRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.PutAccountingRulesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.PutAccountingRulesResponse.class))) })
|
||||||
public String updateAccountingRule(@PathParam("accountingRuleId") @ApiParam(value = "accountingRuleId") final Long accountingRuleId,
|
public String updateAccountingRule(
|
||||||
@ApiParam(hidden = true) final String jsonRequestBody) {
|
@PathParam("accountingRuleId") @Parameter(description = "accountingRuleId") final Long accountingRuleId,
|
||||||
|
@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateAccountingRule(accountingRuleId).withJson(jsonRequestBody)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateAccountingRule(accountingRuleId).withJson(jsonRequestBody)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -228,10 +229,11 @@ public class AccountingRuleApiResource {
|
|||||||
@Path("{accountingRuleId}")
|
@Path("{accountingRuleId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete a Accounting Rule", notes = "Deletes a Accounting rule.")
|
@Operation(summary = "Delete a Accounting Rule", description = "Deletes a Accounting rule.")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.DeleteAccountingRulesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.DeleteAccountingRulesResponse.class))) })
|
||||||
public String deleteAccountingRule(@PathParam("accountingRuleId") @ApiParam(value = "accountingRuleId") final Long accountingRuleId) {
|
public String deleteAccountingRule(
|
||||||
|
@PathParam("accountingRuleId") @Parameter(description = "accountingRuleId") final Long accountingRuleId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteAccountingRule(accountingRuleId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteAccountingRule(accountingRuleId).build();
|
||||||
|
|
||||||
|
|||||||
+20
-21
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.rule.api;
|
package org.apache.fineract.accounting.rule.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
|
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
|
||||||
@@ -35,7 +34,7 @@ final class AccountingRuleApiResourceSwagger {
|
|||||||
// For Swagger Documentation
|
// For Swagger Documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountRulesResponse")
|
@Schema(description = "GetAccountRulesResponse")
|
||||||
public static final class GetAccountRulesResponse {
|
public static final class GetAccountRulesResponse {
|
||||||
|
|
||||||
private GetAccountRulesResponse() {
|
private GetAccountRulesResponse() {
|
||||||
@@ -54,63 +53,63 @@ final class AccountingRuleApiResourceSwagger {
|
|||||||
public List<AccountingTagRuleData> debitTags;
|
public List<AccountingTagRuleData> debitTags;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountRulesTemplateResponse")
|
@Schema(description = "GetAccountRulesTemplateResponse")
|
||||||
public static final class GetAccountRulesTemplateResponse {
|
public static final class GetAccountRulesTemplateResponse {
|
||||||
|
|
||||||
private GetAccountRulesTemplateResponse() {
|
private GetAccountRulesTemplateResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public boolean systemDefined;
|
public boolean systemDefined;
|
||||||
public List<OfficeData> allowedOffices = new ArrayList<OfficeData>();
|
public List<OfficeData> allowedOffices = new ArrayList<OfficeData>();
|
||||||
public List<GLAccountData> allowedAccounts = new ArrayList<GLAccountData>();
|
public List<GLAccountData> allowedAccounts = new ArrayList<GLAccountData>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountingRulesRequest")
|
@Schema(description = "PostAccountingRulesRequest")
|
||||||
public static final class PostAccountingRulesRequest {
|
public static final class PostAccountingRulesRequest {
|
||||||
|
|
||||||
private PostAccountingRulesRequest() {
|
private PostAccountingRulesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "test")
|
@Schema(example = "test")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "21")
|
@Schema(example = "21")
|
||||||
public Long accountToDebit;
|
public Long accountToDebit;
|
||||||
@ApiModelProperty(example = "9")
|
@Schema(example = "9")
|
||||||
public Long accountToCredit;
|
public Long accountToCredit;
|
||||||
@ApiModelProperty(example = "Employee salary")
|
@Schema(example = "Employee salary")
|
||||||
public String description;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountingRulesResponse")
|
@Schema(description = "PostAccountingRulesResponse")
|
||||||
public static final class PostAccountingRulesResponse {
|
public static final class PostAccountingRulesResponse {
|
||||||
|
|
||||||
private PostAccountingRulesResponse() {
|
private PostAccountingRulesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutAccountingRulesRequest")
|
@Schema(description = "PutAccountingRulesRequest")
|
||||||
public static final class PutAccountingRulesRequest {
|
public static final class PutAccountingRulesRequest {
|
||||||
|
|
||||||
private PutAccountingRulesRequest() {
|
private PutAccountingRulesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Employee Salary posting rule")
|
@Schema(example = "Employee Salary posting rule")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutAccountingRulesResponse")
|
@Schema(description = "PutAccountingRulesResponse")
|
||||||
public static final class PutAccountingRulesResponse {
|
public static final class PutAccountingRulesResponse {
|
||||||
|
|
||||||
private PutAccountingRulesResponse() {
|
private PutAccountingRulesResponse() {
|
||||||
@@ -121,23 +120,23 @@ final class AccountingRuleApiResourceSwagger {
|
|||||||
|
|
||||||
public PutAccountingRulesResponsechangesSwagger() {}
|
public PutAccountingRulesResponsechangesSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Employee Salary posting rule")
|
@Schema(example = "Employee Salary posting rule")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutAccountingRulesResponsechangesSwagger changes;
|
public PutAccountingRulesResponsechangesSwagger changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteAccountingRulesResponse")
|
@Schema(description = "DeleteAccountingRulesResponse")
|
||||||
public static final class DeleteAccountingRulesResponse {
|
public static final class DeleteAccountingRulesResponse {
|
||||||
|
|
||||||
private DeleteAccountingRulesResponse() {
|
private DeleteAccountingRulesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-9
@@ -18,10 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.adhocquery.api;
|
package org.apache.fineract.adhocquery.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -54,8 +52,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/adhocquery")
|
@Path("/adhocquery")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "AdhocQuery Api" })
|
@Tag(name = "AdhocQuery Api", description = "")
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "AdhocQuery Api", description = "") })
|
|
||||||
public class AdHocApiResource {
|
public class AdHocApiResource {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,7 +119,7 @@ public class AdHocApiResource {
|
|||||||
@Path("{adHocId}")
|
@Path("{adHocId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
public String retrieveAdHocQuery(@PathParam("adHocId") @ApiParam(value = "adHocId") final Long adHocId,
|
public String retrieveAdHocQuery(@PathParam("adHocId") @Parameter(description = "adHocId") final Long adHocId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
@@ -138,7 +135,7 @@ public class AdHocApiResource {
|
|||||||
@Path("{adHocId}")
|
@Path("{adHocId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
public String update(@PathParam("adHocId") @ApiParam(value = "adHocId") final Long adHocId, final String apiRequestBodyAsJson) {
|
public String update(@PathParam("adHocId") @Parameter(description = "adHocId") final Long adHocId, final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.updateAdHoc(adHocId) //
|
.updateAdHoc(adHocId) //
|
||||||
@@ -160,7 +157,7 @@ public class AdHocApiResource {
|
|||||||
@Path("{adHocId}")
|
@Path("{adHocId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
public String deleteAdHocQuery(@PathParam("adHocId") @ApiParam(value = "adHocId") final Long adHocId) {
|
public String deleteAdHocQuery(@PathParam("adHocId") @Parameter(description = "adHocId") final Long adHocId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.deleteAdHoc(adHocId) //
|
.deleteAdHoc(adHocId) //
|
||||||
|
|||||||
+21
-24
@@ -18,15 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.batch.api;
|
package org.apache.fineract.batch.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
@@ -64,15 +63,13 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/batches")
|
@Path("/batches")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Batch API" })
|
@Tag(name = "Batch API", description = "The Apache Fineract Batch API enables a consumer to access significant amounts of data in a single call or to make changes to several objects at once. Batching allows a consumer to pass instructions for several operations in a single HTTP request. A consumer can also specify dependencies between related operations. Once all operations have been completed, a consolidated response will be passed back and the HTTP connection will be closed.\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n"
|
||||||
@Tag(name = "Batch API", description = "The Apache Fineract Batch API enables a consumer to access significant amounts of data in a single call or to make changes to several objects at once. Batching allows a consumer to pass instructions for several operations in a single HTTP request. A consumer can also specify dependencies between related operations. Once all operations have been completed, a consolidated response will be passed back and the HTTP connection will be closed.\n"
|
+ "The Batch API takes in an array of logical HTTP requests represented as JSON arrays - each request has a requestId (the id of a request used to specify the sequence and as a dependency between requests), a method (corresponding to HTTP method GET/PUT/POST/DELETE etc.), a relativeUrl (the portion of the URL after https://example.org/api/v2/), optional headers array (corresponding to HTTP headers), optional reference parameter if a request is dependent on another request and an optional body (for POST and PUT requests). The Batch API returns an array of logical HTTP responses represented as JSON arrays - each response has a requestId, a status code, an optional headers array and an optional body (which is a JSON encoded string).\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "The Batch API takes in an array of logical HTTP requests represented as JSON arrays - each request has a requestId (the id of a request used to specify the sequence and as a dependency between requests), a method (corresponding to HTTP method GET/PUT/POST/DELETE etc.), a relativeUrl (the portion of the URL after https://example.org/api/v2/), optional headers array (corresponding to HTTP headers), optional reference parameter if a request is dependent on another request and an optional body (for POST and PUT requests). The Batch API returns an array of logical HTTP responses represented as JSON arrays - each response has a requestId, a status code, an optional headers array and an optional body (which is a JSON encoded string).\n"
|
+ "Batch API uses Json Path to handle dependent parameters. For example, if request '2' is referencing request '1' and in the \"body\" or in \"relativeUrl\" of request '2', there is a dependent parameter (which will look like \"$.parameter_name\"), then Batch API will internally substitute this dependent parameter from the response body of request '1'.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "Batch API uses Json Path to handle dependent parameters. For example, if request '2' is referencing request '1' and in the \"body\" or in \"relativeUrl\" of request '2', there is a dependent parameter (which will look like \"$.parameter_name\"), then Batch API will internally substitute this dependent parameter from the response body of request '1'.\n"
|
+ "Batch API is able to handle deeply nested dependent requests as well nested parameters. As shown in the example, requests are dependent on each other as, 1<--2<--6, i.e a nested dependency, where request '6' is not directly dependent on request '1' but still it is one of the nested child of request '1'. In the same way Batch API could handle a deeply nested dependent value, such as {..[..{..,$.parameter_name,..}..]}.")
|
||||||
+ "\n"
|
|
||||||
+ "Batch API is able to handle deeply nested dependent requests as well nested parameters. As shown in the example, requests are dependent on each other as, 1<--2<--6, i.e a nested dependency, where request '6' is not directly dependent on request '1' but still it is one of the nested child of request '1'. In the same way Batch API could handle a deeply nested dependent value, such as {..[..{..,$.parameter_name,..}..]}.") })
|
|
||||||
public class BatchApiResource {
|
public class BatchApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -109,15 +106,15 @@ public class BatchApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Batch requests in a single transaction", httpMethod = "POST", notes = "The Apache Fineract Batch API is also capable of executing all the requests in a single transaction, by setting a Query Parameter, \"enclosingTransaction=true\". So, if one or more of the requests in a batch returns an erroneous response all of the Data base transactions made by other successful requests will be rolled back.\n"
|
@Operation(summary = "Batch requests in a single transaction", description = "The Apache Fineract Batch API is also capable of executing all the requests in a single transaction, by setting a Query Parameter, \"enclosingTransaction=true\". So, if one or more of the requests in a batch returns an erroneous response all of the Data base transactions made by other successful requests will be rolled back.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "If there has been a rollback in a transaction then a single response will be provided, with a '400' status code and a body consisting of the error details of the first failed request.")
|
+ "If there has been a rollback in a transaction then a single response will be provided, with a '400' status code and a body consisting of the error details of the first failed request.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = BatchApiResourceSwagger.PostBatchesRequest.class, description = "request body")))
|
||||||
@ApiImplicitParam(paramType = "body", dataType = "BatchRequest", required = true, type = "body", dataTypeClass = BatchApiResourceSwagger.PostBatchesRequest.class, value = "request body") })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "Success", response = BatchResponse.class) })
|
@ApiResponse(responseCode = "200", description = "Success", content = @Content(schema = @Schema(implementation = BatchResponse.class))) })
|
||||||
public String handleBatchRequests(
|
public String handleBatchRequests(
|
||||||
@DefaultValue("false") @QueryParam("enclosingTransaction") @ApiParam(value = "enclosingTransaction", defaultValue = "false") final boolean enclosingTransaction,
|
@DefaultValue("false") @QueryParam("enclosingTransaction") @Parameter(description = "enclosingTransaction", required = false) final boolean enclosingTransaction,
|
||||||
@ApiParam(hidden = true) final String jsonRequestString, @Context UriInfo uriInfo) {
|
@Parameter(hidden = true) final String jsonRequestString, @Context UriInfo uriInfo) {
|
||||||
|
|
||||||
// Handles user authentication
|
// Handles user authentication
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|||||||
+15
-16
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.batch.api;
|
package org.apache.fineract.batch.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.apache.fineract.batch.domain.Header;
|
import org.apache.fineract.batch.domain.Header;
|
||||||
|
|
||||||
@@ -32,7 +31,7 @@ final class BatchApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostBatchesRequest")
|
@Schema(description = "PostBatchesRequest")
|
||||||
public static final class PostBatchesRequest {
|
public static final class PostBatchesRequest {
|
||||||
|
|
||||||
private PostBatchesRequest() {
|
private PostBatchesRequest() {
|
||||||
@@ -45,35 +44,35 @@ final class BatchApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "\"Petra\"")
|
@Schema(example = "\"Petra\"")
|
||||||
public String firstname;
|
public String firstname;
|
||||||
@ApiModelProperty(example = "\"Yton\"")
|
@Schema(example = "\"Yton\"")
|
||||||
public String lastname;
|
public String lastname;
|
||||||
@ApiModelProperty(example = "\"ex_externalId1\"")
|
@Schema(example = "\"ex_externalId1\"")
|
||||||
public String externalId;
|
public String externalId;
|
||||||
@ApiModelProperty(example = "\"dd MMMM yyyy\"")
|
@Schema(example = "\"dd MMMM yyyy\"")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "\"en\"")
|
@Schema(example = "\"en\"")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean active;
|
public boolean active;
|
||||||
@ApiModelProperty(example = "\"04 March 2009\"")
|
@Schema(example = "\"04 March 2009\"")
|
||||||
public String activationDate;
|
public String activationDate;
|
||||||
@ApiModelProperty(example = "\"04 March 2009\"")
|
@Schema(example = "\"04 March 2009\"")
|
||||||
public String submittedOnDate;
|
public String submittedOnDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long requestId;
|
public Long requestId;
|
||||||
@ApiModelProperty(example = "clients")
|
@Schema(example = "clients")
|
||||||
public String relativeUrl;
|
public String relativeUrl;
|
||||||
@ApiModelProperty(example = "POST")
|
@Schema(example = "POST")
|
||||||
public String method;
|
public String method;
|
||||||
public Set<Header> headers;
|
public Set<Header> headers;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long reference;
|
public Long reference;
|
||||||
public PostBodyRequestSwagger body;
|
public PostBodyRequestSwagger body;
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-41
@@ -18,13 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.commands.api;
|
package org.apache.fineract.commands.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -55,13 +56,11 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/audits")
|
@Path("/audits")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Audits" })
|
@Tag(name = "Audits", description = "Every non-read Mifos API request is audited. A fully processed request can not be changed or deleted. See maker checker api for situations where an audit is not fully processed.\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n"
|
||||||
@Tag(name = "Audits", description = "Every non-read Mifos API request is audited. A fully processed request can not be changed or deleted. See maker checker api for situations where an audit is not fully processed.\n"
|
+ "Permissions: To search and look at audit entries a user needs to be attached to a role that has one of the ALL_FUNCTIONS, ALL_FUNCTIONS_READ or READ_AUDIT permissions.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "Permissions: To search and look at audit entries a user needs to be attached to a role that has one of the ALL_FUNCTIONS, ALL_FUNCTIONS_READ or READ_AUDIT permissions.\n"
|
+ "Data Scope: A user can only see audits that are within their data scope. However, 'head office' users can see all audits including those that aren't office/branch related e.g. Loan Product changes.\")")
|
||||||
+ "\n"
|
|
||||||
+ "Data Scope: A user can only see audits that are within their data scope. However, 'head office' users can see all audits including those that aren't office/branch related e.g. Loan Product changes.\")") })
|
|
||||||
public class AuditsApiResource {
|
public class AuditsApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId",
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId",
|
||||||
@@ -90,33 +89,33 @@ public class AuditsApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Audits", notes = "Get a 200 list of audits that match the criteria supplied and sorted by audit id in descending order, and are within the requestors' data scope. Also it supports pagination and sorting\n"
|
@Operation(summary = "List Audits", description = "Get a 200 list of audits that match the criteria supplied and sorted by audit id in descending order, and are within the requestors' data scope. Also it supports pagination and sorting\n"
|
||||||
+ "\n" + "Example Requests:\n" + "\n" + "audits\n" + "\n" + "audits?fields=madeOnDate,maker,processingResult\n" + "\n"
|
+ "\n" + "Example Requests:\n" + "\n" + "audits\n" + "\n" + "audits?fields=madeOnDate,maker,processingResult\n" + "\n"
|
||||||
+ "audits?makerDateTimeFrom=2013-03-25 08:00:00&makerDateTimeTo=2013-04-04 18:00:00\n" + "\n" + "audits?officeId=1\n" + "\n"
|
+ "audits?makerDateTimeFrom=2013-03-25 08:00:00&makerDateTimeTo=2013-04-04 18:00:00\n" + "\n" + "audits?officeId=1\n" + "\n"
|
||||||
+ "audits?officeId=1&includeJson=true")
|
+ "audits?officeId=1&includeJson=true")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class)))) })
|
||||||
public String retrieveAuditEntries(@Context final UriInfo uriInfo,
|
public String retrieveAuditEntries(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("actionName") @ApiParam(value = "actionName") final String actionName,
|
@QueryParam("actionName") @Parameter(description = "actionName") final String actionName,
|
||||||
@QueryParam("entityName") @ApiParam(value = "entityName") final String entityName,
|
@QueryParam("entityName") @Parameter(description = "entityName") final String entityName,
|
||||||
@QueryParam("resourceId") @ApiParam(value = "resourceId") final Long resourceId,
|
@QueryParam("resourceId") @Parameter(description = "resourceId") final Long resourceId,
|
||||||
@QueryParam("makerId") @ApiParam(value = "makerId") final Long makerId,
|
@QueryParam("makerId") @Parameter(description = "makerId") final Long makerId,
|
||||||
@QueryParam("makerDateTimeFrom") @ApiParam(value = "makerDateTimeFrom") final String makerDateTimeFrom,
|
@QueryParam("makerDateTimeFrom") @Parameter(description = "makerDateTimeFrom") final String makerDateTimeFrom,
|
||||||
@QueryParam("makerDateTimeTo") @ApiParam(value = "makerDateTimeTo") final String makerDateTimeTo,
|
@QueryParam("makerDateTimeTo") @Parameter(description = "makerDateTimeTo") final String makerDateTimeTo,
|
||||||
@QueryParam("checkerId") @ApiParam(value = "checkerId") final Long checkerId,
|
@QueryParam("checkerId") @Parameter(description = "checkerId") final Long checkerId,
|
||||||
@QueryParam("checkerDateTimeFrom") @ApiParam(value = "checkerDateTimeFrom") final String checkerDateTimeFrom,
|
@QueryParam("checkerDateTimeFrom") @Parameter(description = "checkerDateTimeFrom") final String checkerDateTimeFrom,
|
||||||
@QueryParam("checkerDateTimeTo") @ApiParam(value = "checkerDateTimeTo") final String checkerDateTimeTo,
|
@QueryParam("checkerDateTimeTo") @Parameter(description = "checkerDateTimeTo") final String checkerDateTimeTo,
|
||||||
@QueryParam("processingResult") @ApiParam(value = "processingResult") final Integer processingResult,
|
@QueryParam("processingResult") @Parameter(description = "processingResult") final Integer processingResult,
|
||||||
@QueryParam("officeId") @ApiParam(value = "officeId") final Integer officeId,
|
@QueryParam("officeId") @Parameter(description = "officeId") final Integer officeId,
|
||||||
@QueryParam("groupId") @ApiParam(value = "groupId") final Integer groupId,
|
@QueryParam("groupId") @Parameter(description = "groupId") final Integer groupId,
|
||||||
@QueryParam("clientId") @ApiParam(value = "clientId") final Integer clientId,
|
@QueryParam("clientId") @Parameter(description = "clientId") final Integer clientId,
|
||||||
@QueryParam("loanid") @ApiParam(value = "loanid") final Integer loanId,
|
@QueryParam("loanid") @Parameter(description = "loanid") final Integer loanId,
|
||||||
@QueryParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Integer savingsAccountId,
|
@QueryParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Integer savingsAccountId,
|
||||||
@QueryParam("paged") @ApiParam(value = "paged") final Boolean paged,
|
@QueryParam("paged") @Parameter(description = "paged") final Boolean paged,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) {
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
final PaginationParameters parameters = PaginationParameters.instance(paged, offset, limit, orderBy, sortOrder);
|
final PaginationParameters parameters = PaginationParameters.instance(paged, offset, limit, orderBy, sortOrder);
|
||||||
@@ -141,10 +140,11 @@ public class AuditsApiResource {
|
|||||||
@Path("{auditId}")
|
@Path("{auditId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve an Audit Entry", notes = "Example Requests:\n" + "\n" + "audits/20\n"
|
@Operation(summary = "Retrieve an Audit Entry", description = "Example Requests:\n" + "\n" + "audits/20\n"
|
||||||
+ "audits/20?fields=madeOnDate,maker,processingResult")
|
+ "audits/20?fields=madeOnDate,maker,processingResult")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class) })
|
@ApiResponses({
|
||||||
public String retrieveAuditEntry(@PathParam("auditId") @ApiParam(value = "auditId") final Long auditId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class))) })
|
||||||
|
public String retrieveAuditEntry(@PathParam("auditId") @Parameter(description = "auditId") final Long auditId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
@@ -159,10 +159,10 @@ public class AuditsApiResource {
|
|||||||
@Path("/searchtemplate")
|
@Path("/searchtemplate")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Audit Search Template", notes = "This is a convenience resource. It can be useful when building an Audit Search UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with.\n"
|
@Operation(summary = "Audit Search Template", description = "This is a convenience resource. It can be useful when building an Audit Search UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with.\n"
|
||||||
+ "\n" + "Example Requests:\n" + "\n" + "audits/searchtemplate\n" + "audits/searchtemplate?fields=actionNames")
|
+ "\n" + "Example Requests:\n" + "\n" + "audits/searchtemplate\n" + "audits/searchtemplate?fields=actionNames")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckersSearchTemplateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckersSearchTemplateResponse.class))) })
|
||||||
public String retrieveAuditSearchTemplate(@Context final UriInfo uriInfo) {
|
public String retrieveAuditSearchTemplate(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|||||||
+33
-31
@@ -18,13 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.commands.api;
|
package org.apache.fineract.commands.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -58,8 +59,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/makercheckers")
|
@Path("/makercheckers")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Maker Checker (or 4-eye) functionality" })
|
@Tag(name = "Maker Checker (or 4-eye) functionality")
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Maker Checker (or 4-eye) functionality") })
|
|
||||||
public class MakercheckersApiResource {
|
public class MakercheckersApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId",
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId",
|
||||||
@@ -88,24 +88,24 @@ public class MakercheckersApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Maker Checker Entries", notes = "Get a list of entries that can be checked by the requestor that match the criteria supplied.\n"
|
@Operation(summary = "List Maker Checker Entries", description = "Get a list of entries that can be checked by the requestor that match the criteria supplied.\n"
|
||||||
+ "\n" + "Example Requests:\n" + "\n" + "makercheckers\n" + "\n" + "makercheckers?fields=madeOnDate,maker,processingResult\n"
|
+ "\n" + "Example Requests:\n" + "\n" + "makercheckers\n" + "\n" + "makercheckers?fields=madeOnDate,maker,processingResult\n"
|
||||||
+ "\n" + "makercheckers?makerDateTimeFrom=2013-03-25 08:00:00&makerDateTimeTo=2013-04-04 18:00:00\n" + "\n"
|
+ "\n" + "makercheckers?makerDateTimeFrom=2013-03-25 08:00:00&makerDateTimeTo=2013-04-04 18:00:00\n" + "\n"
|
||||||
+ "makercheckers?officeId=1\n" + "\n" + "makercheckers?officeId=1&includeJson=true")
|
+ "makercheckers?officeId=1\n" + "\n" + "makercheckers?officeId=1&includeJson=true")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class)))) })
|
||||||
public String retrieveCommands(@Context final UriInfo uriInfo,
|
public String retrieveCommands(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("actionName") @ApiParam(value = "actionName") final String actionName,
|
@QueryParam("actionName") @Parameter(description = "actionName") final String actionName,
|
||||||
@QueryParam("entityName") @ApiParam(value = "entityName") final String entityName,
|
@QueryParam("entityName") @Parameter(description = "entityName") final String entityName,
|
||||||
@QueryParam("resourceId") @ApiParam(value = "resourceId") final Long resourceId,
|
@QueryParam("resourceId") @Parameter(description = "resourceId") final Long resourceId,
|
||||||
@QueryParam("makerId") @ApiParam(value = "makerId") final Long makerId,
|
@QueryParam("makerId") @Parameter(description = "makerId") final Long makerId,
|
||||||
@QueryParam("makerDateTimeFrom") @ApiParam(value = "makerDateTimeFrom") final String makerDateTimeFrom,
|
@QueryParam("makerDateTimeFrom") @Parameter(description = "makerDateTimeFrom") final String makerDateTimeFrom,
|
||||||
@QueryParam("makerDateTimeTo") @ApiParam(value = "makerDateTimeTo") final String makerDateTimeTo,
|
@QueryParam("makerDateTimeTo") @Parameter(description = "makerDateTimeTo") final String makerDateTimeTo,
|
||||||
@QueryParam("officeId") @ApiParam(value = "officeId") final Integer officeId,
|
@QueryParam("officeId") @Parameter(description = "officeId") final Integer officeId,
|
||||||
@QueryParam("groupId") @ApiParam(value = "groupId") final Integer groupId,
|
@QueryParam("groupId") @Parameter(description = "groupId") final Integer groupId,
|
||||||
@QueryParam("clientId") @ApiParam(value = "clientId") final Integer clientId,
|
@QueryParam("clientId") @Parameter(description = "clientId") final Integer clientId,
|
||||||
@QueryParam("loanid") @ApiParam(value = "loanid") final Integer loanId,
|
@QueryParam("loanid") @Parameter(description = "loanid") final Integer loanId,
|
||||||
@QueryParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Integer savingsAccountId) {
|
@QueryParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Integer savingsAccountId) {
|
||||||
|
|
||||||
final SQLBuilder extraCriteria = getExtraCriteria(actionName, entityName, resourceId, makerId, makerDateTimeFrom, makerDateTimeTo,
|
final SQLBuilder extraCriteria = getExtraCriteria(actionName, entityName, resourceId, makerId, makerDateTimeFrom, makerDateTimeTo,
|
||||||
officeId, groupId, clientId, loanId, savingsAccountId);
|
officeId, groupId, clientId, loanId, savingsAccountId);
|
||||||
@@ -122,10 +122,10 @@ public class MakercheckersApiResource {
|
|||||||
@Path("/searchtemplate")
|
@Path("/searchtemplate")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Maker Checker Search Template", notes = "This is a convenience resource. It can be useful when building a Checker Inbox UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with. \"actionNames\" and \"entityNames\" returned are those that the requestor has Checker approval permissions for.\n"
|
@Operation(summary = "Maker Checker Search Template", description = "This is a convenience resource. It can be useful when building a Checker Inbox UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with. \"actionNames\" and \"entityNames\" returned are those that the requestor has Checker approval permissions for.\n"
|
||||||
+ "\n" + "Example Requests:\n" + "\n" + "makercheckers/searchtemplate\n" + "makercheckers/searchtemplate?fields=entityNames")
|
+ "\n" + "Example Requests:\n" + "\n" + "makercheckers/searchtemplate\n" + "makercheckers/searchtemplate?fields=entityNames")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckersSearchTemplateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckersSearchTemplateResponse.class))) })
|
||||||
public String retrieveAuditSearchTemplate(@Context final UriInfo uriInfo) {
|
public String retrieveAuditSearchTemplate(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
@@ -141,10 +141,11 @@ public class MakercheckersApiResource {
|
|||||||
@Path("{auditId}")
|
@Path("{auditId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Approve Maker Checker Entry | Reject Maker Checker Entry")
|
@Operation(summary = "Approve Maker Checker Entry | Reject Maker Checker Entry")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.PostMakerCheckersResponse.class) })
|
@ApiResponses({
|
||||||
public String approveMakerCheckerEntry(@PathParam("auditId") @ApiParam(value = "auditId") final Long auditId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.PostMakerCheckersResponse.class))) })
|
||||||
@QueryParam("command") @ApiParam(value = "command") final String commandParam) {
|
public String approveMakerCheckerEntry(@PathParam("auditId") @Parameter(description = "auditId") final Long auditId,
|
||||||
|
@QueryParam("command") @Parameter(description = "command") final String commandParam) {
|
||||||
|
|
||||||
CommandProcessingResult result = null;
|
CommandProcessingResult result = null;
|
||||||
if (is(commandParam, "approve")) {
|
if (is(commandParam, "approve")) {
|
||||||
@@ -166,9 +167,10 @@ public class MakercheckersApiResource {
|
|||||||
@Path("{auditId}")
|
@Path("{auditId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete Maker Checker Entry")
|
@Operation(summary = "Delete Maker Checker Entry")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.PostMakerCheckersResponse.class) })
|
@ApiResponses({
|
||||||
public String deleteMakerCheckerEntry(@PathParam("auditId") @ApiParam(value = "auditId") final Long auditId) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.PostMakerCheckersResponse.class))) })
|
||||||
|
public String deleteMakerCheckerEntry(@PathParam("auditId") @Parameter(description = "auditId") final Long auditId) {
|
||||||
|
|
||||||
final Long id = this.writePlatformService.deleteEntry(auditId);
|
final Long id = this.writePlatformService.deleteEntry(auditId);
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.commands.api;
|
package org.apache.fineract.commands.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.commands.data.ProcessingResultLookup;
|
import org.apache.fineract.commands.data.ProcessingResultLookup;
|
||||||
@@ -35,7 +34,7 @@ final class MakercheckersApiResourceSwagger {
|
|||||||
// only to initialize swagger documentation
|
// only to initialize swagger documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetMakerCheckerResponse")
|
@Schema(description = "GetMakerCheckerResponse")
|
||||||
public static final class GetMakerCheckerResponse {
|
public static final class GetMakerCheckerResponse {
|
||||||
|
|
||||||
private GetMakerCheckerResponse() {
|
private GetMakerCheckerResponse() {
|
||||||
@@ -65,7 +64,7 @@ final class MakercheckersApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetMakerCheckersSearchTemplateResponse")
|
@Schema(description = "GetMakerCheckersSearchTemplateResponse")
|
||||||
public static final class GetMakerCheckersSearchTemplateResponse {
|
public static final class GetMakerCheckersSearchTemplateResponse {
|
||||||
|
|
||||||
private GetMakerCheckersSearchTemplateResponse() {
|
private GetMakerCheckersSearchTemplateResponse() {
|
||||||
@@ -78,14 +77,14 @@ final class MakercheckersApiResourceSwagger {
|
|||||||
public Collection<ProcessingResultLookup> processingResults;
|
public Collection<ProcessingResultLookup> processingResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostMakerCheckersResponse")
|
@Schema(description = "PostMakerCheckersResponse")
|
||||||
public static final class PostMakerCheckersResponse {
|
public static final class PostMakerCheckersResponse {
|
||||||
|
|
||||||
private PostMakerCheckersResponse() {
|
private PostMakerCheckersResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long auditId;
|
public Long auditId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+32
-34
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.accountnumberformat.api;
|
package org.apache.fineract.infrastructure.accountnumberformat.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -61,9 +61,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path(AccountNumberFormatConstants.resourceRelativeURL)
|
@Path(AccountNumberFormatConstants.resourceRelativeURL)
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Account number format" })
|
@Tag(name = "Account number format", description = "Account number preferences are used to describe custom formats for account numbers associated with Customer, Loan and Savings accounts.")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Account number format", description = "Account number preferences are used to describe custom formats for account numbers associated with Customer, Loan and Savings accounts.") })
|
|
||||||
public class AccountNumberFormatsApiResource {
|
public class AccountNumberFormatsApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -93,10 +91,10 @@ public class AccountNumberFormatsApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Account number format Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
@Operation(summary = "Retrieve Account number format Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
||||||
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "\n" + "Example Request:\n" + "\n" + "accountnumberformats/template")
|
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "\n" + "Example Request:\n" + "\n" + "accountnumberformats/template")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsResponseTemplate.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsResponseTemplate.class))) })
|
||||||
public String retrieveTemplate(@Context final UriInfo uriInfo) {
|
public String retrieveTemplate(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(AccountNumberFormatConstants.ENTITY_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(AccountNumberFormatConstants.ENTITY_NAME);
|
||||||
@@ -111,10 +109,10 @@ public class AccountNumberFormatsApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Account number formats", notes = "Example Requests:\n" + "\n" + "accountnumberformats\n" + "\n" + "\n"
|
@Operation(summary = "List Account number formats", description = "Example Requests:\n" + "\n" + "accountnumberformats\n" + "\n" + "\n"
|
||||||
+ "accountnumberformats?fields=accountType,prefixType", responseContainer = "List")
|
+ "accountnumberformats?fields=accountType,prefixType")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class, responseContainer = "List") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class)))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo) {
|
public String retrieveAll(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(AccountNumberFormatConstants.ENTITY_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(AccountNumberFormatConstants.ENTITY_NAME);
|
||||||
@@ -130,12 +128,12 @@ public class AccountNumberFormatsApiResource {
|
|||||||
@Path("{accountNumberFormatId}")
|
@Path("{accountNumberFormatId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve an Account number format", notes = "Example Requests:\n" + "\n" + "accountnumberformats/1\n" + "\n"
|
@Operation(summary = "Retrieve an Account number format", description = "Example Requests:\n" + "\n" + "accountnumberformats/1\n" + "\n"
|
||||||
+ "\n" + "accountnumberformats/1?template=true\n" + "\n" + "\n" + "accountnumberformats/1?fields=accountType,prefixType")
|
+ "\n" + "accountnumberformats/1?template=true\n" + "\n" + "\n" + "accountnumberformats/1?fields=accountType,prefixType")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class))) })
|
||||||
public String retrieveOne(@Context final UriInfo uriInfo,
|
public String retrieveOne(@Context final UriInfo uriInfo,
|
||||||
@PathParam("accountNumberFormatId") @ApiParam(value = "accountNumberFormatId") final Long accountNumberFormatId) {
|
@PathParam("accountNumberFormatId") @Parameter(description = "accountNumberFormatId") final Long accountNumberFormatId) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(AccountNumberFormatConstants.ENTITY_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(AccountNumberFormatConstants.ENTITY_NAME);
|
||||||
|
|
||||||
@@ -155,13 +153,12 @@ public class AccountNumberFormatsApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create an Account number format", notes = "Note: You may associate a single Account number format for a given account type\n"
|
@Operation(summary = "Create an Account number format", description = "Note: You may associate a single Account number format for a given account type\n"
|
||||||
+ "Mandatory Fields for Account number formats\n" + "accountType")
|
+ "Mandatory Fields for Account number formats\n" + "accountType")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsResponse.class))) })
|
||||||
public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.createAccountNumberFormat() //
|
.createAccountNumberFormat() //
|
||||||
@@ -177,13 +174,13 @@ public class AccountNumberFormatsApiResource {
|
|||||||
@Path("{accountNumberFormatId}")
|
@Path("{accountNumberFormatId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update an Account number format")
|
@Operation(summary = "Update an Account number format")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsResponse.class))) })
|
||||||
public String update(@PathParam("accountNumberFormatId") @ApiParam(value = "accountNumberFormatId") final Long accountNumberFormatId,
|
public String update(
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@PathParam("accountNumberFormatId") @Parameter(description = "accountNumberFormatId") final Long accountNumberFormatId,
|
||||||
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.updateAccountNumberFormat(accountNumberFormatId) //
|
.updateAccountNumberFormat(accountNumberFormatId) //
|
||||||
@@ -199,10 +196,11 @@ public class AccountNumberFormatsApiResource {
|
|||||||
@Path("{accountNumberFormatId}")
|
@Path("{accountNumberFormatId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete an Account number format", notes = "Note: Account numbers created while this format was active would remain unchanged.")
|
@Operation(summary = "Delete an Account number format", description = "Note: Account numbers created while this format was active would remain unchanged.")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.DeleteAccountNumberFormatsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.DeleteAccountNumberFormatsResponse.class))) })
|
||||||
public String delete(@PathParam("accountNumberFormatId") @ApiParam(value = "accountNumberFormatId") final Long accountNumberFormatId) {
|
public String delete(
|
||||||
|
@PathParam("accountNumberFormatId") @Parameter(description = "accountNumberFormatId") final Long accountNumberFormatId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.deleteAccountNumberFormat(accountNumberFormatId) //
|
.deleteAccountNumberFormat(accountNumberFormatId) //
|
||||||
|
|||||||
+17
-18
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.accountnumberformat.api;
|
package org.apache.fineract.infrastructure.accountnumberformat.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
@@ -33,7 +32,7 @@ final class AccountNumberFormatsApiResourceSwagger {
|
|||||||
// this class is only for Swagger implementation for Live Documentation
|
// this class is only for Swagger implementation for Live Documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountNumberFormatsResponse")
|
@Schema(description = "GetAccountNumberFormatsResponse")
|
||||||
public static final class GetAccountNumberFormatsResponse {
|
public static final class GetAccountNumberFormatsResponse {
|
||||||
|
|
||||||
private GetAccountNumberFormatsResponse() {
|
private GetAccountNumberFormatsResponse() {
|
||||||
@@ -43,14 +42,14 @@ final class AccountNumberFormatsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountNumberFormatsIdResponse")
|
@Schema(description = "GetAccountNumberFormatsIdResponse")
|
||||||
public static final class GetAccountNumberFormatsIdResponse {
|
public static final class GetAccountNumberFormatsIdResponse {
|
||||||
|
|
||||||
private GetAccountNumberFormatsIdResponse() {
|
private GetAccountNumberFormatsIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long id;
|
public Long id;
|
||||||
public EnumOptionData accountType;
|
public EnumOptionData accountType;
|
||||||
|
|
||||||
@@ -58,7 +57,7 @@ final class AccountNumberFormatsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountNumberFormatsResponseTemplate")
|
@Schema(description = "GetAccountNumberFormatsResponseTemplate")
|
||||||
public static final class GetAccountNumberFormatsResponseTemplate {
|
public static final class GetAccountNumberFormatsResponseTemplate {
|
||||||
|
|
||||||
private GetAccountNumberFormatsResponseTemplate() {
|
private GetAccountNumberFormatsResponseTemplate() {
|
||||||
@@ -70,45 +69,45 @@ final class AccountNumberFormatsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountNumberFormatsRequest")
|
@Schema(description = "PostAccountNumberFormatsRequest")
|
||||||
public static final class PostAccountNumberFormatsRequest {
|
public static final class PostAccountNumberFormatsRequest {
|
||||||
|
|
||||||
private PostAccountNumberFormatsRequest() {
|
private PostAccountNumberFormatsRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long accountType;
|
public Long accountType;
|
||||||
@ApiModelProperty(example = "101")
|
@Schema(example = "101")
|
||||||
public Long prefixType;
|
public Long prefixType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountNumberFormatsResponse")
|
@Schema(description = "PostAccountNumberFormatsResponse")
|
||||||
public static final class PostAccountNumberFormatsResponse {
|
public static final class PostAccountNumberFormatsResponse {
|
||||||
|
|
||||||
private PostAccountNumberFormatsResponse() {
|
private PostAccountNumberFormatsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutAccountNumberFormatsRequest")
|
@Schema(description = "PutAccountNumberFormatsRequest")
|
||||||
public static final class PutAccountNumberFormatsRequest {
|
public static final class PutAccountNumberFormatsRequest {
|
||||||
|
|
||||||
private PutAccountNumberFormatsRequest() {
|
private PutAccountNumberFormatsRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long prefixType;
|
public Long prefixType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutAccountNumberFormatsResponse")
|
@Schema(description = "PutAccountNumberFormatsResponse")
|
||||||
public static final class PutAccountNumberFormatsResponse {
|
public static final class PutAccountNumberFormatsResponse {
|
||||||
|
|
||||||
private PutAccountNumberFormatsResponse() {
|
private PutAccountNumberFormatsResponse() {
|
||||||
@@ -121,24 +120,24 @@ final class AccountNumberFormatsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "OFFICE_NAME")
|
@Schema(example = "OFFICE_NAME")
|
||||||
public Long prefixType;
|
public Long prefixType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutAccountNumberFormatschangesSwagger changes;
|
public PutAccountNumberFormatschangesSwagger changes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteAccountNumberFormatsResponse")
|
@Schema(description = "DeleteAccountNumberFormatsResponse")
|
||||||
public static final class DeleteAccountNumberFormatsResponse {
|
public static final class DeleteAccountNumberFormatsResponse {
|
||||||
|
|
||||||
private DeleteAccountNumberFormatsResponse() {
|
private DeleteAccountNumberFormatsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+19
-20
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.cache.api;
|
package org.apache.fineract.infrastructure.cache.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -59,11 +59,9 @@ import org.springframework.stereotype.Component;
|
|||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Cache" })
|
@Tag(name = "Cache", description = "The following settings are possible for cache:\n" + "\n" + "No Caching: caching turned off\n"
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Cache", description = "The following settings are possible for cache:\n" + "\n"
|
|
||||||
+ "No Caching: caching turned off\n"
|
|
||||||
+ "Single node: caching on for single instance deployments of platorm (works for multiple tenants but only one tomcat)\n"
|
+ "Single node: caching on for single instance deployments of platorm (works for multiple tenants but only one tomcat)\n"
|
||||||
+ "By default caching is set to No Caching. Switching between caches results in the cache been clear e.g. from Single node to No cache and back again would clear down the single node cache.") })
|
+ "By default caching is set to No Caching. Switching between caches results in the cache been clear e.g. from Single node to No cache and back again would clear down the single node cache.")
|
||||||
public class CacheApiResource {
|
public class CacheApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id"));
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id"));
|
||||||
@@ -88,9 +86,10 @@ public class CacheApiResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@ApiOperation(value = "Retrieve Cache Types", notes = "Returns the list of caches.\n" + "\n" + "Example Requests:\n" + "\n" + "caches")
|
@Operation(summary = "Retrieve Cache Types", description = "Returns the list of caches.\n" + "\n" + "Example Requests:\n" + "\n"
|
||||||
|
+ "caches")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = CacheApiResourceSwagger.GetCachesResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = CacheApiResourceSwagger.GetCachesResponse.class)))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo) {
|
public String retrieveAll(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
@@ -102,11 +101,11 @@ public class CacheApiResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
@ApiOperation(value = "Switch Cache", notes = "Switches the cache to chosen one.")
|
@Operation(summary = "Switch Cache", description = "Switches the cache to chosen one.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CacheApiResourceSwagger.PutCachesRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CacheApiResourceSwagger.PutCachesRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CacheApiResourceSwagger.PutCachesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CacheApiResourceSwagger.PutCachesResponse.class))) })
|
||||||
public String switchCache(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String switchCache(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCache().withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCache().withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
|
|||||||
+6
-7
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.cache.api;
|
package org.apache.fineract.infrastructure.cache.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,7 +30,7 @@ final class CacheApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetCachesResponse")
|
@Schema(description = "GetCachesResponse")
|
||||||
public static final class GetCachesResponse {
|
public static final class GetCachesResponse {
|
||||||
|
|
||||||
private GetCachesResponse() {
|
private GetCachesResponse() {
|
||||||
@@ -42,19 +41,19 @@ final class CacheApiResourceSwagger {
|
|||||||
public boolean enabled;
|
public boolean enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutCachesRequest")
|
@Schema(description = "PutCachesRequest")
|
||||||
public static final class PutCachesRequest {
|
public static final class PutCachesRequest {
|
||||||
|
|
||||||
private PutCachesRequest() {
|
private PutCachesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long cacheType;
|
public Long cacheType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutCachesResponse")
|
@Schema(description = "PutCachesResponse")
|
||||||
public static final class PutCachesResponse {
|
public static final class PutCachesResponse {
|
||||||
|
|
||||||
private PutCachesResponse() {
|
private PutCachesResponse() {
|
||||||
@@ -67,7 +66,7 @@ final class CacheApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long cacheType;
|
public Long cacheType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-28
@@ -19,12 +19,12 @@
|
|||||||
package org.apache.fineract.infrastructure.campaigns.sms.api;
|
package org.apache.fineract.infrastructure.campaigns.sms.api;
|
||||||
|
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
@@ -64,7 +64,6 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/smscampaigns")
|
@Path("/smscampaigns")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(value = "SMS Campaigns")
|
|
||||||
public class SmsCampaignApiResource {
|
public class SmsCampaignApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext platformSecurityContext;
|
private final PlatformSecurityContext platformSecurityContext;
|
||||||
@@ -100,9 +99,9 @@ public class SmsCampaignApiResource {
|
|||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("template")
|
@Path("template")
|
||||||
@ApiOperation(value = "Retrieve a SMS Campaign", notes = "Example Requests:\n" + "\n" + "smscampaigns/1\n" + "\n" + "\n"
|
@Operation(summary = "Retrieve a SMS Campaign", description = "Example Requests:\n" + "\n" + "smscampaigns/1\n" + "\n" + "\n"
|
||||||
+ "smscampaigns/1?template=true\n" + "\n" + "\n" + "smscampaigns/template")
|
+ "smscampaigns/1?template=true\n" + "\n" + "\n" + "smscampaigns/template")
|
||||||
@ApiResponse(code = 200, message = "", response = SmsCampaignData.class)
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SmsCampaignData.class)))
|
||||||
public String template(@Context final UriInfo uriInfo) {
|
public String template(@Context final UriInfo uriInfo) {
|
||||||
this.platformSecurityContext.authenticatedUser().validateHasReadPermission(SmsCampaignConstants.RESOURCE_NAME);
|
this.platformSecurityContext.authenticatedUser().validateHasReadPermission(SmsCampaignConstants.RESOURCE_NAME);
|
||||||
final SmsCampaignData smsCampaignData = this.smsCampaignReadPlatformService.retrieveTemplate(CampaignType.SMS.name());
|
final SmsCampaignData smsCampaignData = this.smsCampaignReadPlatformService.retrieveTemplate(CampaignType.SMS.name());
|
||||||
@@ -113,13 +112,12 @@ public class SmsCampaignApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a SMS Campaign", notes = "Mandatory Fields\n"
|
@Operation(summary = "Create a SMS Campaign", description = "Mandatory Fields\n"
|
||||||
+ "campaignName, campaignType, triggerType, providerId, runReportId, message\n" + "\n"
|
+ "campaignName, campaignType, triggerType, providerId, runReportId, message\n" + "\n"
|
||||||
+ "Mandatory Fields for Cash based on selected report id\n" + "paramValue in json format")
|
+ "Mandatory Fields for Cash based on selected report id\n" + "paramValue in json format")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CommandWrapper.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CommandWrapper.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class)))
|
||||||
@ApiResponse(code = 200, message = "", response = CommandProcessingResult.class)
|
public String createCampaign(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
public String createCampaign(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createSmsCampaign().withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createSmsCampaign().withJson(apiRequestBodyAsJson).build();
|
||||||
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
@@ -129,8 +127,8 @@ public class SmsCampaignApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Path("{resourceId}")
|
@Path("{resourceId}")
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a SMS Campaign", notes = "Example Requests:\n" + "\n" + "smscampaigns/1\n")
|
@Operation(summary = "Retrieve a SMS Campaign", description = "Example Requests:\n" + "\n" + "smscampaigns/1\n")
|
||||||
@ApiResponse(code = 200, message = "", response = SmsCampaignData.class)
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SmsCampaignData.class)))
|
||||||
public String retrieveCampaign(@PathParam("resourceId") final Long resourceId, @Context final UriInfo uriInfo) {
|
public String retrieveCampaign(@PathParam("resourceId") final Long resourceId, @Context final UriInfo uriInfo) {
|
||||||
this.platformSecurityContext.authenticatedUser().validateHasReadPermission(SmsCampaignConstants.RESOURCE_NAME);
|
this.platformSecurityContext.authenticatedUser().validateHasReadPermission(SmsCampaignConstants.RESOURCE_NAME);
|
||||||
SmsCampaignData smsCampaignData = this.smsCampaignReadPlatformService.retrieveOne(resourceId);
|
SmsCampaignData smsCampaignData = this.smsCampaignReadPlatformService.retrieveOne(resourceId);
|
||||||
@@ -141,8 +139,8 @@ public class SmsCampaignApiResource {
|
|||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List SMS Campaigns", notes = "Example Requests:\n" + "\n" + "smscampaigns")
|
@Operation(summary = "List SMS Campaigns", description = "Example Requests:\n" + "\n" + "smscampaigns")
|
||||||
@ApiResponse(code = 200, message = "", response = SmsCampaignData.class)
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SmsCampaignData.class)))
|
||||||
public String retrieveAllEmails(@QueryParam("sqlSearch") final String sqlSearch, @QueryParam("offset") final Integer offset,
|
public String retrieveAllEmails(@QueryParam("sqlSearch") final String sqlSearch, @QueryParam("offset") final Integer offset,
|
||||||
@QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy,
|
@QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") final String sortOrder, @Context final UriInfo uriInfo) {
|
@QueryParam("sortOrder") final String sortOrder, @Context final UriInfo uriInfo) {
|
||||||
@@ -157,12 +155,11 @@ public class SmsCampaignApiResource {
|
|||||||
@Path("{campaignId}")
|
@Path("{campaignId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Campaign")
|
@Operation(summary = "Update a Campaign")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CommandWrapper.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CommandWrapper.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class)))
|
||||||
@ApiResponse(code = 200, message = "", response = CommandProcessingResult.class)
|
|
||||||
public String updateCampaign(@PathParam("campaignId") final Long campaignId,
|
public String updateCampaign(@PathParam("campaignId") final Long campaignId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateSmsCampaign(campaignId).withJson(apiRequestBodyAsJson)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateSmsCampaign(campaignId).withJson(apiRequestBodyAsJson)
|
||||||
.build();
|
.build();
|
||||||
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
@@ -173,10 +170,10 @@ public class SmsCampaignApiResource {
|
|||||||
@Path("{campaignId}")
|
@Path("{campaignId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "SMS Campaign", notes = "Activates | Deactivates | Reactivates")
|
@Operation(summary = "SMS Campaign", description = "Activates | Deactivates | Reactivates")
|
||||||
@ApiResponse(code = 200, message = "", response = CommandProcessingResult.class)
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class)))
|
||||||
public String handleCommands(@PathParam("campaignId") final Long campaignId, @QueryParam("command") final String commandParam,
|
public String handleCommands(@PathParam("campaignId") final Long campaignId, @QueryParam("command") final String commandParam,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson);
|
final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson);
|
||||||
CommandProcessingResult result = null;
|
CommandProcessingResult result = null;
|
||||||
CommandWrapper commandRequest = null;
|
CommandWrapper commandRequest = null;
|
||||||
@@ -211,8 +208,8 @@ public class SmsCampaignApiResource {
|
|||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{campaignId}")
|
@Path("{campaignId}")
|
||||||
@ApiOperation(value = "Delete a SMS Campaign", notes = "Note: Only closed SMS Campaigns can be deleted")
|
@Operation(summary = "Delete a SMS Campaign", description = "Note: Only closed SMS Campaigns can be deleted")
|
||||||
@ApiResponse(code = 200, message = "", response = CommandProcessingResult.class)
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class)))
|
||||||
public String delete(@PathParam("campaignId") final Long campaignId) {
|
public String delete(@PathParam("campaignId") final Long campaignId) {
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteSmsCampaign(campaignId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteSmsCampaign(campaignId).build();
|
||||||
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
|
|||||||
+39
-39
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.codes.api;
|
package org.apache.fineract.infrastructure.codes.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -61,11 +61,9 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/codes/{codeId}/codevalues")
|
@Path("/codes/{codeId}/codevalues")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Code Values" })
|
@Tag(name = "Code Values", description = "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n"
|
||||||
@Tag(name = "Code Values", description = "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n"
|
+ "Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc")
|
||||||
+ "\n"
|
|
||||||
+ "Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc") })
|
|
||||||
public class CodeValuesApiResource {
|
public class CodeValuesApiResource {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,12 +94,12 @@ public class CodeValuesApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Code Values", notes = "Returns the list of Code Values for a given Code\n" + "\n" + "Example Requests:\n"
|
@Operation(summary = "List Code Values", description = "Returns the list of Code Values for a given Code\n" + "\n"
|
||||||
+ "\n" + "codes/1/codevalues")
|
+ "Example Requests:\n" + "\n" + "codes/1/codevalues")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "A List of Given response", response = CodeValuesApiResourceSwagger.GetCodeValuesDataResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "A List of code values for a given code", content = @Content(array = @ArraySchema(schema = @Schema(implementation = CodeValuesApiResourceSwagger.GetCodeValuesDataResponse.class)))) })
|
||||||
public String retrieveAllCodeValues(@Context final UriInfo uriInfo,
|
public String retrieveAllCodeValues(@Context final UriInfo uriInfo,
|
||||||
@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId) {
|
@PathParam("codeId") @Parameter(description = "codeId") final Long codeId) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|
||||||
@@ -115,11 +113,12 @@ public class CodeValuesApiResource {
|
|||||||
@Path("{codeValueId}")
|
@Path("{codeValueId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a Code Value", notes = "Returns the details of a Code Value\n" + "\n" + "Example Requests:\n" + "\n"
|
@Operation(summary = "Retrieve a Code description", description = "Returns the details of a Code Value\n" + "\n" + "Example Requests:\n"
|
||||||
+ "codes/1/codevalues/1")
|
+ "\n" + "codes/1/codevalues/1")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CodeValuesApiResourceSwagger.GetCodeValuesDataResponse.class) })
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.GetCodeValuesDataResponse.class))) })
|
||||||
public String retrieveCodeValue(@Context final UriInfo uriInfo,
|
public String retrieveCodeValue(@Context final UriInfo uriInfo,
|
||||||
@PathParam("codeValueId") @ApiParam(value = "codeValueId") final Long codeValueId) {
|
@PathParam("codeValueId") @Parameter(description = "codeValueId") final Long codeValueId) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|
||||||
@@ -132,12 +131,12 @@ public class CodeValuesApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a Code Value", notes = "")
|
@Operation(summary = "Create a Code description", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.PostCodeValuesDataRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CodeValuesApiResourceSwagger.PostCodeValuesDataRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CodeValuesApiResourceSwagger.PostCodeValueDataResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.PostCodeValueDataResponse.class))) })
|
||||||
public String createCodeValue(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId,
|
public String createCodeValue(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createCodeValue(codeId).withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createCodeValue(codeId).withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -151,13 +150,13 @@ public class CodeValuesApiResource {
|
|||||||
@Path("{codeValueId}")
|
@Path("{codeValueId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Code Value", notes = "Updates the details of a code value.")
|
@Operation(summary = "Update a Code description", description = "Updates the details of a code description.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.PutCodeValuesDataRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CodeValuesApiResourceSwagger.PutCodeValuesDataRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CodeValuesApiResourceSwagger.PutCodeValueDataResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.PutCodeValueDataResponse.class))) })
|
||||||
public String updateCodeValue(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId,
|
public String updateCodeValue(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId,
|
||||||
@PathParam("codeValueId") @ApiParam(value = "codeValueId") final Long codeValueId,
|
@PathParam("codeValueId") @Parameter(description = "codeValueId") final Long codeValueId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCodeValue(codeId, codeValueId)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCodeValue(codeId, codeValueId)
|
||||||
.withJson(apiRequestBodyAsJson).build();
|
.withJson(apiRequestBodyAsJson).build();
|
||||||
@@ -171,10 +170,11 @@ public class CodeValuesApiResource {
|
|||||||
@Path("{codeValueId}")
|
@Path("{codeValueId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete a Code Value", notes = "Deletes a code value")
|
@Operation(summary = "Delete a Code description", description = "Deletes a code description")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CodeValuesApiResourceSwagger.DeleteCodeValueDataResponse.class) })
|
@ApiResponses({
|
||||||
public String deleteCodeValue(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.DeleteCodeValueDataResponse.class))) })
|
||||||
@PathParam("codeValueId") @ApiParam(value = "codeValueId") final Long codeValueId) {
|
public String deleteCodeValue(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId,
|
||||||
|
@PathParam("codeValueId") @Parameter(description = "codeValueId") final Long codeValueId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteCodeValue(codeId, codeValueId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteCodeValue(codeId, codeValueId).build();
|
||||||
|
|
||||||
|
|||||||
+23
-24
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.codes.api;
|
package org.apache.fineract.infrastructure.codes.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sanyam on 30/7/17.
|
* Created by sanyam on 30/7/17.
|
||||||
@@ -30,65 +29,65 @@ final class CodeValuesApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetCodeValuesDataResponse")
|
@Schema(description = "GetCodeValuesDataResponse")
|
||||||
public static final class GetCodeValuesDataResponse {
|
public static final class GetCodeValuesDataResponse {
|
||||||
|
|
||||||
private GetCodeValuesDataResponse() {
|
private GetCodeValuesDataResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Passport")
|
@Schema(example = "Passport")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Passport information")
|
@Schema(example = "Passport information")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer position;
|
public Integer position;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostCodeValuesDataRequest")
|
@Schema(description = "PostCodeValuesDataRequest")
|
||||||
public static final class PostCodeValuesDataRequest {
|
public static final class PostCodeValuesDataRequest {
|
||||||
|
|
||||||
private PostCodeValuesDataRequest() {
|
private PostCodeValuesDataRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Passport")
|
@Schema(example = "Passport")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Passport information")
|
@Schema(example = "Passport information")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer position;
|
public Integer position;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostCodeValueDataResponse")
|
@Schema(description = "PostCodeValueDataResponse")
|
||||||
public static final class PostCodeValueDataResponse {
|
public static final class PostCodeValueDataResponse {
|
||||||
|
|
||||||
private PostCodeValueDataResponse() {
|
private PostCodeValueDataResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutCodeValuesDataRequest")
|
@Schema(description = "PutCodeValuesDataRequest")
|
||||||
public static final class PutCodeValuesDataRequest {
|
public static final class PutCodeValuesDataRequest {
|
||||||
|
|
||||||
private PutCodeValuesDataRequest() {
|
private PutCodeValuesDataRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Passport")
|
@Schema(example = "Passport")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Passport information")
|
@Schema(example = "Passport information")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer position;
|
public Integer position;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutCodeValueDataResponse")
|
@Schema(description = "PutCodeValueDataResponse")
|
||||||
public static final class PutCodeValueDataResponse {
|
public static final class PutCodeValueDataResponse {
|
||||||
|
|
||||||
private PutCodeValueDataResponse() {
|
private PutCodeValueDataResponse() {
|
||||||
@@ -99,27 +98,27 @@ final class CodeValuesApiResourceSwagger {
|
|||||||
|
|
||||||
private PutCodeValuechangesSwagger() {}
|
private PutCodeValuechangesSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Passport")
|
@Schema(example = "Passport")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Passport information")
|
@Schema(example = "Passport information")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer position;
|
public Integer position;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutCodeValuechangesSwagger changes;
|
public PutCodeValuechangesSwagger changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteCodeValueDataResponse")
|
@Schema(description = "DeleteCodeValueDataResponse")
|
||||||
public static final class DeleteCodeValueDataResponse {
|
public static final class DeleteCodeValueDataResponse {
|
||||||
|
|
||||||
private DeleteCodeValueDataResponse() {
|
private DeleteCodeValueDataResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+34
-33
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.codes.api;
|
package org.apache.fineract.infrastructure.codes.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -59,11 +59,9 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/codes")
|
@Path("/codes")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Codes" })
|
@Tag(name = "Codes", description = "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n"
|
||||||
@Tag(name = "Codes", description = "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n"
|
+ "Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc")
|
||||||
+ "\n"
|
|
||||||
+ "Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc") })
|
|
||||||
public class CodesApiResource {
|
public class CodesApiResource {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,9 +90,9 @@ public class CodesApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Codes", notes = "Returns the list of codes.\n" + "\n" + "Example Requests:\n" + "\n" + "codes")
|
@Operation(summary = "Retrieve Codes", description = "Returns the list of codes.\n" + "\n" + "Example Requests:\n" + "\n" + "codes")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.GetCodesResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = CodesApiResourceSwagger.GetCodesResponse.class)))) })
|
||||||
public String retrieveCodes(@Context final UriInfo uriInfo) {
|
public String retrieveCodes(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
@@ -108,11 +106,11 @@ public class CodesApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a Code", notes = "Creates a code. Codes created through api are always 'user defined' and so system defined is marked as false.")
|
@Operation(summary = "Create a Code", description = "Creates a code. Codes created through api are always 'user defined' and so system defined is marked as false.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.PostCodesRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CodesApiResourceSwagger.PostCodesRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.PostCodesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.PostCodesResponse.class))) })
|
||||||
public String createCode(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createCode(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createCode().withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createCode().withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -125,9 +123,11 @@ public class CodesApiResource {
|
|||||||
@Path("{codeId}")
|
@Path("{codeId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a Code", notes = "Returns the details of a Code.\n" + "\n" + "Example Requests:\n" + "\n" + "codes/1")
|
@Operation(summary = "Retrieve a Code", description = "Returns the details of a Code.\n" + "\n" + "Example Requests:\n" + "\n"
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.GetCodesResponse.class) })
|
+ "codes/1")
|
||||||
public String retrieveCode(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId, @Context final UriInfo uriInfo) {
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.GetCodesResponse.class))) })
|
||||||
|
public String retrieveCode(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId, @Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
final CodeData code = this.readPlatformService.retrieveCode(codeId);
|
final CodeData code = this.readPlatformService.retrieveCode(codeId);
|
||||||
|
|
||||||
@@ -139,12 +139,12 @@ public class CodesApiResource {
|
|||||||
@Path("{codeId}")
|
@Path("{codeId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Code", notes = "Updates the details of a code if it is not system defined.")
|
@Operation(summary = "Update a Code", description = "Updates the details of a code if it is not system defined.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.PutCodesRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CodesApiResourceSwagger.PutCodesRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.PutCodesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.PutCodesResponse.class))) })
|
||||||
public String updateCode(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId,
|
public String updateCode(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCode(codeId).withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCode(codeId).withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -157,9 +157,10 @@ public class CodesApiResource {
|
|||||||
@Path("{codeId}")
|
@Path("{codeId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete a Code", notes = "Deletes a code if it is not system defined.")
|
@Operation(summary = "Delete a Code", description = "Deletes a code if it is not system defined.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.DeleteCodesResponse.class) })
|
@ApiResponses({
|
||||||
public String deleteCode(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.DeleteCodesResponse.class))) })
|
||||||
|
public String deleteCode(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteCode(codeId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteCode(codeId).build();
|
||||||
|
|
||||||
|
|||||||
+16
-17
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.codes.api;
|
package org.apache.fineract.infrastructure.codes.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sanyam on 29/7/17.
|
* Created by sanyam on 29/7/17.
|
||||||
@@ -30,55 +29,55 @@ final class CodesApiResourceSwagger {
|
|||||||
// this class is only for Swagger Live Documentation
|
// this class is only for Swagger Live Documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetCodesResponse")
|
@Schema(description = "GetCodesResponse")
|
||||||
public static final class GetCodesResponse {
|
public static final class GetCodesResponse {
|
||||||
|
|
||||||
private GetCodesResponse() {
|
private GetCodesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Education")
|
@Schema(example = "Education")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean systemDefined;
|
public boolean systemDefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostCodesRequest")
|
@Schema(description = "PostCodesRequest")
|
||||||
public static final class PostCodesRequest {
|
public static final class PostCodesRequest {
|
||||||
|
|
||||||
private PostCodesRequest() {
|
private PostCodesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "MyNewCode")
|
@Schema(example = "MyNewCode")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostCodesResponse")
|
@Schema(description = "PostCodesResponse")
|
||||||
public static final class PostCodesResponse {
|
public static final class PostCodesResponse {
|
||||||
|
|
||||||
private PostCodesResponse() {
|
private PostCodesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutCodesRequest")
|
@Schema(description = "PutCodesRequest")
|
||||||
public static final class PutCodesRequest {
|
public static final class PutCodesRequest {
|
||||||
|
|
||||||
private PutCodesRequest() {
|
private PutCodesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "MyNewCode(changed)")
|
@Schema(example = "MyNewCode(changed)")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutCodesResponse")
|
@Schema(description = "PutCodesResponse")
|
||||||
public static final class PutCodesResponse {
|
public static final class PutCodesResponse {
|
||||||
|
|
||||||
private PutCodesResponse() {
|
private PutCodesResponse() {
|
||||||
@@ -89,23 +88,23 @@ final class CodesApiResourceSwagger {
|
|||||||
|
|
||||||
private PutCodesApichangesSwagger() {}
|
private PutCodesApichangesSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "MyNewCode(changed)")
|
@Schema(example = "MyNewCode(changed)")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutCodesApichangesSwagger changes;
|
public PutCodesApichangesSwagger changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteCodesResponse")
|
@Schema(description = "DeleteCodesResponse")
|
||||||
public static final class DeleteCodesResponse {
|
public static final class DeleteCodesResponse {
|
||||||
|
|
||||||
private DeleteCodesResponse() {
|
private DeleteCodesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-23
@@ -18,15 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.configuration.api;
|
package org.apache.fineract.infrastructure.configuration.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -54,11 +53,9 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/externalservice")
|
@Path("/externalservice")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "External Services" })
|
@Tag(name = "External Services", description = "External Services Configuration related to set of supported configurations for third party services like Amazon S3 and SMTP:\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n" + "S3 (Amazon S3):\n" + "s3_access_key -\n" + "s3_bucket_name -\n" + "s3_secret_key -\n" + "\n" + "\n"
|
||||||
@Tag(name = "External Services", description = "External Services Configuration related to set of supported configurations for third party services like Amazon S3 and SMTP:\n"
|
+ "SMTP (Email Service):\n" + "username -\n" + "password -\n" + "host -\n" + "port -\n" + "useTLS -")
|
||||||
+ "\n" + "S3 (Amazon S3):\n" + "s3_access_key -\n" + "s3_bucket_name -\n" + "s3_secret_key -\n" + "\n" + "\n"
|
|
||||||
+ "SMTP (Email Service):\n" + "username -\n" + "password -\n" + "host -\n" + "port -\n" + "useTLS -") })
|
|
||||||
public class ExternalServicesConfigurationApiResource {
|
public class ExternalServicesConfigurationApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -87,10 +84,11 @@ public class ExternalServicesConfigurationApiResource {
|
|||||||
@Path("{servicename}")
|
@Path("{servicename}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve External Services Configuration", notes = "Returns a external Service configurations based on the Service Name.\n"
|
@Operation(summary = "Retrieve External Services Configuration", description = "Returns a external Service configurations based on the Service Name.\n"
|
||||||
+ "\n" + "Service Names supported are S3 and SMTP.\n" + "\n" + "Example Requests:\n" + "\n" + "externalservice/SMTP")
|
+ "\n" + "Service Names supported are S3 and SMTP.\n" + "\n" + "Example Requests:\n" + "\n" + "externalservice/SMTP")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = ExternalServicesPropertiesData.class) })
|
@ApiResponses({
|
||||||
public String retrieveOne(@PathParam("servicename") @ApiParam(value = "servicename") final String serviceName,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ExternalServicesPropertiesData.class))) })
|
||||||
|
public String retrieveOne(@PathParam("servicename") @Parameter(description = "servicename") final String serviceName,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
this.context.authenticatedUser().validateHasReadPermission(ExternalServiceConfigurationApiConstant.EXTERNAL_SERVICE_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(ExternalServiceConfigurationApiConstant.EXTERNAL_SERVICE_RESOURCE_NAME);
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
@@ -104,13 +102,13 @@ public class ExternalServicesConfigurationApiResource {
|
|||||||
@Path("{servicename}")
|
@Path("{servicename}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update External Service", notes = "Updates the external Service Configuration for a Service Name.\n" + "\n"
|
@Operation(summary = "Update External Service", description = "Updates the external Service Configuration for a Service Name.\n" + "\n"
|
||||||
+ "Example: \n" + "\n" + "externalservice/S3")
|
+ "Example: \n" + "\n" + "externalservice/S3")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ExternalServicesConfigurationApiResourceSwagger.PutExternalServiceRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ExternalServicesConfigurationApiResourceSwagger.PutExternalServiceRequest.class) })
|
@ApiResponses({ @ApiResponse(responseCode = "200", description = "") })
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "") })
|
public String updateExternalServiceProperties(
|
||||||
public String updateExternalServiceProperties(@PathParam("servicename") @ApiParam(value = "servicename") final String serviceName,
|
@PathParam("servicename") @Parameter(description = "servicename") final String serviceName,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
// ExternalServicesData external =
|
// ExternalServicesData external =
|
||||||
// this.externalServiceReadPlatformService.getExternalServiceDetailsByServiceName(serviceName);
|
// this.externalServiceReadPlatformService.getExternalServiceDetailsByServiceName(serviceName);
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateExternalServiceProperties(serviceName)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateExternalServiceProperties(serviceName)
|
||||||
|
|||||||
+4
-5
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.configuration.api;
|
package org.apache.fineract.infrastructure.configuration.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sanyam on 30/7/17.
|
* Created by sanyam on 30/7/17.
|
||||||
@@ -30,16 +29,16 @@ final class ExternalServicesConfigurationApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutExternalServiceRequest")
|
@Schema(description = "PutExternalServiceRequest")
|
||||||
public static final class PutExternalServiceRequest {
|
public static final class PutExternalServiceRequest {
|
||||||
|
|
||||||
private PutExternalServiceRequest() {
|
private PutExternalServiceRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "test@mifos.org")
|
@Schema(example = "test@mifos.org")
|
||||||
public String username;
|
public String username;
|
||||||
@ApiModelProperty(example = "XXXX")
|
@Schema(example = "XXXX")
|
||||||
public String password;
|
public String password;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+30
-32
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.configuration.api;
|
package org.apache.fineract.infrastructure.configuration.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -59,17 +59,15 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/configurations")
|
@Path("/configurations")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Global Configuration" })
|
@Tag(name = "Global Configuration", description = "Global configuration related to set of supported enable/disable configurations:\n" + "\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "maker-checker - defaults to false - if true turns on maker-checker functionality\n"
|
||||||
@Tag(name = "Global Configuration", description = "Global configuration related to set of supported enable/disable configurations:\n"
|
+ "reschedule-future-repayments - defaults to false - if true reschedules repayemnts which falls on a non-working day to configured repayment rescheduling rule\n"
|
||||||
+ "\n" + "maker-checker - defaults to false - if true turns on maker-checker functionality\n"
|
+ "allow-transactions-on-non_workingday - defaults to false - if true allows transactions on non-working days\n"
|
||||||
+ "reschedule-future-repayments - defaults to false - if true reschedules repayemnts which falls on a non-working day to configured repayment rescheduling rule\n"
|
+ "reschedule-repayments-on-holidays - defaults to false - if true reschedules repayemnts which falls on a non-working day to defined reschedule date\n"
|
||||||
+ "allow-transactions-on-non_workingday - defaults to false - if true allows transactions on non-working days\n"
|
+ "allow-transactions-on-holiday - defaults to false - if true allows transactions on holidays\n"
|
||||||
+ "reschedule-repayments-on-holidays - defaults to false - if true reschedules repayemnts which falls on a non-working day to defined reschedule date\n"
|
+ "savings-interest-posting-current-period-end - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.\n"
|
||||||
+ "allow-transactions-on-holiday - defaults to false - if true allows transactions on holidays\n"
|
+ "financial-year-beginning-month - Set it at the database level before any savings interest is posted. Allowed values 1 - 12 (January - December). Interest posting periods are evaluated based on this configuration.\n"
|
||||||
+ "savings-interest-posting-current-period-end - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.\n"
|
+ "meetings-mandatory-for-jlg-loans - if set to true, enforces all JLG loans to follow a meeting schedule belonging to either the parent group or Center.")
|
||||||
+ "financial-year-beginning-month - Set it at the database level before any savings interest is posted. Allowed values 1 - 12 (January - December). Interest posting periods are evaluated based on this configuration.\n"
|
|
||||||
+ "meetings-mandatory-for-jlg-loans - if set to true, enforces all JLG loans to follow a meeting schedule belonging to either the parent group or Center.") })
|
|
||||||
public class GlobalConfigurationApiResource {
|
public class GlobalConfigurationApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("globalConfiguration"));
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("globalConfiguration"));
|
||||||
@@ -100,14 +98,14 @@ public class GlobalConfigurationApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Global Configuration | Retrieve Global Configuration for surveys", notes = "Returns the list global enable/disable configurations.\n"
|
@Operation(summary = "Retrieve Global Configuration | Retrieve Global Configuration for surveys", description = "Returns the list global enable/disable configurations.\n"
|
||||||
+ "\n" + "Example Requests:\n" + "\n" + "configurations\n\n" + "\n"
|
+ "\n" + "Example Requests:\n" + "\n" + "configurations\n\n" + "\n"
|
||||||
+ "Returns the list global enable/disable survey configurations.\n" + "\n" + "Example Requests:\n" + "\n"
|
+ "Returns the list global enable/disable survey configurations.\n" + "\n" + "Example Requests:\n" + "\n"
|
||||||
+ "configurations/survey")
|
+ "configurations/survey")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "List of example \n response \nsurveys response \ngiven below", response = GlobalConfigurationApiResourceSwagger.GetGlobalConfigurationsResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "List of example \\n response \\nsurveys response \\ngiven below", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.GetGlobalConfigurationsResponse.class)))) })
|
||||||
public String retrieveConfiguration(@Context final UriInfo uriInfo,
|
public String retrieveConfiguration(@Context final UriInfo uriInfo,
|
||||||
@DefaultValue("false") @QueryParam("survey") @ApiParam(value = "survey") final boolean survey) {
|
@DefaultValue("false") @QueryParam("survey") @Parameter(description = "survey") final boolean survey) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|
||||||
@@ -121,11 +119,12 @@ public class GlobalConfigurationApiResource {
|
|||||||
@Path("{configId}")
|
@Path("{configId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Global Configuration", notes = "Returns a global enable/disable configurations.\n" + "\n"
|
@Operation(summary = "Retrieve Global Configuration", description = "Returns a global enable/disable configurations.\n" + "\n"
|
||||||
+ "Example Requests:\n" + "\n" + "configurations/1")
|
+ "Example Requests:\n" + "\n" + "configurations/1")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = GlobalConfigurationApiResourceSwagger.GetGlobalConfigurationsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.GetGlobalConfigurationsResponse.class))) })
|
||||||
public String retrieveOne(@PathParam("configId") @ApiParam(value = "configId") final Long configId, @Context final UriInfo uriInfo) {
|
public String retrieveOne(@PathParam("configId") @Parameter(description = "configId") final Long configId,
|
||||||
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|
||||||
@@ -139,13 +138,12 @@ public class GlobalConfigurationApiResource {
|
|||||||
@Path("{configId}")
|
@Path("{configId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update Global Configuration", notes = "Updates an enable/disable global configuration item.")
|
@Operation(summary = "Update Global Configuration", description = "Updates an enable/disable global configuration item.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsResponse.class))) })
|
||||||
public String updateConfiguration(@PathParam("configId") @ApiParam(value = "configId") final Long configId,
|
public String updateConfiguration(@PathParam("configId") @Parameter(description = "configId") final Long configId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.updateGlobalConfiguration(configId) //
|
.updateGlobalConfiguration(configId) //
|
||||||
|
|||||||
+9
-10
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.configuration.api;
|
package org.apache.fineract.infrastructure.configuration.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
||||||
|
|
||||||
@@ -32,7 +31,7 @@ final class GlobalConfigurationApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetGlobalConfigurationsResponse")
|
@Schema(description = "GetGlobalConfigurationsResponse")
|
||||||
public static final class GetGlobalConfigurationsResponse {
|
public static final class GetGlobalConfigurationsResponse {
|
||||||
|
|
||||||
private GetGlobalConfigurationsResponse() {}
|
private GetGlobalConfigurationsResponse() {}
|
||||||
@@ -40,18 +39,18 @@ final class GlobalConfigurationApiResourceSwagger {
|
|||||||
public List<GlobalConfigurationPropertyData> globalConfiguration;
|
public List<GlobalConfigurationPropertyData> globalConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutGlobalConfigurationsRequest")
|
@Schema(description = "PutGlobalConfigurationsRequest")
|
||||||
public static final class PutGlobalConfigurationsRequest {
|
public static final class PutGlobalConfigurationsRequest {
|
||||||
|
|
||||||
private PutGlobalConfigurationsRequest() {}
|
private PutGlobalConfigurationsRequest() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean enabled;
|
public boolean enabled;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long value;
|
public Long description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutGlobalConfigurationsResponse")
|
@Schema(description = "PutGlobalConfigurationsResponse")
|
||||||
public static final class PutGlobalConfigurationsResponse {
|
public static final class PutGlobalConfigurationsResponse {
|
||||||
|
|
||||||
private PutGlobalConfigurationsResponse() {}
|
private PutGlobalConfigurationsResponse() {}
|
||||||
@@ -60,11 +59,11 @@ final class GlobalConfigurationApiResourceSwagger {
|
|||||||
|
|
||||||
private PutGlobalConfigurationsResponsechangesSwagger() {}
|
private PutGlobalConfigurationsResponsechangesSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean enabled;
|
public boolean enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutGlobalConfigurationsResponsechangesSwagger changes;
|
public PutGlobalConfigurationsResponsechangesSwagger changes;
|
||||||
}
|
}
|
||||||
|
|||||||
-2
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package org.apache.fineract.infrastructure.creditbureau.api;
|
package org.apache.fineract.infrastructure.creditbureau.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -57,7 +56,6 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/CreditBureauConfiguration")
|
@Path("/CreditBureauConfiguration")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(value = "CreditBureau Configuration")
|
|
||||||
public class CreditBureauConfigurationAPI {
|
public class CreditBureauConfigurationAPI {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
|
|||||||
+83
-86
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.api;
|
package org.apache.fineract.infrastructure.dataqueries.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
@@ -57,16 +57,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
//import org.slf4j.Logger;
|
|
||||||
|
|
||||||
@Path("/datatables")
|
@Path("/datatables")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Data Tables" })
|
@Tag(name = "Data Tables", description = "The datatables API allows you to plug-in your own tables (MySql) that have a relationship to a Apache Fineract core table. For example, you might want to add some extra client fields and record information about each of the clients' family members. Via the API you can create, read, update and delete entries for each 'plugged-in' table. The API checks for permission and for 'data scoping' (only data within the users' office hierarchy can be managed by the user).\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n"
|
||||||
@Tag(name = "Data Tables", description = "The datatables API allows you to plug-in your own tables (MySql) that have a relationship to a Apache Fineract core table. For example, you might want to add some extra client fields and record information about each of the clients' family members. Via the API you can create, read, update and delete entries for each 'plugged-in' table. The API checks for permission and for 'data scoping' (only data within the users' office hierarchy can be managed by the user).\n"
|
+ "The Apache Fineract Reference App uses a JQuery plug-in called stretchydatatables (which in turn uses this datatables resource) to provide a pretty flexible CRUD (Create, Read, Update, Delete) User Interface.")
|
||||||
+ "\n"
|
|
||||||
+ "The Apache Fineract Reference App uses a JQuery plug-in called stretchydatatables (which in turn uses this datatables resource) to provide a pretty flexible CRUD (Create, Read, Update, Delete) User Interface.") })
|
|
||||||
public class DatatablesApiResource {
|
public class DatatablesApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -91,13 +87,12 @@ public class DatatablesApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Data Tables", notes = "Lists registered data tables and the Apache Fineract Core application table they are registered to.\n"
|
@Operation(summary = "List Data Tables", description = "Lists registered data tables and the Apache Fineract Core application table they are registered to.\n"
|
||||||
+ "\n" + "ARGUMENTS\n" + "\n" + "apptable - optional" + "\n" + "The Apache Fineract core application table.\n" + "\n"
|
+ "\n" + "ARGUMENTS\n" + "\n" + "apptable - optional" + "\n" + "The Apache Fineract core application table.\n" + "\n"
|
||||||
+ "Example Requests:\n" + "\n" + "datatables?apptable=m_client\n" + "\n" + "\n"
|
+ "Example Requests:\n" + "\n" + "datatables?apptable=m_client\n" + "\n" + "\n" + "datatables")
|
||||||
+ "datatables", responseContainer = "List", response = DatatablesApiResourceSwagger.GetDataTablesResponse.class)
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.GetDataTablesResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DatatablesApiResourceSwagger.GetDataTablesResponse.class)))) })
|
||||||
public String getDatatables(@QueryParam("apptable") @ApiParam(value = "apptable") final String apptable,
|
public String getDatatables(@QueryParam("apptable") @Parameter(description = "apptable") final String apptable,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
final List<DatatableData> result = this.readWriteNonCoreDataService.retrieveDatatableNames(apptable);
|
final List<DatatableData> result = this.readWriteNonCoreDataService.retrieveDatatableNames(apptable);
|
||||||
@@ -109,7 +104,7 @@ public class DatatablesApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create Data Table", notes = "Create a new data table and registers it with the Apache Fineract Core application table.\n"
|
@Operation(summary = "Create Data Table", description = "Create a new data table and registers it with the Apache Fineract Core application table.\n"
|
||||||
+ "\n" + "Field Descriptions\n" + "\n" + "Mandatory - datatableName : \n" + "\nThe name of the Data Table.\n" + "\n"
|
+ "\n" + "Field Descriptions\n" + "\n" + "Mandatory - datatableName : \n" + "\nThe name of the Data Table.\n" + "\n"
|
||||||
+ "Mandatory - apptableName\n" + "\n" + "Application table name. Must be one of the following:\n" + "\n" + "m_client\n" + "\n"
|
+ "Mandatory - apptableName\n" + "\n" + "Application table name. Must be one of the following:\n" + "\n" + "m_client\n" + "\n"
|
||||||
+ "m_group" + "\n" + "\n" + "m_loan" + "\n" + "\n" + "m_office" + "\n" + "\n" + "m_saving_account" + "\n" + "\n"
|
+ "m_group" + "\n" + "\n" + "m_loan" + "\n" + "\n" + "m_office" + "\n" + "\n" + "m_saving_account" + "\n" + "\n"
|
||||||
@@ -121,15 +116,15 @@ public class DatatablesApiResource {
|
|||||||
+ "\n" + "\n" + "Mandatory - type" + "\n" + "\n" + "Column type. Must be one of the following:" + "\n" + "\n" + "Boolean" + "\n"
|
+ "\n" + "\n" + "Mandatory - type" + "\n" + "\n" + "Column type. Must be one of the following:" + "\n" + "\n" + "Boolean" + "\n"
|
||||||
+ "\n" + "Date" + "\n" + "\n" + "DateTime" + "\n" + "\n" + "Decimal" + "\n" + "\n" + "Dropdown" + "\n" + "\n" + "\n" + "Number"
|
+ "\n" + "Date" + "\n" + "\n" + "DateTime" + "\n" + "\n" + "Decimal" + "\n" + "\n" + "Dropdown" + "\n" + "\n" + "\n" + "Number"
|
||||||
+ "\n" + "\n" + "String" + "\n" + "\n" + "Text" + "\n" + "\n" + "Mandatory [type = Dropdown] - code" + "\n" + "\n"
|
+ "\n" + "\n" + "String" + "\n" + "\n" + "Text" + "\n" + "\n" + "Mandatory [type = Dropdown] - code" + "\n" + "\n"
|
||||||
+ "Used in Code Value fields. Column name becomes: code_cd_name. Mandatory if using type Dropdown, otherwise an error is returned."
|
+ "Used in Code description fields. Column name becomes: code_cd_name. Mandatory if using type Dropdown, otherwise an error is returned."
|
||||||
+ "\n" + "\n" + "Optional - mandatory" + "\n" + "\n"
|
+ "\n" + "\n" + "Optional - mandatory" + "\n" + "\n"
|
||||||
+ "Determines whether this column must have a value in every entry. Optional, defaults to false." + "\n" + "\n"
|
+ "Determines whether this column must have a value in every entry. Optional, defaults to false." + "\n" + "\n"
|
||||||
+ "Mandatory [type = String] - length" + "\n" + "\n"
|
+ "Mandatory [type = String] - length" + "\n" + "\n"
|
||||||
+ "Length of the text field. Mandatory if type String is used, otherwise an error is returned.")
|
+ "Length of the text field. Mandatory if type String is used, otherwise an error is returned.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PostDataTablesRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PostDataTablesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesResponse.class))) })
|
||||||
public String createDatatable(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createDatatable(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createDBDatatable(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createDBDatatable(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -141,12 +136,12 @@ public class DatatablesApiResource {
|
|||||||
@Path("{datatableName}")
|
@Path("{datatableName}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update Data Table", notes = "Modifies fields of a data table. If the apptableName parameter is passed, data table is deregistered and registered with the new application table.")
|
@Operation(summary = "Update Data Table", description = "Modifies fields of a data table. If the apptableName parameter is passed, data table is deregistered and registered with the new application table.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PutDataTablesRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesResponse.class))) })
|
||||||
public String updateDatatable(@PathParam("datatableName") @ApiParam(value = "datatableName") final String datatableName,
|
public String updateDatatable(@PathParam("datatableName") @Parameter(description = "datatableName") final String datatableName,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateDBDatatable(datatableName, apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateDBDatatable(datatableName, apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -158,10 +153,11 @@ public class DatatablesApiResource {
|
|||||||
@Path("{datatableName}")
|
@Path("{datatableName}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete Data Table", notes = "Deletes a data table and deregisters it from the Apache Fineract Core application table.")
|
@Operation(summary = "Delete Data Table", description = "Deletes a data table and deregisters it from the Apache Fineract Core application table.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.DeleteDataTablesResponse.class) })
|
@ApiResponses({
|
||||||
public String deleteDatatable(@PathParam("datatableName") @ApiParam(value = "datatableName") final String datatableName,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.DeleteDataTablesResponse.class))) })
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String deleteDatatable(@PathParam("datatableName") @Parameter(description = "datatableName") final String datatableName,
|
||||||
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteDBDatatable(datatableName, apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteDBDatatable(datatableName, apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -173,13 +169,13 @@ public class DatatablesApiResource {
|
|||||||
@Path("register/{datatable}/{apptable}")
|
@Path("register/{datatable}/{apptable}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Register Data Table", notes = "Registers a data table with the Apache Fineract Core application table. This allows the data table to be maintained through the API. In case the datatable is a PPI (survey table), a parameter category should be pass along with the request. The API currently support one category (200)")
|
@Operation(summary = "Register Data Table", description = "Registers a data table with the Apache Fineract Core application table. This allows the data table to be maintained through the API. In case the datatable is a PPI (survey table), a parameter category should be pass along with the request. The API currently support one category (200)")
|
||||||
@ApiImplicitParams({
|
@RequestBody(content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesRegisterDatatableAppTable.class)))
|
||||||
@ApiImplicitParam(value = "body", paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PostDataTablesRegisterDatatableAppTable.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesResponse.class))) })
|
||||||
public String registerDatatable(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable,
|
public String registerDatatable(@PathParam("datatable") @Parameter(description = "datatable") final String datatable,
|
||||||
@PathParam("apptable") @ApiParam(value = "apptable") final String apptable,
|
@PathParam("apptable") @Parameter(description = "apptable") final String apptable,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().registerDBDatatable(datatable, apptable)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().registerDBDatatable(datatable, apptable)
|
||||||
.withJson(apiRequestBodyAsJson).build();
|
.withJson(apiRequestBodyAsJson).build();
|
||||||
@@ -193,9 +189,10 @@ public class DatatablesApiResource {
|
|||||||
@Path("deregister/{datatable}")
|
@Path("deregister/{datatable}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Deregister Data Table", notes = "Deregisters a data table. It will no longer be available through the API.")
|
@Operation(summary = "Deregister Data Table", description = "Deregisters a data table. It will no longer be available through the API.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesResponse.class) })
|
@ApiResponses({
|
||||||
public String deregisterDatatable(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesResponse.class))) })
|
||||||
|
public String deregisterDatatable(@PathParam("datatable") @Parameter(description = "datatable") final String datatable) {
|
||||||
|
|
||||||
this.readWriteNonCoreDataService.deregisterDatatable(datatable);
|
this.readWriteNonCoreDataService.deregisterDatatable(datatable);
|
||||||
|
|
||||||
@@ -208,9 +205,10 @@ public class DatatablesApiResource {
|
|||||||
@Path("{datatable}")
|
@Path("{datatable}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Data Table Details", notes = "Lists a registered data table details and the Apache Fineract Core application table they are registered to.")
|
@Operation(summary = "Retrieve Data Table Details", description = "Lists a registered data table details and the Apache Fineract Core application table they are registered to.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.GetDataTablesResponse.class) })
|
@ApiResponses({
|
||||||
public String getDatatable(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.GetDataTablesResponse.class))) })
|
||||||
|
public String getDatatable(@PathParam("datatable") @Parameter(description = "datatable") final String datatable,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
final DatatableData result = this.readWriteNonCoreDataService.retrieveDatatable(datatable);
|
final DatatableData result = this.readWriteNonCoreDataService.retrieveDatatable(datatable);
|
||||||
@@ -223,17 +221,18 @@ public class DatatablesApiResource {
|
|||||||
@Path("{datatable}/{apptableId}")
|
@Path("{datatable}/{apptableId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Entry(s) from Data Table", notes = "Gets the entry (if it exists) for data tables that are one to one with the application table. \n"
|
@Operation(summary = "Retrieve Entry(s) from Data Table", description = "Gets the entry (if it exists) for data tables that are one to one with the application table. \n"
|
||||||
+ "Gets the entries (if they exist) for data tables that are one to many with the application table.\n" + "\n"
|
+ "Gets the entries (if they exist) for data tables that are one to many with the application table.\n" + "\n"
|
||||||
+ "Note: The 'fields' parameter is not available for datatables.\n" + "\n" + "ARGUMENTS\n"
|
+ "Note: The 'fields' parameter is not available for datatables.\n" + "\n" + "ARGUMENTS\n"
|
||||||
+ "orderoptional Specifies the order in which data is returned.genericResultSetoptional, defaults to false If 'true' an optimised JSON format is returned suitable for tabular display of data. This format is used by the default data tables UI functionality.\n"
|
+ "orderoptional Specifies the order in which data is returned.genericResultSetoptional, defaults to false If 'true' an optimised JSON format is returned suitable for tabular display of data. This format is used by the default data tables UI functionality.\n"
|
||||||
+ "Example Requests:\n" + "\n" + "datatables/extra_client_details/1\n" + "\n" + "\n"
|
+ "Example Requests:\n" + "\n" + "datatables/extra_client_details/1\n" + "\n" + "\n"
|
||||||
+ "datatables/extra_family_details/1?order=`Date of Birth` desc\n" + "\n" + "\n"
|
+ "datatables/extra_family_details/1?order=`Date of Birth` desc\n" + "\n" + "\n"
|
||||||
+ "datatables/extra_client_details/1?genericResultSet=true")
|
+ "datatables/extra_client_details/1?genericResultSet=true")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.GetDataTablesAppTableIdResponse.class) })
|
@ApiResponses({
|
||||||
public String getDatatable(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.GetDataTablesAppTableIdResponse.class))) })
|
||||||
@PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId,
|
public String getDatatable(@PathParam("datatable") @Parameter(description = "datatable") final String datatable,
|
||||||
@QueryParam("order") @ApiParam(value = "order") final String order, @Context final UriInfo uriInfo) {
|
@PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId,
|
||||||
|
@QueryParam("order") @Parameter(description = "order") final String order, @Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasDatatableReadPermission(datatable);
|
this.context.authenticatedUser().validateHasDatatableReadPermission(datatable);
|
||||||
|
|
||||||
@@ -282,15 +281,14 @@ public class DatatablesApiResource {
|
|||||||
@Path("{datatable}/{apptableId}")
|
@Path("{datatable}/{apptableId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create Entry in Data Table", notes = "Adds a row to the data table.\n" + "\n"
|
@Operation(summary = "Create Entry in Data Table", description = "Adds a row to the data table.\n" + "\n"
|
||||||
+ "Note that the default datatable UI functionality converts any field name containing spaces to underscores when using the API. This means the field name \"Business Description\" is considered the same as \"Business_Description\". So you shouldn't have both \"versions\" in any data table.")
|
+ "Note that the default datatable UI functionality converts any field name containing spaces to underscores when using the API. This means the field name \"Business Description\" is considered the same as \"Business_Description\". So you shouldn't have both \"versions\" in any data table.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesAppTableIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PostDataTablesAppTableIdRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PostDataTablesAppTableIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesAppTableIdResponse.class))) })
|
||||||
public String createDatatableEntry(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable,
|
public String createDatatableEntry(@PathParam("datatable") @Parameter(description = "datatable") final String datatable,
|
||||||
@PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId,
|
@PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.createDatatable(datatable, apptableId, null) //
|
.createDatatable(datatable, apptableId, null) //
|
||||||
@@ -306,13 +304,13 @@ public class DatatablesApiResource {
|
|||||||
@Path("{datatable}/{apptableId}")
|
@Path("{datatable}/{apptableId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update Entry in Data Table (One to One)", notes = "Updates the row (if it exists) of the data table.")
|
@Operation(summary = "Update Entry in Data Table (One to One)", description = "Updates the row (if it exists) of the data table.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesAppTableIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PutDataTablesAppTableIdRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesAppTableIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesAppTableIdResponse.class))) })
|
||||||
public String updateDatatableEntryOnetoOne(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable,
|
public String updateDatatableEntryOnetoOne(@PathParam("datatable") @Parameter(description = "datatable") final String datatable,
|
||||||
@PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId,
|
@PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.updateDatatable(datatable, apptableId, null) //
|
.updateDatatable(datatable, apptableId, null) //
|
||||||
@@ -328,15 +326,14 @@ public class DatatablesApiResource {
|
|||||||
@Path("{datatable}/{apptableId}/{datatableId}")
|
@Path("{datatable}/{apptableId}/{datatableId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update Entry in Data Table (One to Many)", notes = "Updates the row (if it exists) of the data table.")
|
@Operation(summary = "Update Entry in Data Table (One to Many)", description = "Updates the row (if it exists) of the data table.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesAppTableIdDatatableIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PutDataTablesAppTableIdDatatableIdRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesAppTableIdDatatableIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesAppTableIdDatatableIdResponse.class))) })
|
||||||
public String updateDatatableEntryOneToMany(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable,
|
public String updateDatatableEntryOneToMany(@PathParam("datatable") @Parameter(description = "datatable") final String datatable,
|
||||||
@PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId,
|
@PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId,
|
||||||
@PathParam("datatableId") @ApiParam(value = "datatableId") final Long datatableId,
|
@PathParam("datatableId") @Parameter(description = "datatableId") final Long datatableId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.updateDatatable(datatable, apptableId, datatableId) //
|
.updateDatatable(datatable, apptableId, datatableId) //
|
||||||
@@ -352,12 +349,12 @@ public class DatatablesApiResource {
|
|||||||
@Path("{datatable}/{apptableId}")
|
@Path("{datatable}/{apptableId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete Entry(s) in Data Table", notes = "Deletes the entry (if it exists) for data tables that are one-to-one with the application table. \n"
|
@Operation(summary = "Delete Entry(s) in Data Table", description = "Deletes the entry (if it exists) for data tables that are one-to-one with the application table. \n"
|
||||||
+ "Deletes the entries (if they exist) for data tables that are one-to-many with the application table.")
|
+ "Deletes the entries (if they exist) for data tables that are one-to-many with the application table.")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.DeleteDataTablesDatatableAppTableIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.DeleteDataTablesDatatableAppTableIdResponse.class))) })
|
||||||
public String deleteDatatableEntries(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable,
|
public String deleteDatatableEntries(@PathParam("datatable") @Parameter(description = "datatable") final String datatable,
|
||||||
@PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId) {
|
@PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.deleteDatatable(datatable, apptableId, null) //
|
.deleteDatatable(datatable, apptableId, null) //
|
||||||
@@ -372,14 +369,14 @@ public class DatatablesApiResource {
|
|||||||
@Path("{datatable}/{apptableId}/{datatableId}")
|
@Path("{datatable}/{apptableId}/{datatableId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete Entry in Datatable (One to Many)", notes = "Deletes the entry (if it exists) for data tables that are one to many with the application table.\n"
|
@Operation(summary = "Delete Entry in Datatable (One to Many)", description = "Deletes the entry (if it exists) for data tables that are one to many with the application table.\n"
|
||||||
+ "\n")
|
+ "\n")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.DeleteDataTablesDatatableAppTableIdDatatableIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.DeleteDataTablesDatatableAppTableIdDatatableIdResponse.class))) })
|
||||||
public String deleteDatatableEntries(
|
public String deleteDatatableEntries(
|
||||||
@PathParam("datatable") @ApiParam(value = "datatable", type = "body", example = "{}") final String datatable,
|
@PathParam("datatable") @Parameter(description = "datatable", example = "{}") final String datatable,
|
||||||
@PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId,
|
@PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId,
|
||||||
@PathParam("datatableId") @ApiParam(value = "datatableId") final Long datatableId) {
|
@PathParam("datatableId") @Parameter(description = "datatableId") final Long datatableId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.deleteDatatable(datatable, apptableId, datatableId) //
|
.deleteDatatable(datatable, apptableId, datatableId) //
|
||||||
|
|||||||
+59
-60
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.api;
|
package org.apache.fineract.infrastructure.dataqueries.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetColumnHeaderData;
|
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetColumnHeaderData;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetRowData;
|
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetRowData;
|
||||||
@@ -33,48 +32,48 @@ final class DatatablesApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetDataTablesResponse")
|
@Schema(description = "GetDataTablesResponse")
|
||||||
public static final class GetDataTablesResponse {
|
public static final class GetDataTablesResponse {
|
||||||
|
|
||||||
private GetDataTablesResponse() {
|
private GetDataTablesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "m_client")
|
@Schema(example = "m_client")
|
||||||
public String appTableName;
|
public String appTableName;
|
||||||
@ApiModelProperty(example = "extra_client_details")
|
@Schema(example = "extra_client_details")
|
||||||
public String datatableName;
|
public String datatableName;
|
||||||
public List<ResultsetColumnHeaderData> column;
|
public List<ResultsetColumnHeaderData> column;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostDataTablesRequest")
|
@Schema(description = "PostDataTablesRequest")
|
||||||
public static final class PostDataTablesRequest {
|
public static final class PostDataTablesRequest {
|
||||||
|
|
||||||
private PostDataTablesRequest() {
|
private PostDataTablesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "m_client")
|
@Schema(example = "m_client")
|
||||||
public String applicationTableName;
|
public String applicationTableName;
|
||||||
@ApiModelProperty(example = "extra_client_details")
|
@Schema(example = "extra_client_details")
|
||||||
public String registeredTableName;
|
public String registeredTableName;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(required = false, description = "Allows to create multiple entries in the Data Table. Optional, defaults to false. If this property is not provided Data Table will allow only one entry.", example = "true")
|
||||||
public boolean multiRow;
|
public boolean multiRow;
|
||||||
public List<ResultsetColumnHeaderData> columnHeaderData;
|
public List<ResultsetColumnHeaderData> columnHeaderData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostDataTablesResponse")
|
@Schema(description = "PostDataTablesResponse")
|
||||||
public static final class PostDataTablesResponse {
|
public static final class PostDataTablesResponse {
|
||||||
|
|
||||||
private PostDataTablesResponse() {
|
private PostDataTablesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "extra_client_details")
|
@Schema(example = "extra_client_details")
|
||||||
public String resourceIdentifier;
|
public String resourceIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutDataTablesRequest")
|
@Schema(description = "PutDataTablesRequest")
|
||||||
public static final class PutDataTablesRequest {
|
public static final class PutDataTablesRequest {
|
||||||
|
|
||||||
private PutDataTablesRequest() {
|
private PutDataTablesRequest() {
|
||||||
@@ -85,7 +84,7 @@ final class DatatablesApiResourceSwagger {
|
|||||||
|
|
||||||
private PutDataTablesRequestDropColumns() {}
|
private PutDataTablesRequestDropColumns() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Gender_cd_Question")
|
@Schema(example = "Gender_cd_Question")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,13 +92,13 @@ final class DatatablesApiResourceSwagger {
|
|||||||
|
|
||||||
private PutDataTablesRequestAddColumns() {}
|
private PutDataTablesRequestAddColumns() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Question")
|
@Schema(example = "Question")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Dropdown")
|
@Schema(example = "Dropdown")
|
||||||
public String type;
|
public String type;
|
||||||
@ApiModelProperty(example = "Gender")
|
@Schema(example = "Gender")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean mandatory;
|
public boolean mandatory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,92 +106,92 @@ final class DatatablesApiResourceSwagger {
|
|||||||
|
|
||||||
private PutDataTablesRequestChangeColumns() {}
|
private PutDataTablesRequestChangeColumns() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Question")
|
@Schema(example = "Question")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Question 2")
|
@Schema(example = "Question 2")
|
||||||
public String newName;
|
public String newName;
|
||||||
@ApiModelProperty(example = "Gender")
|
@Schema(example = "Gender")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Gender2")
|
@Schema(example = "Gender2")
|
||||||
public String newCode;
|
public String newCode;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean mandatory;
|
public boolean mandatory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "m_client")
|
@Schema(example = "m_client")
|
||||||
public String appTableName;
|
public String appTableName;
|
||||||
public List<PutDataTablesRequestDropColumns> dropColumns;
|
public List<PutDataTablesRequestDropColumns> dropColumns;
|
||||||
public List<PutDataTablesRequestAddColumns> addColumns;
|
public List<PutDataTablesRequestAddColumns> addColumns;
|
||||||
public List<PutDataTablesRequestChangeColumns> ChangeColumns;
|
public List<PutDataTablesRequestChangeColumns> ChangeColumns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutDataTablesResponse")
|
@Schema(description = "PutDataTablesResponse")
|
||||||
public static final class PutDataTablesResponse {
|
public static final class PutDataTablesResponse {
|
||||||
|
|
||||||
private PutDataTablesResponse() {
|
private PutDataTablesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "extra_client_details")
|
@Schema(example = "extra_client_details")
|
||||||
public String resourceIdentifier;
|
public String resourceIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteDataTablesResponse")
|
@Schema(description = "DeleteDataTablesResponse")
|
||||||
public static final class DeleteDataTablesResponse {
|
public static final class DeleteDataTablesResponse {
|
||||||
|
|
||||||
private DeleteDataTablesResponse() {
|
private DeleteDataTablesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "extra_client_details")
|
@Schema(example = "extra_client_details")
|
||||||
public String resourceIdentifier;
|
public String resourceIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostDataTablesRegisterDatatableAppTable")
|
@Schema(description = "PostDataTablesRegisterDatatableAppTable")
|
||||||
public static final class PostDataTablesRegisterDatatableAppTable {
|
public static final class PostDataTablesRegisterDatatableAppTable {
|
||||||
|
|
||||||
private PostDataTablesRegisterDatatableAppTable() {}
|
private PostDataTablesRegisterDatatableAppTable() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostDataTablesAppTableIdRequest")
|
@Schema(description = "PostDataTablesAppTableIdRequest")
|
||||||
public static final class PostDataTablesAppTableIdRequest {
|
public static final class PostDataTablesAppTableIdRequest {
|
||||||
|
|
||||||
private PostDataTablesAppTableIdRequest() {
|
private PostDataTablesAppTableIdRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Livestock sales")
|
@Schema(example = "Livestock sales")
|
||||||
public String BusinessDescription;
|
public String BusinessDescription;
|
||||||
@ApiModelProperty(example = "First comment made")
|
@Schema(example = "First comment made")
|
||||||
public String Comment;
|
public String Comment;
|
||||||
@ApiModelProperty(example = "Primary")
|
@Schema(example = "Primary")
|
||||||
public String Education_cv;
|
public String Education_cv;
|
||||||
@ApiModelProperty(example = "6")
|
@Schema(example = "6")
|
||||||
public Long Gender_cd;
|
public Long Gender_cd;
|
||||||
@ApiModelProperty(example = "8.5")
|
@Schema(example = "8.5")
|
||||||
public Double HighestRatePaid;
|
public Double HighestRatePaid;
|
||||||
@ApiModelProperty(example = "01 October 2012")
|
@Schema(example = "01 October 2012")
|
||||||
public String NextVisit;
|
public String NextVisit;
|
||||||
@ApiModelProperty(example = "5")
|
@Schema(example = "5")
|
||||||
public Long YearsinBusiness;
|
public Long YearsinBusiness;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostDataTablesAppTableIdResponse ")
|
@Schema(description = "PostDataTablesAppTableIdResponse ")
|
||||||
public static final class PostDataTablesAppTableIdResponse {
|
public static final class PostDataTablesAppTableIdResponse {
|
||||||
|
|
||||||
private PostDataTablesAppTableIdResponse() {
|
private PostDataTablesAppTableIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetDataTablesAppTableIdResponse")
|
@Schema(description = "GetDataTablesAppTableIdResponse")
|
||||||
public static final class GetDataTablesAppTableIdResponse {
|
public static final class GetDataTablesAppTableIdResponse {
|
||||||
|
|
||||||
private GetDataTablesAppTableIdResponse() {
|
private GetDataTablesAppTableIdResponse() {
|
||||||
@@ -203,18 +202,18 @@ final class DatatablesApiResourceSwagger {
|
|||||||
public List<ResultsetRowData> data;
|
public List<ResultsetRowData> data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutDataTablesAppTableIdRequest")
|
@Schema(description = "PutDataTablesAppTableIdRequest")
|
||||||
public static final class PutDataTablesAppTableIdRequest {
|
public static final class PutDataTablesAppTableIdRequest {
|
||||||
|
|
||||||
private PutDataTablesAppTableIdRequest() {
|
private PutDataTablesAppTableIdRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Livestock sales updated")
|
@Schema(example = "Livestock sales updated")
|
||||||
public String BusinessDescription;
|
public String BusinessDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutDataTablesAppTableIdResponse")
|
@Schema(description = "PutDataTablesAppTableIdResponse")
|
||||||
public static final class PutDataTablesAppTableIdResponse {
|
public static final class PutDataTablesAppTableIdResponse {
|
||||||
|
|
||||||
private PutDataTablesAppTableIdResponse() {
|
private PutDataTablesAppTableIdResponse() {
|
||||||
@@ -225,68 +224,68 @@ final class DatatablesApiResourceSwagger {
|
|||||||
|
|
||||||
private PutDataTablesAppTableIdResponseChanges() {}
|
private PutDataTablesAppTableIdResponseChanges() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Livestock sales updated")
|
@Schema(example = "Livestock sales updated")
|
||||||
public String BusinessDescription;
|
public String BusinessDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutDataTablesAppTableIdResponseChanges changes;
|
public PutDataTablesAppTableIdResponseChanges changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutDataTablesAppTableIdDatatableIdRequest")
|
@Schema(description = "PutDataTablesAppTableIdDatatableIdRequest")
|
||||||
public static final class PutDataTablesAppTableIdDatatableIdRequest {
|
public static final class PutDataTablesAppTableIdDatatableIdRequest {
|
||||||
|
|
||||||
private PutDataTablesAppTableIdDatatableIdRequest() {
|
private PutDataTablesAppTableIdDatatableIdRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "01 June 1982")
|
@Schema(example = "01 June 1982")
|
||||||
public String DateOfBirth;
|
public String DateOfBirth;
|
||||||
@ApiModelProperty(example = "5")
|
@Schema(example = "5")
|
||||||
public Long Education_cdHighest;
|
public Long Education_cdHighest;
|
||||||
@ApiModelProperty(example = "June")
|
@Schema(example = "June")
|
||||||
public String Name;
|
public String Name;
|
||||||
@ApiModelProperty(example = "More notes")
|
@Schema(example = "More notes")
|
||||||
public String OtherNotes;
|
public String OtherNotes;
|
||||||
@ApiModelProperty(example = "20")
|
@Schema(example = "20")
|
||||||
public Long PointsScore;
|
public Long PointsScore;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutDataTablesAppTableIdDatatableIdResponse ")
|
@Schema(description = "PutDataTablesAppTableIdDatatableIdResponse ")
|
||||||
public static final class PutDataTablesAppTableIdDatatableIdResponse {
|
public static final class PutDataTablesAppTableIdDatatableIdResponse {
|
||||||
|
|
||||||
private PutDataTablesAppTableIdDatatableIdResponse() {
|
private PutDataTablesAppTableIdDatatableIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteDataTablesDatatableAppTableIdResponse ")
|
@Schema(description = "DeleteDataTablesDatatableAppTableIdResponse ")
|
||||||
public static final class DeleteDataTablesDatatableAppTableIdResponse {
|
public static final class DeleteDataTablesDatatableAppTableIdResponse {
|
||||||
|
|
||||||
private DeleteDataTablesDatatableAppTableIdResponse() {
|
private DeleteDataTablesDatatableAppTableIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteDataTablesDatatableAppTableIdDatatableIdResponse ")
|
@Schema(description = "DeleteDataTablesDatatableAppTableIdDatatableIdResponse ")
|
||||||
public static final class DeleteDataTablesDatatableAppTableIdDatatableIdResponse {
|
public static final class DeleteDataTablesDatatableAppTableIdDatatableIdResponse {
|
||||||
|
|
||||||
private DeleteDataTablesDatatableAppTableIdDatatableIdResponse() {
|
private DeleteDataTablesDatatableAppTableIdDatatableIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+27
-29
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.api;
|
package org.apache.fineract.infrastructure.dataqueries.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -60,8 +60,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/entityDatatableChecks")
|
@Path("/entityDatatableChecks")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Entity Datatable Check" })
|
@Tag(name = "Entity Data Table", description = "This defines Entity-Datatable Check.")
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Entity Data Table", description = "This defines Entity-Datatable Check.") })
|
|
||||||
public class EntityDatatableChecksApiResource {
|
public class EntityDatatableChecksApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -86,17 +85,17 @@ public class EntityDatatableChecksApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Entity-Datatable Checks", notes = "The list capability of Entity-Datatable Checks can support pagination.\n"
|
@Operation(summary = "List Entity-Datatable Checks", description = "The list capability of Entity-Datatable Checks can support pagination.\n"
|
||||||
+ "\n" + "OPTIONAL ARGUMENTS\n"
|
+ "\n" + "OPTIONAL ARGUMENTS\n"
|
||||||
+ "offset Integer optional, defaults to 0 Indicates the result from which pagination startslimit Integer optional, defaults to 200 Restricts the size of results returned. To override the default and return all entries you must explicitly pass a non-positive integer value for limit e.g. limit=0, or limit=-1\n"
|
+ "offset Integer optional, defaults to 0 Indicates the result from which pagination startslimit Integer optional, defaults to 200 Restricts the size of results returned. To override the default and return all entries you must explicitly pass a non-positive integer value for limit e.g. limit=0, or limit=-1\n"
|
||||||
+ "Example Request:\n" + "\n" + "entityDatatableChecks?offset=0&limit=15")
|
+ "Example Request:\n" + "\n" + "entityDatatableChecks?offset=0&limit=15")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksResponse.class)))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("status") @ApiParam(value = "status") final Long status,
|
public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("status") @Parameter(description = "status") final Long status,
|
||||||
@QueryParam("entity") @ApiParam(value = "entity") final String entity,
|
@QueryParam("entity") @Parameter(description = "entity") final String entity,
|
||||||
@QueryParam("productId") @ApiParam(value = "productId") final Long productId,
|
@QueryParam("productId") @Parameter(description = "productId") final Long productId,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit) {
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit) {
|
||||||
final SearchParameters searchParameters = SearchParameters.forPagination(offset, limit);
|
final SearchParameters searchParameters = SearchParameters.forPagination(offset, limit);
|
||||||
final Page<EntityDataTableChecksData> result = this.readEntityDatatableChecksService.retrieveAll(searchParameters, status, entity,
|
final Page<EntityDataTableChecksData> result = this.readEntityDatatableChecksService.retrieveAll(searchParameters, status, entity,
|
||||||
productId);
|
productId);
|
||||||
@@ -109,10 +108,10 @@ public class EntityDatatableChecksApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Entity-Datatable Checks Template", notes = "This is a convenience resource useful for building maintenance user interface screens for Entity-Datatable Checks applications. The template data returned consists of:\n"
|
@Operation(summary = "Retrieve Entity-Datatable Checks Template", description = "This is a convenience resource useful for building maintenance user interface screens for Entity-Datatable Checks applications. The template data returned consists of:\n"
|
||||||
+ "\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "entityDatatableChecks/template")
|
+ "\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "entityDatatableChecks/template")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksTemplateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksTemplateResponse.class))) })
|
||||||
public String getTemplate(@Context final UriInfo uriInfo) {
|
public String getTemplate(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
final EntityDataTableChecksTemplateData result = this.readEntityDatatableChecksService.retrieveTemplate();
|
final EntityDataTableChecksTemplateData result = this.readEntityDatatableChecksService.retrieveTemplate();
|
||||||
@@ -124,13 +123,12 @@ public class EntityDatatableChecksApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create Entity-Datatable Checks", notes = "Mandatory Fields : \n" + "entity, status, datatableName\n" + "\n"
|
@Operation(summary = "Create Entity-Datatable Checks", description = "Mandatory Fields : \n" + "entity, status, datatableName\n" + "\n"
|
||||||
+ "Non-Mandatory Fields : \n" + "productId")
|
+ "Non-Mandatory Fields : \n" + "productId")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.PostEntityDatatableChecksTemplateRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = EntityDatatableChecksApiResourceSwagger.PostEntityDatatableChecksTemplateRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = EntityDatatableChecksApiResourceSwagger.PostEntityDatatableChecksTemplateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.PostEntityDatatableChecksTemplateResponse.class))) })
|
||||||
public String createEntityDatatableCheck(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createEntityDatatableCheck(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createEntityDatatableChecks(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createEntityDatatableChecks(apiRequestBodyAsJson).build();
|
||||||
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
@@ -141,11 +139,11 @@ public class EntityDatatableChecksApiResource {
|
|||||||
@Path("{entityDatatableCheckId}")
|
@Path("{entityDatatableCheckId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete Entity-Datatable Checks", notes = "Deletes an existing Entity-Datatable Check")
|
@Operation(summary = "Delete Entity-Datatable Checks", description = "Deletes an existing Entity-Datatable Check")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = EntityDatatableChecksApiResourceSwagger.DeleteEntityDatatableChecksTemplateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.DeleteEntityDatatableChecksTemplateResponse.class))) })
|
||||||
public String deleteDatatable(
|
public String deleteDatatable(
|
||||||
@PathParam("entityDatatableCheckId") @ApiParam(value = "entityDatatableCheckId") final long entityDatatableCheckId,
|
@PathParam("entityDatatableCheckId") @Parameter(description = "entityDatatableCheckId") final long entityDatatableCheckId,
|
||||||
final String apiRequestBodyAsJson) {
|
final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder()
|
final CommandWrapper commandRequest = new CommandWrapperBuilder()
|
||||||
|
|||||||
+12
-13
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.api;
|
package org.apache.fineract.infrastructure.dataqueries.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
@@ -37,7 +36,7 @@ final class EntityDatatableChecksApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetEntityDatatableChecksResponse")
|
@Schema(description = "GetEntityDatatableChecksResponse")
|
||||||
public static final class GetEntityDatatableChecksResponse {
|
public static final class GetEntityDatatableChecksResponse {
|
||||||
|
|
||||||
private GetEntityDatatableChecksResponse() {}
|
private GetEntityDatatableChecksResponse() {}
|
||||||
@@ -52,7 +51,7 @@ final class EntityDatatableChecksApiResourceSwagger {
|
|||||||
public String productName;
|
public String productName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetEntityDatatableChecksTemplateResponse")
|
@Schema(description = "GetEntityDatatableChecksTemplateResponse")
|
||||||
public static final class GetEntityDatatableChecksTemplateResponse {
|
public static final class GetEntityDatatableChecksTemplateResponse {
|
||||||
|
|
||||||
private GetEntityDatatableChecksTemplateResponse() {}
|
private GetEntityDatatableChecksTemplateResponse() {}
|
||||||
@@ -67,42 +66,42 @@ final class EntityDatatableChecksApiResourceSwagger {
|
|||||||
public Collection<SavingsProductData> savingsProductDatas;
|
public Collection<SavingsProductData> savingsProductDatas;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostEntityDatatableChecksTemplateRequest")
|
@Schema(description = "PostEntityDatatableChecksTemplateRequest")
|
||||||
public static final class PostEntityDatatableChecksTemplateRequest {
|
public static final class PostEntityDatatableChecksTemplateRequest {
|
||||||
|
|
||||||
private PostEntityDatatableChecksTemplateRequest() {
|
private PostEntityDatatableChecksTemplateRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "m_loan")
|
@Schema(example = "m_loan")
|
||||||
public String entity;
|
public String entity;
|
||||||
@ApiModelProperty(example = "100")
|
@Schema(example = "100")
|
||||||
public Long status;
|
public Long status;
|
||||||
@ApiModelProperty(example = "Additional Details")
|
@Schema(example = "Additional Details")
|
||||||
public String datatableName;
|
public String datatableName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long productId;
|
public Long productId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostEntityDatatableChecksTemplateResponse")
|
@Schema(description = "PostEntityDatatableChecksTemplateResponse")
|
||||||
public static final class PostEntityDatatableChecksTemplateResponse {
|
public static final class PostEntityDatatableChecksTemplateResponse {
|
||||||
|
|
||||||
private PostEntityDatatableChecksTemplateResponse() {
|
private PostEntityDatatableChecksTemplateResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteEntityDatatableChecksTemplateResponse")
|
@Schema(description = "DeleteEntityDatatableChecksTemplateResponse")
|
||||||
public static final class DeleteEntityDatatableChecksTemplateResponse {
|
public static final class DeleteEntityDatatableChecksTemplateResponse {
|
||||||
|
|
||||||
private DeleteEntityDatatableChecksTemplateResponse() {
|
private DeleteEntityDatatableChecksTemplateResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+36
-34
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.api;
|
package org.apache.fineract.infrastructure.dataqueries.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -59,8 +59,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/reports")
|
@Path("/reports")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Reports" })
|
@Tag(name = "Reports", description = "Non-core reports can be added, updated and deleted.")
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Reports", description = "Non-core reports can be added, updated and deleted.") })
|
|
||||||
public class ReportsApiResource {
|
public class ReportsApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "reportName", "reportType", "reportSubType",
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "reportName", "reportType", "reportSubType",
|
||||||
@@ -88,9 +87,9 @@ public class ReportsApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Reports", notes = "Lists all reports and their parameters.\n" + "\n" + "Example Request:\n" + "\n"
|
@Operation(summary = "List Reports", description = "Lists all reports and their parameters.\n" + "\n" + "Example Request:\n" + "\n"
|
||||||
+ "reports", responseContainer = "List", response = ReportsApiResourceSwagger.GetReportsResponse.class)
|
+ "reports")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ReportsApiResourceSwagger.GetReportsResponse.class))))
|
||||||
public String retrieveReportList(@Context final UriInfo uriInfo) {
|
public String retrieveReportList(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
@@ -105,10 +104,11 @@ public class ReportsApiResource {
|
|||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a Report\n", notes = "Example Requests:\n" + "\n" + "reports/1\n" + "\n" + "\n"
|
@Operation(summary = "Retrieve a Report\n", description = "Example Requests:\n" + "\n" + "reports/1\n" + "\n" + "\n"
|
||||||
+ "reports/1?template=true")
|
+ "reports/1?template=true")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.GetReportsResponse.class) })
|
@ApiResponses({
|
||||||
public String retrieveReport(@PathParam("id") @ApiParam(value = "id") final Long id, @Context final UriInfo uriInfo) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.GetReportsResponse.class))) })
|
||||||
|
public String retrieveReport(@PathParam("id") @Parameter(description = "id") final Long id, @Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|
||||||
@@ -126,9 +126,10 @@ public class ReportsApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Report Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
@Operation(summary = "Retrieve Report Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
||||||
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "\n" + "Example Request : \n" + "\n" + "reports/template")
|
+ "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "\n" + "Example Request : \n" + "\n" + "reports/template")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.GetReportsTemplateResponse.class) })
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.GetReportsTemplateResponse.class))) })
|
||||||
public String retrieveOfficeTemplate(@Context final UriInfo uriInfo) {
|
public String retrieveOfficeTemplate(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
@@ -143,11 +144,11 @@ public class ReportsApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a Report", notes = "")
|
@Operation(summary = "Create a Report", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.PostRepostRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportsApiResourceSwagger.PostRepostRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.PostReportsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.PostReportsResponse.class))) })
|
||||||
public String createReport(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createReport(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createReport().withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createReport().withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -160,12 +161,12 @@ public class ReportsApiResource {
|
|||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Report", notes = "Only the useReport value can be updated for core reports.")
|
@Operation(summary = "Update a Report", description = "Only the useReport description can be updated for core reports.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.PutReportRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportsApiResourceSwagger.PutReportRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.PutReportResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.PutReportResponse.class))) })
|
||||||
public String updateReport(@PathParam("id") @ApiParam(value = "id") final Long id,
|
public String updateReport(@PathParam("id") @Parameter(description = "id") final Long id,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateReport(id).withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateReport(id).withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -178,9 +179,10 @@ public class ReportsApiResource {
|
|||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete a Report", notes = "Only non-core reports can be deleted.")
|
@Operation(summary = "Delete a Report", description = "Only non-core reports can be deleted.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.DeleteReportsResponse.class) })
|
@ApiResponses({
|
||||||
public String deleteReport(@PathParam("id") @ApiParam(value = "id") final Long id) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.DeleteReportsResponse.class))) })
|
||||||
|
public String deleteReport(@PathParam("id") @Parameter(description = "id") final Long id) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteReport(id).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteReport(id).build();
|
||||||
|
|
||||||
|
|||||||
+27
-28
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.api;
|
package org.apache.fineract.infrastructure.dataqueries.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.data.ReportParameterData;
|
import org.apache.fineract.infrastructure.dataqueries.data.ReportParameterData;
|
||||||
@@ -33,35 +32,35 @@ final class ReportsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetReportsResponse")
|
@Schema(description = "GetReportsResponse")
|
||||||
public static final class GetReportsResponse {
|
public static final class GetReportsResponse {
|
||||||
|
|
||||||
private GetReportsResponse() {
|
private GetReportsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Client Listing")
|
@Schema(example = "Client Listing")
|
||||||
public String reportName;
|
public String reportName;
|
||||||
@ApiModelProperty(example = "Table")
|
@Schema(example = "Table")
|
||||||
public String reportType;
|
public String reportType;
|
||||||
public String reportSubType;
|
public String reportSubType;
|
||||||
@ApiModelProperty(example = "Client")
|
@Schema(example = "Client")
|
||||||
public String reportCategory;
|
public String reportCategory;
|
||||||
@ApiModelProperty(example = "Individual Client Report Lists the small number of defined fields on the client table. Would expect to copy this report and add any one to one additional data for specific tenant needs. Can be run for any size MFI but you expect it only to be run within a branch for larger ones. Depending on how many columns are displayed, there is probably is a limit of about 20/50k clients returned for html display (export to excel doesnt have that client browser/memory impact).")
|
@Schema(example = "Individual Client Report Lists the small number of defined fields on the client table. Would expect to copy this report and add any one to one additional data for specific tenant needs. Can be run for any size MFI but you expect it only to be run within a branch for larger ones. Depending on how many columns are displayed, there is probably is a limit of about 20/50k clients returned for html display (export to excel doesnt have that client browser/memory impact).")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String reportSql;
|
public String reportSql;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean coreReport;
|
public Boolean coreReport;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean useReport;
|
public Boolean useReport;
|
||||||
public Collection<ReportParameterData> reportParameters;
|
public Collection<ReportParameterData> reportParameters;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetReportsTemplateResponse")
|
@Schema(description = "GetReportsTemplateResponse")
|
||||||
public static final class GetReportsTemplateResponse {
|
public static final class GetReportsTemplateResponse {
|
||||||
|
|
||||||
private GetReportsTemplateResponse() {
|
private GetReportsTemplateResponse() {
|
||||||
@@ -73,53 +72,53 @@ final class ReportsApiResourceSwagger {
|
|||||||
public Collection<ReportParameterData> allowedParameters;
|
public Collection<ReportParameterData> allowedParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostRepostRequest")
|
@Schema(description = "PostRepostRequest")
|
||||||
public static final class PostRepostRequest {
|
public static final class PostRepostRequest {
|
||||||
|
|
||||||
private PostRepostRequest() {
|
private PostRepostRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Completely New Report")
|
@Schema(example = "Completely New Report")
|
||||||
public String reportName;
|
public String reportName;
|
||||||
@ApiModelProperty(example = "Table")
|
@Schema(example = "Table")
|
||||||
public String reportType;
|
public String reportType;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String reportSubType;
|
public String reportSubType;
|
||||||
@ApiModelProperty(example = "Loan")
|
@Schema(example = "Loan")
|
||||||
public String reportCategory;
|
public String reportCategory;
|
||||||
@ApiModelProperty(example = "Just An Example")
|
@Schema(example = "Just An Example")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "select 'very good sql' as AComment")
|
@Schema(example = "select 'very good sql' as AComment")
|
||||||
public String reportSql;
|
public String reportSql;
|
||||||
public Collection<ReportParameterData> reportParameters;
|
public Collection<ReportParameterData> reportParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostReportsResponse")
|
@Schema(description = "PostReportsResponse")
|
||||||
public static final class PostReportsResponse {
|
public static final class PostReportsResponse {
|
||||||
|
|
||||||
private PostReportsResponse() {
|
private PostReportsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "132")
|
@Schema(example = "132")
|
||||||
public long resourceId;
|
public long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutReportRequest")
|
@Schema(description = "PutReportRequest")
|
||||||
public static final class PutReportRequest {
|
public static final class PutReportRequest {
|
||||||
|
|
||||||
private PutReportRequest() {
|
private PutReportRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Completely New Report")
|
@Schema(example = "Completely New Report")
|
||||||
public String reportName;
|
public String reportName;
|
||||||
public Collection<ReportParameterData> reportParameters;
|
public Collection<ReportParameterData> reportParameters;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutReportResponse")
|
@Schema(description = "PutReportResponse")
|
||||||
public static final class PutReportResponse {
|
public static final class PutReportResponse {
|
||||||
|
|
||||||
private PutReportResponse() {
|
private PutReportResponse() {
|
||||||
@@ -132,24 +131,24 @@ final class ReportsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Changed New Report")
|
@Schema(example = "Changed New Report")
|
||||||
public String reportName;
|
public String reportName;
|
||||||
public Collection<ReportParameterData> reportParameters;
|
public Collection<ReportParameterData> reportParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "132")
|
@Schema(example = "132")
|
||||||
public long resourceId;
|
public long resourceId;
|
||||||
public PutReportResponseChanges changes;
|
public PutReportResponseChanges changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteReportsResponse")
|
@Schema(description = "DeleteReportsResponse")
|
||||||
public static final class DeleteReportsResponse {
|
public static final class DeleteReportsResponse {
|
||||||
|
|
||||||
private DeleteReportsResponse() {
|
private DeleteReportsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "132")
|
@Schema(example = "132")
|
||||||
public long resourceId;
|
public long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-13
@@ -18,13 +18,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.api;
|
package org.apache.fineract.infrastructure.dataqueries.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -62,8 +62,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/runreports")
|
@Path("/runreports")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Run Reports" })
|
@Tag(name = "Run Reports", description = "")
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Run Reports", description = "") })
|
|
||||||
public class RunreportsApiResource {
|
public class RunreportsApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -87,7 +86,7 @@ public class RunreportsApiResource {
|
|||||||
@Path("{reportName}")
|
@Path("{reportName}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON, "text/csv", "application/vnd.ms-excel", "application/pdf", "text/html" })
|
@Produces({ MediaType.APPLICATION_JSON, "text/csv", "application/vnd.ms-excel", "application/pdf", "text/html" })
|
||||||
@ApiOperation(value = "Running a Report", notes = "This resource allows you to run and receive output from pre-defined Apache Fineract reports.\n"
|
@Operation(summary = "Running a Report", description = "This resource allows you to run and receive output from pre-defined Apache Fineract reports.\n"
|
||||||
+ "\n" + "Reports can also be used to provide data for searching and workflow functionality.\n" + "\n"
|
+ "\n" + "Reports can also be used to provide data for searching and workflow functionality.\n" + "\n"
|
||||||
+ "The default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL.\n"
|
+ "The default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
@@ -105,10 +104,11 @@ public class RunreportsApiResource {
|
|||||||
+ "runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=CSV&R_officeId=1\n"
|
+ "runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=CSV&R_officeId=1\n"
|
||||||
+ "\n" + "\n"
|
+ "\n" + "\n"
|
||||||
+ "runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=PDF&R_officeId=1")
|
+ "runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=PDF&R_officeId=1")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = RunreportsApiResourceSwagger.GetReportNameResponse.class) })
|
@ApiResponses({
|
||||||
public Response runReport(@PathParam("reportName") @ApiParam(value = "reportName") final String reportName,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = RunreportsApiResourceSwagger.GetReportNameResponse.class))) })
|
||||||
|
public Response runReport(@PathParam("reportName") @Parameter(description = "reportName") final String reportName,
|
||||||
@Context final UriInfo uriInfo,
|
@Context final UriInfo uriInfo,
|
||||||
@DefaultValue("false") @QueryParam("isSelfServiceUserReport") @ApiParam(value = "isSelfServiceUserReport") final boolean isSelfServiceUserReport) {
|
@DefaultValue("false") @QueryParam("isSelfServiceUserReport") @Parameter(description = "isSelfServiceUserReport") final boolean isSelfServiceUserReport) {
|
||||||
|
|
||||||
final MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters();
|
final MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.api;
|
package org.apache.fineract.infrastructure.dataqueries.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetColumnHeaderData;
|
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetColumnHeaderData;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetRowData;
|
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetRowData;
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ final class RunreportsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetReportNameResponse")
|
@Schema(description = "GetReportNameResponse")
|
||||||
public static final class GetReportNameResponse {
|
public static final class GetReportNameResponse {
|
||||||
|
|
||||||
private GetReportNameResponse() {
|
private GetReportNameResponse() {
|
||||||
|
|||||||
+52
-53
@@ -21,13 +21,14 @@ package org.apache.fineract.infrastructure.documentmanagement.api;
|
|||||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||||
import com.sun.jersey.multipart.FormDataBodyPart;
|
import com.sun.jersey.multipart.FormDataBodyPart;
|
||||||
import com.sun.jersey.multipart.FormDataParam;
|
import com.sun.jersey.multipart.FormDataParam;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -64,12 +65,10 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("{entityType}/{entityId}/documents")
|
@Path("{entityType}/{entityId}/documents")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Documents" })
|
@Tag(name = "Documents", description = "Multiple Documents (a combination of a name, description and a file) may be attached to different Entities like Clients, Groups, Staff, Loans, Savings and Client Identifiers in the system\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n" + "Note: The currently allowed Entities are\n" + "\n" + "Clients: URL Pattern as clients\n" + "Staff: URL Pattern as staff\n"
|
||||||
@Tag(name = "Documents", description = "Multiple Documents (a combination of a name, description and a file) may be attached to different Entities like Clients, Groups, Staff, Loans, Savings and Client Identifiers in the system\n"
|
+ "Loans: URL Pattern as loans\n" + "Savings: URL Pattern as savings\n" + "Client Identifiers: URL Pattern as client_identifiers\n"
|
||||||
+ "\n" + "Note: The currently allowed Entities are\n" + "\n" + "Clients: URL Pattern as clients\n"
|
+ "Groups: URL Pattern as groups")
|
||||||
+ "Staff: URL Pattern as staff\n" + "Loans: URL Pattern as loans\n" + "Savings: URL Pattern as savings\n"
|
|
||||||
+ "Client Identifiers: URL Pattern as client_identifiers\n" + "Groups: URL Pattern as groups") })
|
|
||||||
public class DocumentManagementApiResource {
|
public class DocumentManagementApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
@@ -97,13 +96,13 @@ public class DocumentManagementApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List documents", notes = "Example Requests:\n" + "\n" + "clients/1/documents\n" + "\n"
|
@Operation(summary = "List documents", description = "Example Requests:\n" + "\n" + "clients/1/documents\n" + "\n"
|
||||||
+ "client_identifiers/1/documents\n" + "\n" + "loans/1/documents?fields=name,description")
|
+ "client_identifiers/1/documents\n" + "\n" + "loans/1/documents?fields=name,description")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = DocumentManagementApiResourceSwagger.GetEntityTypeEntityIdDocumentsResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.GetEntityTypeEntityIdDocumentsResponse.class)))) })
|
||||||
public String retreiveAllDocuments(@Context final UriInfo uriInfo,
|
public String retreiveAllDocuments(@Context final UriInfo uriInfo,
|
||||||
@PathParam("entityType") @ApiParam(value = "entityType") final String entityType,
|
@PathParam("entityType") @Parameter(description = "entityType") final String entityType,
|
||||||
@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId) {
|
@PathParam("entityId") @Parameter(description = "entityId") final Long entityId) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType);
|
this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType);
|
||||||
|
|
||||||
@@ -116,20 +115,20 @@ public class DocumentManagementApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a Document", notes = "Note: A document is created using a Multi-part form upload \n" + "\n"
|
@Operation(summary = "Create a Document", description = "Note: A document is created using a Multi-part form upload \n" + "\n"
|
||||||
+ "Body Parts\n" + "\n" + "name : \n" + "Name or summary of the document\n" + "\n" + "description : \n"
|
+ "Body Parts\n" + "\n" + "name : \n" + "Name or summary of the document\n" + "\n" + "description : \n"
|
||||||
+ "Description of the document\n" + "\n" + "file : \n" + "The file to be uploaded\n" + "\n" + "Mandatory Fields : \n"
|
+ "Description of the document\n" + "\n" + "file : \n" + "The file to be uploaded\n" + "\n" + "Mandatory Fields : \n"
|
||||||
+ "file and description")
|
+ "file and description")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "Not Shown (multi-part form data)", response = DocumentManagementApiResourceSwagger.PostEntityTypeEntityIdDocumentsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "Not Shown (multi-part form data)", content = @Content(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.PostEntityTypeEntityIdDocumentsResponse.class))) })
|
||||||
public String createDocument(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType,
|
public String createDocument(@PathParam("entityType") @Parameter(description = "entityType") final String entityType,
|
||||||
@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId,
|
@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||||
@HeaderParam("Content-Length") @ApiParam(value = "Content-Length") final Long fileSize,
|
@HeaderParam("Content-Length") @Parameter(description = "Content-Length") final Long fileSize,
|
||||||
@FormDataParam("file") @ApiParam(value = "file") final InputStream inputStream,
|
@FormDataParam("file") @Parameter(description = "file") final InputStream inputStream,
|
||||||
@FormDataParam("file") final @ApiParam(value = "file") FormDataContentDisposition fileDetails,
|
@FormDataParam("file") final @Parameter(description = "file") FormDataContentDisposition fileDetails,
|
||||||
@FormDataParam("file") @ApiParam(value = "file") final FormDataBodyPart bodyPart,
|
@FormDataParam("file") @Parameter(description = "file") final FormDataBodyPart bodyPart,
|
||||||
@FormDataParam("name") @ApiParam(value = "name") final String name,
|
@FormDataParam("name") @Parameter(description = "name") final String name,
|
||||||
@FormDataParam("description") @ApiParam(value = "description") final String description) {
|
@FormDataParam("description") @Parameter(description = "description") final String description) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: also need to have a backup and stop reading from stream after max size is reached to protect against
|
* TODO: also need to have a backup and stop reading from stream after max size is reached to protect against
|
||||||
@@ -151,20 +150,20 @@ public class DocumentManagementApiResource {
|
|||||||
@Path("{documentId}")
|
@Path("{documentId}")
|
||||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Document", notes = "Note: A document is updated using a Multi-part form upload \n" + "Body Parts\n"
|
@Operation(summary = "Update a Document", description = "Note: A document is updated using a Multi-part form upload \n" + "Body Parts\n"
|
||||||
+ "name\n" + "Name or summary of the document\n" + "description\n" + "Description of the document\n" + "file\n"
|
+ "name\n" + "Name or summary of the document\n" + "description\n" + "Description of the document\n" + "file\n"
|
||||||
+ "The file to be uploaded")
|
+ "The file to be uploaded")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "Not Shown (multi-part form data)", response = DocumentManagementApiResourceSwagger.PutEntityTypeEntityIdDocumentsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "Not Shown (multi-part form data)", content = @Content(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.PutEntityTypeEntityIdDocumentsResponse.class))) })
|
||||||
public String updateDocument(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType,
|
public String updateDocument(@PathParam("entityType") @Parameter(description = "entityType") final String entityType,
|
||||||
@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId,
|
@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||||
@PathParam("documentId") @ApiParam(value = "documentId") final Long documentId,
|
@PathParam("documentId") @Parameter(description = "documentId") final Long documentId,
|
||||||
@HeaderParam("Content-Length") @ApiParam(value = "Content-Length") final Long fileSize,
|
@HeaderParam("Content-Length") @Parameter(description = "Content-Length") final Long fileSize,
|
||||||
@FormDataParam("file") @ApiParam(value = "file") final InputStream inputStream,
|
@FormDataParam("file") @Parameter(description = "file") final InputStream inputStream,
|
||||||
@FormDataParam("file") @ApiParam(value = "file") final FormDataContentDisposition fileDetails,
|
@FormDataParam("file") @Parameter(description = "file") final FormDataContentDisposition fileDetails,
|
||||||
@FormDataParam("file") @ApiParam(value = "file") final FormDataBodyPart bodyPart,
|
@FormDataParam("file") @Parameter(description = "file") final FormDataBodyPart bodyPart,
|
||||||
@FormDataParam("name") @ApiParam(value = "name") final String name,
|
@FormDataParam("name") @Parameter(description = "name") final String name,
|
||||||
@FormDataParam("description") @ApiParam(value = "description") final String description) {
|
@FormDataParam("description") @Parameter(description = "description") final String description) {
|
||||||
|
|
||||||
final Set<String> modifiedParams = new HashSet<>();
|
final Set<String> modifiedParams = new HashSet<>();
|
||||||
modifiedParams.add("name");
|
modifiedParams.add("name");
|
||||||
@@ -197,13 +196,13 @@ public class DocumentManagementApiResource {
|
|||||||
@Path("{documentId}")
|
@Path("{documentId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a Document", notes = "Example Requests:\n" + "\n" + "clients/1/documents/1\n" + "\n" + "\n"
|
@Operation(summary = "Retrieve a Document", description = "Example Requests:\n" + "\n" + "clients/1/documents/1\n" + "\n" + "\n"
|
||||||
+ "loans/1/documents/1\n" + "\n" + "\n" + "client_identifiers/1/documents/1?fields=name,description")
|
+ "loans/1/documents/1\n" + "\n" + "\n" + "client_identifiers/1/documents/1?fields=name,description")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = DocumentManagementApiResourceSwagger.GetEntityTypeEntityIdDocumentsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.GetEntityTypeEntityIdDocumentsResponse.class))) })
|
||||||
public String getDocument(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType,
|
public String getDocument(@PathParam("entityType") @Parameter(description = "entityType") final String entityType,
|
||||||
@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId,
|
@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||||
@PathParam("documentId") @ApiParam(value = "documentId") final Long documentId, @Context final UriInfo uriInfo) {
|
@PathParam("documentId") @Parameter(description = "documentId") final Long documentId, @Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType);
|
this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType);
|
||||||
|
|
||||||
@@ -217,12 +216,12 @@ public class DocumentManagementApiResource {
|
|||||||
@Path("{documentId}/attachment")
|
@Path("{documentId}/attachment")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_OCTET_STREAM })
|
@Produces({ MediaType.APPLICATION_OCTET_STREAM })
|
||||||
@ApiOperation(value = "Retrieve Binary File associated with Document", notes = "Request used to download the file associated with the document\n"
|
@Operation(summary = "Retrieve Binary File associated with Document", description = "Request used to download the file associated with the document\n"
|
||||||
+ "\n" + "Example Requests:\n" + "\n" + "clients/1/documents/1/attachment\n" + "\n" + "\n" + "loans/1/documents/1/attachment")
|
+ "\n" + "Example Requests:\n" + "\n" + "clients/1/documents/1/attachment\n" + "\n" + "\n" + "loans/1/documents/1/attachment")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "Not Shown: The corresponding Binary file") })
|
@ApiResponses({ @ApiResponse(responseCode = "200", description = "Not Shown: The corresponding Binary file") })
|
||||||
public Response downloadFile(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType,
|
public Response downloadFile(@PathParam("entityType") @Parameter(description = "entityType") final String entityType,
|
||||||
@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId,
|
@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||||
@PathParam("documentId") @ApiParam(value = "documentId") final Long documentId) {
|
@PathParam("documentId") @Parameter(description = "documentId") final Long documentId) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType);
|
this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType);
|
||||||
|
|
||||||
@@ -238,12 +237,12 @@ public class DocumentManagementApiResource {
|
|||||||
@Path("{documentId}")
|
@Path("{documentId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Remove a Document", notes = "")
|
@Operation(summary = "Remove a Document", description = "")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = DocumentManagementApiResourceSwagger.DeleteEntityTypeEntityIdDocumentsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.DeleteEntityTypeEntityIdDocumentsResponse.class))) })
|
||||||
public String deleteDocument(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType,
|
public String deleteDocument(@PathParam("entityType") @Parameter(description = "entityType") final String entityType,
|
||||||
@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId,
|
@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||||
@PathParam("documentId") @ApiParam(value = "documentId") final Long documentId) {
|
@PathParam("documentId") @Parameter(description = "documentId") final Long documentId) {
|
||||||
|
|
||||||
final DocumentCommand documentCommand = new DocumentCommand(null, documentId, entityType, entityId, null, null, null, null, null,
|
final DocumentCommand documentCommand = new DocumentCommand(null, documentId, entityType, entityId, null, null, null, null, null,
|
||||||
null);
|
null);
|
||||||
|
|||||||
+21
-22
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.documentmanagement.api;
|
package org.apache.fineract.infrastructure.documentmanagement.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sanyam on 7/8/17.
|
* Created by sanyam on 7/8/17.
|
||||||
@@ -31,49 +30,49 @@ final class DocumentManagementApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetEntityTypeEntityIdDocumentsResponse")
|
@Schema(description = "GetEntityTypeEntityIdDocumentsResponse")
|
||||||
public static final class GetEntityTypeEntityIdDocumentsResponse {
|
public static final class GetEntityTypeEntityIdDocumentsResponse {
|
||||||
|
|
||||||
private GetEntityTypeEntityIdDocumentsResponse() {
|
private GetEntityTypeEntityIdDocumentsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "clients")
|
@Schema(example = "clients")
|
||||||
public String parentEntityType;
|
public String parentEntityType;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long parentEntityId;
|
public Long parentEntityId;
|
||||||
@ApiModelProperty(example = "Client Details Form")
|
@Schema(example = "Client Details Form")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "CGAP.pdf")
|
@Schema(example = "CGAP.pdf")
|
||||||
public String fileName;
|
public String fileName;
|
||||||
@ApiModelProperty(example = "5246719")
|
@Schema(example = "5246719")
|
||||||
public Long size;
|
public Long size;
|
||||||
@ApiModelProperty(example = "application/pdf")
|
@Schema(example = "application/pdf")
|
||||||
public String type;
|
public String type;
|
||||||
@ApiModelProperty(example = "A signed form signed by new member")
|
@Schema(example = "A signed form signed by new member")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String location;
|
public String location;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public Integer storageType;
|
public Integer storageType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostEntityTypeEntityIdDocumentsResponse")
|
@Schema(description = "PostEntityTypeEntityIdDocumentsResponse")
|
||||||
public static final class PostEntityTypeEntityIdDocumentsResponse {
|
public static final class PostEntityTypeEntityIdDocumentsResponse {
|
||||||
|
|
||||||
private PostEntityTypeEntityIdDocumentsResponse() {
|
private PostEntityTypeEntityIdDocumentsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public String resourceIdentifier;
|
public String resourceIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutEntityTypeEntityIdDocumentsResponse")
|
@Schema(description = "PutEntityTypeEntityIdDocumentsResponse")
|
||||||
public static final class PutEntityTypeEntityIdDocumentsResponse {
|
public static final class PutEntityTypeEntityIdDocumentsResponse {
|
||||||
|
|
||||||
private PutEntityTypeEntityIdDocumentsResponse() {
|
private PutEntityTypeEntityIdDocumentsResponse() {
|
||||||
@@ -88,14 +87,14 @@ final class DocumentManagementApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutEntityTypeEntityIdDocumentsResponse.PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes;
|
public PutEntityTypeEntityIdDocumentsResponse.PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes;
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public String resourceIdentifier;
|
public String resourceIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteEntityTypeEntityIdDocumentsResponse")
|
@Schema(description = "DeleteEntityTypeEntityIdDocumentsResponse")
|
||||||
public static final class DeleteEntityTypeEntityIdDocumentsResponse {
|
public static final class DeleteEntityTypeEntityIdDocumentsResponse {
|
||||||
|
|
||||||
private DeleteEntityTypeEntityIdDocumentsResponse() {
|
private DeleteEntityTypeEntityIdDocumentsResponse() {
|
||||||
@@ -110,10 +109,10 @@ final class DocumentManagementApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public DeleteEntityTypeEntityIdDocumentsResponse.PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes;
|
public DeleteEntityTypeEntityIdDocumentsResponse.PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes;
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public String resourceIdentifier;
|
public String resourceIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -21,7 +21,6 @@ package org.apache.fineract.infrastructure.documentmanagement.api;
|
|||||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||||
import com.sun.jersey.multipart.FormDataBodyPart;
|
import com.sun.jersey.multipart.FormDataBodyPart;
|
||||||
import com.sun.jersey.multipart.FormDataParam;
|
import com.sun.jersey.multipart.FormDataParam;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
@@ -56,7 +55,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("{entity}/{entityId}/images")
|
@Path("{entity}/{entityId}/images")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(value = "DomainName//api//v1//{entity}//{entityId}//images", description = "")
|
|
||||||
public class ImagesApiResource {
|
public class ImagesApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.entityaccess.api;
|
package org.apache.fineract.infrastructure.entityaccess.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
@@ -51,7 +50,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(value = "DomainName/api/v1/entitytoentitymapping", description = "") // https://github.com/swagger-api/swagger-ui/issues/1655
|
|
||||||
public class FineractEntityApiResource {
|
public class FineractEntityApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
|
|||||||
+36
-35
@@ -21,15 +21,15 @@ package org.apache.fineract.infrastructure.hooks.api;
|
|||||||
import static org.apache.fineract.infrastructure.hooks.api.HookApiConstants.HOOK_RESOURCE_NAME;
|
import static org.apache.fineract.infrastructure.hooks.api.HookApiConstants.HOOK_RESOURCE_NAME;
|
||||||
import static org.apache.fineract.infrastructure.hooks.api.HookApiConstants.RESPONSE_DATA_PARAMETERS;
|
import static org.apache.fineract.infrastructure.hooks.api.HookApiConstants.RESPONSE_DATA_PARAMETERS;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
@@ -61,9 +61,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Hooks" })
|
@Tag(name = "Hooks", description = "Hooks are a mechanism to trigger custom code on the occurence of events. ")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Hooks", description = "Hooks are a mechanism to trigger custom code on the occurence of events. ") })
|
|
||||||
public class HookApiResource {
|
public class HookApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -84,10 +82,9 @@ public class HookApiResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@ApiOperation(value = "Retrieve Hooks", notes = "Returns the list of hooks.\n" + "\n" + "Example Requests:\n" + "\n"
|
@Operation(summary = "Retrieve Hooks", description = "Returns the list of hooks.\n" + "\n" + "Example Requests:\n" + "\n" + "hooks")
|
||||||
+ "hooks", responseContainer = "List", response = HookApiResourceSwagger.GetHookResponse.class)
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.GetHookResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = HookApiResourceSwagger.GetHookResponse.class)))) })
|
||||||
public String retrieveHooks(@Context final UriInfo uriInfo) {
|
public String retrieveHooks(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(HOOK_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(HOOK_RESOURCE_NAME);
|
||||||
@@ -100,9 +97,11 @@ public class HookApiResource {
|
|||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("{hookId}")
|
@Path("{hookId}")
|
||||||
@ApiOperation(value = "Retrieve a Hook", notes = "Returns the details of a Hook.\n" + "\n" + "Example Requests:\n" + "\n" + "hooks/1")
|
@Operation(summary = "Retrieve a Hook", description = "Returns the details of a Hook.\n" + "\n" + "Example Requests:\n" + "\n"
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.GetHookResponse.class) })
|
+ "hooks/1")
|
||||||
public String retrieveHook(@PathParam("hookId") @ApiParam(value = "hookId") final Long hookId, @Context final UriInfo uriInfo) {
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.GetHookResponse.class))) })
|
||||||
|
public String retrieveHook(@PathParam("hookId") @Parameter(description = "hookId") final Long hookId, @Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(HOOK_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(HOOK_RESOURCE_NAME);
|
||||||
|
|
||||||
@@ -119,9 +118,10 @@ public class HookApiResource {
|
|||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("template")
|
@Path("template")
|
||||||
@ApiOperation(value = "Retrieve Hooks Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
@Operation(summary = "Retrieve Hooks Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
||||||
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "hooks/template")
|
+ "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "hooks/template")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.GetHookTemplateResponse.class) })
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.GetHookTemplateResponse.class))) })
|
||||||
public String template(@Context final UriInfo uriInfo) {
|
public String template(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(HOOK_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(HOOK_RESOURCE_NAME);
|
||||||
@@ -133,16 +133,16 @@ public class HookApiResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@ApiOperation(value = "Create a Hook", notes = "The following parameters can be passed for the creation of a hook :-\n" + "\n"
|
@Operation(summary = "Create a Hook", description = "The following parameters can be passed for the creation of a hook :-\n" + "\n"
|
||||||
+ "name - string - Required. The name of the template that is being called. (See /hooks/template for the list of valid hook names.)\n"
|
+ "name - string - Required. The name of the template that is being called. (See /hooks/template for the list of valid hook names.)\n"
|
||||||
+ "\n" + "isActive - boolean - Determines whether the hook is actually triggered.\n" + "\n"
|
+ "\n" + "isActive - boolean - Determines whether the hook is actually triggered.\n" + "\n"
|
||||||
+ "events - array - Determines what events the hook is triggered for.\n" + "\n"
|
+ "events - array - Determines what events the hook is triggered for.\n" + "\n"
|
||||||
+ "config - hash - Required. Key/value pairs to provide settings for this hook. These settings vary between the templates.\n"
|
+ "config - hash - Required. Key/value pairs to provide settings for this hook. These settings vary between the templates.\n"
|
||||||
+ "\n" + "templateId - Optional. The UGD template ID associated with the same entity (client or loan).")
|
+ "\n" + "templateId - Optional. The UGD template ID associated with the same entity (client or loan).")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.PostHookRequest.class)))
|
||||||
@ApiImplicitParam(paramType = "body", dataType = "body", required = true, type = "body", dataTypeClass = HookApiResourceSwagger.PostHookRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.PostHookResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.PostHookResponse.class))) })
|
||||||
public String createHook(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createHook(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createHook().withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createHook().withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -153,12 +153,12 @@ public class HookApiResource {
|
|||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
@Path("{hookId}")
|
@Path("{hookId}")
|
||||||
@ApiOperation(value = "Update a Hook", notes = "Updates the details of a hook.")
|
@Operation(summary = "Update a Hook", description = "Updates the details of a hook.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.PutHookRequest.class)))
|
||||||
@ApiImplicitParam(paramType = "body", dataType = "body", required = true, type = "body", dataTypeClass = HookApiResourceSwagger.PutHookRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.PutHookResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.PutHookResponse.class))) })
|
||||||
public String updateHook(@PathParam("hookId") @ApiParam(value = "hookId") final Long hookId,
|
public String updateHook(@PathParam("hookId") @Parameter(description = "hookId") final Long hookId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateHook(hookId).withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateHook(hookId).withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -169,9 +169,10 @@ public class HookApiResource {
|
|||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{hookId}")
|
@Path("{hookId}")
|
||||||
@ApiOperation(value = "Delete a Hook", notes = "Deletes a hook.")
|
@Operation(summary = "Delete a Hook", description = "Deletes a hook.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.DeleteHookResponse.class) })
|
@ApiResponses({
|
||||||
public String deleteHook(@PathParam("hookId") @ApiParam(value = "hookId") final Long hookId) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.DeleteHookResponse.class))) })
|
||||||
|
public String deleteHook(@PathParam("hookId") @Parameter(description = "hookId") final Long hookId) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteHook(hookId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteHook(hookId).build();
|
||||||
|
|
||||||
|
|||||||
+29
-30
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.hooks.api;
|
package org.apache.fineract.infrastructure.hooks.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.hooks.data.Event;
|
import org.apache.fineract.infrastructure.hooks.data.Event;
|
||||||
import org.apache.fineract.infrastructure.hooks.data.Field;
|
import org.apache.fineract.infrastructure.hooks.data.Field;
|
||||||
@@ -37,64 +36,64 @@ final class HookApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostHookRequest")
|
@Schema(description = "PostHookRequest")
|
||||||
public static final class PostHookRequest {
|
public static final class PostHookRequest {
|
||||||
|
|
||||||
private PostHookRequest() {
|
private PostHookRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Web")
|
@Schema(example = "Web")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isActive;
|
public Boolean isActive;
|
||||||
@ApiModelProperty(example = "Kremlin")
|
@Schema(example = "Kremlin")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long templateId;
|
public Long templateId;
|
||||||
public List<Event> events;
|
public List<Event> events;
|
||||||
public List<Field> config;
|
public List<Field> config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostHookResponse")
|
@Schema(description = "PostHookResponse")
|
||||||
public static final class PostHookResponse {
|
public static final class PostHookResponse {
|
||||||
|
|
||||||
private PostHookResponse() {
|
private PostHookResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetHookResponse")
|
@Schema(description = "GetHookResponse")
|
||||||
public static final class GetHookResponse {
|
public static final class GetHookResponse {
|
||||||
|
|
||||||
private GetHookResponse() {
|
private GetHookResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Web")
|
@Schema(example = "Web")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Kremlin")
|
@Schema(example = "Kremlin")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isActive;
|
public Boolean isActive;
|
||||||
@ApiModelProperty(example = "[2014, 9, 16]")
|
@Schema(example = "[2014, 9, 16]")
|
||||||
public LocalDate createdAt;
|
public LocalDate createdAt;
|
||||||
@ApiModelProperty(example = "[2014, 9, 16]")
|
@Schema(example = "[2014, 9, 16]")
|
||||||
public LocalDate updatedAt;
|
public LocalDate updatedAt;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long templateId;
|
public Long templateId;
|
||||||
@ApiModelProperty(example = "My UGD")
|
@Schema(example = "My UGD")
|
||||||
public String templateName;
|
public String templateName;
|
||||||
public List<Event> events;
|
public List<Event> events;
|
||||||
public List<Field> config;
|
public List<Field> config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetHookTemplateResponse")
|
@Schema(description = "GetHookTemplateResponse")
|
||||||
public static final class GetHookTemplateResponse {
|
public static final class GetHookTemplateResponse {
|
||||||
|
|
||||||
private GetHookTemplateResponse() {
|
private GetHookTemplateResponse() {
|
||||||
@@ -105,37 +104,37 @@ final class HookApiResourceSwagger {
|
|||||||
public List<Grouping> groupings;
|
public List<Grouping> groupings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteHookResponse")
|
@Schema(description = "DeleteHookResponse")
|
||||||
public static final class DeleteHookResponse {
|
public static final class DeleteHookResponse {
|
||||||
|
|
||||||
private DeleteHookResponse() {
|
private DeleteHookResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutHookRequest")
|
@Schema(description = "PutHookRequest")
|
||||||
public static final class PutHookRequest {
|
public static final class PutHookRequest {
|
||||||
|
|
||||||
private PutHookRequest() {
|
private PutHookRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Web")
|
@Schema(example = "Web")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isActive;
|
public Boolean isActive;
|
||||||
@ApiModelProperty(example = "Kremlin")
|
@Schema(example = "Kremlin")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long templateId;
|
public Long templateId;
|
||||||
public List<Event> events;
|
public List<Event> events;
|
||||||
public List<Field> config;
|
public List<Field> config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutHookResponse")
|
@Schema(description = "PutHookResponse")
|
||||||
public static final class PutHookResponse {
|
public static final class PutHookResponse {
|
||||||
|
|
||||||
private PutHookResponse() {
|
private PutHookResponse() {
|
||||||
@@ -146,14 +145,14 @@ final class HookApiResourceSwagger {
|
|||||||
|
|
||||||
private PutHookResponseChangesSwagger() {}
|
private PutHookResponseChangesSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Kremlin")
|
@Schema(example = "Kremlin")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public List<Event> events;
|
public List<Event> events;
|
||||||
public List<Field> config;
|
public List<Field> config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutHookResponseChangesSwagger changes;
|
public PutHookResponseChangesSwagger changes;
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-14
@@ -18,13 +18,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.jobs.api;
|
package org.apache.fineract.infrastructure.jobs.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.POST;
|
import javax.ws.rs.POST;
|
||||||
@@ -49,8 +49,8 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
@Path("/scheduler")
|
@Path("/scheduler")
|
||||||
@Component
|
@Component
|
||||||
@Api(tags = { "Scheduler" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Scheduler", description = "") })
|
@Tag(name = "Scheduler", description = "")
|
||||||
public class SchedulerApiResource {
|
public class SchedulerApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -70,9 +70,10 @@ public class SchedulerApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Scheduler Status", notes = "Returns the scheduler status.\n" + "\n" + "Example Requests:\n" + "\n"
|
@Operation(summary = "Retrieve Scheduler Status", description = "Returns the scheduler status.\n" + "\n" + "Example Requests:\n" + "\n"
|
||||||
+ "scheduler")
|
+ "scheduler")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = SchedulerApiResourceSwagger.GetSchedulerResponse.class) })
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SchedulerApiResourceSwagger.GetSchedulerResponse.class))) })
|
||||||
public String retrieveStatus(@Context final UriInfo uriInfo) {
|
public String retrieveStatus(@Context final UriInfo uriInfo) {
|
||||||
this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME);
|
||||||
final boolean isSchedulerRunning = this.jobRegisterService.isSchedulerRunning();
|
final boolean isSchedulerRunning = this.jobRegisterService.isSchedulerRunning();
|
||||||
@@ -85,10 +86,11 @@ public class SchedulerApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Activate Scheduler Jobs | Suspend Scheduler Jobs", notes = "Activates the scheduler job service. | Suspends the scheduler job service.")
|
@Operation(summary = "Activate Scheduler Jobs | Suspend Scheduler Jobs", description = "Activates the scheduler job service. | Suspends the scheduler job service.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "POST : scheduler?command=start\n\n" + "\n" + "POST : scheduler?command=stop") })
|
@ApiResponses({ @ApiResponse(responseCode = "200", description = "POST : scheduler?command=start\n\n" + "\n"
|
||||||
|
+ "POST : scheduler?command=stop") })
|
||||||
public Response changeSchedulerStatus(
|
public Response changeSchedulerStatus(
|
||||||
@QueryParam(SchedulerJobApiConstants.COMMAND) @ApiParam(value = "command") final String commandParam) {
|
@QueryParam(SchedulerJobApiConstants.COMMAND) @Parameter(description = "command") final String commandParam) {
|
||||||
// check the logged in user have permissions to update scheduler status
|
// check the logged in user have permissions to update scheduler status
|
||||||
final boolean hasNotPermission = this.context.authenticatedUser().hasNotPermissionForAnyOf("ALL_FUNCTIONS", "UPDATE_SCHEDULER");
|
final boolean hasNotPermission = this.context.authenticatedUser().hasNotPermissionForAnyOf("ALL_FUNCTIONS", "UPDATE_SCHEDULER");
|
||||||
if (hasNotPermission) {
|
if (hasNotPermission) {
|
||||||
|
|||||||
+3
-4
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.jobs.api;
|
package org.apache.fineract.infrastructure.jobs.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sanyam on 12/8/17.
|
* Created by sanyam on 12/8/17.
|
||||||
@@ -30,14 +29,14 @@ final class SchedulerApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetSchedulerResponse")
|
@Schema(description = "GetSchedulerResponse")
|
||||||
public static final class GetSchedulerResponse {
|
public static final class GetSchedulerResponse {
|
||||||
|
|
||||||
private GetSchedulerResponse() {
|
private GetSchedulerResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean active;
|
public boolean active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+33
-34
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.jobs.api;
|
package org.apache.fineract.infrastructure.jobs.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -64,9 +64,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Component
|
@Component
|
||||||
@Api(tags = { "MIFOSX-BATCH JOBS" })
|
@Tag(name = "MIFOSX-BATCH JOBS", description = "Batch jobs (also known as cron jobs on Unix-based systems) are a series of back-end jobs executed on a computer at a particular time defined in job's cron expression.\n\n At any point, you can view the list of batch jobs scheduled to run along with other details specific to each job. Manually you can execute the jobs at any point of time.\n\n The scheduler status can be either \"Active\" or \"Standby\". If the scheduler status is Active, it indicates that all batch jobs are running/ will run as per the specified schedule.If the scheduler status is Standby, it will ensure all scheduled batch runs are suspended.")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "MIFOSX-BATCH JOBS", description = "Batch jobs (also known as cron jobs on Unix-based systems) are a series of back-end jobs executed on a computer at a particular time defined in job's cron expression.\n\n At any point, you can view the list of batch jobs scheduled to run along with other details specific to each job. Manually you can execute the jobs at any point of time.\n\n The scheduler status can be either \"Active\" or \"Standby\". If the scheduler status is Active, it indicates that all batch jobs are running/ will run as per the specified schedule.If the scheduler status is Standby, it will ensure all scheduled batch runs are suspended.") })
|
|
||||||
public class SchedulerJobApiResource {
|
public class SchedulerJobApiResource {
|
||||||
|
|
||||||
private final SchedulerJobRunnerReadService schedulerJobRunnerReadService;
|
private final SchedulerJobRunnerReadService schedulerJobRunnerReadService;
|
||||||
@@ -93,9 +91,10 @@ public class SchedulerJobApiResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@ApiOperation(value = "Retrieve Scheduler Jobs", notes = "Returns the list of jobs.\n" + "\n" + "Example Requests:\n" + "\n" + "jobs")
|
@Operation(summary = "Retrieve Scheduler Jobs", description = "Returns the list of jobs.\n" + "\n" + "Example Requests:\n" + "\n"
|
||||||
|
+ "jobs")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = SchedulerJobApiResourceSwagger.GetJobsResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SchedulerJobApiResourceSwagger.GetJobsResponse.class)))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo) {
|
public String retrieveAll(@Context final UriInfo uriInfo) {
|
||||||
this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME);
|
||||||
final List<JobDetailData> jobDetailDatas = this.schedulerJobRunnerReadService.findAllJobDeatils();
|
final List<JobDetailData> jobDetailDatas = this.schedulerJobRunnerReadService.findAllJobDeatils();
|
||||||
@@ -105,9 +104,10 @@ public class SchedulerJobApiResource {
|
|||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("{" + SchedulerJobApiConstants.JOB_ID + "}")
|
@Path("{" + SchedulerJobApiConstants.JOB_ID + "}")
|
||||||
@ApiOperation(value = "Retrieve a Job", notes = "Returns the details of a Job.\n" + "\n" + "Example Requests:\n" + "\n" + "jobs/5")
|
@Operation(summary = "Retrieve a Job", description = "Returns the details of a Job.\n" + "\n" + "Example Requests:\n" + "\n" + "jobs/5")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = SchedulerJobApiResourceSwagger.GetJobsResponse.class) })
|
@ApiResponses({
|
||||||
public String retrieveOne(@PathParam(SchedulerJobApiConstants.JOB_ID) @ApiParam(value = "jobId") final Long jobId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SchedulerJobApiResourceSwagger.GetJobsResponse.class))) })
|
||||||
|
public String retrieveOne(@PathParam(SchedulerJobApiConstants.JOB_ID) @Parameter(description = "jobId") final Long jobId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME);
|
||||||
final JobDetailData jobDetailData = this.schedulerJobRunnerReadService.retrieveOne(jobId);
|
final JobDetailData jobDetailData = this.schedulerJobRunnerReadService.retrieveOne(jobId);
|
||||||
@@ -117,15 +117,15 @@ public class SchedulerJobApiResource {
|
|||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("{" + SchedulerJobApiConstants.JOB_ID + "}/" + SchedulerJobApiConstants.JOB_RUN_HISTORY)
|
@Path("{" + SchedulerJobApiConstants.JOB_ID + "}/" + SchedulerJobApiConstants.JOB_RUN_HISTORY)
|
||||||
@ApiOperation(value = "Retrieve Job Run History", notes = "Example Requests:\n" + "\n" + "jobs/5/runhistory?offset=0&limit=200")
|
@Operation(summary = "Retrieve Job Run History", description = "Example Requests:\n" + "\n" + "jobs/5/runhistory?offset=0&limit=200")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = SchedulerJobApiResourceSwagger.GetJobsJobIDJobRunHistoryResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SchedulerJobApiResourceSwagger.GetJobsJobIDJobRunHistoryResponse.class))) })
|
||||||
public String retrieveHistory(@Context final UriInfo uriInfo,
|
public String retrieveHistory(@Context final UriInfo uriInfo,
|
||||||
@PathParam(SchedulerJobApiConstants.JOB_ID) @ApiParam(value = "jobId") final Long jobId,
|
@PathParam(SchedulerJobApiConstants.JOB_ID) @Parameter(description = "jobId") final Long jobId,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) {
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) {
|
||||||
this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME);
|
||||||
final SearchParameters searchParameters = SearchParameters.forPagination(offset, limit, orderBy, sortOrder);
|
final SearchParameters searchParameters = SearchParameters.forPagination(offset, limit, orderBy, sortOrder);
|
||||||
final Page<JobDetailHistoryData> jobhistoryDetailData = this.schedulerJobRunnerReadService.retrieveJobHistory(jobId,
|
final Page<JobDetailHistoryData> jobhistoryDetailData = this.schedulerJobRunnerReadService.retrieveJobHistory(jobId,
|
||||||
@@ -137,10 +137,10 @@ public class SchedulerJobApiResource {
|
|||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("{" + SchedulerJobApiConstants.JOB_ID + "}")
|
@Path("{" + SchedulerJobApiConstants.JOB_ID + "}")
|
||||||
@ApiOperation(value = "Run a Job", notes = "Manually Execute Specific Job.")
|
@Operation(summary = "Run a Job", description = "Manually Execute Specific Job.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "POST: jobs/1?command=executeJob") })
|
@ApiResponses({ @ApiResponse(responseCode = "200", description = "POST: jobs/1?command=executeJob") })
|
||||||
public Response executeJob(@PathParam(SchedulerJobApiConstants.JOB_ID) @ApiParam(value = "jobId") final Long jobId,
|
public Response executeJob(@PathParam(SchedulerJobApiConstants.JOB_ID) @Parameter(description = "jobId") final Long jobId,
|
||||||
@QueryParam(SchedulerJobApiConstants.COMMAND) @ApiParam(value = "command") final String commandParam) {
|
@QueryParam(SchedulerJobApiConstants.COMMAND) @Parameter(description = "command") final String commandParam) {
|
||||||
// check the logged in user have permissions to execute scheduler jobs
|
// check the logged in user have permissions to execute scheduler jobs
|
||||||
final boolean hasNotPermission = this.context.authenticatedUser().hasNotPermissionForAnyOf("ALL_FUNCTIONS", "EXECUTEJOB_SCHEDULER");
|
final boolean hasNotPermission = this.context.authenticatedUser().hasNotPermissionForAnyOf("ALL_FUNCTIONS", "EXECUTEJOB_SCHEDULER");
|
||||||
if (hasNotPermission) {
|
if (hasNotPermission) {
|
||||||
@@ -159,12 +159,11 @@ public class SchedulerJobApiResource {
|
|||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
@Path("{" + SchedulerJobApiConstants.JOB_ID + "}")
|
@Path("{" + SchedulerJobApiConstants.JOB_ID + "}")
|
||||||
@ApiOperation(value = "Update a Job", notes = "Updates the details of a job.")
|
@Operation(summary = "Update a Job", description = "Updates the details of a job.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = SchedulerJobApiResourceSwagger.PutJobsJobIDRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SchedulerJobApiResourceSwagger.PutJobsJobIDRequest.class) })
|
@ApiResponses({ @ApiResponse(responseCode = "200", description = "") })
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "") })
|
public String updateJobDetail(@PathParam(SchedulerJobApiConstants.JOB_ID) @Parameter(description = "jobId") final Long jobId,
|
||||||
public String updateJobDetail(@PathParam(SchedulerJobApiConstants.JOB_ID) @ApiParam(value = "jobId") final Long jobId,
|
@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
@ApiParam(hidden = true) final String jsonRequestBody) {
|
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.updateJobDetail(jobId) //
|
.updateJobDetail(jobId) //
|
||||||
|
|||||||
+20
-21
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.jobs.api;
|
package org.apache.fineract.infrastructure.jobs.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.jobs.data.JobDetailHistoryData;
|
import org.apache.fineract.infrastructure.jobs.data.JobDetailHistoryData;
|
||||||
@@ -33,47 +32,47 @@ final class SchedulerJobApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetJobsResponse")
|
@Schema(description = "GetJobsResponse")
|
||||||
public static final class GetJobsResponse {
|
public static final class GetJobsResponse {
|
||||||
|
|
||||||
private GetJobsResponse() {
|
private GetJobsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long jobId;
|
public Long jobId;
|
||||||
@ApiModelProperty(example = "Update loan Summary")
|
@Schema(example = "Update loan Summary")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public Date nextRunTime;
|
public Date nextRunTime;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String initializingError;
|
public String initializingError;
|
||||||
@ApiModelProperty(example = "0 0 22 1/1 * ? *")
|
@Schema(example = "0 0 22 1/1 * ? *")
|
||||||
public String cronExpression;
|
public String cronExpression;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public boolean active;
|
public boolean active;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public boolean currentlyRunning;
|
public boolean currentlyRunning;
|
||||||
public JobDetailHistoryData lastRunHistory;
|
public JobDetailHistoryData lastRunHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutJobsJobsIDRequest")
|
@Schema(description = "PutJobsJobsIDRequest")
|
||||||
public static final class PutJobsJobIDRequest {
|
public static final class PutJobsJobIDRequest {
|
||||||
|
|
||||||
private PutJobsJobIDRequest() {
|
private PutJobsJobIDRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Update loan Summary")
|
@Schema(example = "Update loan Summary")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "0 0 22 1/1 * ? *")
|
@Schema(example = "0 0 22 1/1 * ? *")
|
||||||
public String cronExpression;
|
public String cronExpression;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public boolean active;
|
public boolean active;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetJobsJobIDJobRunHistoryResponse")
|
@Schema(description = "GetJobsJobIDJobRunHistoryResponse")
|
||||||
public static final class GetJobsJobIDJobRunHistoryResponse {
|
public static final class GetJobsJobIDJobRunHistoryResponse {
|
||||||
|
|
||||||
private GetJobsJobIDJobRunHistoryResponse() {
|
private GetJobsJobIDJobRunHistoryResponse() {
|
||||||
@@ -84,19 +83,19 @@ final class SchedulerJobApiResourceSwagger {
|
|||||||
|
|
||||||
private JobDetailHistoryDataSwagger() {}
|
private JobDetailHistoryDataSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long version;
|
public Long version;
|
||||||
@ApiModelProperty(example = "Jul 16, 2013 12:00:00 PM")
|
@Schema(example = "Jul 16, 2013 12:00:00 PM")
|
||||||
public Date jobRunStartTime;
|
public Date jobRunStartTime;
|
||||||
@ApiModelProperty(example = "Jul 16, 2013 12:00:00 PM")
|
@Schema(example = "Jul 16, 2013 12:00:00 PM")
|
||||||
public Date jobRunEndTime;
|
public Date jobRunEndTime;
|
||||||
@ApiModelProperty(example = "success")
|
@Schema(example = "success")
|
||||||
public String status;
|
public String status;
|
||||||
@ApiModelProperty(example = "cron")
|
@Schema(example = "cron")
|
||||||
public String triggerType;
|
public String triggerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "8")
|
@Schema(example = "8")
|
||||||
public int totalFilteredRecords;
|
public int totalFilteredRecords;
|
||||||
public List<JobDetailHistoryDataSwagger> pageItems;
|
public List<JobDetailHistoryDataSwagger> pageItems;
|
||||||
|
|
||||||
|
|||||||
+36
-41
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.reportmailingjob.api;
|
package org.apache.fineract.infrastructure.reportmailingjob.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -59,9 +59,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/" + ReportMailingJobConstants.REPORT_MAILING_JOB_RESOURCE_NAME)
|
@Path("/" + ReportMailingJobConstants.REPORT_MAILING_JOB_RESOURCE_NAME)
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Report Mailing Jobs" })
|
@Tag(name = "Report Mailing Jobs", description = "This resource allows you to create a scheduled job that runs a report and sents it by email to specified email addresses.\n\nThe scheduled job can be configured to run once or on a regular basis (once a day, twice a week, etc)")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Report Mailing Jobs", description = "This resource allows you to create a scheduled job that runs a report and sents it by email to specified email addresses.\n\nThe scheduled job can be configured to run once or on a regular basis (once a day, twice a week, etc)") })
|
|
||||||
public class ReportMailingJobApiResource {
|
public class ReportMailingJobApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext platformSecurityContext;
|
private final PlatformSecurityContext platformSecurityContext;
|
||||||
@@ -86,14 +84,13 @@ public class ReportMailingJobApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a Report Mailing Job", notes = "Mandatory Fields: "
|
@Operation(summary = "Create a Report Mailing Job", description = "Mandatory Fields: "
|
||||||
+ "name, startDateTime, stretchyReportId, emailRecipients, emailSubject, emailMessage, emailAttachmentFileFormatId, recurrence, isActive\n"
|
+ "name, startDateTime, stretchyReportId, emailRecipients, emailSubject, emailMessage, emailAttachmentFileFormatId, recurrence, isActive\n"
|
||||||
+ "\n" + "Optional Fields: " + "description, stretchyReportParamMap")
|
+ "\n" + "Optional Fields: " + "description, stretchyReportParamMap")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.PostReportMailingJobsRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportMailingJobApiResourceSwagger.PostReportMailingJobsRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.PostReportMailingJobsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.PostReportMailingJobsResponse.class))) })
|
||||||
public String createReportMailingJob(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createReportMailingJob(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
final CommandWrapper commandWrapper = new CommandWrapperBuilder()
|
final CommandWrapper commandWrapper = new CommandWrapperBuilder()
|
||||||
.createReportMailingJob(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME).withJson(apiRequestBodyAsJson).build();
|
.createReportMailingJob(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME).withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -106,13 +103,12 @@ public class ReportMailingJobApiResource {
|
|||||||
@Path("{entityId}")
|
@Path("{entityId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Report Mailing Job\n", notes = "")
|
@Operation(summary = "Update a Report Mailing Job\n", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.PutReportMailingJobsRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportMailingJobApiResourceSwagger.PutReportMailingJobsRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.PutReportMailingJobsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.PutReportMailingJobsResponse.class))) })
|
||||||
public String updateReportMailingJob(@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId,
|
public String updateReportMailingJob(@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
final CommandWrapper commandWrapper = new CommandWrapperBuilder()
|
final CommandWrapper commandWrapper = new CommandWrapperBuilder()
|
||||||
.updateReportMailingJob(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME, entityId).withJson(apiRequestBodyAsJson)
|
.updateReportMailingJob(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME, entityId).withJson(apiRequestBodyAsJson)
|
||||||
.build();
|
.build();
|
||||||
@@ -126,13 +122,12 @@ public class ReportMailingJobApiResource {
|
|||||||
@Path("{entityId}")
|
@Path("{entityId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete a Report Mailing Job", notes = "")
|
@Operation(summary = "Delete a Report Mailing Job", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.DeleteReportMailingJobsRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportMailingJobApiResourceSwagger.DeleteReportMailingJobsRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.DeleteReportMailingJobsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.DeleteReportMailingJobsResponse.class))) })
|
||||||
public String deleteReportMailingJob(@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId,
|
public String deleteReportMailingJob(@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
final CommandWrapper commandWrapper = new CommandWrapperBuilder()
|
final CommandWrapper commandWrapper = new CommandWrapperBuilder()
|
||||||
.deleteReportMailingJob(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME, entityId).withJson(apiRequestBodyAsJson)
|
.deleteReportMailingJob(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME, entityId).withJson(apiRequestBodyAsJson)
|
||||||
.build();
|
.build();
|
||||||
@@ -146,11 +141,11 @@ public class ReportMailingJobApiResource {
|
|||||||
@Path("{entityId}")
|
@Path("{entityId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a Report Mailing Job", notes = "Example Requests:\n" + "\n" + "reportmailingjobs/1\n" + "\n" + "\n"
|
@Operation(summary = "Retrieve a Report Mailing Job", description = "Example Requests:\n" + "\n" + "reportmailingjobs/1\n" + "\n" + "\n"
|
||||||
+ "reportmailingjobs/1?template=true")
|
+ "reportmailingjobs/1?template=true")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.GetReportMailingJobsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.GetReportMailingJobsResponse.class))) })
|
||||||
public String retrieveReportMailingJob(@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId,
|
public String retrieveReportMailingJob(@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
this.platformSecurityContext.authenticatedUser()
|
this.platformSecurityContext.authenticatedUser()
|
||||||
.validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME);
|
.validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME);
|
||||||
@@ -172,10 +167,10 @@ public class ReportMailingJobApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Report Mailing Job Details Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for report mailing job applications. The template data returned consists of any or all of:\n"
|
@Operation(summary = "Retrieve Report Mailing Job Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for report mailing job applications. The template data returned consists of any or all of:\n"
|
||||||
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "reportmailingjobs/template")
|
+ "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "reportmailingjobs/template")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.GetReportMailingJobsTemplate.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.GetReportMailingJobsTemplate.class))) })
|
||||||
public String retrieveReportMailingJobTemplate(@Context final UriInfo uriInfo) {
|
public String retrieveReportMailingJobTemplate(@Context final UriInfo uriInfo) {
|
||||||
this.platformSecurityContext.authenticatedUser()
|
this.platformSecurityContext.authenticatedUser()
|
||||||
.validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME);
|
.validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME);
|
||||||
@@ -191,14 +186,14 @@ public class ReportMailingJobApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Report Mailing Jobs", notes = "Example Requests:\n" + "\n" + "reportmailingjobs")
|
@Operation(summary = "List Report Mailing Jobs", description = "Example Requests:\n" + "\n" + "reportmailingjobs")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.GetReportMailingJobsResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.GetReportMailingJobsResponse.class)))) })
|
||||||
public String retrieveAllReportMailingJobs(@Context final UriInfo uriInfo,
|
public String retrieveAllReportMailingJobs(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) {
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) {
|
||||||
this.platformSecurityContext.authenticatedUser()
|
this.platformSecurityContext.authenticatedUser()
|
||||||
.validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME);
|
.validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME);
|
||||||
|
|
||||||
|
|||||||
+44
-45
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.reportmailingjob.api;
|
package org.apache.fineract.infrastructure.reportmailingjob.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.data.ReportData;
|
import org.apache.fineract.infrastructure.dataqueries.data.ReportData;
|
||||||
@@ -35,120 +34,120 @@ final class ReportMailingJobApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetReportMailingJobsTemplate")
|
@Schema(description = "GetReportMailingJobsTemplate")
|
||||||
public static final class GetReportMailingJobsTemplate {
|
public static final class GetReportMailingJobsTemplate {
|
||||||
|
|
||||||
private GetReportMailingJobsTemplate() {
|
private GetReportMailingJobsTemplate() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean isActive;
|
public boolean isActive;
|
||||||
public List<EnumOptionData> emailAttachmentFileFormatOptions;
|
public List<EnumOptionData> emailAttachmentFileFormatOptions;
|
||||||
public List<EnumOptionData> stretchyReportParamDateOptions;
|
public List<EnumOptionData> stretchyReportParamDateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetReportMailingJobsResponse")
|
@Schema(description = "GetReportMailingJobsResponse")
|
||||||
public static final class GetReportMailingJobsResponse {
|
public static final class GetReportMailingJobsResponse {
|
||||||
|
|
||||||
private GetReportMailingJobsResponse() {
|
private GetReportMailingJobsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Client Numbers Report")
|
@Schema(example = "Client Numbers Report")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Client Numbers Report")
|
@Schema(example = "Client Numbers Report")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "1469627093000")
|
@Schema(example = "1469627093000")
|
||||||
public DateTime startDateTime;
|
public DateTime startDateTime;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String recurrence;
|
public String recurrence;
|
||||||
public ReportMailingJobTimelineData timeline;
|
public ReportMailingJobTimelineData timeline;
|
||||||
@ApiModelProperty(example = "info@musonisystem.com")
|
@Schema(example = "info@musonisystem.com")
|
||||||
public String emailRecipients;
|
public String emailRecipients;
|
||||||
@ApiModelProperty(example = "Client Numbers Report")
|
@Schema(example = "Client Numbers Report")
|
||||||
public String emailSubject;
|
public String emailSubject;
|
||||||
@ApiModelProperty(example = "Client Numbers Report")
|
@Schema(example = "Client Numbers Report")
|
||||||
public String emailMessage;
|
public String emailMessage;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public EnumOptionData emailAttachmentFileFormat;
|
public EnumOptionData emailAttachmentFileFormat;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public ReportData stretchyReport;
|
public ReportData stretchyReport;
|
||||||
@ApiModelProperty(example = "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}")
|
@Schema(example = "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}")
|
||||||
public String stretchyReportParamMap;
|
public String stretchyReportParamMap;
|
||||||
@ApiModelProperty(example = "1469627093000")
|
@Schema(example = "1469627093000")
|
||||||
public DateTime nextRunDateTime;
|
public DateTime nextRunDateTime;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer numberOfRuns;
|
public Integer numberOfRuns;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean isActive;
|
public boolean isActive;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long runAsUserId;
|
public Long runAsUserId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostReportMailingJobsRequest")
|
@Schema(description = "PostReportMailingJobsRequest")
|
||||||
public static final class PostReportMailingJobsRequest {
|
public static final class PostReportMailingJobsRequest {
|
||||||
|
|
||||||
private PostReportMailingJobsRequest() {
|
private PostReportMailingJobsRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "en_GB")
|
@Schema(example = "en_GB")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy HH:mm:ss")
|
@Schema(example = "dd-MM-yyyy HH:mm:ss")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "Client Numbers Report")
|
@Schema(example = "Client Numbers Report")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Client Numbers Report")
|
@Schema(example = "Client Numbers Report")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "1469627093000")
|
@Schema(example = "1469627093000")
|
||||||
public DateTime startDateTime;
|
public DateTime startDateTime;
|
||||||
@ApiModelProperty(example = "120")
|
@Schema(example = "120")
|
||||||
public Long stretchyReportId;
|
public Long stretchyReportId;
|
||||||
@ApiModelProperty(example = "info@musonisystem.com")
|
@Schema(example = "info@musonisystem.com")
|
||||||
public String emailRecipients;
|
public String emailRecipients;
|
||||||
@ApiModelProperty(example = "Client Numbers Report")
|
@Schema(example = "Client Numbers Report")
|
||||||
public String emailSubject;
|
public String emailSubject;
|
||||||
@ApiModelProperty(example = "Client Numbers Report")
|
@Schema(example = "Client Numbers Report")
|
||||||
public String emailMessage;
|
public String emailMessage;
|
||||||
@ApiModelProperty(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR")
|
@Schema(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR")
|
||||||
public String recurrence;
|
public String recurrence;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean isActive;
|
public boolean isActive;
|
||||||
@ApiModelProperty(example = "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}")
|
@Schema(example = "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}")
|
||||||
public String stretchyReportParamMap;
|
public String stretchyReportParamMap;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostReportMailingJobsResponse")
|
@Schema(description = "PostReportMailingJobsResponse")
|
||||||
public static final class PostReportMailingJobsResponse {
|
public static final class PostReportMailingJobsResponse {
|
||||||
|
|
||||||
private PostReportMailingJobsResponse() {
|
private PostReportMailingJobsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutReportMailingJobsRequest")
|
@Schema(description = "PutReportMailingJobsRequest")
|
||||||
public static final class PutReportMailingJobsRequest {
|
public static final class PutReportMailingJobsRequest {
|
||||||
|
|
||||||
private PutReportMailingJobsRequest() {
|
private PutReportMailingJobsRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "en_GB")
|
@Schema(example = "en_GB")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy HH:mm:ss")
|
@Schema(example = "dd-MM-yyyy HH:mm:ss")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "10-08-2016 23:30:00")
|
@Schema(example = "10-08-2016 23:30:00")
|
||||||
public DateTime startDateTime;
|
public DateTime startDateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutReportMailingJobsResponse")
|
@Schema(description = "PutReportMailingJobsResponse")
|
||||||
public static final class PutReportMailingJobsResponse {
|
public static final class PutReportMailingJobsResponse {
|
||||||
|
|
||||||
private PutReportMailingJobsResponse() {
|
private PutReportMailingJobsResponse() {
|
||||||
@@ -159,16 +158,16 @@ final class ReportMailingJobApiResourceSwagger {
|
|||||||
|
|
||||||
private PutReportMailingJobsResponseChanges() {}
|
private PutReportMailingJobsResponseChanges() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "10-08-2016 23:30:00")
|
@Schema(example = "10-08-2016 23:30:00")
|
||||||
public DateTime startDateTime;
|
public DateTime startDateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutReportMailingJobsResponseChanges changes;
|
public PutReportMailingJobsResponseChanges changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteReportMailingJobsRequest ")
|
@Schema(description = "DeleteReportMailingJobsRequest ")
|
||||||
public static final class DeleteReportMailingJobsRequest {
|
public static final class DeleteReportMailingJobsRequest {
|
||||||
|
|
||||||
private DeleteReportMailingJobsRequest() {
|
private DeleteReportMailingJobsRequest() {
|
||||||
@@ -176,14 +175,14 @@ final class ReportMailingJobApiResourceSwagger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteReportMailingJobsResponse")
|
@Schema(description = "DeleteReportMailingJobsResponse")
|
||||||
public static final class DeleteReportMailingJobsResponse {
|
public static final class DeleteReportMailingJobsResponse {
|
||||||
|
|
||||||
private DeleteReportMailingJobsResponse() {
|
private DeleteReportMailingJobsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-16
@@ -18,13 +18,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.reportmailingjob.api;
|
package org.apache.fineract.infrastructure.reportmailingjob.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
@@ -47,8 +47,8 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
@Path("/" + ReportMailingJobConstants.REPORT_MAILING_JOB_RUN_HISTORY_RESOURCE_NAME)
|
@Path("/" + ReportMailingJobConstants.REPORT_MAILING_JOB_RUN_HISTORY_RESOURCE_NAME)
|
||||||
@Component
|
@Component
|
||||||
@Api(tags = { "List Report Mailing Job History" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "List Report Mailing Job History", description = "") })
|
@Tag(name = "List Report Mailing Job History", description = "")
|
||||||
public class ReportMailingJobRunHistoryApiResource {
|
public class ReportMailingJobRunHistoryApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext platformSecurityContext;
|
private final PlatformSecurityContext platformSecurityContext;
|
||||||
@@ -70,15 +70,16 @@ public class ReportMailingJobRunHistoryApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Report Mailing Job History", notes = "The list capability of report mailing job history can support pagination and sorting.\n"
|
@Operation(summary = "List Report Mailing Job History", description = "The list capability of report mailing job history can support pagination and sorting.\n"
|
||||||
+ "\n" + "Example Requests:\n" + "\n" + "reportmailingjobrunhistory/1")
|
+ "\n" + "Example Requests:\n" + "\n" + "reportmailingjobrunhistory/1")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportMailingJobRunHistoryData.class) })
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobRunHistoryData.class))) })
|
||||||
public String retrieveAllByReportMailingJobId(@Context final UriInfo uriInfo,
|
public String retrieveAllByReportMailingJobId(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("reportMailingJobId") @ApiParam(value = "reportMailingJobId") final Long reportMailingJobId,
|
@QueryParam("reportMailingJobId") @Parameter(description = "reportMailingJobId") final Long reportMailingJobId,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) {
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) {
|
||||||
this.platformSecurityContext.authenticatedUser()
|
this.platformSecurityContext.authenticatedUser()
|
||||||
.validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME);
|
.validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME);
|
||||||
final SearchParameters searchParameters = SearchParameters.fromReportMailingJobRunHistory(offset, limit, orderBy, sortOrder);
|
final SearchParameters searchParameters = SearchParameters.fromReportMailingJobRunHistory(offset, limit, orderBy, sortOrder);
|
||||||
|
|||||||
+9
-10
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.reportmailingjob.api;
|
package org.apache.fineract.infrastructure.reportmailingjob.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,26 +30,26 @@ final class ReportMailingJobRunHistoryApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetReportMailingJobRunHistoryResponse")
|
@Schema(description = "GetReportMailingJobRunHistoryResponse")
|
||||||
public static final class GetReportMailingJobRunHistoryResponse {
|
public static final class GetReportMailingJobRunHistoryResponse {
|
||||||
|
|
||||||
private GetReportMailingJobRunHistoryResponse() {
|
private GetReportMailingJobRunHistoryResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long reportMailingJobId;
|
public Long reportMailingJobId;
|
||||||
@ApiModelProperty(example = "1469627093050")
|
@Schema(example = "1469627093050")
|
||||||
public DateTime startDateTime;
|
public DateTime startDateTime;
|
||||||
@ApiModelProperty(example = "1469627093050")
|
@Schema(example = "1469627093050")
|
||||||
public DateTime endDateTime;
|
public DateTime endDateTime;
|
||||||
@ApiModelProperty(example = "success")
|
@Schema(example = "success")
|
||||||
public String status;
|
public String status;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String errorMessage;
|
public String errorMessage;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String errorLog;
|
public String errorLog;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-12
@@ -20,12 +20,12 @@ package org.apache.fineract.infrastructure.security.api;
|
|||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.sun.jersey.core.util.Base64;
|
import com.sun.jersey.core.util.Base64;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -58,9 +58,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Profile("basicauth")
|
@Profile("basicauth")
|
||||||
@Path("/authentication")
|
@Path("/authentication")
|
||||||
@Api(tags = { "Authentication HTTP Basic" })
|
@Tag(name = "Authentication HTTP Basic", description = "An API capability that allows client applications to verify authentication details using HTTP Basic Authentication.")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Authentication HTTP Basic", description = "An API capability that allows client applications to verify authentication details using HTTP Basic Authentication.") })
|
|
||||||
public class AuthenticationApiResource {
|
public class AuthenticationApiResource {
|
||||||
|
|
||||||
public static class AuthenticateRequest {
|
public static class AuthenticateRequest {
|
||||||
@@ -88,9 +86,10 @@ public class AuthenticationApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Verify authentication", notes = "Authenticates the credentials provided and returns the set roles and permissions allowed.")
|
@Operation(summary = "Verify authentication", description = "Authenticates the credentials provided and returns the set roles and permissions allowed.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = AuthenticationApiResourceSwagger.PostAuthenticationResponse.class),
|
@ApiResponses({
|
||||||
@ApiResponse(code = 400, message = "Unauthenticated. Please login") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AuthenticationApiResourceSwagger.PostAuthenticationResponse.class))),
|
||||||
|
@ApiResponse(responseCode = "400", description = "Unauthenticated. Please login") })
|
||||||
public String authenticate(final String apiRequestBodyAsJson) {
|
public String authenticate(final String apiRequestBodyAsJson) {
|
||||||
// TODO FINERACT-819: sort out Jersey so JSON conversion does not have
|
// TODO FINERACT-819: sort out Jersey so JSON conversion does not have
|
||||||
// to be done explicitly via GSON here, but implicit by arg
|
// to be done explicitly via GSON here, but implicit by arg
|
||||||
|
|||||||
+11
-12
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.security.api;
|
package org.apache.fineract.infrastructure.security.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
import org.apache.fineract.useradministration.data.RoleData;
|
import org.apache.fineract.useradministration.data.RoleData;
|
||||||
@@ -33,32 +32,32 @@ final class AuthenticationApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAuthenticationResponse")
|
@Schema(description = "PostAuthenticationResponse")
|
||||||
public static final class PostAuthenticationResponse {
|
public static final class PostAuthenticationResponse {
|
||||||
|
|
||||||
private PostAuthenticationResponse() {
|
private PostAuthenticationResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String username;
|
public String username;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long userId;
|
public Long userId;
|
||||||
@ApiModelProperty(example = "bWlmb3M6cGFzc3dvcmQ=")
|
@Schema(example = "bWlmb3M6cGFzc3dvcmQ=")
|
||||||
public String base64EncodedAuthenticationKey;
|
public String base64EncodedAuthenticationKey;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean authenticated;
|
public boolean authenticated;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long staffId;
|
public Long staffId;
|
||||||
@ApiModelProperty(example = "Director, Program")
|
@Schema(example = "Director, Program")
|
||||||
public String staffDisplayName;
|
public String staffDisplayName;
|
||||||
public EnumOptionData organisationalRole;
|
public EnumOptionData organisationalRole;
|
||||||
public Collection<RoleData> roles;
|
public Collection<RoleData> roles;
|
||||||
@ApiModelProperty(example = "ALL_FUNCTIONS")
|
@Schema(example = "ALL_FUNCTIONS")
|
||||||
public Collection<String> permissions;
|
public Collection<String> permissions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-12
@@ -18,13 +18,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.security.api;
|
package org.apache.fineract.infrastructure.security.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -58,8 +58,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Component
|
@Component
|
||||||
@Profile("oauth")
|
@Profile("oauth")
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Fetch authenticated user details" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Fetch authenticated user details", description = "") })
|
@Tag(name = "Fetch authenticated user details", description = "")
|
||||||
@SuppressWarnings("deprecation") // TODO FINERACT-1012
|
@SuppressWarnings("deprecation") // TODO FINERACT-1012
|
||||||
public class UserDetailsApiResource {
|
public class UserDetailsApiResource {
|
||||||
|
|
||||||
@@ -80,9 +80,11 @@ public class UserDetailsApiResource {
|
|||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Fetch authenticated user details\n", notes = "checks the Authentication and returns the set roles and permissions allowed.")
|
@Operation(summary = "Fetch authenticated user details\n", description = "checks the Authentication and returns the set roles and permissions allowed.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = UserDetailsApiResourceSwagger.GetUserDetailsResponse.class) })
|
@ApiResponses({
|
||||||
public String fetchAuthenticatedUserData(@QueryParam("access_token") @ApiParam(value = "access_token") final String accessToken) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = UserDetailsApiResourceSwagger.GetUserDetailsResponse.class))) })
|
||||||
|
public String fetchAuthenticatedUserData(
|
||||||
|
@QueryParam("access_token") @Parameter(description = "access_token") final String accessToken) {
|
||||||
|
|
||||||
final Authentication authentication = this.tokenServices.loadAuthentication(accessToken);
|
final Authentication authentication = this.tokenServices.loadAuthentication(accessToken);
|
||||||
if (authentication.isAuthenticated()) {
|
if (authentication.isAuthenticated()) {
|
||||||
|
|||||||
+11
-12
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.security.api;
|
package org.apache.fineract.infrastructure.security.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
import org.apache.fineract.useradministration.data.RoleData;
|
import org.apache.fineract.useradministration.data.RoleData;
|
||||||
@@ -33,32 +32,32 @@ final class UserDetailsApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetUserDetailsResponse")
|
@Schema(description = "GetUserDetailsResponse")
|
||||||
public static final class GetUserDetailsResponse {
|
public static final class GetUserDetailsResponse {
|
||||||
|
|
||||||
private GetUserDetailsResponse() {
|
private GetUserDetailsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String username;
|
public String username;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long userId;
|
public Long userId;
|
||||||
@ApiModelProperty(example = "bWlmb3M6cGFzc3dvcmQ=")
|
@Schema(example = "bWlmb3M6cGFzc3dvcmQ=")
|
||||||
public String accessToken;
|
public String accessToken;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public boolean authenticated;
|
public boolean authenticated;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long staffId;
|
public Long staffId;
|
||||||
@ApiModelProperty(example = "mifosStaffDisplayName")
|
@Schema(example = "mifosStaffDisplayName")
|
||||||
public String staffDisplayName;
|
public String staffDisplayName;
|
||||||
public EnumOptionData organisationalRole;
|
public EnumOptionData organisationalRole;
|
||||||
public Collection<RoleData> roles;
|
public Collection<RoleData> roles;
|
||||||
@ApiModelProperty(example = "ALL_FUNCTIONS")
|
@Schema(example = "ALL_FUNCTIONS")
|
||||||
public Collection<String> permissions;
|
public Collection<String> permissions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.sms.api;
|
package org.apache.fineract.infrastructure.sms.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
@@ -55,7 +54,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(value = "SMS", description = "")
|
|
||||||
public class SmsApiResource {
|
public class SmsApiResource {
|
||||||
|
|
||||||
private final String resourceNameForPermissions = "SMS";
|
private final String resourceNameForPermissions = "SMS";
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.survey.api;
|
package org.apache.fineract.infrastructure.survey.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -45,7 +44,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/likelihood")
|
@Path("/likelihood")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(value = "Likelihood")
|
|
||||||
public class LikelihoodApiResource {
|
public class LikelihoodApiResource {
|
||||||
|
|
||||||
private final DefaultToApiJsonSerializer<LikelihoodData> toApiJsonSerializer;
|
private final DefaultToApiJsonSerializer<LikelihoodData> toApiJsonSerializer;
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.survey.api;
|
package org.apache.fineract.infrastructure.survey.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
@@ -37,7 +36,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/povertyLine")
|
@Path("/povertyLine")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(value = "Poverty Line")
|
|
||||||
public class PovertyLineApiResource {
|
public class PovertyLineApiResource {
|
||||||
|
|
||||||
private final DefaultToApiJsonSerializer<PpiPovertyLineData> toApiJsonSerializer;
|
private final DefaultToApiJsonSerializer<PpiPovertyLineData> toApiJsonSerializer;
|
||||||
|
|||||||
+22
-20
@@ -18,13 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.survey.api;
|
package org.apache.fineract.infrastructure.survey.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
@@ -57,7 +58,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/survey")
|
@Path("/survey")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(value = "Survey", description = "")
|
|
||||||
public class SurveyApiResource {
|
public class SurveyApiResource {
|
||||||
|
|
||||||
private final DefaultToApiJsonSerializer<SurveyData> toApiJsonSerializer;
|
private final DefaultToApiJsonSerializer<SurveyData> toApiJsonSerializer;
|
||||||
@@ -84,9 +85,9 @@ public class SurveyApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve surveys", notes = "Retrieve surveys. This allows to retrieve the list of survey tables registered .")
|
@Operation(summary = "Retrieve surveys", description = "Retrieve surveys. This allows to retrieve the list of survey tables registered .")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = SurveyApiResourceSwagger.GetSurveyResponse.class, responseContainer = "List") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SurveyApiResourceSwagger.GetSurveyResponse.class)))) })
|
||||||
public String retrieveSurveys() {
|
public String retrieveSurveys() {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(SurveyApiConstants.SURVEY_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(SurveyApiConstants.SURVEY_RESOURCE_NAME);
|
||||||
@@ -99,9 +100,10 @@ public class SurveyApiResource {
|
|||||||
@Path("{surveyName}")
|
@Path("{surveyName}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve survey", notes = "Lists a registered survey table details and the Apache Fineract Core application table they are registered to.")
|
@Operation(summary = "Retrieve survey", description = "Lists a registered survey table details and the Apache Fineract Core application table they are registered to.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = SurveyApiResourceSwagger.GetSurveyResponse.class) })
|
@ApiResponses({
|
||||||
public String retrieveSurvey(@PathParam("surveyName") @ApiParam(value = "surveyName") final String surveyName) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.GetSurveyResponse.class))) })
|
||||||
|
public String retrieveSurvey(@PathParam("surveyName") @Parameter(description = "surveyName") final String surveyName) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(SurveyApiConstants.SURVEY_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(SurveyApiConstants.SURVEY_RESOURCE_NAME);
|
||||||
|
|
||||||
@@ -115,14 +117,14 @@ public class SurveyApiResource {
|
|||||||
@Path("{surveyName}/{apptableId}")
|
@Path("{surveyName}/{apptableId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create an entry in the survey table", notes = "Insert and entry in a survey table (full fill the survey)." + "\n"
|
@Operation(summary = "Create an entry in the survey table", description = "Insert and entry in a survey table (full fill the survey)."
|
||||||
+ "\n" + "Refer Link for sample Body: [ https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#survey_create ] ")
|
+ "\n" + "\n"
|
||||||
@ApiImplicitParams({
|
+ "Refer Link for sample Body: [ https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#survey_create ] ")
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdRequest.class) })
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdRequest.class)))
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdResponse.class))) })
|
||||||
public String createDatatableEntry(@PathParam("surveyName") @ApiParam(value = "surveyName") final String datatable,
|
public String createDatatableEntry(@PathParam("surveyName") @Parameter(description = "surveyName") final String datatable,
|
||||||
@PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId, final String apiRequestBodyAsJson) {
|
@PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId, final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.fullFilSurvey(datatable, apptableId) //
|
.fullFilSurvey(datatable, apptableId) //
|
||||||
|
|||||||
+23
-24
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.survey.api;
|
package org.apache.fineract.infrastructure.survey.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetColumnHeaderData;
|
import org.apache.fineract.infrastructure.dataqueries.data.ResultsetColumnHeaderData;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
@@ -33,7 +32,7 @@ final class SurveyApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetSurveyResponse")
|
@Schema(description = "GetSurveyResponse")
|
||||||
public static final class GetSurveyResponse {
|
public static final class GetSurveyResponse {
|
||||||
|
|
||||||
private GetSurveyResponse() {
|
private GetSurveyResponse() {
|
||||||
@@ -46,65 +45,65 @@ final class SurveyApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "m_client")
|
@Schema(example = "m_client")
|
||||||
public String applicationTableName;
|
public String applicationTableName;
|
||||||
@ApiModelProperty(example = "ppi_kenya_2005")
|
@Schema(example = "ppi_kenya_2005")
|
||||||
public String registeredTableName;
|
public String registeredTableName;
|
||||||
public List<ResultsetColumnHeaderData> columnHeaderData;
|
public List<ResultsetColumnHeaderData> columnHeaderData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetSurveyResponseDatatableData datatableData;
|
public GetSurveyResponseDatatableData datatableData;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public boolean enabled;
|
public boolean enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostSurveySurveyNameApptableIdRequest")
|
@Schema(description = "PostSurveySurveyNameApptableIdRequest")
|
||||||
public static final class PostSurveySurveyNameApptableIdRequest {
|
public static final class PostSurveySurveyNameApptableIdRequest {
|
||||||
|
|
||||||
private PostSurveySurveyNameApptableIdRequest() {
|
private PostSurveySurveyNameApptableIdRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "167")
|
@Schema(example = "167")
|
||||||
public Long ppi_household_members_cd_q1_householdmembers;
|
public Long ppi_household_members_cd_q1_householdmembers;
|
||||||
@ApiModelProperty(example = "174")
|
@Schema(example = "174")
|
||||||
public Long ppi_highestschool_cd_q2_highestschool;
|
public Long ppi_highestschool_cd_q2_highestschool;
|
||||||
@ApiModelProperty(example = "180")
|
@Schema(example = "180")
|
||||||
public Long ppi_businessoccupation_cd_q3_businessoccupation;
|
public Long ppi_businessoccupation_cd_q3_businessoccupation;
|
||||||
@ApiModelProperty(example = "184")
|
@Schema(example = "184")
|
||||||
public Long ppi_habitablerooms_cd_q4_habitablerooms;
|
public Long ppi_habitablerooms_cd_q4_habitablerooms;
|
||||||
@ApiModelProperty(example = "188")
|
@Schema(example = "188")
|
||||||
public Long ppi_floortype_cd_q5_floortype;
|
public Long ppi_floortype_cd_q5_floortype;
|
||||||
@ApiModelProperty(example = "190")
|
@Schema(example = "190")
|
||||||
public Long ppi_lightingsource_cd_q6_lightingsource;
|
public Long ppi_lightingsource_cd_q6_lightingsource;
|
||||||
@ApiModelProperty(example = "193")
|
@Schema(example = "193")
|
||||||
public Long ppi_irons_cd_q7_irons;
|
public Long ppi_irons_cd_q7_irons;
|
||||||
@ApiModelProperty(example = "195")
|
@Schema(example = "195")
|
||||||
public Long ppi_mosquitonets_cd_q8_mosquitonets;
|
public Long ppi_mosquitonets_cd_q8_mosquitonets;
|
||||||
@ApiModelProperty(example = "198")
|
@Schema(example = "198")
|
||||||
public Long ppi_towels_cd_q9_towels;
|
public Long ppi_towels_cd_q9_towels;
|
||||||
@ApiModelProperty(example = "201")
|
@Schema(example = "201")
|
||||||
public Long ppi_fryingpans_cd_q10_fryingpans;
|
public Long ppi_fryingpans_cd_q10_fryingpans;
|
||||||
@ApiModelProperty(example = "2014-12-02 20:30:00")
|
@Schema(example = "2014-12-02 20:30:00")
|
||||||
public DateTime Date;
|
public DateTime Date;
|
||||||
@ApiModelProperty(example = "Y-m-d H:i:s")
|
@Schema(example = "Y-m-d H:i:s")
|
||||||
public DateTime dateFormat;
|
public DateTime dateFormat;
|
||||||
@ApiModelProperty(example = "en_GB")
|
@Schema(example = "en_GB")
|
||||||
public String locale;
|
public String locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostSurveySurveyNameApptableIdResponse")
|
@Schema(description = "PostSurveySurveyNameApptableIdResponse")
|
||||||
public static final class PostSurveySurveyNameApptableIdResponse {
|
public static final class PostSurveySurveyNameApptableIdResponse {
|
||||||
|
|
||||||
private PostSurveySurveyNameApptableIdResponse() {
|
private PostSurveySurveyNameApptableIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "87")
|
@Schema(example = "87")
|
||||||
public Long clientId;
|
public Long clientId;
|
||||||
@ApiModelProperty(example = "87")
|
@Schema(example = "87")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+98
-88
@@ -20,15 +20,14 @@ package org.apache.fineract.interoperation.api;
|
|||||||
|
|
||||||
import static org.apache.fineract.interoperation.util.InteropUtil.ENTITY_NAME_QUOTE;
|
import static org.apache.fineract.interoperation.util.InteropUtil.ENTITY_NAME_QUOTE;
|
||||||
import static org.apache.fineract.interoperation.util.InteropUtil.ENTITY_NAME_REQUEST;
|
import static org.apache.fineract.interoperation.util.InteropUtil.ENTITY_NAME_REQUEST;
|
||||||
import static org.apache.fineract.interoperation.util.InteropUtil.ROOT_PATH;
|
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
@@ -71,7 +70,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/interoperation") // api/v1/
|
@Path("/interoperation") // api/v1/
|
||||||
@Component
|
@Component
|
||||||
@Scope
|
@Scope
|
||||||
@Api(value = ROOT_PATH, description = "")
|
|
||||||
public class InteropApiResource {
|
public class InteropApiResource {
|
||||||
|
|
||||||
private PlatformSecurityContext context;
|
private PlatformSecurityContext context;
|
||||||
@@ -97,8 +96,8 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("health")
|
@Path("health")
|
||||||
@ApiOperation(value = "Query Interoperation Health Request", httpMethod = "GET", notes = "")
|
@Operation(summary = "Query Interoperation Health Request", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK") })
|
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") })
|
||||||
public String health(@Context UriInfo uriInfo) {
|
public String health(@Context UriInfo uriInfo) {
|
||||||
return "OK";
|
return "OK";
|
||||||
}
|
}
|
||||||
@@ -107,9 +106,11 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("accounts/{accountId}")
|
@Path("accounts/{accountId}")
|
||||||
@ApiOperation(value = "Query Interoperation Account details", httpMethod = "GET", notes = "")
|
@Operation(summary = "Query Interoperation Account details", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropAccountData.class) })
|
@ApiResponses({
|
||||||
public String getAccountDetails(@PathParam("accountId") @ApiParam(value = "accountId") String accountId, @Context UriInfo uriInfo) {
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropAccountData.class))) })
|
||||||
|
public String getAccountDetails(@PathParam("accountId") @Parameter(description = "accountId") String accountId,
|
||||||
|
@Context UriInfo uriInfo) {
|
||||||
InteropAccountData result = interopService.getAccountDetails(accountId);
|
InteropAccountData result = interopService.getAccountDetails(accountId);
|
||||||
ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
|
||||||
@@ -120,13 +121,15 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("accounts/{accountId}/transactions")
|
@Path("accounts/{accountId}/transactions")
|
||||||
@ApiOperation(value = "Query transactions by Account Id", httpMethod = "GET", notes = "")
|
@Operation(summary = "Query transactions by Account Id", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransactionsData.class) })
|
@ApiResponses({
|
||||||
public String getAccountTransactions(@PathParam("accountId") @ApiParam(value = "accountId") String accountId,
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransactionsData.class))) })
|
||||||
@DefaultValue("true") @QueryParam("debit") @ApiParam(value = "debit") boolean debit,
|
public String getAccountTransactions(@PathParam("accountId") @Parameter(description = "accountId") String accountId,
|
||||||
@DefaultValue("false") @QueryParam("credit") @ApiParam(value = "credit") boolean credit,
|
@DefaultValue("true") @QueryParam("debit") @Parameter(description = "debit") boolean debit,
|
||||||
@QueryParam("fromBookingDateTime") @ApiParam(value = "fromBookingDateTime") String fromBookingDateTime,
|
@DefaultValue("false") @QueryParam("credit") @Parameter(description = "credit") boolean credit,
|
||||||
@QueryParam("toBookingDateTime") @ApiParam(value = "toBookingDateTime") String toBookingDateTime, @Context UriInfo uriInfo) {
|
@QueryParam("fromBookingDateTime") @Parameter(description = "fromBookingDateTime") String fromBookingDateTime,
|
||||||
|
@QueryParam("toBookingDateTime") @Parameter(description = "toBookingDateTime") String toBookingDateTime,
|
||||||
|
@Context UriInfo uriInfo) {
|
||||||
LocalDateTime transactionsFrom = fromBookingDateTime == null ? null
|
LocalDateTime transactionsFrom = fromBookingDateTime == null ? null
|
||||||
: LocalDateTime.parse(fromBookingDateTime, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
|
: LocalDateTime.parse(fromBookingDateTime, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
|
||||||
LocalDateTime transactionsTo = toBookingDateTime == null ? null
|
LocalDateTime transactionsTo = toBookingDateTime == null ? null
|
||||||
@@ -142,9 +145,11 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("accounts/{accountId}/identifiers")
|
@Path("accounts/{accountId}/identifiers")
|
||||||
@ApiOperation(value = "Query Interoperation secondary identifiers by Account Id", httpMethod = "GET", notes = "")
|
@Operation(summary = "Query Interoperation secondary identifiers by Account Id", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifiersResponseData.class) })
|
@ApiResponses({
|
||||||
public String getAccountIdentifiers(@PathParam("accountId") @ApiParam(value = "accountId") String accountId, @Context UriInfo uriInfo) {
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifiersResponseData.class))) })
|
||||||
|
public String getAccountIdentifiers(@PathParam("accountId") @Parameter(description = "accountId") String accountId,
|
||||||
|
@Context UriInfo uriInfo) {
|
||||||
InteropIdentifiersResponseData result = interopService.getAccountIdentifiers(accountId);
|
InteropIdentifiersResponseData result = interopService.getAccountIdentifiers(accountId);
|
||||||
ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
|
||||||
@@ -155,10 +160,11 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("parties/{idType}/{idValue}")
|
@Path("parties/{idType}/{idValue}")
|
||||||
@ApiOperation(value = "Query Interoperation Account by secondary identifier", httpMethod = "GET", notes = "")
|
@Operation(summary = "Query Interoperation Account by secondary identifier", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) })
|
@ApiResponses({
|
||||||
public String getAccountByIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType,
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) })
|
||||||
@PathParam("idValue") @ApiParam(value = "idValue") String idValue, @Context UriInfo uriInfo) {
|
public String getAccountByIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType,
|
||||||
|
@PathParam("idValue") @Parameter(description = "idValue") String idValue, @Context UriInfo uriInfo) {
|
||||||
InteropIdentifierAccountResponseData result = interopService.getAccountByIdentifier(idType, idValue, null);
|
InteropIdentifierAccountResponseData result = interopService.getAccountByIdentifier(idType, idValue, null);
|
||||||
ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
|
||||||
@@ -169,11 +175,12 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("parties/{idType}/{idValue}/{subIdOrType}")
|
@Path("parties/{idType}/{idValue}/{subIdOrType}")
|
||||||
@ApiOperation(value = "Query Interoperation Account by secondary identifier", httpMethod = "GET", notes = "")
|
@Operation(summary = "Query Interoperation Account by secondary identifier", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) })
|
@ApiResponses({
|
||||||
public String getAccountByIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType,
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) })
|
||||||
@PathParam("idValue") @ApiParam(value = "idValue") String idValue,
|
public String getAccountByIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType,
|
||||||
@PathParam("subIdOrType") @ApiParam(value = "subIdOrType") String subIdOrType, @Context UriInfo uriInfo) {
|
@PathParam("idValue") @Parameter(description = "idValue") String idValue,
|
||||||
|
@PathParam("subIdOrType") @Parameter(description = "subIdOrType") String subIdOrType, @Context UriInfo uriInfo) {
|
||||||
InteropIdentifierAccountResponseData result = interopService.getAccountByIdentifier(idType, idValue, subIdOrType);
|
InteropIdentifierAccountResponseData result = interopService.getAccountByIdentifier(idType, idValue, subIdOrType);
|
||||||
ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
|
||||||
@@ -184,12 +191,12 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("parties/{idType}/{idValue}")
|
@Path("parties/{idType}/{idValue}")
|
||||||
@ApiOperation(value = "Interoperation Identifier registration", httpMethod = "POST", notes = "")
|
@Operation(summary = "Interoperation Identifier registration", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropIdentifierRequestData.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropIdentifierRequestData.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) })
|
||||||
public String registerAccountIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType,
|
public String registerAccountIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType,
|
||||||
@PathParam("idValue") @ApiParam(value = "idValue") String idValue, @ApiParam(hidden = true) String identifierJson,
|
@PathParam("idValue") @Parameter(description = "idValue") String idValue, @Parameter(hidden = true) String identifierJson,
|
||||||
@Context UriInfo uriInfo) {
|
@Context UriInfo uriInfo) {
|
||||||
CommandWrapper commandRequest = new InteropWrapperBuilder().registerAccountIdentifier(idType, idValue, null)
|
CommandWrapper commandRequest = new InteropWrapperBuilder().registerAccountIdentifier(idType, idValue, null)
|
||||||
.withJson(identifierJson).build();
|
.withJson(identifierJson).build();
|
||||||
@@ -205,14 +212,14 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("parties/{idType}/{idValue}/{subIdOrType}")
|
@Path("parties/{idType}/{idValue}/{subIdOrType}")
|
||||||
@ApiOperation(value = "Interoperation Identifier registration", httpMethod = "POST", notes = "")
|
@Operation(summary = "Interoperation Identifier registration", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropIdentifierRequestData.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropIdentifierRequestData.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) })
|
||||||
public String registerAccountIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType,
|
public String registerAccountIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType,
|
||||||
@PathParam("idValue") @ApiParam(value = "idValue") String idValue,
|
@PathParam("idValue") @Parameter(description = "idValue") String idValue,
|
||||||
@PathParam("subIdOrType") @ApiParam(value = "subIdOrType") String subIdOrType, @ApiParam(hidden = true) String identifierJson,
|
@PathParam("subIdOrType") @Parameter(description = "subIdOrType") String subIdOrType,
|
||||||
@Context UriInfo uriInfo) {
|
@Parameter(hidden = true) String identifierJson, @Context UriInfo uriInfo) {
|
||||||
CommandWrapper commandRequest = new InteropWrapperBuilder().registerAccountIdentifier(idType, idValue, subIdOrType)
|
CommandWrapper commandRequest = new InteropWrapperBuilder().registerAccountIdentifier(idType, idValue, subIdOrType)
|
||||||
.withJson(identifierJson).build();
|
.withJson(identifierJson).build();
|
||||||
|
|
||||||
@@ -227,12 +234,12 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("parties/{idType}/{idValue}")
|
@Path("parties/{idType}/{idValue}")
|
||||||
@ApiOperation(value = "Allow Interoperation Identifier registration", httpMethod = "DELETE", notes = "")
|
@Operation(summary = "Allow Interoperation Identifier registration", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropIdentifierRequestData.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropIdentifierRequestData.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) })
|
||||||
public String deleteAccountIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType,
|
public String deleteAccountIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType,
|
||||||
@PathParam("idValue") @ApiParam(value = "idValue") String idValue, @Context UriInfo uriInfo) {
|
@PathParam("idValue") @Parameter(description = "idValue") String idValue, @Context UriInfo uriInfo) {
|
||||||
CommandWrapper commandRequest = new InteropWrapperBuilder().deleteAccountIdentifier(idType, idValue, null).build();
|
CommandWrapper commandRequest = new InteropWrapperBuilder().deleteAccountIdentifier(idType, idValue, null).build();
|
||||||
|
|
||||||
InteropIdentifierAccountResponseData result = (InteropIdentifierAccountResponseData) commandsSourceService
|
InteropIdentifierAccountResponseData result = (InteropIdentifierAccountResponseData) commandsSourceService
|
||||||
@@ -246,13 +253,13 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("parties/{idType}/{idValue}/{subIdOrType}")
|
@Path("parties/{idType}/{idValue}/{subIdOrType}")
|
||||||
@ApiOperation(value = "Allow Interoperation Identifier registration", httpMethod = "DELETE", notes = "")
|
@Operation(summary = "Allow Interoperation Identifier registration", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropIdentifierRequestData.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropIdentifierRequestData.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) })
|
||||||
public String deleteAccountIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType,
|
public String deleteAccountIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType,
|
||||||
@PathParam("idValue") @ApiParam(value = "idValue") String idValue,
|
@PathParam("idValue") @Parameter(description = "idValue") String idValue,
|
||||||
@PathParam("subIdOrType") @ApiParam(value = "subIdOrType") String subIdOrType, @Context UriInfo uriInfo) {
|
@PathParam("subIdOrType") @Parameter(description = "subIdOrType") String subIdOrType, @Context UriInfo uriInfo) {
|
||||||
CommandWrapper commandRequest = new InteropWrapperBuilder().deleteAccountIdentifier(idType, idValue, subIdOrType).build();
|
CommandWrapper commandRequest = new InteropWrapperBuilder().deleteAccountIdentifier(idType, idValue, subIdOrType).build();
|
||||||
|
|
||||||
InteropIdentifierAccountResponseData result = (InteropIdentifierAccountResponseData) commandsSourceService
|
InteropIdentifierAccountResponseData result = (InteropIdentifierAccountResponseData) commandsSourceService
|
||||||
@@ -266,10 +273,11 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("transactions/{transactionCode}/requests/{requestCode}")
|
@Path("transactions/{transactionCode}/requests/{requestCode}")
|
||||||
@ApiOperation(value = "Query Interoperation Transaction Request", httpMethod = "GET", notes = "")
|
@Operation(summary = "Query Interoperation Transaction Request", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransactionRequestResponseData.class) })
|
@ApiResponses({
|
||||||
public String getTransactionRequest(@PathParam("transactionCode") @ApiParam(value = "transactionCode") String transactionCode,
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransactionRequestResponseData.class))) })
|
||||||
@PathParam("requestCode") @ApiParam(value = "requestCode") String requestCode, @Context UriInfo uriInfo) {
|
public String getTransactionRequest(@PathParam("transactionCode") @Parameter(description = "transactionCode") String transactionCode,
|
||||||
|
@PathParam("requestCode") @Parameter(description = "requestCode") String requestCode, @Context UriInfo uriInfo) {
|
||||||
context.authenticatedUser().validateHasReadPermission(ENTITY_NAME_REQUEST);
|
context.authenticatedUser().validateHasReadPermission(ENTITY_NAME_REQUEST);
|
||||||
|
|
||||||
InteropTransactionRequestResponseData result = interopService.getTransactionRequest(transactionCode, requestCode);
|
InteropTransactionRequestResponseData result = interopService.getTransactionRequest(transactionCode, requestCode);
|
||||||
@@ -282,11 +290,11 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("requests")
|
@Path("requests")
|
||||||
@ApiOperation(value = "Allow Interoperation Transaction Request", httpMethod = "POST", notes = "")
|
@Operation(summary = "Allow Interoperation Transaction Request", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropTransactionRequestData.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropTransactionRequestData.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransactionRequestResponseData.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransactionRequestResponseData.class))) })
|
||||||
public String createTransactionRequest(@ApiParam(hidden = true) String quotesJson, @Context UriInfo uriInfo) {
|
public String createTransactionRequest(@Parameter(hidden = true) String quotesJson, @Context UriInfo uriInfo) {
|
||||||
CommandWrapper commandRequest = new InteropWrapperBuilder().createTransactionRequest().withJson(quotesJson).build();
|
CommandWrapper commandRequest = new InteropWrapperBuilder().createTransactionRequest().withJson(quotesJson).build();
|
||||||
|
|
||||||
InteropTransactionRequestResponseData result = (InteropTransactionRequestResponseData) commandsSourceService
|
InteropTransactionRequestResponseData result = (InteropTransactionRequestResponseData) commandsSourceService
|
||||||
@@ -300,10 +308,11 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("transactions/{transactionCode}/quotes/{quoteCode}")
|
@Path("transactions/{transactionCode}/quotes/{quoteCode}")
|
||||||
@ApiOperation(value = "Query Interoperation Quote", httpMethod = "GET", notes = "")
|
@Operation(summary = "Query Interoperation Quote", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropQuoteResponseData.class) })
|
@ApiResponses({
|
||||||
public String getQuote(@PathParam("transactionCode") @ApiParam(value = "transactionCode") String transactionCode,
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropQuoteResponseData.class))) })
|
||||||
@PathParam("quoteCode") @ApiParam(value = "quoteCode") String quoteCode, @Context UriInfo uriInfo) {
|
public String getQuote(@PathParam("transactionCode") @Parameter(description = "transactionCode") String transactionCode,
|
||||||
|
@PathParam("quoteCode") @Parameter(description = "quoteCode") String quoteCode, @Context UriInfo uriInfo) {
|
||||||
context.authenticatedUser().validateHasReadPermission(ENTITY_NAME_QUOTE);
|
context.authenticatedUser().validateHasReadPermission(ENTITY_NAME_QUOTE);
|
||||||
|
|
||||||
InteropQuoteResponseData result = interopService.getQuote(transactionCode, quoteCode);
|
InteropQuoteResponseData result = interopService.getQuote(transactionCode, quoteCode);
|
||||||
@@ -316,11 +325,11 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("quotes")
|
@Path("quotes")
|
||||||
@ApiOperation(value = "Calculate Interoperation Quote", httpMethod = "POST", notes = "")
|
@Operation(summary = "Calculate Interoperation Quote", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropQuoteRequestData.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropQuoteRequestData.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropQuoteResponseData.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropQuoteResponseData.class))) })
|
||||||
public String createQuote(@ApiParam(hidden = true) String quotesJson, @Context UriInfo uriInfo) {
|
public String createQuote(@Parameter(hidden = true) String quotesJson, @Context UriInfo uriInfo) {
|
||||||
CommandWrapper commandRequest = new InteropWrapperBuilder().createQuotes().withJson(quotesJson).build();
|
CommandWrapper commandRequest = new InteropWrapperBuilder().createQuotes().withJson(quotesJson).build();
|
||||||
|
|
||||||
InteropQuoteResponseData result = (InteropQuoteResponseData) commandsSourceService.logCommandSource(commandRequest);
|
InteropQuoteResponseData result = (InteropQuoteResponseData) commandsSourceService.logCommandSource(commandRequest);
|
||||||
@@ -333,10 +342,11 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("transactions/{transactionCode}/transfers/{transferCode}")
|
@Path("transactions/{transactionCode}/transfers/{transferCode}")
|
||||||
@ApiOperation(value = "Query Interoperation Transfer", httpMethod = "GET", notes = "")
|
@Operation(summary = "Query Interoperation Transfer", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransferResponseData.class) })
|
@ApiResponses({
|
||||||
public String getTransfer(@PathParam("transactionCode") @ApiParam(value = "transactionCode") String transactionCode,
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransferResponseData.class))) })
|
||||||
@PathParam("transferCode") @ApiParam(value = "transferCode") String transferCode, @Context UriInfo uriInfo) {
|
public String getTransfer(@PathParam("transactionCode") @Parameter(description = "transactionCode") String transactionCode,
|
||||||
|
@PathParam("transferCode") @Parameter(description = "transferCode") String transferCode, @Context UriInfo uriInfo) {
|
||||||
context.authenticatedUser().validateHasReadPermission(ENTITY_NAME_QUOTE);
|
context.authenticatedUser().validateHasReadPermission(ENTITY_NAME_QUOTE);
|
||||||
|
|
||||||
InteropTransferResponseData result = interopService.getTransfer(transactionCode, transferCode);
|
InteropTransferResponseData result = interopService.getTransfer(transactionCode, transferCode);
|
||||||
@@ -349,12 +359,12 @@ public class InteropApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Path("transfers")
|
@Path("transfers")
|
||||||
@ApiOperation(value = "Prepare Interoperation Transfer", httpMethod = "POST", notes = "")
|
@Operation(summary = "Prepare Interoperation Transfer", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropTransferRequestData.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropTransferRequestData.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransferResponseData.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransferResponseData.class))) })
|
||||||
public String performTransfer(@QueryParam("action") @ApiParam(value = "action") String action,
|
public String performTransfer(@QueryParam("action") @Parameter(description = "action") String action,
|
||||||
@ApiParam(hidden = true) String quotesJson, @Context UriInfo uriInfo) {
|
@Parameter(hidden = true) String quotesJson, @Context UriInfo uriInfo) {
|
||||||
CommandWrapper commandRequest = new InteropWrapperBuilder().performTransfer(InteropTransferActionType.valueOf(action))
|
CommandWrapper commandRequest = new InteropWrapperBuilder().performTransfer(InteropTransferActionType.valueOf(action))
|
||||||
.withJson(quotesJson).build();
|
.withJson(quotesJson).build();
|
||||||
|
|
||||||
|
|||||||
+3
-5
@@ -18,9 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.mix.api;
|
package org.apache.fineract.mix.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.sql.Date;
|
import java.sql.Date;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
@@ -37,8 +35,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/mixreport")
|
@Path("/mixreport")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Mix Report" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Mix Report", description = "") })
|
@Tag(name = "Mix Report", description = "")
|
||||||
public class MixReportApiResource {
|
public class MixReportApiResource {
|
||||||
|
|
||||||
private final XBRLResultService xbrlResultService;
|
private final XBRLResultService xbrlResultService;
|
||||||
|
|||||||
+3
-5
@@ -18,9 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.mix.api;
|
package org.apache.fineract.mix.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -45,8 +43,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/mixtaxonomy")
|
@Path("/mixtaxonomy")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Mix Taxonomy" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Mix Taxonomy", description = "") })
|
@Tag(name = "Mix Taxonomy", description = "")
|
||||||
public class MixTaxonomyApiResource {
|
public class MixTaxonomyApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
|
|||||||
+3
-5
@@ -18,9 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.mix.api;
|
package org.apache.fineract.mix.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -49,8 +47,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/mixmapping")
|
@Path("/mixmapping")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Mix Mapping " })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Mix Mapping", description = "") })
|
@Tag(name = "Mix Mapping", description = "")
|
||||||
public class MixTaxonomyMappingApiResource {
|
public class MixTaxonomyMappingApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("identifier", "config"));
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("identifier", "config"));
|
||||||
|
|||||||
+3
-5
@@ -18,9 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.notification.api;
|
package org.apache.fineract.notification.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.PUT;
|
import javax.ws.rs.PUT;
|
||||||
@@ -45,8 +43,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/notifications")
|
@Path("/notifications")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Notification" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Notification", description = "") })
|
@Tag(name = "Notification", description = "")
|
||||||
public class NotificationApiResource {
|
public class NotificationApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
|
|||||||
+48
-47
@@ -21,15 +21,15 @@ package org.apache.fineract.organisation.holiday.api;
|
|||||||
import static org.apache.fineract.organisation.holiday.api.HolidayApiConstants.HOLIDAY_RESOURCE_NAME;
|
import static org.apache.fineract.organisation.holiday.api.HolidayApiConstants.HOLIDAY_RESOURCE_NAME;
|
||||||
import static org.apache.fineract.organisation.holiday.api.HolidayApiConstants.HOLIDAY_RESPONSE_DATA_PARAMETERS;
|
import static org.apache.fineract.organisation.holiday.api.HolidayApiConstants.HOLIDAY_RESPONSE_DATA_PARAMETERS;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
@@ -64,13 +64,11 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/holidays")
|
@Path("/holidays")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Holidays" })
|
@Tag(name = "Holidays", description = "Some MFI's span large regions where different branch offices might observe different holidays. They need the ability to define holidays for specific branch offices and be able to set the repayment rule to follow during those holidays.\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n"
|
||||||
@Tag(name = "Holidays", description = "Some MFI's span large regions where different branch offices might observe different holidays. They need the ability to define holidays for specific branch offices and be able to set the repayment rule to follow during those holidays.\n"
|
+ "The reschedule of repayments to repaymentsRescheduledTo date during defined holidays is turned on/off by enabling/disabling reschedule-repayments-on-holidays in Global configurations.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "The reschedule of repayments to repaymentsRescheduledTo date during defined holidays is turned on/off by enabling/disabling reschedule-repayments-on-holidays in Global configurations.\n"
|
+ "Allow Repayment transactions on a defined holidays is turned on/off by enabling/disabling allow-transactions-on-holiday in Global configurations.")
|
||||||
+ "\n"
|
|
||||||
+ "Allow Repayment transactions on a defined holidays is turned on/off by enabling/disabling allow-transactions-on-holiday in Global configurations.") })
|
|
||||||
public class HolidaysApiResource {
|
public class HolidaysApiResource {
|
||||||
|
|
||||||
private final DefaultToApiJsonSerializer<HolidayData> toApiJsonSerializer;
|
private final DefaultToApiJsonSerializer<HolidayData> toApiJsonSerializer;
|
||||||
@@ -94,12 +92,12 @@ public class HolidaysApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a Holiday", notes = "Mandatory Fields: "
|
@Operation(summary = "Create a Holiday", description = "Mandatory Fields: "
|
||||||
+ "name, description, fromDate, toDate, repaymentsRescheduledTo, offices")
|
+ "name, description, fromDate, toDate, repaymentsRescheduledTo, offices")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = HolidaysApiResourceSwagger.PostHolidaysRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.PostHolidaysResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysResponse.class))) })
|
||||||
public String createNewHoliday(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createNewHoliday(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createHoliday().withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createHoliday().withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -112,14 +110,14 @@ public class HolidaysApiResource {
|
|||||||
@Path("{holidayId}")
|
@Path("{holidayId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Activate a Holiday", notes = "Always Holidays are created in pending state. This API allows to activate a holiday.\n"
|
@Operation(summary = "Activate a Holiday", description = "Always Holidays are created in pending state. This API allows to activate a holiday.\n"
|
||||||
+ "\n" + "Only the active holidays are considered for rescheduling the loan repayment.")
|
+ "\n" + "Only the active holidays are considered for rescheduling the loan repayment.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysHolidayIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = HolidaysApiResourceSwagger.PostHolidaysHolidayIdRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.PostHolidaysHolidayIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysHolidayIdResponse.class))) })
|
||||||
public String handleCommands(@PathParam("holidayId") @ApiParam(value = "holidayId") final Long holidayId,
|
public String handleCommands(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId,
|
||||||
@QueryParam("command") @ApiParam(value = "command") final String commandParam,
|
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
String jsonApiRequest = apiRequestBodyAsJson;
|
String jsonApiRequest = apiRequestBodyAsJson;
|
||||||
if (StringUtils.isBlank(jsonApiRequest)) {
|
if (StringUtils.isBlank(jsonApiRequest)) {
|
||||||
@@ -145,9 +143,11 @@ public class HolidaysApiResource {
|
|||||||
@Path("{holidayId}")
|
@Path("{holidayId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a Holiday", notes = "Example Requests:\n" + "\n" + "holidays/1")
|
@Operation(summary = "Retrieve a Holiday", description = "Example Requests:\n" + "\n" + "holidays/1")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.GetHolidaysResponse.class) })
|
@ApiResponses({
|
||||||
public String retrieveOne(@PathParam("holidayId") @ApiParam(value = "holidayId") final Long holidayId, @Context final UriInfo uriInfo) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.GetHolidaysResponse.class))) })
|
||||||
|
public String retrieveOne(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId,
|
||||||
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(HOLIDAY_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(HOLIDAY_RESOURCE_NAME);
|
||||||
|
|
||||||
@@ -162,12 +162,12 @@ public class HolidaysApiResource {
|
|||||||
@Path("{holidayId}")
|
@Path("{holidayId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Holiday", notes = "If a holiday is in pending state (created and not activated) then all fields are allowed to modify. Once holidays become active only name and descriptions are allowed to modify.")
|
@Operation(summary = "Update a Holiday", description = "If a holiday is in pending state (created and not activated) then all fields are allowed to modify. Once holidays become active only name and descriptions are allowed to modify.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PutHolidaysHolidayIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = HolidaysApiResourceSwagger.PutHolidaysHolidayIdRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.PutHolidaysHolidayIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PutHolidaysHolidayIdResponse.class))) })
|
||||||
public String update(@PathParam("holidayId") @ApiParam(value = "holidayId") final Long holidayId,
|
public String update(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId,
|
||||||
@ApiParam(hidden = true) final String jsonRequestBody) {
|
@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateHoliday(holidayId).withJson(jsonRequestBody).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateHoliday(holidayId).withJson(jsonRequestBody).build();
|
||||||
|
|
||||||
@@ -180,9 +180,10 @@ public class HolidaysApiResource {
|
|||||||
@Path("{holidayId}")
|
@Path("{holidayId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Delete a Holiday", notes = "This API allows to delete a holiday. This is a soft delete the deleted holiday status is marked as deleted.")
|
@Operation(summary = "Delete a Holiday", description = "This API allows to delete a holiday. This is a soft delete the deleted holiday status is marked as deleted.")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.DeleteHolidaysHolidayIdResponse.class) })
|
@ApiResponses({
|
||||||
public String delete(@PathParam("holidayId") @ApiParam(value = "holidayId") final Long holidayId) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.DeleteHolidaysHolidayIdResponse.class))) })
|
||||||
|
public String delete(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId) {
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteHoliday(holidayId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteHoliday(holidayId).build();
|
||||||
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
return this.toApiJsonSerializer.serialize(result);
|
return this.toApiJsonSerializer.serialize(result);
|
||||||
@@ -195,15 +196,15 @@ public class HolidaysApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Holidays", notes = "Example Requests:\n" + "\n" + "holidays?officeId=1")
|
@Operation(summary = "List Holidays", description = "Example Requests:\n" + "\n" + "holidays?officeId=1")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.GetHolidaysResponse.class, responseContainer = "List") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = HolidaysApiResourceSwagger.GetHolidaysResponse.class)))) })
|
||||||
public String retrieveAllHolidays(@Context final UriInfo uriInfo,
|
public String retrieveAllHolidays(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId,
|
@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId,
|
||||||
@QueryParam("fromDate") @ApiParam(value = "fromDate") final DateParam fromDateParam,
|
@QueryParam("fromDate") @Parameter(description = "fromDate") final DateParam fromDateParam,
|
||||||
@QueryParam("toDate") @ApiParam(value = "toDate") final DateParam toDateParam,
|
@QueryParam("toDate") @Parameter(description = "toDate") final DateParam toDateParam,
|
||||||
@QueryParam("locale") @ApiParam(value = "locale") final String locale,
|
@QueryParam("locale") @Parameter(description = "locale") final String locale,
|
||||||
@QueryParam("dateFormat") @ApiParam(value = "dateFormat") final String dateFormat) {
|
@QueryParam("dateFormat") @Parameter(description = "dateFormat") final String dateFormat) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(HOLIDAY_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(HOLIDAY_RESOURCE_NAME);
|
||||||
|
|
||||||
|
|||||||
+31
-32
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.holiday.api;
|
package org.apache.fineract.organisation.holiday.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
@@ -33,29 +32,29 @@ final class HolidaysApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetHolidaysResponse")
|
@Schema(description = "GetHolidaysResponse")
|
||||||
public static final class GetHolidaysResponse {
|
public static final class GetHolidaysResponse {
|
||||||
|
|
||||||
private GetHolidaysResponse() {
|
private GetHolidaysResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Good Friday")
|
@Schema(example = "Good Friday")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "[2013, 10, 26]")
|
@Schema(example = "[2013, 10, 26]")
|
||||||
public LocalDate fromDate;
|
public LocalDate fromDate;
|
||||||
@ApiModelProperty(example = "[2013, 10, 26]")
|
@Schema(example = "[2013, 10, 26]")
|
||||||
public LocalDate toDate;
|
public LocalDate toDate;
|
||||||
@ApiModelProperty(example = "[2013, 10, 27]")
|
@Schema(example = "[2013, 10, 27]")
|
||||||
public LocalDate repaymentsRescheduledTo;
|
public LocalDate repaymentsRescheduledTo;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
public EnumOptionData status;
|
public EnumOptionData status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostHolidaysRequest")
|
@Schema(description = "PostHolidaysRequest")
|
||||||
public static final class PostHolidaysRequest {
|
public static final class PostHolidaysRequest {
|
||||||
|
|
||||||
private PostHolidaysRequest() {
|
private PostHolidaysRequest() {
|
||||||
@@ -68,39 +67,39 @@ final class HolidaysApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Good Friday")
|
@Schema(example = "Good Friday")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Good Friday")
|
@Schema(example = "Good Friday")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "25 October 2013")
|
@Schema(example = "25 October 2013")
|
||||||
public LocalDate fromDate;
|
public LocalDate fromDate;
|
||||||
@ApiModelProperty(example = "25 October 2013")
|
@Schema(example = "25 October 2013")
|
||||||
public LocalDate toDate;
|
public LocalDate toDate;
|
||||||
@ApiModelProperty(example = "26 October 2013")
|
@Schema(example = "26 October 2013")
|
||||||
public LocalDate repaymentsRescheduledTo;
|
public LocalDate repaymentsRescheduledTo;
|
||||||
public List<PostHolidaysRequestOffices> offices;
|
public List<PostHolidaysRequestOffices> offices;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostHolidaysResponse")
|
@Schema(description = "PostHolidaysResponse")
|
||||||
public static final class PostHolidaysResponse {
|
public static final class PostHolidaysResponse {
|
||||||
|
|
||||||
private PostHolidaysResponse() {
|
private PostHolidaysResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostHolidaysHolidayIdRequest")
|
@Schema(description = "PostHolidaysHolidayIdRequest")
|
||||||
public static final class PostHolidaysHolidayIdRequest {
|
public static final class PostHolidaysHolidayIdRequest {
|
||||||
|
|
||||||
private PostHolidaysHolidayIdRequest() {
|
private PostHolidaysHolidayIdRequest() {
|
||||||
@@ -108,31 +107,31 @@ final class HolidaysApiResourceSwagger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostHolidaysHolidayIdResponse")
|
@Schema(description = "PostHolidaysHolidayIdResponse")
|
||||||
public static final class PostHolidaysHolidayIdResponse {
|
public static final class PostHolidaysHolidayIdResponse {
|
||||||
|
|
||||||
private PostHolidaysHolidayIdResponse() {
|
private PostHolidaysHolidayIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutHolidaysHolidayIdRequest")
|
@Schema(description = "PutHolidaysHolidayIdRequest")
|
||||||
public static final class PutHolidaysHolidayIdRequest {
|
public static final class PutHolidaysHolidayIdRequest {
|
||||||
|
|
||||||
private PutHolidaysHolidayIdRequest() {
|
private PutHolidaysHolidayIdRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Independence day")
|
@Schema(example = "Independence day")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Holiday for Independence day celebration")
|
@Schema(example = "Holiday for Independence day celebration")
|
||||||
public String description;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutHolidaysHolidayIdResponse")
|
@Schema(description = "PutHolidaysHolidayIdResponse")
|
||||||
public static final class PutHolidaysHolidayIdResponse {
|
public static final class PutHolidaysHolidayIdResponse {
|
||||||
|
|
||||||
private PutHolidaysHolidayIdResponse() {
|
private PutHolidaysHolidayIdResponse() {
|
||||||
@@ -143,25 +142,25 @@ final class HolidaysApiResourceSwagger {
|
|||||||
|
|
||||||
private PutHolidaysHolidayIdResponseChanges() {}
|
private PutHolidaysHolidayIdResponseChanges() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Independence day")
|
@Schema(example = "Independence day")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Holiday for Independence day celebration")
|
@Schema(example = "Holiday for Independence day celebration")
|
||||||
public String description;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutHolidaysHolidayIdResponseChanges changes;
|
public PutHolidaysHolidayIdResponseChanges changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteHolidaysHolidayIdResponse")
|
@Schema(description = "DeleteHolidaysHolidayIdResponse")
|
||||||
public static final class DeleteHolidaysHolidayIdResponse {
|
public static final class DeleteHolidaysHolidayIdResponse {
|
||||||
|
|
||||||
private DeleteHolidaysHolidayIdResponse() {
|
private DeleteHolidaysHolidayIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-19
@@ -18,15 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.monetary.api;
|
package org.apache.fineract.organisation.monetary.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -55,9 +54,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/currencies")
|
@Path("/currencies")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Currency" })
|
|
||||||
@SwaggerDefinition(tags = {
|
@Tag(name = "Currency", description = "Application related configuration around viewing/updating the currencies permitted for use within the MFI.")
|
||||||
@Tag(name = "Currency", description = "Application related configuration around viewing/updating the currencies permitted for use within the MFI.") })
|
|
||||||
public class CurrenciesApiResource {
|
public class CurrenciesApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("selectedCurrencyOptions", "currencyOptions"));
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("selectedCurrencyOptions", "currencyOptions"));
|
||||||
@@ -85,9 +83,10 @@ public class CurrenciesApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Currency Configuration", notes = "Returns the list of currencies permitted for use AND the list of currencies not selected (but available for selection).\n"
|
@Operation(summary = "Retrieve Currency Configuration", description = "Returns the list of currencies permitted for use AND the list of currencies not selected (but available for selection).\n"
|
||||||
+ "\n" + "Example Requests:\n" + "\n" + "currencies\n" + "\n" + "\n" + "currencies?fields=selectedCurrencyOptions")
|
+ "\n" + "Example Requests:\n" + "\n" + "currencies\n" + "\n" + "\n" + "currencies?fields=selectedCurrencyOptions")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CurrenciesApiResourceSwagger.GetCurrenciesResponse.class) })
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CurrenciesApiResourceSwagger.GetCurrenciesResponse.class))) })
|
||||||
public String retrieveCurrencies(@Context final UriInfo uriInfo) {
|
public String retrieveCurrencies(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
@@ -101,11 +100,11 @@ public class CurrenciesApiResource {
|
|||||||
@PUT
|
@PUT
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update Currency Configuration", notes = "Updates the list of currencies permitted for use.")
|
@Operation(summary = "Update Currency Configuration", description = "Updates the list of currencies permitted for use.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CurrenciesApiResourceSwagger.PutCurrenciesRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CurrenciesApiResourceSwagger.PutCurrenciesRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = CurrenciesApiResourceSwagger.PutCurrenciesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CurrenciesApiResourceSwagger.PutCurrenciesResponse.class))) })
|
||||||
public String updateCurrencies(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String updateCurrencies(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.updateCurrencies() //
|
.updateCurrencies() //
|
||||||
|
|||||||
+8
-9
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.monetary.api;
|
package org.apache.fineract.organisation.monetary.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||||
|
|
||||||
@@ -32,7 +31,7 @@ final class CurrenciesApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetCurrenciesResponse")
|
@Schema(description = "GetCurrenciesResponse")
|
||||||
public static final class GetCurrenciesResponse {
|
public static final class GetCurrenciesResponse {
|
||||||
|
|
||||||
private GetCurrenciesResponse() {
|
private GetCurrenciesResponse() {
|
||||||
@@ -43,28 +42,28 @@ final class CurrenciesApiResourceSwagger {
|
|||||||
public Collection<CurrencyData> currencyOptions;
|
public Collection<CurrencyData> currencyOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutCurrenciesRequest")
|
@Schema(description = "PutCurrenciesRequest")
|
||||||
public static final class PutCurrenciesRequest {
|
public static final class PutCurrenciesRequest {
|
||||||
|
|
||||||
private PutCurrenciesRequest() {
|
private PutCurrenciesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "[\"KES\",\n" + " \"BND\",\n" + " \"LBP\",\n" + " \"GHC\",\n"
|
@Schema(example = "[\"KES\",\n" + " \"BND\",\n" + " \"LBP\",\n" + " \"GHC\",\n" + " \"USD\",\n"
|
||||||
+ " \"USD\",\n" + " \"XOF\",\n" + " \"AED\",\n" + " \"AMD\"]")
|
+ " \"XOF\",\n" + " \"AED\",\n" + " \"AMD\"]")
|
||||||
public String currencies;
|
public String currencies;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutCurrenciesResponse")
|
@Schema(description = "PutCurrenciesResponse")
|
||||||
public static final class PutCurrenciesResponse {
|
public static final class PutCurrenciesResponse {
|
||||||
|
|
||||||
private PutCurrenciesResponse() {
|
private PutCurrenciesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "[\"KES\",\n" + " \"BND\",\n" + " \"LBP\",\n" + " \"GHC\",\n"
|
@Schema(example = "[\"KES\",\n" + " \"BND\",\n" + " \"LBP\",\n" + " \"GHC\",\n" + " \"USD\",\n"
|
||||||
+ " \"USD\",\n" + " \"XOF\",\n" + " \"AED\",\n" + " \"AMD\"]")
|
+ " \"XOF\",\n" + " \"AED\",\n" + " \"AMD\"]")
|
||||||
public String currencies;
|
public String currencies;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.office.api;
|
package org.apache.fineract.organisation.office.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -50,7 +49,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/officetransactions")
|
@Path("/officetransactions")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(value = "officetransactions", description = "")
|
|
||||||
public class OfficeTransactionsApiResource {
|
public class OfficeTransactionsApiResource {
|
||||||
|
|
||||||
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
|
|||||||
+35
-34
@@ -20,15 +20,15 @@ package org.apache.fineract.organisation.office.api;
|
|||||||
|
|
||||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||||
import com.sun.jersey.multipart.FormDataParam;
|
import com.sun.jersey.multipart.FormDataParam;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -68,9 +68,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/offices")
|
@Path("/offices")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Offices" })
|
@Tag(name = "Offices", description = "Offices are used to model an MFIs structure. A hierarchical representation of offices is supported. There will always be at least one office (which represents the MFI or an MFIs head office). All subsequent offices added must have a parent office.")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Offices", description = "Offices are used to model an MFIs structure. A hierarchical representation of offices is supported. There will always be at least one office (which represents the MFI or an MFIs head office). All subsequent offices added must have a parent office.") })
|
|
||||||
public class OfficesApiResource {
|
public class OfficesApiResource {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,14 +105,14 @@ public class OfficesApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Offices", notes = "Example Requests:\n" + "\n" + "offices\n" + "\n" + "\n"
|
@Operation(summary = "List Offices", description = "Example Requests:\n" + "\n" + "offices\n" + "\n" + "\n"
|
||||||
+ "offices?fields=id,name,openingDate")
|
+ "offices?fields=id,name,openingDate")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.GetOfficesResponse.class, responseContainer = "List") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = OfficesApiResourceSwagger.GetOfficesResponse.class)))) })
|
||||||
public String retrieveOffices(@Context final UriInfo uriInfo,
|
public String retrieveOffices(@Context final UriInfo uriInfo,
|
||||||
@DefaultValue("false") @QueryParam("includeAllOffices") @ApiParam(value = "includeAllOffices") final boolean onlyManualEntries,
|
@DefaultValue("false") @QueryParam("includeAllOffices") @Parameter(description = "includeAllOffices") final boolean onlyManualEntries,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) {
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|
||||||
@@ -130,9 +128,10 @@ public class OfficesApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Office Details Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
@Operation(summary = "Retrieve Office Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
||||||
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "offices/template")
|
+ "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "offices/template")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.GetOfficesTemplateResponse.class) })
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.GetOfficesTemplateResponse.class))) })
|
||||||
public String retrieveOfficeTemplate(@Context final UriInfo uriInfo) {
|
public String retrieveOfficeTemplate(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
@@ -149,11 +148,11 @@ public class OfficesApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create an Office", notes = "Mandatory Fields\n" + "name, openingDate, parentId")
|
@Operation(summary = "Create an Office", description = "Mandatory Fields\n" + "name, openingDate, parentId")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.PostOfficesRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = OfficesApiResourceSwagger.PostOfficesRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.PostOfficesResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.PostOfficesResponse.class))) })
|
||||||
public String createOffice(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createOffice(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.createOffice() //
|
.createOffice() //
|
||||||
@@ -169,10 +168,12 @@ public class OfficesApiResource {
|
|||||||
@Path("{officeId}")
|
@Path("{officeId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve an Office", notes = "Example Requests:\n" + "\n" + "offices/1\n" + "\n" + "\n"
|
@Operation(summary = "Retrieve an Office", description = "Example Requests:\n" + "\n" + "offices/1\n" + "\n" + "\n"
|
||||||
+ "offices/1?template=true\n" + "\n" + "\n" + "offices/1?fields=id,name,parentName")
|
+ "offices/1?template=true\n" + "\n" + "\n" + "offices/1?fields=id,name,parentName")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.GetOfficesResponse.class) })
|
@ApiResponses({
|
||||||
public String retreiveOffice(@PathParam("officeId") @ApiParam(value = "officeId") final Long officeId, @Context final UriInfo uriInfo) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.GetOfficesResponse.class))) })
|
||||||
|
public String retreiveOffice(@PathParam("officeId") @Parameter(description = "officeId") final Long officeId,
|
||||||
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|
||||||
@@ -191,12 +192,12 @@ public class OfficesApiResource {
|
|||||||
@Path("{officeId}")
|
@Path("{officeId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update Office", notes = "")
|
@Operation(summary = "Update Office", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.PutOfficesOfficeIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = OfficesApiResourceSwagger.PutOfficesOfficeIdRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.PutOfficesOfficeIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.PutOfficesOfficeIdResponse.class))) })
|
||||||
public String updateOffice(@PathParam("officeId") @ApiParam(value = "officeId") final Long officeId,
|
public String updateOffice(@PathParam("officeId") @Parameter(description = "officeId") final Long officeId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
.updateOffice(officeId) //
|
.updateOffice(officeId) //
|
||||||
|
|||||||
+28
-29
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.office.api;
|
package org.apache.fineract.organisation.office.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
@@ -32,90 +31,90 @@ final class OfficesApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetOfficesResponse")
|
@Schema(description = "GetOfficesResponse")
|
||||||
public static final class GetOfficesResponse {
|
public static final class GetOfficesResponse {
|
||||||
|
|
||||||
private GetOfficesResponse() {
|
private GetOfficesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String nameDecorated;
|
public String nameDecorated;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public String externalId;
|
public String externalId;
|
||||||
@ApiModelProperty(example = "[2009, 1, 1]")
|
@Schema(example = "[2009, 1, 1]")
|
||||||
public LocalDate openingDate;
|
public LocalDate openingDate;
|
||||||
@ApiModelProperty(example = ".")
|
@Schema(example = ".")
|
||||||
public String hierarchy;
|
public String hierarchy;
|
||||||
// @ApiModelProperty(example = "")
|
// @Schema(example = "")
|
||||||
// public Long parentId;
|
// public Long parentId;
|
||||||
// @ApiModelProperty(example = "")
|
// @Schema(example = "")
|
||||||
// public String parentName;
|
// public String parentName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetOfficesTemplateResponse")
|
@Schema(description = "GetOfficesTemplateResponse")
|
||||||
public static final class GetOfficesTemplateResponse {
|
public static final class GetOfficesTemplateResponse {
|
||||||
|
|
||||||
private GetOfficesTemplateResponse() {
|
private GetOfficesTemplateResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "[2009, 1, 1]")
|
@Schema(example = "[2009, 1, 1]")
|
||||||
public LocalDate openingDate;
|
public LocalDate openingDate;
|
||||||
public Collection<GetOfficesResponse> allowedParents;
|
public Collection<GetOfficesResponse> allowedParents;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostOfficesRequest")
|
@Schema(description = "PostOfficesRequest")
|
||||||
public static final class PostOfficesRequest {
|
public static final class PostOfficesRequest {
|
||||||
|
|
||||||
private PostOfficesRequest() {
|
private PostOfficesRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Good Friday")
|
@Schema(example = "Good Friday")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "01 July 2007")
|
@Schema(example = "01 July 2007")
|
||||||
public LocalDate openingDate;
|
public LocalDate openingDate;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long parentId;
|
public Long parentId;
|
||||||
@ApiModelProperty(example = "SYS54-88")
|
@Schema(example = "SYS54-88")
|
||||||
public String externalId;
|
public String externalId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostOfficesResponse")
|
@Schema(description = "PostOfficesResponse")
|
||||||
public static final class PostOfficesResponse {
|
public static final class PostOfficesResponse {
|
||||||
|
|
||||||
private PostOfficesResponse() {
|
private PostOfficesResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutOfficesOfficeIdRequest")
|
@Schema(description = "PutOfficesOfficeIdRequest")
|
||||||
public static final class PutOfficesOfficeIdRequest {
|
public static final class PutOfficesOfficeIdRequest {
|
||||||
|
|
||||||
private PutOfficesOfficeIdRequest() {
|
private PutOfficesOfficeIdRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Name is updated")
|
@Schema(example = "Name is updated")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutOfficesOfficeIdResponse")
|
@Schema(description = "PutOfficesOfficeIdResponse")
|
||||||
public static final class PutOfficesOfficeIdResponse {
|
public static final class PutOfficesOfficeIdResponse {
|
||||||
|
|
||||||
private PutOfficesOfficeIdResponse() {
|
private PutOfficesOfficeIdResponse() {
|
||||||
@@ -128,13 +127,13 @@ final class OfficesApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Name is updated")
|
@Schema(example = "Name is updated")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutOfficesOfficeIdResponseChanges changes;
|
public PutOfficesOfficeIdResponseChanges changes;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-5
@@ -18,9 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.provisioning.api;
|
package org.apache.fineract.organisation.provisioning.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
@@ -50,8 +48,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/provisioningcategory")
|
@Path("/provisioningcategory")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Provisioning Category" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Provisioning Category", description = "") })
|
@Tag(name = "Provisioning Category", description = "")
|
||||||
public class ProvisioningCategoryApiResource {
|
public class ProvisioningCategoryApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext platformSecurityContext;
|
private final PlatformSecurityContext platformSecurityContext;
|
||||||
|
|||||||
+28
-30
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.provisioning.api;
|
package org.apache.fineract.organisation.provisioning.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -60,8 +60,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/provisioningcriteria")
|
@Path("/provisioningcriteria")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Provisioning Criteria" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Provisioning Criteria", description = "This defines the Provisioning Criteria") })
|
@Tag(name = "Provisioning Criteria", description = "This defines the Provisioning Criteria")
|
||||||
public class ProvisioningCriteriaApiResource {
|
public class ProvisioningCriteriaApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext platformSecurityContext;
|
private final PlatformSecurityContext platformSecurityContext;
|
||||||
@@ -110,10 +110,10 @@ public class ProvisioningCriteriaApiResource {
|
|||||||
@Path("{criteriaId}")
|
@Path("{criteriaId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieves a Provisioning Criteria", notes = "Retrieves a Provisioning Criteria")
|
@Operation(summary = "Retrieves a Provisioning Criteria", description = "Retrieves a Provisioning Criteria")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaCriteriaIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaCriteriaIdResponse.class))) })
|
||||||
public String retrieveProvisioningCriteria(@PathParam("criteriaId") @ApiParam(value = "criteriaId") final Long criteriaId,
|
public String retrieveProvisioningCriteria(@PathParam("criteriaId") @Parameter(description = "criteriaId") final Long criteriaId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
platformSecurityContext.authenticatedUser();
|
platformSecurityContext.authenticatedUser();
|
||||||
ProvisioningCriteriaData criteria = this.provisioningCriteriaReadPlatformService.retrieveProvisioningCriteria(criteriaId);
|
ProvisioningCriteriaData criteria = this.provisioningCriteriaReadPlatformService.retrieveProvisioningCriteria(criteriaId);
|
||||||
@@ -127,9 +127,9 @@ public class ProvisioningCriteriaApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieves all created Provisioning Criterias", notes = "Retrieves all created Provisioning Criterias")
|
@Operation(summary = "Retrieves all created Provisioning Criterias", description = "Retrieves all created Provisioning Criterias")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", responseContainer = "List", response = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaResponse.class)))) })
|
||||||
public String retrieveAllProvisioningCriterias(@Context final UriInfo uriInfo) {
|
public String retrieveAllProvisioningCriterias(@Context final UriInfo uriInfo) {
|
||||||
platformSecurityContext.authenticatedUser();
|
platformSecurityContext.authenticatedUser();
|
||||||
Collection<ProvisioningCriteriaData> data = this.provisioningCriteriaReadPlatformService.retrieveAllProvisioningCriterias();
|
Collection<ProvisioningCriteriaData> data = this.provisioningCriteriaReadPlatformService.retrieveAllProvisioningCriterias();
|
||||||
@@ -140,13 +140,12 @@ public class ProvisioningCriteriaApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a new Provisioning Criteria", notes = "Creates a new Provisioning Criteria\n" + "\n"
|
@Operation(summary = "Create a new Provisioning Criteria", description = "Creates a new Provisioning Criteria\n" + "\n"
|
||||||
+ "Mandatory Fields: \n" + "criteriaName\n" + "provisioningcriteria\n" + "\n" + "Optional Fields: \n" + "loanProducts")
|
+ "Mandatory Fields: \n" + "criteriaName\n" + "provisioningcriteria\n" + "\n" + "Optional Fields: \n" + "loanProducts")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.PostProvisioningCriteriaRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ProvisioningCriteriaApiResourceSwagger.PostProvisioningCriteriaRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ProvisioningCriteriaApiResourceSwagger.PostProvisioningCriteriaResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.PostProvisioningCriteriaResponse.class))) })
|
||||||
public String createProvisioningCriteria(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createProvisioningCriteria(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
CommandWrapper commandWrapper = null;
|
CommandWrapper commandWrapper = null;
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
commandWrapper = new CommandWrapperBuilder().createProvisioningCriteria().withJson(apiRequestBodyAsJson).build();
|
commandWrapper = new CommandWrapperBuilder().createProvisioningCriteria().withJson(apiRequestBodyAsJson).build();
|
||||||
@@ -158,14 +157,13 @@ public class ProvisioningCriteriaApiResource {
|
|||||||
@Path("{criteriaId}")
|
@Path("{criteriaId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Updates a new Provisioning Criteria", notes = "Updates a new Provisioning Criteria\n" + "\n"
|
@Operation(summary = "Updates a new Provisioning Criteria", description = "Updates a new Provisioning Criteria\n" + "\n"
|
||||||
+ "Optional Fields\n" + "criteriaName, loanProducts, provisioningcriteria")
|
+ "Optional Fields\n" + "criteriaName, loanProducts, provisioningcriteria")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.PutProvisioningCriteriaRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ProvisioningCriteriaApiResourceSwagger.PutProvisioningCriteriaRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ProvisioningCriteriaApiResourceSwagger.PutProvisioningCriteriaResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.PutProvisioningCriteriaResponse.class))) })
|
||||||
public String updateProvisioningCriteria(@PathParam("criteriaId") @ApiParam(value = "criteriaId") final Long criteriaId,
|
public String updateProvisioningCriteria(@PathParam("criteriaId") @Parameter(description = "criteriaId") final Long criteriaId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateProvisioningCriteria(criteriaId)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateProvisioningCriteria(criteriaId)
|
||||||
.withJson(apiRequestBodyAsJson).build();
|
.withJson(apiRequestBodyAsJson).build();
|
||||||
@@ -177,10 +175,10 @@ public class ProvisioningCriteriaApiResource {
|
|||||||
@Path("{criteriaId}")
|
@Path("{criteriaId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Deletes Provisioning Criteria", notes = "Deletes Provisioning Criteria")
|
@Operation(summary = "Deletes Provisioning Criteria", description = "Deletes Provisioning Criteria")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = ProvisioningCriteriaApiResourceSwagger.DeleteProvisioningCriteriaResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.DeleteProvisioningCriteriaResponse.class))) })
|
||||||
public String deleteProvisioningCriteria(@PathParam("criteriaId") @ApiParam(value = "criteriaId") final Long criteriaId) {
|
public String deleteProvisioningCriteria(@PathParam("criteriaId") @Parameter(description = "criteriaId") final Long criteriaId) {
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteProvisioningCriteria(criteriaId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteProvisioningCriteria(criteriaId).build();
|
||||||
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
|
|||||||
+20
-21
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.provisioning.api;
|
package org.apache.fineract.organisation.provisioning.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import org.apache.fineract.organisation.provisioning.data.ProvisioningCriteriaDefinitionData;
|
import org.apache.fineract.organisation.provisioning.data.ProvisioningCriteriaDefinitionData;
|
||||||
import org.apache.fineract.portfolio.loanproduct.data.LoanProductData;
|
import org.apache.fineract.portfolio.loanproduct.data.LoanProductData;
|
||||||
@@ -33,76 +32,76 @@ final class ProvisioningCriteriaApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostProvisioningCriteriaRequest")
|
@Schema(description = "PostProvisioningCriteriaRequest")
|
||||||
public static final class PostProvisioningCriteriaRequest {
|
public static final class PostProvisioningCriteriaRequest {
|
||||||
|
|
||||||
private PostProvisioningCriteriaRequest() {
|
private PostProvisioningCriteriaRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "High Risk Products Criteria")
|
@Schema(example = "High Risk Products Criteria")
|
||||||
public String criteriaName;
|
public String criteriaName;
|
||||||
public Collection<LoanProductData> loanProducts;
|
public Collection<LoanProductData> loanProducts;
|
||||||
public Collection<ProvisioningCriteriaDefinitionData> provisioningcriteria;
|
public Collection<ProvisioningCriteriaDefinitionData> provisioningcriteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostProvisioningCriteriaResponse")
|
@Schema(description = "PostProvisioningCriteriaResponse")
|
||||||
public static final class PostProvisioningCriteriaResponse {
|
public static final class PostProvisioningCriteriaResponse {
|
||||||
|
|
||||||
private PostProvisioningCriteriaResponse() {
|
private PostProvisioningCriteriaResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetProvisioningCriteriaResponse")
|
@Schema(description = "GetProvisioningCriteriaResponse")
|
||||||
public static final class GetProvisioningCriteriaResponse {
|
public static final class GetProvisioningCriteriaResponse {
|
||||||
|
|
||||||
private GetProvisioningCriteriaResponse() {
|
private GetProvisioningCriteriaResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long criteriaId;
|
public Long criteriaId;
|
||||||
@ApiModelProperty(example = "High Risk Products Criteria")
|
@Schema(example = "High Risk Products Criteria")
|
||||||
public String criteriaName;
|
public String criteriaName;
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String createdBy;
|
public String createdBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetProvisioningCriteriaCriteriaIdResponse")
|
@Schema(description = "GetProvisioningCriteriaCriteriaIdResponse")
|
||||||
public static final class GetProvisioningCriteriaCriteriaIdResponse {
|
public static final class GetProvisioningCriteriaCriteriaIdResponse {
|
||||||
|
|
||||||
private GetProvisioningCriteriaCriteriaIdResponse() {
|
private GetProvisioningCriteriaCriteriaIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long criteriaId;
|
public Long criteriaId;
|
||||||
@ApiModelProperty(example = "High Risk Products Criteria")
|
@Schema(example = "High Risk Products Criteria")
|
||||||
public String criteriaName;
|
public String criteriaName;
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String createdBy;
|
public String createdBy;
|
||||||
public Collection<LoanProductData> loanProducts;
|
public Collection<LoanProductData> loanProducts;
|
||||||
public Collection<ProvisioningCriteriaDefinitionData> provisioningcriteria;
|
public Collection<ProvisioningCriteriaDefinitionData> provisioningcriteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutProvisioningCriteriaRequest")
|
@Schema(description = "PutProvisioningCriteriaRequest")
|
||||||
public static final class PutProvisioningCriteriaRequest {
|
public static final class PutProvisioningCriteriaRequest {
|
||||||
|
|
||||||
private PutProvisioningCriteriaRequest() {
|
private PutProvisioningCriteriaRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "High Risk Products Criteria")
|
@Schema(example = "High Risk Products Criteria")
|
||||||
public String criteriaName;
|
public String criteriaName;
|
||||||
public Collection<LoanProductData> loanProducts;
|
public Collection<LoanProductData> loanProducts;
|
||||||
public Collection<ProvisioningCriteriaDefinitionData> provisioningcriteria;
|
public Collection<ProvisioningCriteriaDefinitionData> provisioningcriteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutProvisioningCriteriaResponse")
|
@Schema(description = "PutProvisioningCriteriaResponse")
|
||||||
public static final class PutProvisioningCriteriaResponse {
|
public static final class PutProvisioningCriteriaResponse {
|
||||||
|
|
||||||
private PutProvisioningCriteriaResponse() {
|
private PutProvisioningCriteriaResponse() {
|
||||||
@@ -113,23 +112,23 @@ final class ProvisioningCriteriaApiResourceSwagger {
|
|||||||
|
|
||||||
private PutProvisioningCriteriaResponseChanges() {}
|
private PutProvisioningCriteriaResponseChanges() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "High Risk Products Criteria")
|
@Schema(example = "High Risk Products Criteria")
|
||||||
public String criteriaName;
|
public String criteriaName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutProvisioningCriteriaResponseChanges changes;
|
public PutProvisioningCriteriaResponseChanges changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteProvisioningCriteriaResponse")
|
@Schema(description = "DeleteProvisioningCriteriaResponse")
|
||||||
public static final class DeleteProvisioningCriteriaResponse {
|
public static final class DeleteProvisioningCriteriaResponse {
|
||||||
|
|
||||||
private DeleteProvisioningCriteriaResponse() {
|
private DeleteProvisioningCriteriaResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+34
-34
@@ -20,15 +20,15 @@ package org.apache.fineract.organisation.staff.api;
|
|||||||
|
|
||||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||||
import com.sun.jersey.multipart.FormDataParam;
|
import com.sun.jersey.multipart.FormDataParam;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -69,9 +69,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/staff")
|
@Path("/staff")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Staff" })
|
@Tag(name = "Staff", description = "Allows you to model staff members. At present the key role of significance is whether this staff member is a loan officer or not.")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Staff", description = "Allows you to model staff members. At present the key role of significance is whether this staff member is a loan officer or not.") })
|
|
||||||
public class StaffApiResource {
|
public class StaffApiResource {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,20 +109,20 @@ public class StaffApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Staff", notes = "Returns the list of staff members.\n" + "\n" + "Example Requests:\n" + "\n"
|
@Operation(summary = "Retrieve Staff", 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"
|
+ "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"
|
+ "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"
|
+ "and for status=ALL, it Returns both ACTIVE and INACTIVE Staff.\n" + "\n" + "Example Requests:\n" + "\n"
|
||||||
+ "staff?status=active")
|
+ "staff?status=active")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = StaffApiResourceSwagger.GetStaffResponse.class, responseContainer = "List"),
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = StaffApiResourceSwagger.GetStaffResponse.class)))),
|
||||||
@ApiResponse(code = 200, message = "GET https://DomainName/api/v1/staff?status={ACTIVE|INACTIVE|ALL}", response = StaffApiResourceSwagger.GetStaffResponse.class) })
|
@ApiResponse(responseCode = "200", description = "GET https://DomainName/api/v1/staff?status={ACTIVE|INACTIVE|ALL}", content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.GetStaffResponse.class))) })
|
||||||
public String retrieveStaff(@Context final UriInfo uriInfo,
|
public String retrieveStaff(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch,
|
@QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch,
|
||||||
@QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId,
|
@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId,
|
||||||
@DefaultValue("false") @QueryParam("staffInOfficeHierarchy") @ApiParam(value = "staffInOfficeHierarchy") final boolean staffInOfficeHierarchy,
|
@DefaultValue("false") @QueryParam("staffInOfficeHierarchy") @Parameter(description = "staffInOfficeHierarchy") final boolean staffInOfficeHierarchy,
|
||||||
@DefaultValue("false") @QueryParam("loanOfficersOnly") @ApiParam(value = "loanOfficersOnly") final boolean loanOfficersOnly,
|
@DefaultValue("false") @QueryParam("loanOfficersOnly") @Parameter(description = "loanOfficersOnly") final boolean loanOfficersOnly,
|
||||||
@DefaultValue("active") @QueryParam("status") @ApiParam(value = "status") final String status) {
|
@DefaultValue("active") @QueryParam("status") @Parameter(description = "status") final String status) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|
||||||
@@ -142,12 +140,12 @@ public class StaffApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create a staff member", notes = "Creates a staff member.\n" + "\n" + "Mandatory Fields: \n"
|
@Operation(summary = "Create a staff member", description = "Creates a staff member.\n" + "\n" + "Mandatory Fields: \n"
|
||||||
+ "officeId, firstname, lastname\n" + "\n" + "Optional Fields: \n" + "isLoanOfficer, isActive")
|
+ "officeId, firstname, lastname\n" + "\n" + "Optional Fields: \n" + "isLoanOfficer, isActive")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.PostStaffRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = StaffApiResourceSwagger.PostStaffRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = StaffApiResourceSwagger.PostStaffResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.PostStaffResponse.class))) })
|
||||||
public String createStaff(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String createStaff(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createStaff().withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createStaff().withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -160,10 +158,12 @@ public class StaffApiResource {
|
|||||||
@Path("{staffId}")
|
@Path("{staffId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a Staff Member", notes = "Returns the details of a Staff Member.\n" + "\n" + "Example Requests:\n"
|
@Operation(summary = "Retrieve a Staff Member", description = "Returns the details of a Staff Member.\n" + "\n" + "Example Requests:\n"
|
||||||
+ "\n" + "staff/1")
|
+ "\n" + "staff/1")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = StaffApiResourceSwagger.GetStaffResponse.class) })
|
@ApiResponses({
|
||||||
public String retreiveStaff(@PathParam("staffId") @ApiParam(value = "staffId") final Long staffId, @Context final UriInfo uriInfo) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.GetStaffResponse.class))) })
|
||||||
|
public String retreiveStaff(@PathParam("staffId") @Parameter(description = "staffId") final Long staffId,
|
||||||
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
|
||||||
@@ -181,12 +181,12 @@ public class StaffApiResource {
|
|||||||
@Path("{staffId}")
|
@Path("{staffId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Staff Member", notes = "Updates the details of a staff member.")
|
@Operation(summary = "Update a Staff Member", description = "Updates the details of a staff member.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.PutStaffRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = StaffApiResourceSwagger.PutStaffRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = StaffApiResourceSwagger.PutStaffResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.PutStaffResponse.class))) })
|
||||||
public String updateStaff(@PathParam("staffId") @ApiParam(value = "staffId") final Long staffId,
|
public String updateStaff(@PathParam("staffId") @Parameter(description = "staffId") final Long staffId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateStaff(staffId).withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateStaff(staffId).withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
|
|||||||
+34
-35
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.staff.api;
|
package org.apache.fineract.organisation.staff.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,94 +31,94 @@ final class StaffApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostStaffRequest")
|
@Schema(description = "PostStaffRequest")
|
||||||
public static final class PostStaffRequest {
|
public static final class PostStaffRequest {
|
||||||
|
|
||||||
private PostStaffRequest() {
|
private PostStaffRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "John")
|
@Schema(example = "John")
|
||||||
public String firstname;
|
public String firstname;
|
||||||
@ApiModelProperty(example = "Doe")
|
@Schema(example = "Doe")
|
||||||
public String lastname;
|
public String lastname;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isLoanOfficer;
|
public Boolean isLoanOfficer;
|
||||||
@ApiModelProperty(example = "17H")
|
@Schema(example = "17H")
|
||||||
public String externalId;
|
public String externalId;
|
||||||
@ApiModelProperty(example = "+353851239876")
|
@Schema(example = "+353851239876")
|
||||||
public String mobileNo;
|
public String mobileNo;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isActive;
|
public Boolean isActive;
|
||||||
@ApiModelProperty(example = "01 January 2009")
|
@Schema(example = "01 January 2009")
|
||||||
public LocalDate joiningDate;
|
public LocalDate joiningDate;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostStaffResponse")
|
@Schema(description = "PostStaffResponse")
|
||||||
public static final class PostStaffResponse {
|
public static final class PostStaffResponse {
|
||||||
|
|
||||||
private PostStaffResponse() {
|
private PostStaffResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetStaffResponse")
|
@Schema(description = "GetStaffResponse")
|
||||||
public static final class GetStaffResponse {
|
public static final class GetStaffResponse {
|
||||||
|
|
||||||
private GetStaffResponse() {
|
private GetStaffResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "John")
|
@Schema(example = "John")
|
||||||
public String firstname;
|
public String firstname;
|
||||||
@ApiModelProperty(example = "Doe")
|
@Schema(example = "Doe")
|
||||||
public String lastname;
|
public String lastname;
|
||||||
@ApiModelProperty(example = "Doe, John")
|
@Schema(example = "Doe, John")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isLoanOfficer;
|
public Boolean isLoanOfficer;
|
||||||
@ApiModelProperty(example = "17H")
|
@Schema(example = "17H")
|
||||||
public String externalId;
|
public String externalId;
|
||||||
@ApiModelProperty(example = "+353851239876")
|
@Schema(example = "+353851239876")
|
||||||
public Boolean isActive;
|
public Boolean isActive;
|
||||||
@ApiModelProperty(example = "[2009,8,1]")
|
@Schema(example = "[2009,8,1]")
|
||||||
public LocalDate joiningDate;
|
public LocalDate joiningDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutStaffRequest")
|
@Schema(description = "PutStaffRequest")
|
||||||
public static final class PutStaffRequest {
|
public static final class PutStaffRequest {
|
||||||
|
|
||||||
private PutStaffRequest() {
|
private PutStaffRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean isLoanOfficer;
|
public Boolean isLoanOfficer;
|
||||||
@ApiModelProperty(example = "17Hbb")
|
@Schema(example = "17Hbb")
|
||||||
public String externalId;
|
public String externalId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutStaffResponse")
|
@Schema(description = "PutStaffResponse")
|
||||||
public static final class PutStaffResponse {
|
public static final class PutStaffResponse {
|
||||||
|
|
||||||
private PutStaffResponse() {
|
private PutStaffResponse() {
|
||||||
@@ -130,15 +129,15 @@ final class StaffApiResourceSwagger {
|
|||||||
|
|
||||||
private PutStaffResponseChanges() {}
|
private PutStaffResponseChanges() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean isLoanOfficer;
|
public Boolean isLoanOfficer;
|
||||||
@ApiModelProperty(example = "17Hbb")
|
@Schema(example = "17Hbb")
|
||||||
public String externalId;
|
public String externalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-5
@@ -18,9 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.teller.api;
|
package org.apache.fineract.organisation.teller.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
@@ -41,8 +39,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("cashiers")
|
@Path("cashiers")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Cashiers" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Cashiers", description = "") })
|
@Tag(name = "Cashiers", description = "")
|
||||||
public class CashierApiResource {
|
public class CashierApiResource {
|
||||||
|
|
||||||
private final DefaultToApiJsonSerializer<CashierData> jsonSerializer;
|
private final DefaultToApiJsonSerializer<CashierData> jsonSerializer;
|
||||||
|
|||||||
+100
-102
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.teller.api;
|
package org.apache.fineract.organisation.teller.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
@@ -64,9 +64,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("tellers")
|
@Path("tellers")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Teller Cash Management" })
|
|
||||||
@SwaggerDefinition(tags = {
|
@Tag(name = "Teller Cash Management", description = "Teller cash management which will allow an organization to manage their cash transactions at branches or head office more effectively.")
|
||||||
@Tag(name = "Teller Cash Management", description = "Teller cash management which will allow an organization to manage their cash transactions at branches or head office more effectively.") })
|
|
||||||
public class TellerApiResource {
|
public class TellerApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext securityContext;
|
private final PlatformSecurityContext securityContext;
|
||||||
@@ -88,10 +87,10 @@ public class TellerApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "List all tellers", notes = "Retrieves list tellers")
|
@Operation(summary = "List all tellers", description = "Retrieves list tellers")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersResponse.class, responseContainer = "List") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersResponse.class)))) })
|
||||||
public String getTellerData(@QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId) {
|
public String getTellerData(@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId) {
|
||||||
final Collection<TellerData> foundTellers = this.readPlatformService.getTellers(officeId);
|
final Collection<TellerData> foundTellers = this.readPlatformService.getTellers(officeId);
|
||||||
|
|
||||||
return this.jsonSerializer.serialize(foundTellers);
|
return this.jsonSerializer.serialize(foundTellers);
|
||||||
@@ -101,9 +100,10 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}")
|
@Path("{tellerId}")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Retrieve tellers", notes = "")
|
@Operation(summary = "Retrieve tellers", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersResponse.class) })
|
@ApiResponses({
|
||||||
public String findTeller(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId) {
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersResponse.class))) })
|
||||||
|
public String findTeller(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId) {
|
||||||
final TellerData teller = this.readPlatformService.findTeller(tellerId);
|
final TellerData teller = this.readPlatformService.findTeller(tellerId);
|
||||||
|
|
||||||
return this.jsonSerializer.serialize(teller);
|
return this.jsonSerializer.serialize(teller);
|
||||||
@@ -112,12 +112,12 @@ public class TellerApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Create teller", notes = "Mandatory Fields\n" + "Teller name, OfficeId, Description, Start Date, Status\n"
|
@Operation(summary = "Create teller", description = "Mandatory Fields\n" + "Teller name, OfficeId, Description, Start Date, Status\n"
|
||||||
+ "Optional Fields\n" + "End Date")
|
+ "Optional Fields\n" + "End Date")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PostTellersRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PostTellersResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersResponse.class))) })
|
||||||
public String createTeller(@ApiParam(hidden = true) final String tellerData) {
|
public String createTeller(@Parameter(hidden = true) final String tellerData) {
|
||||||
final CommandWrapper request = new CommandWrapperBuilder().createTeller().withJson(tellerData).build();
|
final CommandWrapper request = new CommandWrapperBuilder().createTeller().withJson(tellerData).build();
|
||||||
|
|
||||||
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
||||||
@@ -129,12 +129,12 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}")
|
@Path("{tellerId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Update teller", notes = "")
|
@Operation(summary = "Update teller", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PutTellersRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PutTellersResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersResponse.class))) })
|
||||||
public String updateTeller(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String updateTeller(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@ApiParam(hidden = true) final String tellerData) {
|
@Parameter(hidden = true) final String tellerData) {
|
||||||
final CommandWrapper request = new CommandWrapperBuilder().updateTeller(tellerId).withJson(tellerData).build();
|
final CommandWrapper request = new CommandWrapperBuilder().updateTeller(tellerId).withJson(tellerData).build();
|
||||||
|
|
||||||
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
||||||
@@ -146,7 +146,7 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}")
|
@Path("{tellerId}")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public String deleteTeller(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId) {
|
public String deleteTeller(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId) {
|
||||||
final CommandWrapper request = new CommandWrapperBuilder().deleteTeller(tellerId).build();
|
final CommandWrapper request = new CommandWrapperBuilder().deleteTeller(tellerId).build();
|
||||||
|
|
||||||
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
||||||
@@ -158,11 +158,12 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers")
|
@Path("{tellerId}/cashiers")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "List Cashiers", notes = "")
|
@Operation(summary = "List Cashiers", description = "")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersResponse.class) })
|
@ApiResponses({
|
||||||
public String getCashierData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersResponse.class))) })
|
||||||
@QueryParam("fromdate") @ApiParam(value = "fromdate") final String fromDateStr,
|
public String getCashierData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@QueryParam("todate") @ApiParam(value = "todate") final String toDateStr) {
|
@QueryParam("fromdate") @Parameter(description = "fromdate") final String fromDateStr,
|
||||||
|
@QueryParam("todate") @Parameter(description = "todate") final String toDateStr) {
|
||||||
final DateTimeFormatter dateFormatter = ISODateTimeFormat.basicDate();
|
final DateTimeFormatter dateFormatter = ISODateTimeFormat.basicDate();
|
||||||
|
|
||||||
final Date fromDate = fromDateStr != null ? dateFormatter.parseDateTime(fromDateStr).toDate() : new Date();
|
final Date fromDate = fromDateStr != null ? dateFormatter.parseDateTime(fromDateStr).toDate() : new Date();
|
||||||
@@ -185,11 +186,11 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers/{cashierId}")
|
@Path("{tellerId}/cashiers/{cashierId}")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Retrieve a cashier", notes = "")
|
@Operation(summary = "Retrieve a cashier", description = "")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashierIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashierIdResponse.class))) })
|
||||||
public String findCashierData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String findCashierData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId) {
|
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId) {
|
||||||
final CashierData cashier = this.readPlatformService.findCashier(cashierId);
|
final CashierData cashier = this.readPlatformService.findCashier(cashierId);
|
||||||
|
|
||||||
return this.jsonSerializer.serialize(cashier);
|
return this.jsonSerializer.serialize(cashier);
|
||||||
@@ -199,10 +200,10 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers/template")
|
@Path("{tellerId}/cashiers/template")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Find Cashiers", notes = "")
|
@Operation(summary = "Find Cashiers", description = "")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersTemplateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersTemplateResponse.class))) })
|
||||||
public String getCashierTemplate(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId) {
|
public String getCashierTemplate(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId) {
|
||||||
|
|
||||||
final TellerData teller = this.readPlatformService.findTeller(tellerId);
|
final TellerData teller = this.readPlatformService.findTeller(tellerId);
|
||||||
Long officeId = teller.getOfficeId();
|
Long officeId = teller.getOfficeId();
|
||||||
@@ -216,14 +217,14 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers")
|
@Path("{tellerId}/cashiers")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Create Cashiers", notes = "Mandatory Fields: \n"
|
@Operation(summary = "Create Cashiers", description = "Mandatory Fields: \n"
|
||||||
+ "Cashier/staff, Fromm Date, To Date, Full Day or From time and To time\n" + "\n\n\n" + "Optional Fields: \n"
|
+ "Cashier/staff, Fromm Date, To Date, Full Day or From time and To time\n" + "\n\n\n" + "Optional Fields: \n"
|
||||||
+ "Description/Notes")
|
+ "Description/Notes")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PostTellersTellerIdCashiersRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PostTellersTellerIdCashiersResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersResponse.class))) })
|
||||||
public String createCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String createCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@ApiParam(hidden = true) final String cashierData) {
|
@Parameter(hidden = true) final String cashierData) {
|
||||||
final CommandWrapper request = new CommandWrapperBuilder().allocateTeller(tellerId).withJson(cashierData).build();
|
final CommandWrapper request = new CommandWrapperBuilder().allocateTeller(tellerId).withJson(cashierData).build();
|
||||||
|
|
||||||
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
||||||
@@ -235,14 +236,13 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers/{cashierId}")
|
@Path("{tellerId}/cashiers/{cashierId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Update Cashier", notes = "")
|
@Operation(summary = "Update Cashier", description = "")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdResponse.class))) })
|
||||||
public String updateCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String updateCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId,
|
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId,
|
||||||
@ApiParam(hidden = true) final String cashierDate) {
|
@Parameter(hidden = true) final String cashierDate) {
|
||||||
final CommandWrapper request = new CommandWrapperBuilder().updateAllocationTeller(tellerId, cashierId).withJson(cashierDate)
|
final CommandWrapper request = new CommandWrapperBuilder().updateAllocationTeller(tellerId, cashierId).withJson(cashierDate)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -255,11 +255,11 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers/{cashierId}")
|
@Path("{tellerId}/cashiers/{cashierId}")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Delete Cashier", notes = "")
|
@Operation(summary = "Delete Cashier", description = "")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.DeleteTellersTellerIdCashiersCashierIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.DeleteTellersTellerIdCashiersCashierIdResponse.class))) })
|
||||||
public String deleteCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String deleteCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId) {
|
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId) {
|
||||||
final CommandWrapper request = new CommandWrapperBuilder().deleteAllocationTeller(tellerId, cashierId).build();
|
final CommandWrapper request = new CommandWrapperBuilder().deleteAllocationTeller(tellerId, cashierId).build();
|
||||||
|
|
||||||
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request);
|
||||||
@@ -271,14 +271,13 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers/{cashierId}/allocate")
|
@Path("{tellerId}/cashiers/{cashierId}/allocate")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Allocate Cash To Cashier", notes = "Mandatory Fields: \n" + "Date, Amount, Currency, Notes/Comments")
|
@Operation(summary = "Allocate Cash To Cashier", description = "Mandatory Fields: \n" + "Date, Amount, Currency, Notes/Comments")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdAllocateRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdAllocateRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdAllocateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdAllocateResponse.class))) })
|
||||||
public String allocateCashToCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String allocateCashToCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId,
|
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId,
|
||||||
@ApiParam(hidden = true) final String cashierTxnData) {
|
@Parameter(hidden = true) final String cashierTxnData) {
|
||||||
final CommandWrapper request = new CommandWrapperBuilder().allocateCashToCashier(tellerId, cashierId).withJson(cashierTxnData)
|
final CommandWrapper request = new CommandWrapperBuilder().allocateCashToCashier(tellerId, cashierId).withJson(cashierTxnData)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -292,14 +291,13 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers/{cashierId}/settle")
|
@Path("{tellerId}/cashiers/{cashierId}/settle")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Settle Cash From Cashier", notes = "Mandatory Fields\n" + "Date, Amount, Currency, Notes/Comments")
|
@Operation(summary = "Settle Cash From Cashier", description = "Mandatory Fields\n" + "Date, Amount, Currency, Notes/Comments")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdSettleRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdSettleRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdSettleResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdSettleResponse.class))) })
|
||||||
public String settleCashFromCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String settleCashFromCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId,
|
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId,
|
||||||
@ApiParam(hidden = true) final String cashierTxnData) {
|
@Parameter(hidden = true) final String cashierTxnData) {
|
||||||
final CommandWrapper request = new CommandWrapperBuilder().settleCashFromCashier(tellerId, cashierId).withJson(cashierTxnData)
|
final CommandWrapper request = new CommandWrapperBuilder().settleCashFromCashier(tellerId, cashierId).withJson(cashierTxnData)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -313,16 +311,16 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers/{cashierId}/transactions")
|
@Path("{tellerId}/cashiers/{cashierId}/transactions")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Retrieve Cashier Transaction", notes = "")
|
@Operation(summary = "Retrieve Cashier Transaction", description = "")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsResponse.class, responseContainer = "List") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsResponse.class)))) })
|
||||||
public String getTransactionsForCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String getTransactionsForCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId,
|
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId,
|
||||||
@QueryParam("currencyCode") @ApiParam(value = "currencyCode") final String currencyCode,
|
@QueryParam("currencyCode") @Parameter(description = "currencyCode") final String currencyCode,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) {
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) {
|
||||||
final TellerData teller = this.readPlatformService.findTeller(tellerId);
|
final TellerData teller = this.readPlatformService.findTeller(tellerId);
|
||||||
final CashierData cashier = this.readPlatformService.findCashier(cashierId);
|
final CashierData cashier = this.readPlatformService.findCashier(cashierId);
|
||||||
|
|
||||||
@@ -339,16 +337,16 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers/{cashierId}/summaryandtransactions")
|
@Path("{tellerId}/cashiers/{cashierId}/summaryandtransactions")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Transactions Wtih Summary For Cashier", notes = "")
|
@Operation(summary = "Transactions Wtih Summary For Cashier", description = "")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse.class))) })
|
||||||
public String getTransactionsWtihSummaryForCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String getTransactionsWtihSummaryForCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId,
|
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId,
|
||||||
@QueryParam("currencyCode") @ApiParam(value = "currencyCode") final String currencyCode,
|
@QueryParam("currencyCode") @Parameter(description = "currencyCode") final String currencyCode,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) {
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) {
|
||||||
final TellerData teller = this.readPlatformService.findTeller(tellerId);
|
final TellerData teller = this.readPlatformService.findTeller(tellerId);
|
||||||
final CashierData cashier = this.readPlatformService.findCashier(cashierId);
|
final CashierData cashier = this.readPlatformService.findCashier(cashierId);
|
||||||
|
|
||||||
@@ -367,11 +365,11 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers/{cashierId}/transactions/template")
|
@Path("{tellerId}/cashiers/{cashierId}/transactions/template")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@ApiOperation(value = "Retrieve Cashier Transaction Template", notes = "")
|
@Operation(summary = "Retrieve Cashier Transaction Template", description = "")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse.class))) })
|
||||||
public String getCashierTxnTemplate(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String getCashierTxnTemplate(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId) {
|
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId) {
|
||||||
|
|
||||||
final CashierTransactionData cashierTxnTemplate = this.readPlatformService.retrieveCashierTxnTemplate(cashierId);
|
final CashierTransactionData cashierTxnTemplate = this.readPlatformService.retrieveCashierTxnTemplate(cashierId);
|
||||||
|
|
||||||
@@ -382,8 +380,8 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/transactions")
|
@Path("{tellerId}/transactions")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public String getTransactionData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String getTransactionData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@QueryParam("dateRange") @ApiParam(value = "dateRange") final String dateRange) {
|
@QueryParam("dateRange") @Parameter(description = "dateRange") final String dateRange) {
|
||||||
final DateRange dateRangeHolder = DateRange.fromString(dateRange);
|
final DateRange dateRangeHolder = DateRange.fromString(dateRange);
|
||||||
|
|
||||||
final Collection<TellerTransactionData> transactions = this.readPlatformService.fetchTellerTransactionsByTellerId(tellerId,
|
final Collection<TellerTransactionData> transactions = this.readPlatformService.fetchTellerTransactionsByTellerId(tellerId,
|
||||||
@@ -396,8 +394,8 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/transactions/{transactionId}")
|
@Path("{tellerId}/transactions/{transactionId}")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public String findTransactionData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerid,
|
public String findTransactionData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerid,
|
||||||
@PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId) {
|
@PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId) {
|
||||||
final TellerTransactionData transaction = this.readPlatformService.findTellerTransaction(transactionId);
|
final TellerTransactionData transaction = this.readPlatformService.findTellerTransaction(transactionId);
|
||||||
|
|
||||||
return this.jsonSerializer.serialize(transaction);
|
return this.jsonSerializer.serialize(transaction);
|
||||||
@@ -407,9 +405,9 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/journals")
|
@Path("{tellerId}/journals")
|
||||||
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public String getJournalData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId,
|
public String getJournalData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
|
||||||
@QueryParam("cashierId") @ApiParam(value = "cashierId") final Long cashierDate,
|
@QueryParam("cashierId") @Parameter(description = "cashierId") final Long cashierDate,
|
||||||
@QueryParam("dateRange") @ApiParam(value = "dateRange") final String dateRange) {
|
@QueryParam("dateRange") @Parameter(description = "dateRange") final String dateRange) {
|
||||||
final DateRange dateRangeHolder = DateRange.fromString(dateRange);
|
final DateRange dateRangeHolder = DateRange.fromString(dateRange);
|
||||||
|
|
||||||
final Collection<TellerJournalData> journals = this.readPlatformService.fetchTellerJournals(tellerId, cashierDate,
|
final Collection<TellerJournalData> journals = this.readPlatformService.fetchTellerJournals(tellerId, cashierDate,
|
||||||
|
|||||||
+140
-141
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.teller.api;
|
package org.apache.fineract.organisation.teller.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -41,95 +40,95 @@ final class TellerApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetTellersResponse")
|
@Schema(description = "GetTellersResponse")
|
||||||
public static final class GetTellersResponse {
|
public static final class GetTellersResponse {
|
||||||
|
|
||||||
private GetTellersResponse() {
|
private GetTellersResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Long debitAccountId;
|
public Long debitAccountId;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Long creditAccountId;
|
public Long creditAccountId;
|
||||||
@ApiModelProperty(example = "Teller3")
|
@Schema(example = "Teller3")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "[2015,2,1]")
|
@Schema(example = "[2015,2,1]")
|
||||||
public LocalDate startDate;
|
public LocalDate startDate;
|
||||||
@ApiModelProperty(example = "ACTIVE")
|
@Schema(example = "ACTIVE")
|
||||||
public TellerStatus status;
|
public TellerStatus status;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostTellersRequest")
|
@Schema(description = "PostTellersRequest")
|
||||||
public static final class PostTellersRequest {
|
public static final class PostTellersRequest {
|
||||||
|
|
||||||
private PostTellersRequest() {
|
private PostTellersRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Teller3")
|
@Schema(example = "Teller3")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "cash handling")
|
@Schema(example = "cash handling")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "ACTIVE")
|
@Schema(example = "ACTIVE")
|
||||||
public TellerStatus status;
|
public TellerStatus status;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy")
|
@Schema(example = "dd-MM-yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "01 February 2015")
|
@Schema(example = "01 February 2015")
|
||||||
public LocalDate startDate;
|
public LocalDate startDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostTellersResponse")
|
@Schema(description = "PostTellersResponse")
|
||||||
public static final class PostTellersResponse {
|
public static final class PostTellersResponse {
|
||||||
|
|
||||||
private PostTellersResponse() {
|
private PostTellersResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "5")
|
@Schema(example = "5")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutTellersRequest")
|
@Schema(description = "PutTellersRequest")
|
||||||
public static final class PutTellersRequest {
|
public static final class PutTellersRequest {
|
||||||
|
|
||||||
private PutTellersRequest() {
|
private PutTellersRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "Teller3")
|
@Schema(example = "Teller3")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "teller cash handling")
|
@Schema(example = "teller cash handling")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "ACTIVE")
|
@Schema(example = "ACTIVE")
|
||||||
public TellerStatus status;
|
public TellerStatus status;
|
||||||
@ApiModelProperty(example = "28 February 2015")
|
@Schema(example = "28 February 2015")
|
||||||
public LocalDate endDate;
|
public LocalDate endDate;
|
||||||
@ApiModelProperty(example = "01 February 2015")
|
@Schema(example = "01 February 2015")
|
||||||
public LocalDate startDate;
|
public LocalDate startDate;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy")
|
@Schema(example = "dd-MM-yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutTellersResponse")
|
@Schema(description = "PutTellersResponse")
|
||||||
public static final class PutTellersResponse {
|
public static final class PutTellersResponse {
|
||||||
|
|
||||||
private PutTellersResponse() {
|
private PutTellersResponse() {
|
||||||
@@ -140,140 +139,140 @@ final class TellerApiResourceSwagger {
|
|||||||
|
|
||||||
private PutTellersResponseChanges() {}
|
private PutTellersResponseChanges() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "teller cash handling")
|
@Schema(example = "teller cash handling")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "28 February 2015")
|
@Schema(example = "28 February 2015")
|
||||||
public LocalDate endDate;
|
public LocalDate endDate;
|
||||||
@ApiModelProperty(example = "01 February 2015")
|
@Schema(example = "01 February 2015")
|
||||||
public LocalDate startDate;
|
public LocalDate startDate;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy")
|
@Schema(example = "dd-MM-yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "5")
|
@Schema(example = "5")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
public PutTellersResponseChanges changes;
|
public PutTellersResponseChanges changes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetTellersTellerIdCashiersResponse")
|
@Schema(description = "GetTellersTellerIdCashiersResponse")
|
||||||
public static final class GetTellersTellerIdCashiersResponse {
|
public static final class GetTellersTellerIdCashiersResponse {
|
||||||
|
|
||||||
private GetTellersTellerIdCashiersResponse() {
|
private GetTellersTellerIdCashiersResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long tellerId;
|
public Long tellerId;
|
||||||
@ApiModelProperty(example = "Teller1")
|
@Schema(example = "Teller1")
|
||||||
public String tellerName;
|
public String tellerName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
public Collection<CashierData> cashiers;
|
public Collection<CashierData> cashiers;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostTellersTellerIdCashiersRequest")
|
@Schema(description = "PostTellersTellerIdCashiersRequest")
|
||||||
public static final class PostTellersTellerIdCashiersRequest {
|
public static final class PostTellersTellerIdCashiersRequest {
|
||||||
|
|
||||||
private PostTellersTellerIdCashiersRequest() {
|
private PostTellersTellerIdCashiersRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "28 February 2015")
|
@Schema(example = "28 February 2015")
|
||||||
public LocalDate endDate;
|
public LocalDate endDate;
|
||||||
@ApiModelProperty(example = "teller cash handling")
|
@Schema(example = "teller cash handling")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isFullDay;
|
public Boolean isFullDay;
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long staffId;
|
public Long staffId;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy")
|
@Schema(example = "dd-MM-yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "01 February 2015")
|
@Schema(example = "01 February 2015")
|
||||||
public LocalDate startDate;
|
public LocalDate startDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostTellersTellerIdCashiersResponse")
|
@Schema(description = "PostTellersTellerIdCashiersResponse")
|
||||||
public static final class PostTellersTellerIdCashiersResponse {
|
public static final class PostTellersTellerIdCashiersResponse {
|
||||||
|
|
||||||
private PostTellersTellerIdCashiersResponse() {
|
private PostTellersTellerIdCashiersResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long subResourceId;
|
public Long subResourceId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetTellersTellerIdCashiersCashierIdResponse")
|
@Schema(description = "GetTellersTellerIdCashiersCashierIdResponse")
|
||||||
public static final class GetTellersTellerIdCashiersCashierIdResponse {
|
public static final class GetTellersTellerIdCashiersCashierIdResponse {
|
||||||
|
|
||||||
private GetTellersTellerIdCashiersCashierIdResponse() {
|
private GetTellersTellerIdCashiersCashierIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long tellerId;
|
public Long tellerId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long staffId;
|
public Long staffId;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "Feb 20, 2015 12:00:00 AM")
|
@Schema(example = "Feb 20, 2015 12:00:00 AM")
|
||||||
public LocalDate startDate;
|
public LocalDate startDate;
|
||||||
@ApiModelProperty(example = "Feb 27, 2015 12:00:00 AM")
|
@Schema(example = "Feb 27, 2015 12:00:00 AM")
|
||||||
public LocalDate endDate;
|
public LocalDate endDate;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isFullDay;
|
public Boolean isFullDay;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String startTime;
|
public String startTime;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public String endTime;
|
public String endTime;
|
||||||
@ApiModelProperty(example = "Teller1")
|
@Schema(example = "Teller1")
|
||||||
public String tellerName;
|
public String tellerName;
|
||||||
@ApiModelProperty(example = "Staff1, Test")
|
@Schema(example = "Staff1, Test")
|
||||||
public String staffName;
|
public String staffName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutTellersTellerIdCashiersCashierIdRequest")
|
@Schema(description = "PutTellersTellerIdCashiersCashierIdRequest")
|
||||||
public static final class PutTellersTellerIdCashiersCashierIdRequest {
|
public static final class PutTellersTellerIdCashiersCashierIdRequest {
|
||||||
|
|
||||||
private PutTellersTellerIdCashiersCashierIdRequest() {
|
private PutTellersTellerIdCashiersCashierIdRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "25 February 2015")
|
@Schema(example = "25 February 2015")
|
||||||
public LocalDate endDate;
|
public LocalDate endDate;
|
||||||
@ApiModelProperty(example = "Cashier updated.")
|
@Schema(example = "Cashier updated.")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isFullDay;
|
public Boolean isFullDay;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long staffId;
|
public Long staffId;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy")
|
@Schema(example = "dd-MM-yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "01 February 2015")
|
@Schema(example = "01 February 2015")
|
||||||
public LocalDate startDate;
|
public LocalDate startDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutTellersTellerIdCashiersCashierIdResponse")
|
@Schema(description = "PutTellersTellerIdCashiersCashierIdResponse")
|
||||||
public static final class PutTellersTellerIdCashiersCashierIdResponse {
|
public static final class PutTellersTellerIdCashiersCashierIdResponse {
|
||||||
|
|
||||||
private PutTellersTellerIdCashiersCashierIdResponse() {
|
private PutTellersTellerIdCashiersCashierIdResponse() {
|
||||||
@@ -284,207 +283,207 @@ final class TellerApiResourceSwagger {
|
|||||||
|
|
||||||
private PutTellersTellerIdCashiersCashierIdResponseChanges() {}
|
private PutTellersTellerIdCashiersCashierIdResponseChanges() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "25 February 2015")
|
@Schema(example = "25 February 2015")
|
||||||
public LocalDate endDate;
|
public LocalDate endDate;
|
||||||
@ApiModelProperty(example = "Cashier updated.")
|
@Schema(example = "Cashier updated.")
|
||||||
public String description;
|
public String description;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy")
|
@Schema(example = "dd-MM-yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long subResourceId;
|
public Long subResourceId;
|
||||||
public PutTellersTellerIdCashiersCashierIdResponseChanges changes;
|
public PutTellersTellerIdCashiersCashierIdResponseChanges changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "DeleteTellersTellerIdCashiersCashierIdResponse")
|
@Schema(description = "DeleteTellersTellerIdCashiersCashierIdResponse")
|
||||||
public static final class DeleteTellersTellerIdCashiersCashierIdResponse {
|
public static final class DeleteTellersTellerIdCashiersCashierIdResponse {
|
||||||
|
|
||||||
private DeleteTellersTellerIdCashiersCashierIdResponse() {
|
private DeleteTellersTellerIdCashiersCashierIdResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetTellersTellerIdCashiersTemplateResponse")
|
@Schema(description = "GetTellersTellerIdCashiersTemplateResponse")
|
||||||
public static final class GetTellersTellerIdCashiersTemplateResponse {
|
public static final class GetTellersTellerIdCashiersTemplateResponse {
|
||||||
|
|
||||||
private GetTellersTellerIdCashiersTemplateResponse() {
|
private GetTellersTellerIdCashiersTemplateResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long tellerId;
|
public Long tellerId;
|
||||||
@ApiModelProperty(example = "Teller1")
|
@Schema(example = "Teller1")
|
||||||
public String tellerName;
|
public String tellerName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
public Collection<StaffData> staffOptions;
|
public Collection<StaffData> staffOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetTellersTellerIdCashiersCashiersIdTransactionsResponse")
|
@Schema(description = "GetTellersTellerIdCashiersCashiersIdTransactionsResponse")
|
||||||
public static final class GetTellersTellerIdCashiersCashiersIdTransactionsResponse {
|
public static final class GetTellersTellerIdCashiersCashiersIdTransactionsResponse {
|
||||||
|
|
||||||
private GetTellersTellerIdCashiersCashiersIdTransactionsResponse() {
|
private GetTellersTellerIdCashiersCashiersIdTransactionsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "8")
|
@Schema(example = "8")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "15")
|
@Schema(example = "15")
|
||||||
public Long cashierId;
|
public Long cashierId;
|
||||||
public CashierTxnType txnType;
|
public CashierTxnType txnType;
|
||||||
@ApiModelProperty(example = "1000")
|
@Schema(example = "1000")
|
||||||
public BigDecimal txnAmount;
|
public BigDecimal txnAmount;
|
||||||
@ApiModelProperty(example = "Feb 25, 2015 12:00:00 AM")
|
@Schema(example = "Feb 25, 2015 12:00:00 AM")
|
||||||
public Date txnDate;
|
public Date txnDate;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long entityId;
|
public Long entityId;
|
||||||
@ApiModelProperty(example = "loans")
|
@Schema(example = "loans")
|
||||||
public String entityType;
|
public String entityType;
|
||||||
@ApiModelProperty(example = "Disbursement, Loan:2-000000002,Client:1-Test 1")
|
@Schema(example = "Disbursement, Loan:2-000000002,Client:1-Test 1")
|
||||||
public String txnNote;
|
public String txnNote;
|
||||||
@ApiModelProperty(example = "Feb 25, 2015 12:00:00 AM")
|
@Schema(example = "Feb 25, 2015 12:00:00 AM")
|
||||||
public Date createdDate;
|
public Date createdDate;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Long tellerId;
|
public Long tellerId;
|
||||||
@ApiModelProperty(example = "B, Ramesh")
|
@Schema(example = "B, Ramesh")
|
||||||
public String cashierName;
|
public String cashierName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostTellersTellerIdCashiersCashierIdAllocateRequest")
|
@Schema(description = "PostTellersTellerIdCashiersCashierIdAllocateRequest")
|
||||||
public static final class PostTellersTellerIdCashiersCashierIdAllocateRequest {
|
public static final class PostTellersTellerIdCashiersCashierIdAllocateRequest {
|
||||||
|
|
||||||
private PostTellersTellerIdCashiersCashierIdAllocateRequest() {
|
private PostTellersTellerIdCashiersCashierIdAllocateRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "USD")
|
@Schema(example = "USD")
|
||||||
public String currencyCode;
|
public String currencyCode;
|
||||||
@ApiModelProperty(example = "5000")
|
@Schema(example = "5000")
|
||||||
public BigDecimal txnAmount;
|
public BigDecimal txnAmount;
|
||||||
@ApiModelProperty(example = "allocating cash")
|
@Schema(example = "allocating cash")
|
||||||
public String txnNote;
|
public String txnNote;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy")
|
@Schema(example = "dd-MM-yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "01 February 2015")
|
@Schema(example = "01 February 2015")
|
||||||
public Date txnDate;
|
public Date txnDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostTellersTellerIdCashiersCashierIdAllocateResponse")
|
@Schema(description = "PostTellersTellerIdCashiersCashierIdAllocateResponse")
|
||||||
public static final class PostTellersTellerIdCashiersCashierIdAllocateResponse {
|
public static final class PostTellersTellerIdCashiersCashierIdAllocateResponse {
|
||||||
|
|
||||||
private PostTellersTellerIdCashiersCashierIdAllocateResponse() {
|
private PostTellersTellerIdCashiersCashierIdAllocateResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long subResourceId;
|
public Long subResourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostTellersTellerIdCashiersCashierIdSettleRequest")
|
@Schema(description = "PostTellersTellerIdCashiersCashierIdSettleRequest")
|
||||||
public static final class PostTellersTellerIdCashiersCashierIdSettleRequest {
|
public static final class PostTellersTellerIdCashiersCashierIdSettleRequest {
|
||||||
|
|
||||||
private PostTellersTellerIdCashiersCashierIdSettleRequest() {
|
private PostTellersTellerIdCashiersCashierIdSettleRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "USD")
|
@Schema(example = "USD")
|
||||||
public String currencyCode;
|
public String currencyCode;
|
||||||
@ApiModelProperty(example = "2000")
|
@Schema(example = "2000")
|
||||||
public BigDecimal txnAmount;
|
public BigDecimal txnAmount;
|
||||||
@ApiModelProperty(example = "cash settlement")
|
@Schema(example = "cash settlement")
|
||||||
public String txnNote;
|
public String txnNote;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd-MM-yyyy")
|
@Schema(example = "dd-MM-yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "20 February 2015")
|
@Schema(example = "20 February 2015")
|
||||||
public Date txnDate;
|
public Date txnDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostTellersTellerIdCashiersCashierIdSettleResponse")
|
@Schema(description = "PostTellersTellerIdCashiersCashierIdSettleResponse")
|
||||||
public static final class PostTellersTellerIdCashiersCashierIdSettleResponse {
|
public static final class PostTellersTellerIdCashiersCashierIdSettleResponse {
|
||||||
|
|
||||||
private PostTellersTellerIdCashiersCashierIdSettleResponse() {
|
private PostTellersTellerIdCashiersCashierIdSettleResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
@ApiModelProperty(example = "5")
|
@Schema(example = "5")
|
||||||
public Long subResourceId;
|
public Long subResourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse")
|
@Schema(description = "GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse")
|
||||||
public static final class GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse {
|
public static final class GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse {
|
||||||
|
|
||||||
private GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse() {
|
private GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "7000.000000")
|
@Schema(example = "7000.000000")
|
||||||
public BigDecimal sumCashAllocation;
|
public BigDecimal sumCashAllocation;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public BigDecimal sumInwardCash;
|
public BigDecimal sumInwardCash;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public BigDecimal sumOutwardCash;
|
public BigDecimal sumOutwardCash;
|
||||||
@ApiModelProperty(example = "50.000000")
|
@Schema(example = "50.000000")
|
||||||
public BigDecimal sumCashSettlement;
|
public BigDecimal sumCashSettlement;
|
||||||
@ApiModelProperty(example = "6950.000000")
|
@Schema(example = "6950.000000")
|
||||||
public BigDecimal netCash;
|
public BigDecimal netCash;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public long tellerId;
|
public long tellerId;
|
||||||
@ApiModelProperty(example = "Teller1")
|
@Schema(example = "Teller1")
|
||||||
public String tellerName;
|
public String tellerName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public long cashierId;
|
public long cashierId;
|
||||||
@ApiModelProperty(example = "Staff1, Test")
|
@Schema(example = "Staff1, Test")
|
||||||
public String cashierName;
|
public String cashierName;
|
||||||
public Page<CashierTransactionData> cashierTransactions;
|
public Page<CashierTransactionData> cashierTransactions;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse")
|
@Schema(description = "GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse")
|
||||||
public static final class GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse {
|
public static final class GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse {
|
||||||
|
|
||||||
private GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse() {
|
private GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long cashierId;
|
public Long cashierId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Long tellerId;
|
public Long tellerId;
|
||||||
@ApiModelProperty(example = "Teller1")
|
@Schema(example = "Teller1")
|
||||||
public String tellerName;
|
public String tellerName;
|
||||||
@ApiModelProperty(example = "Staff1, Test")
|
@Schema(example = "Staff1, Test")
|
||||||
public String cashierName;
|
public String cashierName;
|
||||||
public CashierData cashierData;
|
public CashierData cashierData;
|
||||||
@ApiModelProperty(example = "Feb 20, 2015 12:00:00 AM")
|
@Schema(example = "Feb 20, 2015 12:00:00 AM")
|
||||||
public LocalDate startDate;
|
public LocalDate startDate;
|
||||||
@ApiModelProperty(example = "Feb 27, 2015 12:00:00 AM")
|
@Schema(example = "Feb 27, 2015 12:00:00 AM")
|
||||||
public LocalDate endDate;
|
public LocalDate endDate;
|
||||||
public Collection<CurrencyData> currencyOptions;
|
public Collection<CurrencyData> currencyOptions;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-5
@@ -18,9 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.teller.api;
|
package org.apache.fineract.organisation.teller.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -41,8 +39,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("cashiersjournal")
|
@Path("cashiersjournal")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Cashier Journals" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Cashier Journals", description = "") })
|
@Tag(name = "Cashier Journals", description = "")
|
||||||
public class TellerJournalApiResource {
|
public class TellerJournalApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext securityContext;
|
private final PlatformSecurityContext securityContext;
|
||||||
|
|||||||
+22
-21
@@ -18,15 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.workingdays.api;
|
package org.apache.fineract.organisation.workingdays.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.PUT;
|
import javax.ws.rs.PUT;
|
||||||
@@ -52,11 +52,11 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/workingdays")
|
@Path("/workingdays")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Working days" })
|
|
||||||
@SwaggerDefinition(tags = { @Tag(name = "Working days", description = "The days of the week that are workdays.\n" + "\n"
|
@Tag(name = "Working days", description = "The days of the week that are workdays.\n" + "\n"
|
||||||
+ "Rescheduling of repayments when it falls on a non-working is turned on /off by enable/disable reschedule-future-repayments parameter in Global configurations\n"
|
+ "Rescheduling of repayments when it falls on a non-working is turned on /off by enable/disable reschedule-future-repayments parameter in Global configurations\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "Allow transactions on non-working days is configurable by enabling/disbaling the allow-transactions-on-non_workingday parameter in Global configurations.") })
|
+ "Allow transactions on non-working days is configurable by enabling/disbaling the allow-transactions-on-non_workingday parameter in Global configurations.")
|
||||||
public class WorkingDaysApiResource {
|
public class WorkingDaysApiResource {
|
||||||
|
|
||||||
private final DefaultToApiJsonSerializer<WorkingDaysData> toApiJsonSerializer;
|
private final DefaultToApiJsonSerializer<WorkingDaysData> toApiJsonSerializer;
|
||||||
@@ -80,9 +80,9 @@ public class WorkingDaysApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Working days", notes = "Example Requests:\n" + "\n" + "workingdays")
|
@Operation(summary = "List Working days", description = "Example Requests:\n" + "\n" + "workingdays")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "", response = WorkingDaysApiResourceSwagger.GetWorkingDaysResponse.class, responseContainer = "list") })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = WorkingDaysApiResourceSwagger.GetWorkingDaysResponse.class)))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo) {
|
public String retrieveAll(@Context final UriInfo uriInfo) {
|
||||||
this.context.authenticatedUser().validateHasReadPermission(WorkingDaysApiConstants.WORKING_DAYS_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(WorkingDaysApiConstants.WORKING_DAYS_RESOURCE_NAME);
|
||||||
final WorkingDaysData workingDaysData = this.workingDaysReadPlatformService.retrieve();
|
final WorkingDaysData workingDaysData = this.workingDaysReadPlatformService.retrieve();
|
||||||
@@ -94,12 +94,12 @@ public class WorkingDaysApiResource {
|
|||||||
@PUT
|
@PUT
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update a Working Day", notes = "Mandatory Fields\n"
|
@Operation(summary = "Update a Working Day", description = "Mandatory Fields\n"
|
||||||
+ "recurrence,repaymentRescheduleType,extendTermForDailyRepayments,locale")
|
+ "recurrence,repaymentRescheduleType,extendTermForDailyRepayments,locale")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = WorkingDaysApiResourceSwagger.PutWorkingDaysRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = WorkingDaysApiResourceSwagger.PutWorkingDaysRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = WorkingDaysApiResourceSwagger.PutWorkingDaysResponse.class) })
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = WorkingDaysApiResourceSwagger.PutWorkingDaysResponse.class))) })
|
||||||
public String update(@ApiParam(hidden = true) final String jsonRequestBody) {
|
public String update(@Parameter(hidden = true) final String jsonRequestBody) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateWorkingDays().withJson(jsonRequestBody).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateWorkingDays().withJson(jsonRequestBody).build();
|
||||||
|
|
||||||
@@ -112,9 +112,10 @@ public class WorkingDaysApiResource {
|
|||||||
@Path("/template")
|
@Path("/template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Working Days Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for working days.\n"
|
@Operation(summary = "Working Days Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for working days.\n"
|
||||||
+ "\n" + "Example Request:\n" + "\n" + "workingdays/template")
|
+ "\n" + "Example Request:\n" + "\n" + "workingdays/template")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "", response = WorkingDaysApiResourceSwagger.GetWorkingDaysTemplateResponse.class) })
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = WorkingDaysApiResourceSwagger.GetWorkingDaysTemplateResponse.class))) })
|
||||||
public String template(@Context final UriInfo uriInfo) {
|
public String template(@Context final UriInfo uriInfo) {
|
||||||
this.context.authenticatedUser().validateHasReadPermission(WorkingDaysApiConstants.WORKING_DAYS_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(WorkingDaysApiConstants.WORKING_DAYS_RESOURCE_NAME);
|
||||||
|
|
||||||
|
|||||||
+13
-14
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.workingdays.api;
|
package org.apache.fineract.organisation.workingdays.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
|
|
||||||
@@ -33,23 +32,23 @@ final class WorkingDaysApiResourceSwagger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetWorkingDaysResponse")
|
@Schema(description = "GetWorkingDaysResponse")
|
||||||
public static final class GetWorkingDaysResponse {
|
public static final class GetWorkingDaysResponse {
|
||||||
|
|
||||||
private GetWorkingDaysResponse() {
|
private GetWorkingDaysResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR")
|
@Schema(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR")
|
||||||
public String recurrence;
|
public String recurrence;
|
||||||
public EnumOptionData repaymentRescheduleType;
|
public EnumOptionData repaymentRescheduleType;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean extendTermForDailyRepayments;
|
public Boolean extendTermForDailyRepayments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetWorkingDaysTemplateResponse")
|
@Schema(description = "GetWorkingDaysTemplateResponse")
|
||||||
public static final class GetWorkingDaysTemplateResponse {
|
public static final class GetWorkingDaysTemplateResponse {
|
||||||
|
|
||||||
private GetWorkingDaysTemplateResponse() {
|
private GetWorkingDaysTemplateResponse() {
|
||||||
@@ -59,31 +58,31 @@ final class WorkingDaysApiResourceSwagger {
|
|||||||
public Collection<EnumOptionData> repaymentRescheduleOptions;
|
public Collection<EnumOptionData> repaymentRescheduleOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutWorkingDaysRequest")
|
@Schema(description = "PutWorkingDaysRequest")
|
||||||
public static final class PutWorkingDaysRequest {
|
public static final class PutWorkingDaysRequest {
|
||||||
|
|
||||||
private PutWorkingDaysRequest() {
|
private PutWorkingDaysRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR")
|
@Schema(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR")
|
||||||
public String recurrence;
|
public String recurrence;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public EnumOptionData repaymentRescheduleType;
|
public EnumOptionData repaymentRescheduleType;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean extendTermForDailyRepayments;
|
public Boolean extendTermForDailyRepayments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutWorkingDaysResponse")
|
@Schema(description = "PutWorkingDaysResponse")
|
||||||
public static final class PutWorkingDaysResponse {
|
public static final class PutWorkingDaysResponse {
|
||||||
|
|
||||||
private PutWorkingDaysResponse() {
|
private PutWorkingDaysResponse() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long resourceId;
|
public Long resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+53
-57
@@ -18,15 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.account.api;
|
package org.apache.fineract.portfolio.account.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.POST;
|
import javax.ws.rs.POST;
|
||||||
@@ -56,9 +55,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/accounttransfers")
|
@Path("/accounttransfers")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Account Transfers" })
|
@Tag(name = "Account Transfers", description = "Ability to be able to transfer monetary funds from one account to another.\n\nNote: At present only savings account to savings account transfers are supported.")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Account Transfers", description = "Ability to be able to transfer monetary funds from one account to another.\n\nNote: At present only savings account to savings account transfers are supported.") })
|
|
||||||
public class AccountTransfersApiResource {
|
public class AccountTransfersApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -84,21 +81,22 @@ public class AccountTransfersApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Account Transfer Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\n"
|
@Operation(summary = "Retrieve Account Transfer Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\n"
|
||||||
+ "\n\n" + "Field Defaults\n\n" + "Allowed Value Lists\n\n" + "Example Requests:\n\n" + "\n\n"
|
+ "\n\n" + "Field Defaults\n\n" + "Allowed Value Lists\n\n" + "Example Requests:\n\n" + "\n\n"
|
||||||
+ "accounttransfers/template?fromAccountType=2&fromOfficeId=1\n\n" + "\n\n"
|
+ "accounttransfers/template?fromAccountType=2&fromOfficeId=1\n\n" + "\n\n"
|
||||||
+ "accounttransfers/template?fromAccountType=2&fromOfficeId=1&fromClientId=1\n\n" + "\n\n"
|
+ "accounttransfers/template?fromAccountType=2&fromOfficeId=1&fromClientId=1\n\n" + "\n\n"
|
||||||
+ "accounttransfers/template?fromClientId=1&fromAccountType=2&fromAccountId=1")
|
+ "accounttransfers/template?fromClientId=1&fromAccountType=2&fromAccountId=1")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateResponse.class))) })
|
||||||
public String template(@QueryParam("fromOfficeId") @ApiParam(value = "fromOfficeId") final Long fromOfficeId,
|
public String template(@QueryParam("fromOfficeId") @Parameter(description = "fromOfficeId") final Long fromOfficeId,
|
||||||
@QueryParam("fromClientId") @ApiParam(value = "fromClientId") final Long fromClientId,
|
@QueryParam("fromClientId") @Parameter(description = "fromClientId") final Long fromClientId,
|
||||||
@QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccountId,
|
@QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccountId,
|
||||||
@QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType,
|
@QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType,
|
||||||
@QueryParam("toOfficeId") @ApiParam(value = "toOfficeId") final Long toOfficeId,
|
@QueryParam("toOfficeId") @Parameter(description = "toOfficeId") final Long toOfficeId,
|
||||||
@QueryParam("toClientId") @ApiParam(value = "toClientId") final Long toClientId,
|
@QueryParam("toClientId") @Parameter(description = "toClientId") final Long toClientId,
|
||||||
@QueryParam("toAccountId") @ApiParam(value = "toAccountId") final Long toAccountId,
|
@QueryParam("toAccountId") @Parameter(description = "toAccountId") final Long toAccountId,
|
||||||
@QueryParam("toAccountType") @ApiParam(value = "toAccountType") final Integer toAccountType, @Context final UriInfo uriInfo) {
|
@QueryParam("toAccountType") @Parameter(description = "toAccountType") final Integer toAccountType,
|
||||||
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
|
||||||
|
|
||||||
@@ -112,12 +110,10 @@ public class AccountTransfersApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create new Transfer", httpMethod = "POST", notes = "Ability to create new transfer of monetary funds from one account to another.")
|
@Operation(summary = "Create new Transfer", description = "Ability to create new transfer of monetary funds from one account to another.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountTransfersApiResourceSwagger.PostAccountTransfersRequest.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersResponse.class)))
|
||||||
@ApiResponses({
|
public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
@ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.PostAccountTransfersResponse.class) })
|
|
||||||
public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createAccountTransfer().withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createAccountTransfer().withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
@@ -129,18 +125,18 @@ public class AccountTransfersApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List account transfers", httpMethod = "GET", notes = "Lists account's transfers\n\n" + "Example Requests:\n\n"
|
@Operation(summary = "List account transfers", description = "Lists account's transfers\n\n" + "Example Requests:\n\n" + "\n\n"
|
||||||
+ "\n\n" + "accounttransfers")
|
+ "accounttransfers")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.class))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo,
|
public String retrieveAll(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch,
|
@QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch,
|
||||||
@QueryParam("externalId") @ApiParam(value = "externalId") final String externalId,
|
@QueryParam("externalId") @Parameter(description = "externalId") final String externalId,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(example = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(example = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder,
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder,
|
||||||
@QueryParam("accountDetailId") @ApiParam(value = "accountDetailId") final Long accountDetailId) {
|
@QueryParam("accountDetailId") @Parameter(description = "accountDetailId") final Long accountDetailId) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
|
||||||
|
|
||||||
@@ -157,11 +153,11 @@ public class AccountTransfersApiResource {
|
|||||||
@Path("{transferId}")
|
@Path("{transferId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve account transfer", httpMethod = "GET", notes = "Retrieves account transfer\n\n"
|
@Operation(summary = "Retrieve account transfer", description = "Retrieves account transfer\n\n" + "Example Requests :\n\n" + "\n\n"
|
||||||
+ "Example Requests :\n\n" + "\n\n" + "accounttransfers/1")
|
+ "accounttransfers/1")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.GetAccountTransfersPageItems.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.GetAccountTransfersPageItems.class))) })
|
||||||
public String retrieveOne(@PathParam("transferId") @ApiParam(value = "transferId") final Long transferId,
|
public String retrieveOne(@PathParam("transferId") @Parameter(description = "transferId") final Long transferId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
|
||||||
@@ -176,19 +172,20 @@ public class AccountTransfersApiResource {
|
|||||||
@Path("templateRefundByTransfer")
|
@Path("templateRefundByTransfer")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Refund of an Active Loan by Transfer Template", httpMethod = "GET", notes = "Retrieves Refund of an Active Loan by Transfer Template"
|
@Operation(summary = "Retrieve Refund of an Active Loan by Transfer Template", description = "Retrieves Refund of an Active Loan by Transfer Template"
|
||||||
+ "Example Requests :\n\n" + "\n\n"
|
+ "Example Requests :\n\n" + "\n\n"
|
||||||
+ "accounttransfers/templateRefundByTransfer?fromAccountId=2&fromAccountType=1& toAccountId=1&toAccountType=2&toClientId=1&toOfficeId=1")
|
+ "accounttransfers/templateRefundByTransfer?fromAccountId=2&fromAccountType=1& toAccountId=1&toAccountType=2&toClientId=1&toOfficeId=1")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateRefundByTransferResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateRefundByTransferResponse.class))) })
|
||||||
public String templateRefundByTransfer(@QueryParam("fromOfficeId") @ApiParam(value = "fromOfficeId") final Long fromOfficeId,
|
public String templateRefundByTransfer(@QueryParam("fromOfficeId") @Parameter(description = "fromOfficeId") final Long fromOfficeId,
|
||||||
@QueryParam("fromClientId") @ApiParam(value = "fromClientId") final Long fromClientId,
|
@QueryParam("fromClientId") @Parameter(description = "fromClientId") final Long fromClientId,
|
||||||
@QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccountId,
|
@QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccountId,
|
||||||
@QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType,
|
@QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType,
|
||||||
@QueryParam("toOfficeId") @ApiParam(value = "toOfficeId") final Long toOfficeId,
|
@QueryParam("toOfficeId") @Parameter(description = "toOfficeId") final Long toOfficeId,
|
||||||
@QueryParam("toClientId") @ApiParam(value = "toClientId") final Long toClientId,
|
@QueryParam("toClientId") @Parameter(description = "toClientId") final Long toClientId,
|
||||||
@QueryParam("toAccountId") @ApiParam(value = "toAccountId") final Long toAccountId,
|
@QueryParam("toAccountId") @Parameter(description = "toAccountId") final Long toAccountId,
|
||||||
@QueryParam("toAccountType") @ApiParam(value = "toAccountType") final Integer toAccountType, @Context final UriInfo uriInfo) {
|
@QueryParam("toAccountType") @Parameter(description = "toAccountType") final Integer toAccountType,
|
||||||
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
|
||||||
|
|
||||||
@@ -203,12 +200,11 @@ public class AccountTransfersApiResource {
|
|||||||
@Path("refundByTransfer")
|
@Path("refundByTransfer")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Refund of an Active Loan by Transfer", httpMethod = "POST", notes = "Ability to refund an active loan by transferring to a savings account.")
|
@Operation(summary = "Refund of an Active Loan by Transfer", description = "Ability to refund an active loan by transferring to a savings account.")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersRefundByTransferRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountTransfersApiResourceSwagger.PostAccountTransfersRefundByTransferRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.PostAccountTransfersRefundByTransferResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersRefundByTransferResponse.class))) })
|
||||||
public String templateRefundByTransferPost(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String templateRefundByTransferPost(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().refundByTransfer().withJson(apiRequestBodyAsJson).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().refundByTransfer().withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
|
|||||||
+157
-158
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.account.api;
|
package org.apache.fineract.portfolio.account.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private AccountTransfersApiResourceSwagger() {}
|
private AccountTransfersApiResourceSwagger() {}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountTransfersTemplateResponse")
|
@Schema(description = "GetAccountTransfersTemplateResponse")
|
||||||
public static final class GetAccountTransfersTemplateResponse {
|
public static final class GetAccountTransfersTemplateResponse {
|
||||||
|
|
||||||
private GetAccountTransfersTemplateResponse() {}
|
private GetAccountTransfersTemplateResponse() {}
|
||||||
@@ -39,17 +38,17 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersFromOffice() {}
|
private GetAccountTransfersFromOffice() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "HO")
|
@Schema(example = "HO")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "HO")
|
@Schema(example = "HO")
|
||||||
public String nameDecorated;
|
public String nameDecorated;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer externalId;
|
public Integer externalId;
|
||||||
@ApiModelProperty(example = "[2009, 1, 1]")
|
@Schema(example = "[2009, 1, 1]")
|
||||||
public LocalDate openingDate;
|
public LocalDate openingDate;
|
||||||
@ApiModelProperty(example = ".")
|
@Schema(example = ".")
|
||||||
public String hierarchy;
|
public String hierarchy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,23 +56,23 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersFromAccountType() {}
|
private GetAccountTransfersFromAccountType() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountType.savings")
|
@Schema(example = "accountType.savings")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Savings Account")
|
@Schema(example = "Savings Account")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetAccountTransfersFromOfficeOptions {
|
static final class GetAccountTransfersFromOfficeOptions {
|
||||||
|
|
||||||
private GetAccountTransfersFromOfficeOptions() {}
|
private GetAccountTransfersFromOfficeOptions() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "HO")
|
@Schema(example = "HO")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "HO")
|
@Schema(example = "HO")
|
||||||
public String nameDecorated;
|
public String nameDecorated;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,13 +80,13 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersFromClientOptions() {}
|
private GetAccountTransfersFromClientOptions() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "Small shop")
|
@Schema(example = "Small shop")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer officeId;
|
public Integer officeId;
|
||||||
@ApiModelProperty(example = "HO")
|
@Schema(example = "HO")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,23 +94,23 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersFromAccountTypeOptions() {}
|
private GetAccountTransfersFromAccountTypeOptions() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountType.savings")
|
@Schema(example = "accountType.savings")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Savings Account")
|
@Schema(example = "Savings Account")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetAccountTransfersToOfficeOptions {
|
static final class GetAccountTransfersToOfficeOptions {
|
||||||
|
|
||||||
private GetAccountTransfersToOfficeOptions() {}
|
private GetAccountTransfersToOfficeOptions() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "HO")
|
@Schema(example = "HO")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "HO")
|
@Schema(example = "HO")
|
||||||
public String nameDecorated;
|
public String nameDecorated;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,17 +118,17 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersToAccountTypeOptions() {}
|
private GetAccountTransfersToAccountTypeOptions() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountType.savings")
|
@Schema(example = "accountType.savings")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Savings Account")
|
@Schema(example = "Savings Account")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Long transferAmount;
|
public Long transferAmount;
|
||||||
@ApiModelProperty(example = "[2013, 8, 15]")
|
@Schema(example = "[2013, 8, 15]")
|
||||||
public LocalDate transferDate;
|
public LocalDate transferDate;
|
||||||
public GetAccountTransfersFromOffice fromOffice;
|
public GetAccountTransfersFromOffice fromOffice;
|
||||||
public GetAccountTransfersFromAccountType fromAccountType;
|
public GetAccountTransfersFromAccountType fromAccountType;
|
||||||
@@ -140,51 +139,51 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
public Set<GetAccountTransfersToAccountTypeOptions> toAccountTypeOptions;
|
public Set<GetAccountTransfersToAccountTypeOptions> toAccountTypeOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountTransfersRequest")
|
@Schema(description = "PostAccountTransfersRequest")
|
||||||
public static final class PostAccountTransfersRequest {
|
public static final class PostAccountTransfersRequest {
|
||||||
|
|
||||||
private PostAccountTransfersRequest() {}
|
private PostAccountTransfersRequest() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer fromOfficeId;
|
public Integer fromOfficeId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer fromClientId;
|
public Integer fromClientId;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer fromAccountType;
|
public Integer fromAccountType;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer fromAccountId;
|
public Integer fromAccountId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer toOfficeId;
|
public Integer toOfficeId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer toClientId;
|
public Integer toClientId;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer toAccountType;
|
public Integer toAccountType;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer toAccountId;
|
public Integer toAccountId;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "01 August 2011")
|
@Schema(example = "01 August 2011")
|
||||||
public String transferDate;
|
public String transferDate;
|
||||||
@ApiModelProperty(example = "112.45")
|
@Schema(example = "112.45")
|
||||||
public Float transferAmount;
|
public Float transferAmount;
|
||||||
@ApiModelProperty(example = "A description of the transfer")
|
@Schema(example = "A description of the transfer")
|
||||||
public String transferDescription;
|
public String transferDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountTransfersResponse")
|
@Schema(description = "PostAccountTransfersResponse")
|
||||||
public static final class PostAccountTransfersResponse {
|
public static final class PostAccountTransfersResponse {
|
||||||
|
|
||||||
private PostAccountTransfersResponse() {}
|
private PostAccountTransfersResponse() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer savingsId;
|
public Integer savingsId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer resourceId;
|
public Integer resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountTransfersResponse")
|
@Schema(description = "GetAccountTransfersResponse")
|
||||||
public static final class GetAccountTransfersResponse {
|
public static final class GetAccountTransfersResponse {
|
||||||
|
|
||||||
private GetAccountTransfersResponse() {}
|
private GetAccountTransfersResponse() {}
|
||||||
@@ -197,17 +196,17 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersPageItemsCurrency() {}
|
private GetAccountTransfersPageItemsCurrency() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "USD")
|
@Schema(example = "USD")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "US Dollar")
|
@Schema(example = "US Dollar")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer decimalPlaces;
|
public Integer decimalPlaces;
|
||||||
@ApiModelProperty(example = "$")
|
@Schema(example = "$")
|
||||||
public String displaySymbol;
|
public String displaySymbol;
|
||||||
@ApiModelProperty(example = "currency.USD")
|
@Schema(example = "currency.USD")
|
||||||
public String nameCode;
|
public String nameCode;
|
||||||
@ApiModelProperty(example = "US Dollar ($)")
|
@Schema(example = "US Dollar ($)")
|
||||||
public String displayLabel;
|
public String displayLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,9 +214,9 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersPageItemsFromOffice() {}
|
private GetAccountTransfersPageItemsFromOffice() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "HO")
|
@Schema(example = "HO")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,9 +224,9 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersPageItemsFromAccount() {}
|
private GetAccountTransfersPageItemsFromAccount() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "000000001")
|
@Schema(example = "000000001")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,24 +234,24 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersPageItemsToAccountType() {}
|
private GetAccountTransfersPageItemsToAccountType() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountType.loan")
|
@Schema(example = "accountType.loan")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Loan Account")
|
@Schema(example = "Loan Account")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean reversed;
|
public Boolean reversed;
|
||||||
public GetAccountTransfersPageItemsCurrency currency;
|
public GetAccountTransfersPageItemsCurrency currency;
|
||||||
@ApiModelProperty(example = "200")
|
@Schema(example = "200")
|
||||||
public Float transferAmount;
|
public Float transferAmount;
|
||||||
@ApiModelProperty(example = "[2013, 4, 1]")
|
@Schema(example = "[2013, 4, 1]")
|
||||||
public LocalDate transferDate;
|
public LocalDate transferDate;
|
||||||
@ApiModelProperty(example = "pay off loan from savings.")
|
@Schema(example = "pay off loan from savings.")
|
||||||
public String transferDescription;
|
public String transferDescription;
|
||||||
public GetAccountTransfersPageItemsFromOffice fromOffice;
|
public GetAccountTransfersPageItemsFromOffice fromOffice;
|
||||||
public GetAccountTransfersTemplateResponse.GetAccountTransfersFromClientOptions fromClient;
|
public GetAccountTransfersTemplateResponse.GetAccountTransfersFromClientOptions fromClient;
|
||||||
@@ -264,12 +263,12 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
public GetAccountTransfersPageItemsFromAccount toAccount;
|
public GetAccountTransfersPageItemsFromAccount toAccount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Integer totalFilteredRecords;
|
public Integer totalFilteredRecords;
|
||||||
public Set<GetAccountTransfersPageItems> pageItems;
|
public Set<GetAccountTransfersPageItems> pageItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountTransfersTemplateRefundByTransferResponse")
|
@Schema(description = "GetAccountTransfersTemplateRefundByTransferResponse")
|
||||||
public static final class GetAccountTransfersTemplateRefundByTransferResponse {
|
public static final class GetAccountTransfersTemplateRefundByTransferResponse {
|
||||||
|
|
||||||
private GetAccountTransfersTemplateRefundByTransferResponse() {}
|
private GetAccountTransfersTemplateRefundByTransferResponse() {}
|
||||||
@@ -278,19 +277,19 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersTemplateRefundByTransferCurrency() {}
|
private GetAccountTransfersTemplateRefundByTransferCurrency() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "USD")
|
@Schema(example = "USD")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "US Dollar")
|
@Schema(example = "US Dollar")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer decimalPlaces;
|
public Integer decimalPlaces;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer inMultiplesOf;
|
public Integer inMultiplesOf;
|
||||||
@ApiModelProperty(example = "$")
|
@Schema(example = "$")
|
||||||
public String displaySymbol;
|
public String displaySymbol;
|
||||||
@ApiModelProperty(example = "currency.USD")
|
@Schema(example = "currency.USD")
|
||||||
public String nameCode;
|
public String nameCode;
|
||||||
@ApiModelProperty(example = "US Dollar ($)")
|
@Schema(example = "US Dollar ($)")
|
||||||
public String displayLabel;
|
public String displayLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,17 +297,17 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersTemplateRefundByTransferFromOffice() {}
|
private GetAccountTransfersTemplateRefundByTransferFromOffice() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String nameDecorated;
|
public String nameDecorated;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer externalId;
|
public Integer externalId;
|
||||||
@ApiModelProperty(example = "[2009, 1, 1]")
|
@Schema(example = "[2009, 1, 1]")
|
||||||
public LocalDate openingDate;
|
public LocalDate openingDate;
|
||||||
@ApiModelProperty(example = ".")
|
@Schema(example = ".")
|
||||||
public String hierarchy;
|
public String hierarchy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,12 +319,12 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersStatus() {}
|
private GetAccountTransfersStatus() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "300")
|
@Schema(example = "300")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "clientStatusType.active")
|
@Schema(example = "clientStatusType.active")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Active")
|
@Schema(example = "Active")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetAccountTransfersGender {
|
static final class GetAccountTransfersGender {
|
||||||
@@ -347,21 +346,21 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersTimeline() {}
|
private GetAccountTransfersTimeline() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "[2012, 2, 1]")
|
@Schema(example = "[2012, 2, 1]")
|
||||||
public LocalDate submittedOnDate;
|
public LocalDate submittedOnDate;
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String submittedByUsername;
|
public String submittedByUsername;
|
||||||
@ApiModelProperty(example = "App")
|
@Schema(example = "App")
|
||||||
public String submittedByFirstname;
|
public String submittedByFirstname;
|
||||||
@ApiModelProperty(example = "Administrator")
|
@Schema(example = "Administrator")
|
||||||
public String submittedByLastname;
|
public String submittedByLastname;
|
||||||
@ApiModelProperty(example = "[2012, 2, 1]")
|
@Schema(example = "[2012, 2, 1]")
|
||||||
public LocalDate activatedOnDate;
|
public LocalDate activatedOnDate;
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String activatedByUsername;
|
public String activatedByUsername;
|
||||||
@ApiModelProperty(example = "App")
|
@Schema(example = "App")
|
||||||
public String activatedByFirstname;
|
public String activatedByFirstname;
|
||||||
@ApiModelProperty(example = "Administrator")
|
@Schema(example = "Administrator")
|
||||||
public String activatedByLastname;
|
public String activatedByLastname;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,27 +369,27 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
private GetAccountTransfersGroups() {}
|
private GetAccountTransfersGroups() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "000000001")
|
@Schema(example = "000000001")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
public GetAccountTransfersStatus status;
|
public GetAccountTransfersStatus status;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean active;
|
public Boolean active;
|
||||||
@ApiModelProperty(example = "[2012, 2, 1]")
|
@Schema(example = "[2012, 2, 1]")
|
||||||
public LocalDate activationDate;
|
public LocalDate activationDate;
|
||||||
@ApiModelProperty(example = "Daniel")
|
@Schema(example = "Daniel")
|
||||||
public String firstname;
|
public String firstname;
|
||||||
@ApiModelProperty(example = "Owusu")
|
@Schema(example = "Owusu")
|
||||||
public String lastname;
|
public String lastname;
|
||||||
@ApiModelProperty(example = "Daniel Owusu")
|
@Schema(example = "Daniel Owusu")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
public GetAccountTransfersGender gender;
|
public GetAccountTransfersGender gender;
|
||||||
public GetAccountTransfersClientType clientType;
|
public GetAccountTransfersClientType clientType;
|
||||||
public GetAccountTransfersClientClassification clientClassification;
|
public GetAccountTransfersClientClassification clientClassification;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer officeId;
|
public Integer officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
public GetAccountTransfersTimeline timeline;
|
public GetAccountTransfersTimeline timeline;
|
||||||
public GetAccountTransfersGroups groups;
|
public GetAccountTransfersGroups groups;
|
||||||
@@ -400,22 +399,22 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersTemplateRefundByTransferFromAccount() {}
|
private GetAccountTransfersTemplateRefundByTransferFromAccount() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "000000002")
|
@Schema(example = "000000002")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer clientId;
|
public Integer clientId;
|
||||||
@ApiModelProperty(example = "Daniel Owusu")
|
@Schema(example = "Daniel Owusu")
|
||||||
public String clientName;
|
public String clientName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer productId;
|
public Integer productId;
|
||||||
@ApiModelProperty(example = "CTRL")
|
@Schema(example = "CTRL")
|
||||||
public String productName;
|
public String productName;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer fieldOfficerId;
|
public Integer fieldOfficerId;
|
||||||
public GetAccountTransfersTemplateRefundByTransferCurrency currency;
|
public GetAccountTransfersTemplateRefundByTransferCurrency currency;
|
||||||
@ApiModelProperty(example = "130")
|
@Schema(example = "130")
|
||||||
public Float amtForTransfer;
|
public Float amtForTransfer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -423,13 +422,13 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersTemplateRefundByTransferToClient() {}
|
private GetAccountTransfersTemplateRefundByTransferToClient() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "Daniel Owusu")
|
@Schema(example = "Daniel Owusu")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer officeId;
|
public Integer officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,19 +436,19 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersTemplateRefundByTransferToAccount() {}
|
private GetAccountTransfersTemplateRefundByTransferToAccount() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "000000001")
|
@Schema(example = "000000001")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer clientId;
|
public Integer clientId;
|
||||||
@ApiModelProperty(example = "Daniel Owusu")
|
@Schema(example = "Daniel Owusu")
|
||||||
public String clientName;
|
public String clientName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer productId;
|
public Integer productId;
|
||||||
@ApiModelProperty(example = "TEST")
|
@Schema(example = "TEST")
|
||||||
public String productName;
|
public String productName;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer fieldOfficerId;
|
public Integer fieldOfficerId;
|
||||||
public GetAccountTransfersTemplateRefundByTransferCurrency currency;
|
public GetAccountTransfersTemplateRefundByTransferCurrency currency;
|
||||||
}
|
}
|
||||||
@@ -458,11 +457,11 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersTemplateRefundByTransferFromOfficeOptions() {}
|
private GetAccountTransfersTemplateRefundByTransferFromOfficeOptions() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String nameDecorated;
|
public String nameDecorated;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,13 +469,13 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersTemplateRefundByTransferFromClientOptions() {}
|
private GetAccountTransfersTemplateRefundByTransferFromClientOptions() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "Daniel Owusu")
|
@Schema(example = "Daniel Owusu")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer officeId;
|
public Integer officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -484,27 +483,27 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountTransfersTemplateRefundByTransferFromAccountOptions() {}
|
private GetAccountTransfersTemplateRefundByTransferFromAccountOptions() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "000000002")
|
@Schema(example = "000000002")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer clientId;
|
public Integer clientId;
|
||||||
@ApiModelProperty(example = "Daniel Owusu")
|
@Schema(example = "Daniel Owusu")
|
||||||
public String clientName;
|
public String clientName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer productId;
|
public Integer productId;
|
||||||
@ApiModelProperty(example = "CTRL")
|
@Schema(example = "CTRL")
|
||||||
public String productName;
|
public String productName;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer fieldOfficerId;
|
public Integer fieldOfficerId;
|
||||||
public GetAccountTransfersTemplateRefundByTransferCurrency currency;
|
public GetAccountTransfersTemplateRefundByTransferCurrency currency;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetAccountTransfersTemplateRefundByTransferCurrency currency;
|
public GetAccountTransfersTemplateRefundByTransferCurrency currency;
|
||||||
@ApiModelProperty(example = "130")
|
@Schema(example = "130")
|
||||||
public Float transferAmount;
|
public Float transferAmount;
|
||||||
@ApiModelProperty(example = "[2014, 11, 1]")
|
@Schema(example = "[2014, 11, 1]")
|
||||||
public LocalDate transferDate;
|
public LocalDate transferDate;
|
||||||
public GetAccountTransfersTemplateRefundByTransferFromOffice fromOffice;
|
public GetAccountTransfersTemplateRefundByTransferFromOffice fromOffice;
|
||||||
public GetAccountTransfersTemplateRefundByTransferFromClient fromClient;
|
public GetAccountTransfersTemplateRefundByTransferFromClient fromClient;
|
||||||
@@ -524,47 +523,47 @@ final class AccountTransfersApiResourceSwagger {
|
|||||||
public Set<GetAccountTransfersTemplateRefundByTransferToAccount> toAccountOptions;
|
public Set<GetAccountTransfersTemplateRefundByTransferToAccount> toAccountOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountTransfersRefundByTransferRequest")
|
@Schema(description = "PostAccountTransfersRefundByTransferRequest")
|
||||||
public static final class PostAccountTransfersRefundByTransferRequest {
|
public static final class PostAccountTransfersRefundByTransferRequest {
|
||||||
|
|
||||||
private PostAccountTransfersRefundByTransferRequest() {}
|
private PostAccountTransfersRefundByTransferRequest() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer fromAccountId;
|
public Integer fromAccountId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer fromAccountType;
|
public Integer fromAccountType;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer toOfficeId;
|
public Integer toOfficeId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer toClientId;
|
public Integer toClientId;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer toAccountType;
|
public Integer toAccountType;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer toAccountId;
|
public Integer toAccountId;
|
||||||
@ApiModelProperty(example = "130")
|
@Schema(example = "130")
|
||||||
public Float transferAmount;
|
public Float transferAmount;
|
||||||
@ApiModelProperty(example = "31 October 2014")
|
@Schema(example = "31 October 2014")
|
||||||
public String transferDate;
|
public String transferDate;
|
||||||
@ApiModelProperty(example = "Transfer refund to my savings account")
|
@Schema(example = "Transfer refund to my savings account")
|
||||||
public String transferDescription;
|
public String transferDescription;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer fromClientId;
|
public Integer fromClientId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer fromOfficeId;
|
public Integer fromOfficeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountTransfersRefundByTransferResponse")
|
@Schema(description = "PostAccountTransfersRefundByTransferResponse")
|
||||||
public static final class PostAccountTransfersRefundByTransferResponse {
|
public static final class PostAccountTransfersRefundByTransferResponse {
|
||||||
|
|
||||||
private PostAccountTransfersRefundByTransferResponse() {}
|
private PostAccountTransfersRefundByTransferResponse() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer savingsId;
|
public Integer savingsId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer resourceId;
|
public Integer resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+55
-60
@@ -18,15 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.account.api;
|
package org.apache.fineract.portfolio.account.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -66,11 +65,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/standinginstructions")
|
@Path("/standinginstructions")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Standing Instructions" })
|
@Tag(name = "Standing Instructions", description = "Standing instructions (or standing orders) refer to instructions a bank account holder (\"the payer\") gives to his or her bank to pay a set amount at regular intervals to another's (\"the payee's\") account.\n"
|
||||||
@SwaggerDefinition(tags = {
|
+ "\n" + "Note: At present only savings account to savings account and savings account to Loan account transfers are permitted.")
|
||||||
@Tag(name = "Standing Instructions", description = "Standing instructions (or standing orders) refer to instructions a bank account holder (\"the payer\") gives to his or her bank to pay a set amount at regular intervals to another's (\"the payee's\") account.\n"
|
|
||||||
+ "\n"
|
|
||||||
+ "Note: At present only savings account to savings account and savings account to Loan account transfers are permitted.") })
|
|
||||||
public class StandingInstructionApiResource {
|
public class StandingInstructionApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -99,22 +95,23 @@ public class StandingInstructionApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Standing Instruction Template", httpMethod = "GET", notes = "This is a convenience resource. "
|
@Operation(summary = "Retrieve Standing Instruction Template", description = "This is a convenience resource. "
|
||||||
+ "It can be useful when building maintenance user interface screens for client applications. "
|
+ "It can be useful when building maintenance user interface screens for client applications. "
|
||||||
+ "The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n"
|
+ "The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n"
|
||||||
+ "Example Requests:\n" + "\n" + "standinginstructions/template?fromAccountType=2&fromOfficeId=1\n" + "\n"
|
+ "Example Requests:\n" + "\n" + "standinginstructions/template?fromAccountType=2&fromOfficeId=1\n" + "\n"
|
||||||
+ "standinginstructions/template?fromAccountType=2&fromOfficeId=1&fromClientId=1&transferType=1\n" + "\n"
|
+ "standinginstructions/template?fromAccountType=2&fromOfficeId=1&fromClientId=1&transferType=1\n" + "\n"
|
||||||
+ "standinginstructions/template?fromClientId=1&fromAccountType=2&fromAccountId=1&transferType=1")
|
+ "standinginstructions/template?fromClientId=1&fromAccountType=2&fromAccountId=1&transferType=1")
|
||||||
@ApiResponses(@ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.GetStandingInstructionsTemplateResponse.class))
|
@ApiResponses(@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.GetStandingInstructionsTemplateResponse.class))))
|
||||||
public String template(@QueryParam("fromOfficeId") @ApiParam(value = "fromOfficeId") final Long fromOfficeId,
|
public String template(@QueryParam("fromOfficeId") @Parameter(description = "fromOfficeId") final Long fromOfficeId,
|
||||||
@QueryParam("fromClientId") @ApiParam(value = "fromClientId") final Long fromClientId,
|
@QueryParam("fromClientId") @Parameter(description = "fromClientId") final Long fromClientId,
|
||||||
@QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccountId,
|
@QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccountId,
|
||||||
@QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType,
|
@QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType,
|
||||||
@QueryParam("toOfficeId") @ApiParam(value = "toOfficeId") final Long toOfficeId,
|
@QueryParam("toOfficeId") @Parameter(description = "toOfficeId") final Long toOfficeId,
|
||||||
@QueryParam("toClientId") @ApiParam(value = "toClientId") final Long toClientId,
|
@QueryParam("toClientId") @Parameter(description = "toClientId") final Long toClientId,
|
||||||
@QueryParam("toAccountId") @ApiParam(value = "toAccountId") final Long toAccountId,
|
@QueryParam("toAccountId") @Parameter(description = "toAccountId") final Long toAccountId,
|
||||||
@QueryParam("toAccountType") @ApiParam(value = "toAccountType") final Integer toAccountType,
|
@QueryParam("toAccountType") @Parameter(description = "toAccountType") final Integer toAccountType,
|
||||||
@QueryParam("transferType") @ApiParam(value = "transferType") final Integer transferType, @Context final UriInfo uriInfo) {
|
@QueryParam("transferType") @Parameter(description = "transferType") final Integer transferType,
|
||||||
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
|
||||||
|
|
||||||
@@ -129,12 +126,11 @@ public class StandingInstructionApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Create new Standing Instruction", httpMethod = "POST", notes = "Ability to create new instruction for transfer of monetary funds from one account to another")
|
@Operation(summary = "Create new Standing Instruction", description = "Ability to create new instruction for transfer of monetary funds from one account to another")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PostStandingInstructionsRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = StandingInstructionApiResourceSwagger.PostStandingInstructionsRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.PostStandingInstructionsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PostStandingInstructionsResponse.class))) })
|
||||||
public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().createStandingInstruction().withJson(apiRequestBodyAsJson)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createStandingInstruction().withJson(apiRequestBodyAsJson)
|
||||||
.build();
|
.build();
|
||||||
@@ -148,17 +144,17 @@ public class StandingInstructionApiResource {
|
|||||||
@Path("{standingInstructionId}")
|
@Path("{standingInstructionId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Update Standing Instruction | Delete Standing Instruction", httpMethod = "PUT", notes = "Ability to modify existing instruction for transfer of monetary funds from one account to another.\n"
|
@Operation(summary = "Update Standing Instruction | Delete Standing Instruction", description = "Ability to modify existing instruction for transfer of monetary funds from one account to another.\n"
|
||||||
+ "\n" + "PUT https://DomainName/api/v1/standinginstructions/1?command=update\n" + "\n\n"
|
+ "\n" + "PUT https://DomainName/api/v1/standinginstructions/1?command=update\n" + "\n\n"
|
||||||
+ "Ability to modify existing instruction for transfer of monetary funds from one account to another.\n" + "\n"
|
+ "Ability to modify existing instruction for transfer of monetary funds from one account to another.\n" + "\n"
|
||||||
+ "PUT https://DomainName/api/v1/standinginstructions/1?command=delete")
|
+ "PUT https://DomainName/api/v1/standinginstructions/1?command=delete")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = false, content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PutStandingInstructionsStandingInstructionIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = false, paramType = "body", dataType = "body", format = "body", dataTypeClass = StandingInstructionApiResourceSwagger.PutStandingInstructionsStandingInstructionIdRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.PutStandingInstructionsStandingInstructionIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PutStandingInstructionsStandingInstructionIdResponse.class))) })
|
||||||
public String update(@PathParam("standingInstructionId") @ApiParam(value = "standingInstructionId") final Long standingInstructionId,
|
public String update(
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson,
|
@PathParam("standingInstructionId") @Parameter(description = "standingInstructionId") final Long standingInstructionId,
|
||||||
@QueryParam("command") @ApiParam(value = "command") final String commandParam) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson,
|
||||||
|
@QueryParam("command") @Parameter(description = "command") final String commandParam) {
|
||||||
|
|
||||||
CommandWrapper commandRequest = null;
|
CommandWrapper commandRequest = null;
|
||||||
if (is(commandParam, "update")) {
|
if (is(commandParam, "update")) {
|
||||||
@@ -185,21 +181,21 @@ public class StandingInstructionApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List Standing Instructions", httpMethod = "GET", notes = "Example Requests:\n" + "\n" + "standinginstructions")
|
@Operation(summary = "List Standing Instructions", description = "Example Requests:\n" + "\n" + "standinginstructions")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.class))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo,
|
public String retrieveAll(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch,
|
@QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch,
|
||||||
@QueryParam("externalId") @ApiParam(value = "externalId") final String externalId,
|
@QueryParam("externalId") @Parameter(description = "externalId") final String externalId,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder,
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder,
|
||||||
@QueryParam("transferType") @ApiParam(value = "transferType") final Integer transferType,
|
@QueryParam("transferType") @Parameter(description = "transferType") final Integer transferType,
|
||||||
@QueryParam("clientName") @ApiParam(value = "clientName") final String clientName,
|
@QueryParam("clientName") @Parameter(description = "clientName") final String clientName,
|
||||||
@QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId,
|
@QueryParam("clientId") @Parameter(description = "clientId") final Long clientId,
|
||||||
@QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccount,
|
@QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccount,
|
||||||
@QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType) {
|
@QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
|
||||||
|
|
||||||
@@ -221,18 +217,17 @@ public class StandingInstructionApiResource {
|
|||||||
@Path("{standingInstructionId}")
|
@Path("{standingInstructionId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Standing Instruction", httpMethod = "GET", notes = "Example Requests :\n" + "\n"
|
@Operation(summary = "Retrieve Standing Instruction", description = "Example Requests :\n" + "\n" + "standinginstructions/1")
|
||||||
+ "standinginstructions/1")
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.GetStandingInstructionsStandingInstructionIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.GetStandingInstructionsStandingInstructionIdResponse.class))) })
|
||||||
public String retrieveOne(
|
public String retrieveOne(
|
||||||
@PathParam("standingInstructionId") @ApiParam(value = "standingInstructionId") final Long standingInstructionId,
|
@PathParam("standingInstructionId") @Parameter(description = "standingInstructionId") final Long standingInstructionId,
|
||||||
@Context final UriInfo uriInfo, @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch,
|
@Context final UriInfo uriInfo, @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch,
|
||||||
@QueryParam("externalId") @ApiParam(value = "externalId") final String externalId,
|
@QueryParam("externalId") @Parameter(description = "externalId") final String externalId,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) {
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
|
||||||
|
|
||||||
|
|||||||
+154
-155
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.account.api;
|
package org.apache.fineract.portfolio.account.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -32,7 +31,7 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
// this class is only for Swagger Live Documentation
|
// this class is only for Swagger Live Documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetStandingInstructionsTemplateResponse")
|
@Schema(description = "GetStandingInstructionsTemplateResponse")
|
||||||
public static final class GetStandingInstructionsTemplateResponse {
|
public static final class GetStandingInstructionsTemplateResponse {
|
||||||
|
|
||||||
private GetStandingInstructionsTemplateResponse() {}
|
private GetStandingInstructionsTemplateResponse() {}
|
||||||
@@ -41,17 +40,17 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetFromOfficeResponseStandingInstructionSwagger() {}
|
private GetFromOfficeResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String decoratedName;
|
public String decoratedName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer externalId;
|
public Integer externalId;
|
||||||
@ApiModelProperty(example = "[2009, 1, 1]")
|
@Schema(example = "[2009, 1, 1]")
|
||||||
public LocalDate openingDate;
|
public LocalDate openingDate;
|
||||||
@ApiModelProperty(example = ".")
|
@Schema(example = ".")
|
||||||
public String hierarchy;
|
public String hierarchy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,23 +58,23 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetFromAccountTypeResponseStandingInstructionSwagger() {}
|
private GetFromAccountTypeResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "accountType.savings")
|
@Schema(example = "accountType.savings")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Savings Account")
|
@Schema(example = "Savings Account")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetFromOfficeOptionsResponseStandingInstructionSwagger {
|
static final class GetFromOfficeOptionsResponseStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetFromOfficeOptionsResponseStandingInstructionSwagger() {}
|
private GetFromOfficeOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String nameDecorated;
|
public String nameDecorated;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,13 +82,13 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetFromClientOptionsResponseStandingInstructionSwagger() {}
|
private GetFromClientOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Client_FirstName_2VRAG Client_LastName_9QCY")
|
@Schema(example = "Client_FirstName_2VRAG Client_LastName_9QCY")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,23 +96,23 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetFromAccountTypeOptionsResponseStandingInstructionSwagger() {}
|
private GetFromAccountTypeOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "accountType.savings")
|
@Schema(example = "accountType.savings")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Savings Account")
|
@Schema(example = "Savings Account")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetToOfficeOptionsResponseStandingInstructionSwagger {
|
static final class GetToOfficeOptionsResponseStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetToOfficeOptionsResponseStandingInstructionSwagger() {}
|
private GetToOfficeOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String nameDecorated;
|
public String nameDecorated;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,84 +120,84 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetToAccountTypeOptionsResponseStandingInstructionSwagger() {}
|
private GetToAccountTypeOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountType.loan")
|
@Schema(example = "accountType.loan")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Loan Account")
|
@Schema(example = "Loan Account")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetTransferTypeOptionsResponseStandingInstructionSwagger {
|
static final class GetTransferTypeOptionsResponseStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetTransferTypeOptionsResponseStandingInstructionSwagger() {}
|
private GetTransferTypeOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountTransferType.account.transfer")
|
@Schema(example = "accountTransferType.account.transfer")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Account Transfer")
|
@Schema(example = "Account Transfer")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetStatusOptionsResponseStandingInstructionSwagger {
|
static final class GetStatusOptionsResponseStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetStatusOptionsResponseStandingInstructionSwagger() {}
|
private GetStatusOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "standingInstructionStatus.active")
|
@Schema(example = "standingInstructionStatus.active")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Active")
|
@Schema(example = "Active")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetInstructionTypeOptionsResponseStandingInstructionSwagger {
|
static final class GetInstructionTypeOptionsResponseStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetInstructionTypeOptionsResponseStandingInstructionSwagger() {}
|
private GetInstructionTypeOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "standingInstructionType.fixed")
|
@Schema(example = "standingInstructionType.fixed")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Fixed")
|
@Schema(example = "Fixed")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetPriorityOptionsResponseStandingInstructionSwagger {
|
static final class GetPriorityOptionsResponseStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetPriorityOptionsResponseStandingInstructionSwagger() {}
|
private GetPriorityOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "standingInstructionPriority.urgent")
|
@Schema(example = "standingInstructionPriority.urgent")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Urgent Priority")
|
@Schema(example = "Urgent Priority")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetRecurrenceTypeOptionsResponseStandingInstructionSwagger {
|
static final class GetRecurrenceTypeOptionsResponseStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetRecurrenceTypeOptionsResponseStandingInstructionSwagger() {}
|
private GetRecurrenceTypeOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountTransferRecurrenceType.periodic")
|
@Schema(example = "accountTransferRecurrenceType.periodic")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Periodic Recurrence")
|
@Schema(example = "Periodic Recurrence")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger {
|
static final class GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger() {}
|
private GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "frequencyperiodFrequencyType.days")
|
@Schema(example = "frequencyperiodFrequencyType.days")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Days")
|
@Schema(example = "Days")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetFromOfficeResponseStandingInstructionSwagger fromOffice;
|
public GetFromOfficeResponseStandingInstructionSwagger fromOffice;
|
||||||
@@ -216,18 +215,18 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
public Set<GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger> recurrenceFrequencyOptions;
|
public Set<GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger> recurrenceFrequencyOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostStandingInstructionsResponse")
|
@Schema(description = "PostStandingInstructionsResponse")
|
||||||
public static final class PostStandingInstructionsResponse {
|
public static final class PostStandingInstructionsResponse {
|
||||||
|
|
||||||
private PostStandingInstructionsResponse() {}
|
private PostStandingInstructionsResponse() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long clientId;
|
public Long clientId;
|
||||||
@ApiModelProperty(example = "65")
|
@Schema(example = "65")
|
||||||
public Integer resourceId;
|
public Integer resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetStandingInstructionsResponse")
|
@Schema(description = "GetStandingInstructionsResponse")
|
||||||
public static final class GetStandingInstructionsResponse {
|
public static final class GetStandingInstructionsResponse {
|
||||||
|
|
||||||
private GetStandingInstructionsResponse() {}
|
private GetStandingInstructionsResponse() {}
|
||||||
@@ -238,9 +237,9 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetFromOfficeStandingInstructionSwagger() {}
|
private GetFromOfficeStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,13 +247,13 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetFromClientStandingInstructionSwagger() {}
|
private GetFromClientStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Test test")
|
@Schema(example = "Test test")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,25 +261,25 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetFromAccountTypeStandingInstructionSwagger() {}
|
private GetFromAccountTypeStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountType.savings")
|
@Schema(example = "accountType.savings")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Savings Account")
|
@Schema(example = "Savings Account")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetFromAccountStandingInstructionSwagger {
|
static final class GetFromAccountStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetFromAccountStandingInstructionSwagger() {}
|
private GetFromAccountStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "14")
|
@Schema(example = "14")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "000000014")
|
@Schema(example = "000000014")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long productId;
|
public Long productId;
|
||||||
@ApiModelProperty(example = "savings old")
|
@Schema(example = "savings old")
|
||||||
public String productName;
|
public String productName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,9 +287,9 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetToOfficeStandingInstructionSwagger() {}
|
private GetToOfficeStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,13 +297,13 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetToClientStandingInstructionSwagger() {}
|
private GetToClientStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Test test")
|
@Schema(example = "Test test")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,25 +311,25 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetToAccountTypeStandingInstructionSwagger() {}
|
private GetToAccountTypeStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountType.savings")
|
@Schema(example = "accountType.savings")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Savings Account")
|
@Schema(example = "Savings Account")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetToAccountStandingInstructionSwagger {
|
static final class GetToAccountStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetToAccountStandingInstructionSwagger() {}
|
private GetToAccountStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "000000003")
|
@Schema(example = "000000003")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "4")
|
@Schema(example = "4")
|
||||||
public Long productId;
|
public Long productId;
|
||||||
@ApiModelProperty(example = "account overdraft")
|
@Schema(example = "account overdraft")
|
||||||
public String productName;
|
public String productName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,79 +337,79 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
|
|
||||||
private GetTransferTypeStandingInstructionSwagger() {}
|
private GetTransferTypeStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountTransferType.account.transfer")
|
@Schema(example = "accountTransferType.account.transfer")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Account Transfer")
|
@Schema(example = "Account Transfer")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetPriorityStandingInstructionSwagger {
|
static final class GetPriorityStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetPriorityStandingInstructionSwagger() {}
|
private GetPriorityStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "standingInstructionPriority.medium")
|
@Schema(example = "standingInstructionPriority.medium")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Medium Priority")
|
@Schema(example = "Medium Priority")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetInstructionTypeStandingInstructionSwagger {
|
static final class GetInstructionTypeStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetInstructionTypeStandingInstructionSwagger() {}
|
private GetInstructionTypeStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "standingInstructionType.fixed")
|
@Schema(example = "standingInstructionType.fixed")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Fixed")
|
@Schema(example = "Fixed")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetStatusStandingInstructionSwagger {
|
static final class GetStatusStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetStatusStandingInstructionSwagger() {}
|
private GetStatusStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "standingInstructionStatus.deleted")
|
@Schema(example = "standingInstructionStatus.deleted")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Deleted")
|
@Schema(example = "Deleted")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetRecurrenceTypeStandingInstructionSwagger {
|
static final class GetRecurrenceTypeStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetRecurrenceTypeStandingInstructionSwagger() {}
|
private GetRecurrenceTypeStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "accountTransferRecurrenceType.periodic")
|
@Schema(example = "accountTransferRecurrenceType.periodic")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Periodic Recurrence")
|
@Schema(example = "Periodic Recurrence")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetRecurrenceFrequencyStandingInstructionSwagger {
|
static final class GetRecurrenceFrequencyStandingInstructionSwagger {
|
||||||
|
|
||||||
private GetRecurrenceFrequencyStandingInstructionSwagger() {}
|
private GetRecurrenceFrequencyStandingInstructionSwagger() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "frequencyperiodFrequencyType.months")
|
@Schema(example = "frequencyperiodFrequencyType.months")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Months")
|
@Schema(example = "Months")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "6")
|
@Schema(example = "6")
|
||||||
public Long accountDetailId;
|
public Long accountDetailId;
|
||||||
@ApiModelProperty(example = "test standing")
|
@Schema(example = "test standing")
|
||||||
public String name;
|
public String name;
|
||||||
public GetFromOfficeStandingInstructionSwagger fromOffice;
|
public GetFromOfficeStandingInstructionSwagger fromOffice;
|
||||||
public GetFromClientStandingInstructionSwagger fromClient;
|
public GetFromClientStandingInstructionSwagger fromClient;
|
||||||
@@ -424,84 +423,84 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
public GetPriorityStandingInstructionSwagger priority;
|
public GetPriorityStandingInstructionSwagger priority;
|
||||||
public GetInstructionTypeStandingInstructionSwagger instructionType;
|
public GetInstructionTypeStandingInstructionSwagger instructionType;
|
||||||
public GetStatusStandingInstructionSwagger status;
|
public GetStatusStandingInstructionSwagger status;
|
||||||
@ApiModelProperty(example = "150.000000")
|
@Schema(example = "150.000000")
|
||||||
public float amount;
|
public float amount;
|
||||||
@ApiModelProperty(example = "[2014, 4, 3]")
|
@Schema(example = "[2014, 4, 3]")
|
||||||
public LocalDate validFrom;
|
public LocalDate validFrom;
|
||||||
public GetRecurrenceTypeStandingInstructionSwagger recurrenceType;
|
public GetRecurrenceTypeStandingInstructionSwagger recurrenceType;
|
||||||
public GetRecurrenceFrequencyStandingInstructionSwagger recurrenceFrequency;
|
public GetRecurrenceFrequencyStandingInstructionSwagger recurrenceFrequency;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer recurrenceInterval;
|
public Integer recurrenceInterval;
|
||||||
@ApiModelProperty(example = "[4, 3]")
|
@Schema(example = "[4, 3]")
|
||||||
public LocalDate recurrenceOnMonthDay;
|
public LocalDate recurrenceOnMonthDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer totalFilteredRecords;
|
public Integer totalFilteredRecords;
|
||||||
public Set<GetPageItemsStandingInstructionSwagger> pageItems;
|
public Set<GetPageItemsStandingInstructionSwagger> pageItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostStandingInstructionsRequest")
|
@Schema(description = "PostStandingInstructionsRequest")
|
||||||
public static final class PostStandingInstructionsRequest {
|
public static final class PostStandingInstructionsRequest {
|
||||||
|
|
||||||
private PostStandingInstructionsRequest() {}
|
private PostStandingInstructionsRequest() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long fromOfficeId;
|
public Long fromOfficeId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long fromClientId;
|
public Long fromClientId;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer fromAccountType;
|
public Integer fromAccountType;
|
||||||
@ApiModelProperty(example = "standing instruction")
|
@Schema(example = "standing instruction")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer transferType;
|
public Integer transferType;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer priority;
|
public Integer priority;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer status;
|
public Integer status;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long fromAccountId;
|
public Long fromAccountId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long toOfficeId;
|
public Long toOfficeId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long toClientId;
|
public Long toClientId;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer toAccountType;
|
public Integer toAccountType;
|
||||||
@ApiModelProperty(example = "3")
|
@Schema(example = "3")
|
||||||
public Long toAccountId;
|
public Long toAccountId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer instructionType;
|
public Integer instructionType;
|
||||||
@ApiModelProperty(example = "221")
|
@Schema(example = "221")
|
||||||
public Integer amount;
|
public Integer amount;
|
||||||
@ApiModelProperty(example = "08 April 2014")
|
@Schema(example = "08 April 2014")
|
||||||
public String validFrom;
|
public String validFrom;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer recurrenceType;
|
public Integer recurrenceType;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer recurrenceInterval;
|
public Integer recurrenceInterval;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer recurrenceFrequency;
|
public Integer recurrenceFrequency;
|
||||||
@ApiModelProperty(value = "en")
|
@Schema(description = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "02 April")
|
@Schema(example = "02 April")
|
||||||
public String recurrenceOnMonthDay;
|
public String recurrenceOnMonthDay;
|
||||||
@ApiModelProperty(example = "dd MMMM")
|
@Schema(example = "dd MMMM")
|
||||||
public String monthDayFormat;
|
public String monthDayFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetStandingInstructionsStandingInstructionIdResponse")
|
@Schema(description = "GetStandingInstructionsStandingInstructionIdResponse")
|
||||||
public static final class GetStandingInstructionsStandingInstructionIdResponse {
|
public static final class GetStandingInstructionsStandingInstructionIdResponse {
|
||||||
|
|
||||||
private GetStandingInstructionsStandingInstructionIdResponse() {}
|
private GetStandingInstructionsStandingInstructionIdResponse() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "6")
|
@Schema(example = "6")
|
||||||
public Long accountDetailId;
|
public Long accountDetailId;
|
||||||
@ApiModelProperty(example = "test standing")
|
@Schema(example = "test standing")
|
||||||
public String name;
|
public String name;
|
||||||
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetFromOfficeStandingInstructionSwagger fromOffice;
|
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetFromOfficeStandingInstructionSwagger fromOffice;
|
||||||
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetFromClientStandingInstructionSwagger fromClient;
|
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetFromClientStandingInstructionSwagger fromClient;
|
||||||
@@ -515,40 +514,40 @@ final class StandingInstructionApiResourceSwagger {
|
|||||||
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetPriorityStandingInstructionSwagger priority;
|
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetPriorityStandingInstructionSwagger priority;
|
||||||
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetInstructionTypeStandingInstructionSwagger instructionType;
|
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetInstructionTypeStandingInstructionSwagger instructionType;
|
||||||
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetStatusStandingInstructionSwagger status;
|
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetStatusStandingInstructionSwagger status;
|
||||||
@ApiModelProperty(example = "150.000000")
|
@Schema(example = "150.000000")
|
||||||
public float amount;
|
public float amount;
|
||||||
@ApiModelProperty(example = "[2014, 4, 3]")
|
@Schema(example = "[2014, 4, 3]")
|
||||||
public LocalDate validFrom;
|
public LocalDate validFrom;
|
||||||
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetRecurrenceTypeStandingInstructionSwagger recurrenceType;
|
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetRecurrenceTypeStandingInstructionSwagger recurrenceType;
|
||||||
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetRecurrenceFrequencyStandingInstructionSwagger recurrenceFrequency;
|
public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetRecurrenceFrequencyStandingInstructionSwagger recurrenceFrequency;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer recurrenceInterval;
|
public Integer recurrenceInterval;
|
||||||
@ApiModelProperty(example = "[4, 3]")
|
@Schema(example = "[4, 3]")
|
||||||
public LocalDate recurrenceOnMonthDay;
|
public LocalDate recurrenceOnMonthDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutStandingInstructionsStandingInstructionIdResponse")
|
@Schema(description = "PutStandingInstructionsStandingInstructionIdResponse")
|
||||||
public static final class PutStandingInstructionsStandingInstructionIdResponse {
|
public static final class PutStandingInstructionsStandingInstructionIdResponse {
|
||||||
|
|
||||||
private PutStandingInstructionsStandingInstructionIdResponse() {}
|
private PutStandingInstructionsStandingInstructionIdResponse() {}
|
||||||
|
|
||||||
static final class PutUpdateStandingInstructionChanges {
|
static final class PutUpdateStandingInstructionChanges {
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer recurrenceInterval;
|
public Integer recurrenceInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "20")
|
@Schema(example = "20")
|
||||||
public Integer resourceId;
|
public Integer resourceId;
|
||||||
public PutUpdateStandingInstructionChanges changes;
|
public PutUpdateStandingInstructionChanges changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutStandingInstructionsStandingInstructionIdRequest")
|
@Schema(description = "PutStandingInstructionsStandingInstructionIdRequest")
|
||||||
public static final class PutStandingInstructionsStandingInstructionIdRequest {
|
public static final class PutStandingInstructionsStandingInstructionIdRequest {
|
||||||
|
|
||||||
private PutStandingInstructionsStandingInstructionIdRequest() {}
|
private PutStandingInstructionsStandingInstructionIdRequest() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer recurrenceInterval;
|
public Integer recurrenceInterval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-27
@@ -18,13 +18,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.account.api;
|
package org.apache.fineract.portfolio.account.api;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -51,9 +51,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/standinginstructionrunhistory")
|
@Path("/standinginstructionrunhistory")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Standing Instructions History" })
|
@Tag(name = "Standing Instructions History", description = "The list capability of history can support pagination and sorting.")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Standing Instructions History", description = "The list capability of history can support pagination and sorting.") })
|
|
||||||
public class StandingInstructionHistoryApiResource {
|
public class StandingInstructionHistoryApiResource {
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -75,27 +73,27 @@ public class StandingInstructionHistoryApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Standing Instructions Logged History", httpMethod = "GET", notes = "The list capability of history can support pagination and sorting \n\n"
|
@Operation(summary = "Standing Instructions Logged History", description = "The list capability of history can support pagination and sorting \n\n"
|
||||||
+ "Example Requests :\n" + "\n" + "standinginstructionrunhistory\n" + "\n"
|
+ "Example Requests :\n" + "\n" + "standinginstructionrunhistory\n" + "\n"
|
||||||
+ "standinginstructionrunhistory?orderBy=name&sortOrder=DESC\n" + "\n" + "standinginstructionrunhistory?offset=10&limit=50")
|
+ "standinginstructionrunhistory?orderBy=name&sortOrder=DESC\n" + "\n" + "standinginstructionrunhistory?offset=10&limit=50")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = StandingInstructionHistoryApiResourceSwagger.GetStandingInstructionRunHistoryResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionHistoryApiResourceSwagger.GetStandingInstructionRunHistoryResponse.class))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo,
|
public String retrieveAll(@Context final UriInfo uriInfo,
|
||||||
@QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch,
|
@QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch,
|
||||||
@QueryParam("externalId") @ApiParam(value = "externalId") final String externalId,
|
@QueryParam("externalId") @Parameter(description = "externalId") final String externalId,
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit,
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit,
|
||||||
@QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy,
|
@QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy,
|
||||||
@QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder,
|
@QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder,
|
||||||
@QueryParam("transferType") @ApiParam(value = "transferType") final Integer transferType,
|
@QueryParam("transferType") @Parameter(description = "transferType") final Integer transferType,
|
||||||
@QueryParam("clientName") @ApiParam(value = "clientName") final String clientName,
|
@QueryParam("clientName") @Parameter(description = "clientName") final String clientName,
|
||||||
@QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId,
|
@QueryParam("clientId") @Parameter(description = "clientId") final Long clientId,
|
||||||
@QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccount,
|
@QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccount,
|
||||||
@QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType,
|
@QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType,
|
||||||
@QueryParam("locale") @ApiParam(value = "locale") final String locale,
|
@QueryParam("locale") @Parameter(description = "locale") final String locale,
|
||||||
@QueryParam("dateFormat") @ApiParam(value = "dateFormat") final String dateFormat,
|
@QueryParam("dateFormat") @Parameter(description = "dateFormat") final String dateFormat,
|
||||||
@QueryParam("fromDate") @ApiParam(value = "fromDate") final DateParam fromDateParam,
|
@QueryParam("fromDate") @Parameter(description = "fromDate") final DateParam fromDateParam,
|
||||||
@QueryParam("toDate") @ApiParam(value = "toDate") final DateParam toDateParam) {
|
@QueryParam("toDate") @Parameter(description = "toDate") final DateParam toDateParam) {
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
|
this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
|
||||||
|
|
||||||
|
|||||||
+25
-26
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.account.api;
|
package org.apache.fineract.portfolio.account.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ final class StandingInstructionHistoryApiResourceSwagger {
|
|||||||
|
|
||||||
private StandingInstructionHistoryApiResourceSwagger() {}
|
private StandingInstructionHistoryApiResourceSwagger() {}
|
||||||
|
|
||||||
@ApiModel(value = "GetStandingInstructionRunHistoryResponse")
|
@Schema(description = "GetStandingInstructionRunHistoryResponse")
|
||||||
public static final class GetStandingInstructionRunHistoryResponse {
|
public static final class GetStandingInstructionRunHistoryResponse {
|
||||||
|
|
||||||
private GetStandingInstructionRunHistoryResponse() {}
|
private GetStandingInstructionRunHistoryResponse() {}
|
||||||
@@ -41,13 +40,13 @@ final class StandingInstructionHistoryApiResourceSwagger {
|
|||||||
|
|
||||||
private GetStandingInstructionHistoryPageItemsFromClient() {}
|
private GetStandingInstructionHistoryPageItemsFromClient() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Test client")
|
@Schema(example = "Test client")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,13 +54,13 @@ final class StandingInstructionHistoryApiResourceSwagger {
|
|||||||
|
|
||||||
private GetStandingInstructionHistoryFromAccount() {}
|
private GetStandingInstructionHistoryFromAccount() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "000000002")
|
@Schema(example = "000000002")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long productId;
|
public Long productId;
|
||||||
@ApiModelProperty(example = "General Savings")
|
@Schema(example = "General Savings")
|
||||||
public String productName;
|
public String productName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,13 +68,13 @@ final class StandingInstructionHistoryApiResourceSwagger {
|
|||||||
|
|
||||||
private GetStandingInstructionHistoryToAccount() {}
|
private GetStandingInstructionHistoryToAccount() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "000000001")
|
@Schema(example = "000000001")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long productId;
|
public Long productId;
|
||||||
@ApiModelProperty(example = "General Savings")
|
@Schema(example = "General Savings")
|
||||||
public String productName;
|
public String productName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,19 +82,19 @@ final class StandingInstructionHistoryApiResourceSwagger {
|
|||||||
|
|
||||||
private GetStandingInstructionHistoryToClient() {}
|
private GetStandingInstructionHistoryToClient() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long id;
|
public Long id;
|
||||||
@ApiModelProperty(example = "Test client")
|
@Schema(example = "Test client")
|
||||||
public String displayName;
|
public String displayName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long officeId;
|
public Long officeId;
|
||||||
@ApiModelProperty(example = "Head Office")
|
@Schema(example = "Head Office")
|
||||||
public String officeName;
|
public String officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Long standingInstructionId;
|
public Long standingInstructionId;
|
||||||
@ApiModelProperty(example = "ACC Transfer")
|
@Schema(example = "ACC Transfer")
|
||||||
public String name;
|
public String name;
|
||||||
public StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetFromOfficeStandingInstructionSwagger fromOffice;
|
public StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetFromOfficeStandingInstructionSwagger fromOffice;
|
||||||
public GetStandingInstructionHistoryPageItemsFromClient fromClient;
|
public GetStandingInstructionHistoryPageItemsFromClient fromClient;
|
||||||
@@ -105,17 +104,17 @@ final class StandingInstructionHistoryApiResourceSwagger {
|
|||||||
public GetStandingInstructionHistoryToAccount toAccount;
|
public GetStandingInstructionHistoryToAccount toAccount;
|
||||||
public StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetToOfficeStandingInstructionSwagger toOffice;
|
public StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetToOfficeStandingInstructionSwagger toOffice;
|
||||||
public GetStandingInstructionHistoryToClient toClient;
|
public GetStandingInstructionHistoryToClient toClient;
|
||||||
@ApiModelProperty(example = "10")
|
@Schema(example = "10")
|
||||||
public Float amount;
|
public Float amount;
|
||||||
@ApiModelProperty(example = "success")
|
@Schema(example = "success")
|
||||||
public String status;
|
public String status;
|
||||||
@ApiModelProperty(example = "[2014, 6, 30]")
|
@Schema(example = "[2014, 6, 30]")
|
||||||
public LocalDate executionTime;
|
public LocalDate executionTime;
|
||||||
@ApiModelProperty(example = " ")
|
@Schema(example = " ")
|
||||||
public String errorLog;
|
public String errorLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer totalFilteredRecords;
|
public Integer totalFilteredRecords;
|
||||||
public Set<GetStandingInstructionHistoryPageItemsResponse> pageItems;
|
public Set<GetStandingInstructionHistoryPageItemsResponse> pageItems;
|
||||||
}
|
}
|
||||||
|
|||||||
+45
-48
@@ -20,15 +20,14 @@ package org.apache.fineract.portfolio.accounts.api;
|
|||||||
|
|
||||||
import com.sun.jersey.core.header.FormDataContentDisposition;
|
import com.sun.jersey.core.header.FormDataContentDisposition;
|
||||||
import com.sun.jersey.multipart.FormDataParam;
|
import com.sun.jersey.multipart.FormDataParam;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.annotations.SwaggerDefinition;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.annotations.Tag;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -67,9 +66,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Path("/accounts/{type}")
|
@Path("/accounts/{type}")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@Api(tags = { "Share Account" })
|
@Tag(name = "Share Account", description = "Share accounts are instances of a praticular share product created for an individual. An application process around the creation of accounts is also supported.")
|
||||||
@SwaggerDefinition(tags = {
|
|
||||||
@Tag(name = "Share Account", description = "Share accounts are instances of a praticular share product created for an individual. An application process around the creation of accounts is also supported.") })
|
|
||||||
public class AccountsApiResource {
|
public class AccountsApiResource {
|
||||||
|
|
||||||
private final ApplicationContext applicationContext;
|
private final ApplicationContext applicationContext;
|
||||||
@@ -99,13 +96,14 @@ public class AccountsApiResource {
|
|||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve Share Account Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
@Operation(summary = "Retrieve Share Account Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
||||||
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n\n" + "Example Requests:\n" + "\n" + "accounts/share/template?clientId=1\n"
|
+ "\n" + "Field Defaults\n" + "Allowed Value Lists\n\n" + "Example Requests:\n" + "\n" + "accounts/share/template?clientId=1\n"
|
||||||
+ "\n" + "\n" + "accounts/share/template?clientId=1&productId=1")
|
+ "\n" + "\n" + "accounts/share/template?clientId=1&productId=1")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.GetAccountsTypeTemplateResponse.class) })
|
@ApiResponses({
|
||||||
public String template(@PathParam("type") @ApiParam(value = "type") final String accountType,
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.GetAccountsTypeTemplateResponse.class))) })
|
||||||
@QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId,
|
public String template(@PathParam("type") @Parameter(description = "type") final String accountType,
|
||||||
@QueryParam("productId") @ApiParam(value = "productId") final Long productId, @Context final UriInfo uriInfo) {
|
@QueryParam("clientId") @Parameter(description = "clientId") final Long clientId,
|
||||||
|
@QueryParam("productId") @Parameter(description = "productId") final Long productId, @Context final UriInfo uriInfo) {
|
||||||
try {
|
try {
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
String serviceName = accountType + AccountsApiConstants.READPLATFORM_NAME;
|
String serviceName = accountType + AccountsApiConstants.READPLATFORM_NAME;
|
||||||
@@ -122,12 +120,12 @@ public class AccountsApiResource {
|
|||||||
@Path("{accountId}")
|
@Path("{accountId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Retrieve a share application/account", httpMethod = "GET", notes = "Retrieves a share application/account\n\n"
|
@Operation(summary = "Retrieve a share application/account", description = "Retrieves a share application/account\n\n"
|
||||||
+ "Example Requests :\n" + "\n" + "shareaccount/1")
|
+ "Example Requests :\n" + "\n" + "shareaccount/1")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.GetAccountsTypeAccountIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.GetAccountsTypeAccountIdResponse.class))) })
|
||||||
public String retrieveAccount(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId,
|
public String retrieveAccount(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId,
|
||||||
@PathParam("type") @ApiParam(value = "type") final String accountType, @Context final UriInfo uriInfo) {
|
@PathParam("type") @Parameter(description = "type") final String accountType, @Context final UriInfo uriInfo) {
|
||||||
try {
|
try {
|
||||||
String serviceName = accountType + AccountsApiConstants.READPLATFORM_NAME;
|
String serviceName = accountType + AccountsApiConstants.READPLATFORM_NAME;
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
@@ -142,12 +140,13 @@ public class AccountsApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "List share applications/accounts", httpMethod = "GET", notes = "Lists share applications/accounts\n\n"
|
@Operation(summary = "List share applications/accounts", description = "Lists share applications/accounts\n\n" + "Example Requests:\n"
|
||||||
+ "Example Requests:\n" + "\n" + "shareaccount")
|
+ "\n" + "shareaccount")
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.GetAccountsTypeResponse.class) })
|
@ApiResponses({
|
||||||
public String retrieveAllAccounts(@PathParam("type") @ApiParam(value = "type") final String accountType,
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.GetAccountsTypeResponse.class))) })
|
||||||
@QueryParam("offset") @ApiParam(value = "offset") final Integer offset,
|
public String retrieveAllAccounts(@PathParam("type") @Parameter(description = "type") final String accountType,
|
||||||
@QueryParam("limit") @ApiParam(value = "limit") final Integer limit, @Context final UriInfo uriInfo) {
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
|
@QueryParam("limit") @Parameter(description = "limit") final Integer limit, @Context final UriInfo uriInfo) {
|
||||||
try {
|
try {
|
||||||
String serviceName = accountType + AccountsApiConstants.READPLATFORM_NAME;
|
String serviceName = accountType + AccountsApiConstants.READPLATFORM_NAME;
|
||||||
AccountReadPlatformService service = (AccountReadPlatformService) this.applicationContext.getBean(serviceName);
|
AccountReadPlatformService service = (AccountReadPlatformService) this.applicationContext.getBean(serviceName);
|
||||||
@@ -162,15 +161,15 @@ public class AccountsApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Submit new share application", httpMethod = "POST", notes = "Submits new share application\n\n"
|
@Operation(summary = "Submit new share application", description = "Submits new share application\n\n"
|
||||||
+ "Mandatory Fields: clientId, productId, submittedDate, savingsAccountId, requestedShares, applicationDate\n\n"
|
+ "Mandatory Fields: clientId, productId, submittedDate, savingsAccountId, requestedShares, applicationDate\n\n"
|
||||||
+ "Optional Fields: accountNo, externalId\n\n"
|
+ "Optional Fields: accountNo, externalId\n\n"
|
||||||
+ "Inherited from Product (if not provided): minimumActivePeriod, minimumActivePeriodFrequencyType, lockinPeriodFrequency, lockinPeriodFrequencyType")
|
+ "Inherited from Product (if not provided): minimumActivePeriod, minimumActivePeriodFrequencyType, lockinPeriodFrequency, lockinPeriodFrequencyType")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountsApiResourceSwagger.PostAccountsTypeRequest.class) })
|
@ApiResponses({
|
||||||
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.PostAccountsTypeResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeResponse.class))) })
|
||||||
public String createAccount(@PathParam("type") @ApiParam(value = "type") final String accountType,
|
public String createAccount(@PathParam("type") @Parameter(description = "type") final String accountType,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
CommandWrapper commandWrapper = null;
|
CommandWrapper commandWrapper = null;
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
commandWrapper = new CommandWrapperBuilder().createAccount(accountType).withJson(apiRequestBodyAsJson).build();
|
commandWrapper = new CommandWrapperBuilder().createAccount(accountType).withJson(apiRequestBodyAsJson).build();
|
||||||
@@ -182,7 +181,7 @@ public class AccountsApiResource {
|
|||||||
@Path("{accountId}")
|
@Path("{accountId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Approve share application | Undo approval share application | Reject share application | Activate a share account | Close a share account | Apply additional shares on a share account | Approve additional shares request on a share account | Reject additional shares request on a share account | Redeem shares on a share account", httpMethod = "POST", notes = "Approve share application:\n\n"
|
@Operation(summary = "Approve share application | Undo approval share application | Reject share application | Activate a share account | Close a share account | Apply additional shares on a share account | Approve additional shares request on a share account | Reject additional shares request on a share account | Redeem shares on a share account", description = "Approve share application:\n\n"
|
||||||
+ "Approves share application so long as its in 'Submitted and pending approval' state.\n\n"
|
+ "Approves share application so long as its in 'Submitted and pending approval' state.\n\n"
|
||||||
+ "Undo approval share application:\n\n"
|
+ "Undo approval share application:\n\n"
|
||||||
+ "Will move 'approved' share application back to 'Submitted and pending approval' state.\n\n" + "Reject share application:\n\n"
|
+ "Will move 'approved' share application back to 'Submitted and pending approval' state.\n\n" + "Reject share application:\n\n"
|
||||||
@@ -201,14 +200,13 @@ public class AccountsApiResource {
|
|||||||
+ "Mandatory Fields: dateFormat,locale,requestedDate,requestedShares\n\n"
|
+ "Mandatory Fields: dateFormat,locale,requestedDate,requestedShares\n\n"
|
||||||
+ "Showing request/response for 'Reject additional shares request on a share account'\n\n"
|
+ "Showing request/response for 'Reject additional shares request on a share account'\n\n"
|
||||||
+ "For more info visit this link - https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#shareaccounts")
|
+ "For more info visit this link - https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#shareaccounts")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeAccountIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountsApiResourceSwagger.PostAccountsTypeAccountIdRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.PostAccountsTypeAccountIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeAccountIdResponse.class))) })
|
||||||
public String handleCommands(@PathParam("type") @ApiParam(value = "type") final String accountType,
|
public String handleCommands(@PathParam("type") @Parameter(description = "type") final String accountType,
|
||||||
@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId,
|
@PathParam("accountId") @Parameter(description = "accountId") final Long accountId,
|
||||||
@QueryParam("command") @ApiParam(value = "command") final String commandParam,
|
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
CommandWrapper commandWrapper = null;
|
CommandWrapper commandWrapper = null;
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
commandWrapper = new CommandWrapperBuilder().createAccountCommand(accountType, accountId, commandParam)
|
commandWrapper = new CommandWrapperBuilder().createAccountCommand(accountType, accountId, commandParam)
|
||||||
@@ -221,14 +219,13 @@ public class AccountsApiResource {
|
|||||||
@Path("{accountId}")
|
@Path("{accountId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@ApiOperation(value = "Modify a share application", httpMethod = "PUT", notes = "Share application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc")
|
@Operation(summary = "Modify a share application", description = "Share application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc")
|
||||||
@ApiImplicitParams({
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PutAccountsTypeAccountIdRequest.class)))
|
||||||
@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountsApiResourceSwagger.PutAccountsTypeAccountIdRequest.class) })
|
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.PutAccountsTypeAccountIdResponse.class) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PutAccountsTypeAccountIdResponse.class))) })
|
||||||
public String updateAccount(@PathParam("type") @ApiParam(value = "type") final String accountType,
|
public String updateAccount(@PathParam("type") @Parameter(description = "type") final String accountType,
|
||||||
@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId,
|
@PathParam("accountId") @Parameter(description = "accountId") final Long accountId,
|
||||||
@ApiParam(hidden = true) final String apiRequestBodyAsJson) {
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
this.platformSecurityContext.authenticatedUser();
|
this.platformSecurityContext.authenticatedUser();
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateAccount(accountType, accountId)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateAccount(accountType, accountId)
|
||||||
.withJson(apiRequestBodyAsJson).build();
|
.withJson(apiRequestBodyAsJson).build();
|
||||||
|
|||||||
+156
-157
@@ -18,8 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.accounts.api;
|
package org.apache.fineract.portfolio.accounts.api;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -31,7 +30,7 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private AccountsApiResourceSwagger() {}
|
private AccountsApiResourceSwagger() {}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountsTypeTemplateResponse")
|
@Schema(description = "GetAccountsTypeTemplateResponse")
|
||||||
public static final class GetAccountsTypeTemplateResponse {
|
public static final class GetAccountsTypeTemplateResponse {
|
||||||
|
|
||||||
private GetAccountsTypeTemplateResponse() {}
|
private GetAccountsTypeTemplateResponse() {}
|
||||||
@@ -40,24 +39,24 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsTypeProductOptions() {}
|
private GetAccountsTypeProductOptions() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "Share Product")
|
@Schema(example = "Share Product")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "SP")
|
@Schema(example = "SP")
|
||||||
public String shortName;
|
public String shortName;
|
||||||
@ApiModelProperty(example = "100")
|
@Schema(example = "100")
|
||||||
public Long totalShares;
|
public Long totalShares;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "7")
|
@Schema(example = "7")
|
||||||
public Integer clientId;
|
public Integer clientId;
|
||||||
@ApiModelProperty(example = "Client Name")
|
@Schema(example = "Client Name")
|
||||||
public String clientName;
|
public String clientName;
|
||||||
public Set<GetAccountsTypeProductOptions> productOptions;
|
public Set<GetAccountsTypeProductOptions> productOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountsTypeAccountIdResponse")
|
@Schema(description = "GetAccountsTypeAccountIdResponse")
|
||||||
public static final class GetAccountsTypeAccountIdResponse {
|
public static final class GetAccountsTypeAccountIdResponse {
|
||||||
|
|
||||||
private GetAccountsTypeAccountIdResponse() {}
|
private GetAccountsTypeAccountIdResponse() {}
|
||||||
@@ -66,21 +65,21 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsStatus() {}
|
private GetAccountsStatus() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "300")
|
@Schema(example = "300")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "shareAccountStatusType.active")
|
@Schema(example = "shareAccountStatusType.active")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Active")
|
@Schema(example = "Active")
|
||||||
public String value;
|
public String description;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean submittedAndPendingApproval;
|
public Boolean submittedAndPendingApproval;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean approved;
|
public Boolean approved;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean rejected;
|
public Boolean rejected;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean active;
|
public Boolean active;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean closed;
|
public Boolean closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,23 +87,23 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsTimeline() {}
|
private GetAccountsTimeline() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "[2016, 4, 1]")
|
@Schema(example = "[2016, 4, 1]")
|
||||||
public LocalDate submittedOnDate;
|
public LocalDate submittedOnDate;
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String submittedByUsername;
|
public String submittedByUsername;
|
||||||
@ApiModelProperty(example = "App")
|
@Schema(example = "App")
|
||||||
public String submittedByFirstname;
|
public String submittedByFirstname;
|
||||||
@ApiModelProperty(example = "Administrator")
|
@Schema(example = "Administrator")
|
||||||
public String submittedByLastname;
|
public String submittedByLastname;
|
||||||
@ApiModelProperty(example = "[2016, 4, 1]")
|
@Schema(example = "[2016, 4, 1]")
|
||||||
public LocalDate approvedDate;
|
public LocalDate approvedDate;
|
||||||
@ApiModelProperty(example = "mifos")
|
@Schema(example = "mifos")
|
||||||
public String approvedByUsername;
|
public String approvedByUsername;
|
||||||
@ApiModelProperty(example = "App")
|
@Schema(example = "App")
|
||||||
public String approvedByFirstname;
|
public String approvedByFirstname;
|
||||||
@ApiModelProperty(example = "Administrator")
|
@Schema(example = "Administrator")
|
||||||
public String approvedByLastname;
|
public String approvedByLastname;
|
||||||
@ApiModelProperty(example = "[2016, 4, 1]")
|
@Schema(example = "[2016, 4, 1]")
|
||||||
public LocalDate activatedDate;
|
public LocalDate activatedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,19 +111,19 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsCurrency() {}
|
private GetAccountsCurrency() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "USD")
|
@Schema(example = "USD")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "US Dollar")
|
@Schema(example = "US Dollar")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer decimalPlaces;
|
public Integer decimalPlaces;
|
||||||
@ApiModelProperty(example = "100")
|
@Schema(example = "100")
|
||||||
public Integer inMultiplesOf;
|
public Integer inMultiplesOf;
|
||||||
@ApiModelProperty(example = "$")
|
@Schema(example = "$")
|
||||||
public String displaySymbol;
|
public String displaySymbol;
|
||||||
@ApiModelProperty(example = "currency.USD")
|
@Schema(example = "currency.USD")
|
||||||
public String nameCode;
|
public String nameCode;
|
||||||
@ApiModelProperty(example = "US Dollar ($)")
|
@Schema(example = "US Dollar ($)")
|
||||||
public String displayLabel;
|
public String displayLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,17 +131,17 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsSummary() {}
|
private GetAccountsSummary() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "000000002")
|
@Schema(example = "000000002")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer totalApprovedShares;
|
public Integer totalApprovedShares;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer totalPendingForApprovalShares;
|
public Integer totalPendingForApprovalShares;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer productId;
|
public Integer productId;
|
||||||
@ApiModelProperty(example = "Conflux Share Product")
|
@Schema(example = "Conflux Share Product")
|
||||||
public String productName;
|
public String productName;
|
||||||
public GetAccountsStatus status;
|
public GetAccountsStatus status;
|
||||||
public GetAccountsTimeline timeline;
|
public GetAccountsTimeline timeline;
|
||||||
@@ -157,43 +156,43 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsPurchasedSharesStatus() {}
|
private GetAccountsPurchasedSharesStatus() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "300")
|
@Schema(example = "300")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "purchasedSharesStatusType.approved")
|
@Schema(example = "purchasedSharesStatusType.approved")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Approved")
|
@Schema(example = "Approved")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetAccountsPurchasedSharesType {
|
static final class GetAccountsPurchasedSharesType {
|
||||||
|
|
||||||
private GetAccountsPurchasedSharesType() {}
|
private GetAccountsPurchasedSharesType() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "500")
|
@Schema(example = "500")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "purchasedSharesType.purchased")
|
@Schema(example = "purchasedSharesType.purchased")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Purchase")
|
@Schema(example = "Purchase")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "6")
|
@Schema(example = "6")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer accountId;
|
public Integer accountId;
|
||||||
@ApiModelProperty(example = "[2016, 4, 1]")
|
@Schema(example = "[2016, 4, 1]")
|
||||||
public LocalDate purchasedDate;
|
public LocalDate purchasedDate;
|
||||||
@ApiModelProperty(example = "10")
|
@Schema(example = "10")
|
||||||
public Integer numberOfShares;
|
public Integer numberOfShares;
|
||||||
@ApiModelProperty(example = "0.5")
|
@Schema(example = "0.5")
|
||||||
public Double purchasedPrice;
|
public Double purchasedPrice;
|
||||||
public GetAccountsPurchasedSharesStatus status;
|
public GetAccountsPurchasedSharesStatus status;
|
||||||
public GetAccountsPurchasedSharesType type;
|
public GetAccountsPurchasedSharesType type;
|
||||||
@ApiModelProperty(example = "5.05")
|
@Schema(example = "5.05")
|
||||||
public Double amount;
|
public Double amount;
|
||||||
@ApiModelProperty(example = "0.05")
|
@Schema(example = "0.05")
|
||||||
public Double chargeAmount;
|
public Double chargeAmount;
|
||||||
@ApiModelProperty(example = "5.05")
|
@Schema(example = "5.05")
|
||||||
public Double amountPaid;
|
public Double amountPaid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,12 +200,12 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsLockPeriodTypeEnum() {}
|
private GetAccountsLockPeriodTypeEnum() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "savings.lockin.sharePeriodFrequencyType.days")
|
@Schema(example = "savings.lockin.sharePeriodFrequencyType.days")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Days")
|
@Schema(example = "Days")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetAccountsCharges {
|
static final class GetAccountsCharges {
|
||||||
@@ -217,112 +216,112 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsChargeTimeType() {}
|
private GetAccountsChargeTimeType() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "13")
|
@Schema(example = "13")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "chargeTimeType.activation")
|
@Schema(example = "chargeTimeType.activation")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Share Account Activate")
|
@Schema(example = "Share Account Activate")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetAccountsChargeCalculationType {
|
static final class GetAccountsChargeCalculationType {
|
||||||
|
|
||||||
private GetAccountsChargeCalculationType() {}
|
private GetAccountsChargeCalculationType() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "chargeCalculationType.flat")
|
@Schema(example = "chargeCalculationType.flat")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Flat")
|
@Schema(example = "Flat")
|
||||||
public String value;
|
public String description;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class GetAccountsChargesCurrency {
|
static final class GetAccountsChargesCurrency {
|
||||||
|
|
||||||
private GetAccountsChargesCurrency() {}
|
private GetAccountsChargesCurrency() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "USD")
|
@Schema(example = "USD")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "US Dollar")
|
@Schema(example = "US Dollar")
|
||||||
public String name;
|
public String name;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer decimalPlaces;
|
public Integer decimalPlaces;
|
||||||
@ApiModelProperty(example = "$")
|
@Schema(example = "$")
|
||||||
public String displaySymbol;
|
public String displaySymbol;
|
||||||
@ApiModelProperty(example = "currency.USD")
|
@Schema(example = "currency.USD")
|
||||||
public String nameCode;
|
public String nameCode;
|
||||||
@ApiModelProperty(example = "US Dollar ($)")
|
@Schema(example = "US Dollar ($)")
|
||||||
public String displayLabel;
|
public String displayLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "9")
|
@Schema(example = "9")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "20")
|
@Schema(example = "20")
|
||||||
public Integer chargeId;
|
public Integer chargeId;
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer accountId;
|
public Integer accountId;
|
||||||
@ApiModelProperty(example = "Share Account Activation Flat")
|
@Schema(example = "Share Account Activation Flat")
|
||||||
public String name;
|
public String name;
|
||||||
public GetAccountsChargeTimeType chargeTimeType;
|
public GetAccountsChargeTimeType chargeTimeType;
|
||||||
public GetAccountsChargeCalculationType chargeCalculationType;
|
public GetAccountsChargeCalculationType chargeCalculationType;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Double percentage;
|
public Double percentage;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Double amountPercentageAppliedTo;
|
public Double amountPercentageAppliedTo;
|
||||||
public GetAccountsChargesCurrency currency;
|
public GetAccountsChargesCurrency currency;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Float amount;
|
public Float amount;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Float amountPaid;
|
public Float amountPaid;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Float amountWaived;
|
public Float amountWaived;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Float amountWrittenOff;
|
public Float amountWrittenOff;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Float amountOutstanding;
|
public Float amountOutstanding;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Float amountOrPercentage;
|
public Float amountOrPercentage;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean isActive;
|
public Boolean isActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "2")
|
@Schema(example = "2")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "000000002")
|
@Schema(example = "000000002")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "000000013")
|
@Schema(example = "000000013")
|
||||||
public Long savingsAccountNumber;
|
public Long savingsAccountNumber;
|
||||||
@ApiModelProperty(example = "7")
|
@Schema(example = "7")
|
||||||
public Integer clientId;
|
public Integer clientId;
|
||||||
@ApiModelProperty(example = "Client_FirstName_2KX8C Client_LastName_NWNG")
|
@Schema(example = "Client_FirstName_2KX8C Client_LastName_NWNG")
|
||||||
public String clientName;
|
public String clientName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer productId;
|
public Integer productId;
|
||||||
@ApiModelProperty(example = "Share Product")
|
@Schema(example = "Share Product")
|
||||||
public String productName;
|
public String productName;
|
||||||
public GetAccountsStatus status;
|
public GetAccountsStatus status;
|
||||||
public GetAccountsTimeline timeline;
|
public GetAccountsTimeline timeline;
|
||||||
public GetAccountsCurrency currency;
|
public GetAccountsCurrency currency;
|
||||||
public GetAccountsSummary summary;
|
public GetAccountsSummary summary;
|
||||||
public Set<GetAccountsPurchasedShares> purchasedShares;
|
public Set<GetAccountsPurchasedShares> purchasedShares;
|
||||||
@ApiModelProperty(example = "13")
|
@Schema(example = "13")
|
||||||
public Integer savingsAccountId;
|
public Integer savingsAccountId;
|
||||||
@ApiModelProperty(example = "5")
|
@Schema(example = "5")
|
||||||
public Integer currentMarketPrice;
|
public Integer currentMarketPrice;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer lockinPeriod;
|
public Integer lockinPeriod;
|
||||||
public GetAccountsLockPeriodTypeEnum lockPeriodTypeEnum;
|
public GetAccountsLockPeriodTypeEnum lockPeriodTypeEnum;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer minimumActivePeriod;
|
public Integer minimumActivePeriod;
|
||||||
public GetAccountsLockPeriodTypeEnum minimumActivePeriodTypeEnum;
|
public GetAccountsLockPeriodTypeEnum minimumActivePeriodTypeEnum;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean allowDividendCalculationForInactiveClients;
|
public Boolean allowDividendCalculationForInactiveClients;
|
||||||
public Set<GetAccountsCharges> charges;
|
public Set<GetAccountsCharges> charges;
|
||||||
@ApiModelProperty(example = "")
|
@Schema(example = "")
|
||||||
public List<String> dividends;
|
public List<String> dividends;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "GetAccountsTypeResponse")
|
@Schema(description = "GetAccountsTypeResponse")
|
||||||
public static final class GetAccountsTypeResponse {
|
public static final class GetAccountsTypeResponse {
|
||||||
|
|
||||||
private GetAccountsTypeResponse() {}
|
private GetAccountsTypeResponse() {}
|
||||||
@@ -335,21 +334,21 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsTypeStatus() {}
|
private GetAccountsTypeStatus() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "100")
|
@Schema(example = "100")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "shareAccountStatusType.submitted.and.pending.approval")
|
@Schema(example = "shareAccountStatusType.submitted.and.pending.approval")
|
||||||
public String code;
|
public String code;
|
||||||
@ApiModelProperty(example = "Submitted and pending approval")
|
@Schema(example = "Submitted and pending approval")
|
||||||
public String value;
|
public String description;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean submittedAndPendingApproval;
|
public Boolean submittedAndPendingApproval;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean approved;
|
public Boolean approved;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean rejected;
|
public Boolean rejected;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean active;
|
public Boolean active;
|
||||||
@ApiModelProperty(example = "false")
|
@Schema(example = "false")
|
||||||
public Boolean closed;
|
public Boolean closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,7 +356,7 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsTypeTimeline() {}
|
private GetAccountsTypeTimeline() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "[2013, 3, 1]")
|
@Schema(example = "[2013, 3, 1]")
|
||||||
public LocalDate submittedOnDate;
|
public LocalDate submittedOnDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,13 +364,13 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private GetAccountsTypePurchasedShares() {}
|
private GetAccountsTypePurchasedShares() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "01 May 2013")
|
@Schema(example = "01 May 2013")
|
||||||
public String purchasedDate;
|
public String purchasedDate;
|
||||||
@ApiModelProperty(example = "10")
|
@Schema(example = "10")
|
||||||
public Integer numberOfShares;
|
public Integer numberOfShares;
|
||||||
@ApiModelProperty(example = "5")
|
@Schema(example = "5")
|
||||||
public Integer purchasedPrice;
|
public Integer purchasedPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,17 +381,17 @@ final class AccountsApiResourceSwagger {
|
|||||||
public GetAccountsTypeAccountIdResponse.GetAccountsCharges.GetAccountsChargesCurrency currency;
|
public GetAccountsTypeAccountIdResponse.GetAccountsCharges.GetAccountsChargesCurrency currency;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
@ApiModelProperty(example = "000000001")
|
@Schema(example = "000000001")
|
||||||
public Long accountNo;
|
public Long accountNo;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer clientId;
|
public Integer clientId;
|
||||||
@ApiModelProperty(example = "Client Name")
|
@Schema(example = "Client Name")
|
||||||
public String clientName;
|
public String clientName;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer productId;
|
public Integer productId;
|
||||||
@ApiModelProperty(example = "Share Product Name")
|
@Schema(example = "Share Product Name")
|
||||||
public String productName;
|
public String productName;
|
||||||
public GetAccountsTypeStatus status;
|
public GetAccountsTypeStatus status;
|
||||||
public GetAccountsTypeTimeline timeline;
|
public GetAccountsTypeTimeline timeline;
|
||||||
@@ -401,12 +400,12 @@ final class AccountsApiResourceSwagger {
|
|||||||
public GetAccountsTypeSummary summary;
|
public GetAccountsTypeSummary summary;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer totalFilteredRecords;
|
public Integer totalFilteredRecords;
|
||||||
public Set<GetAccountsPageItems> pageItems;
|
public Set<GetAccountsPageItems> pageItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountsTypeRequest")
|
@Schema(description = "PostAccountsTypeRequest")
|
||||||
public static final class PostAccountsTypeRequest {
|
public static final class PostAccountsTypeRequest {
|
||||||
|
|
||||||
private PostAccountsTypeRequest() {}
|
private PostAccountsTypeRequest() {}
|
||||||
@@ -415,53 +414,53 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private PostAccountsCharges() {}
|
private PostAccountsCharges() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "20")
|
@Schema(example = "20")
|
||||||
public Integer chargeId;
|
public Integer chargeId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer amount;
|
public Integer amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "7")
|
@Schema(example = "7")
|
||||||
public Integer clientId;
|
public Integer clientId;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer productId;
|
public Integer productId;
|
||||||
@ApiModelProperty(example = "100")
|
@Schema(example = "100")
|
||||||
public Integer requestedShares;
|
public Integer requestedShares;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer externalId;
|
public Integer externalId;
|
||||||
@ApiModelProperty(example = "01 May 2016")
|
@Schema(example = "01 May 2016")
|
||||||
public String submittedDate;
|
public String submittedDate;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer minimumActivePeriod;
|
public Integer minimumActivePeriod;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer minimumActivePeriodFrequencyType;
|
public Integer minimumActivePeriodFrequencyType;
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer lockinPeriodFrequency;
|
public Integer lockinPeriodFrequency;
|
||||||
@ApiModelProperty(example = "0")
|
@Schema(example = "0")
|
||||||
public Integer lockinPeriodFrequencyType;
|
public Integer lockinPeriodFrequencyType;
|
||||||
@ApiModelProperty(example = "01 May 2016")
|
@Schema(example = "01 May 2016")
|
||||||
public String applicationDate;
|
public String applicationDate;
|
||||||
@ApiModelProperty(example = "true")
|
@Schema(example = "true")
|
||||||
public Boolean allowDividendCalculationForInactiveClients;
|
public Boolean allowDividendCalculationForInactiveClients;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
public Set<PostAccountsCharges> charges;
|
public Set<PostAccountsCharges> charges;
|
||||||
@ApiModelProperty(example = "13")
|
@Schema(example = "13")
|
||||||
public Integer savingsAccountId;
|
public Integer savingsAccountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountsTypeResponse")
|
@Schema(description = "PostAccountsTypeResponse")
|
||||||
public static final class PostAccountsTypeResponse {
|
public static final class PostAccountsTypeResponse {
|
||||||
|
|
||||||
private PostAccountsTypeResponse() {}
|
private PostAccountsTypeResponse() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer resourceId;
|
public Integer resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountsTypeAccountIdRequest")
|
@Schema(description = "PostAccountsTypeAccountIdRequest")
|
||||||
public static final class PostAccountsTypeAccountIdRequest {
|
public static final class PostAccountsTypeAccountIdRequest {
|
||||||
|
|
||||||
private PostAccountsTypeAccountIdRequest() {}
|
private PostAccountsTypeAccountIdRequest() {}
|
||||||
@@ -470,38 +469,38 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private PostAccountsRequestedShares() {}
|
private PostAccountsRequestedShares() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "35")
|
@Schema(example = "35")
|
||||||
public Integer id;
|
public Integer id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<PostAccountsRequestedShares> requestedShares;
|
public Set<PostAccountsRequestedShares> requestedShares;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PostAccountsTypeAccountIdResponse")
|
@Schema(description = "PostAccountsTypeAccountIdResponse")
|
||||||
public static final class PostAccountsTypeAccountIdResponse {
|
public static final class PostAccountsTypeAccountIdResponse {
|
||||||
|
|
||||||
private PostAccountsTypeAccountIdResponse() {}
|
private PostAccountsTypeAccountIdResponse() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "5")
|
@Schema(example = "5")
|
||||||
public Integer resourceId;
|
public Integer resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutAccountsTypeAccountIdRequest")
|
@Schema(description = "PutAccountsTypeAccountIdRequest")
|
||||||
public static final class PutAccountsTypeAccountIdRequest {
|
public static final class PutAccountsTypeAccountIdRequest {
|
||||||
|
|
||||||
private PutAccountsTypeAccountIdRequest() {}
|
private PutAccountsTypeAccountIdRequest() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "01 April 2016")
|
@Schema(example = "01 April 2016")
|
||||||
public String applicationDate;
|
public String applicationDate;
|
||||||
@ApiModelProperty(example = "20")
|
@Schema(example = "20")
|
||||||
public Integer requestedShares;
|
public Integer requestedShares;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModel(value = "PutAccountsTypeAccountIdResponse")
|
@Schema(description = "PutAccountsTypeAccountIdResponse")
|
||||||
public static final class PutAccountsTypeAccountIdResponse {
|
public static final class PutAccountsTypeAccountIdResponse {
|
||||||
|
|
||||||
private PutAccountsTypeAccountIdResponse() {}
|
private PutAccountsTypeAccountIdResponse() {}
|
||||||
@@ -510,17 +509,17 @@ final class AccountsApiResourceSwagger {
|
|||||||
|
|
||||||
private PutAccountsChanges() {}
|
private PutAccountsChanges() {}
|
||||||
|
|
||||||
@ApiModelProperty(example = "dd MMMM yyyy")
|
@Schema(example = "dd MMMM yyyy")
|
||||||
public String dateFormat;
|
public String dateFormat;
|
||||||
@ApiModelProperty(example = "01 April 2016")
|
@Schema(example = "01 April 2016")
|
||||||
public String applicationDate;
|
public String applicationDate;
|
||||||
@ApiModelProperty(example = "20")
|
@Schema(example = "20")
|
||||||
public Integer requestedShares;
|
public Integer requestedShares;
|
||||||
@ApiModelProperty(example = "en")
|
@Schema(example = "en")
|
||||||
public String locale;
|
public String locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "1")
|
@Schema(example = "1")
|
||||||
public Integer resourceId;
|
public Integer resourceId;
|
||||||
public PutAccountsChanges changes;
|
public PutAccountsChanges changes;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user