Search in sources :

Example 6 with CommandWrapperBuilder

use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.

the class CreditBureauConfigurationAPI method updateCreditBureauLoanProductMapping.

@PUT
@Path("/mappings")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public String updateCreditBureauLoanProductMapping(final String apiRequestBodyAsJson) {
    final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCreditBureauLoanProductMapping().withJson(apiRequestBodyAsJson).build();
    final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
    return this.toApiJsonSerializer.serialize(result);
}
Also used : CommandWrapperBuilder(org.apache.fineract.commands.service.CommandWrapperBuilder) CommandWrapper(org.apache.fineract.commands.domain.CommandWrapper) CommandProcessingResult(org.apache.fineract.infrastructure.core.data.CommandProcessingResult) Path(javax.ws.rs.Path) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) PUT(javax.ws.rs.PUT)

Example 7 with CommandWrapperBuilder

use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.

the class CreditBureauIntegrationAPI method deleteCreditReport.

// deletes saved creditReports from database
@DELETE
@Path("deleteCreditReport/{creditBureauId}")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public String deleteCreditReport(@PathParam("creditBureauId") @Parameter(description = "creditBureauId") final Long creditBureauId, @Parameter(hidden = true) final String apiRequestBodyAsJson) {
    final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteCreditReport(creditBureauId).withJson(apiRequestBodyAsJson).build();
    final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
    return this.toCreditReportApiJsonSerializer.serialize(result);
}
Also used : CommandWrapperBuilder(org.apache.fineract.commands.service.CommandWrapperBuilder) CommandWrapper(org.apache.fineract.commands.domain.CommandWrapper) CommandProcessingResult(org.apache.fineract.infrastructure.core.data.CommandProcessingResult) Path(javax.ws.rs.Path) DELETE(javax.ws.rs.DELETE) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces)

Example 8 with CommandWrapperBuilder

use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.

the class ClientCollateralManagementApiResource method updateCollateral.

@PUT
@Path("{collateralId}")
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@Operation(summary = "Update New Collateral of a Client", description = "Update New Collateral of a Client")
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientCollateralManagementApiResourceSwagger.PutClientCollateralRequest.class)))
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralManagementApiResourceSwagger.PutClientCollateralResponse.class))) })
public String updateCollateral(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, @PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId, @Parameter(hidden = true) String apiJsonRequestBody) {
    final CommandWrapper commandWrapper = new CommandWrapperBuilder().updateClientCollateralProduct(clientId, collateralId).withJson(apiJsonRequestBody).build();
    final CommandProcessingResult commandProcessingResult = this.commandsSourceWritePlatformService.logCommandSource(commandWrapper);
    return this.apiJsonSerializerService.serialize(commandProcessingResult);
}
Also used : CommandWrapperBuilder(org.apache.fineract.commands.service.CommandWrapperBuilder) CommandWrapper(org.apache.fineract.commands.domain.CommandWrapper) CommandProcessingResult(org.apache.fineract.infrastructure.core.data.CommandProcessingResult) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) Consumes(javax.ws.rs.Consumes) Operation(io.swagger.v3.oas.annotations.Operation) PUT(javax.ws.rs.PUT) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses) RequestBody(io.swagger.v3.oas.annotations.parameters.RequestBody)

Example 9 with CommandWrapperBuilder

use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.

the class CollateralManagementApiResource method createCollateral.

@POST
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Create a new collateral", description = "Collateral Creation")
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CollateralManagementApiResourceSwagger.PostCollateralManagementProductRequest.class)))
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CollateralManagementApiResourceSwagger.PostCollateralManagementProductResponse.class))) })
public String createCollateral(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
    final CommandWrapper commandWrapper = new CommandWrapperBuilder().createCollateral().withJson(apiRequestBodyAsJson).build();
    final CommandProcessingResult commandProcessingResult = this.commandsSourceWritePlatformService.logCommandSource(commandWrapper);
    return this.apiJsonSerializerService.serialize(commandProcessingResult);
}
Also used : CommandWrapperBuilder(org.apache.fineract.commands.service.CommandWrapperBuilder) CommandWrapper(org.apache.fineract.commands.domain.CommandWrapper) CommandProcessingResult(org.apache.fineract.infrastructure.core.data.CommandProcessingResult) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses) RequestBody(io.swagger.v3.oas.annotations.parameters.RequestBody)

Example 10 with CommandWrapperBuilder

use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.

the class CollateralManagementApiResource method updateCollateral.

@PUT
@Path("{collateralId}")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Update Collateral", description = "Update Collateral")
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CollateralManagementApiResourceSwagger.PutCollateralProductRequest.class)))
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CollateralManagementApiResourceSwagger.PutCollateralProductResponse.class))) })
public String updateCollateral(@PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId, @Parameter(hidden = true) final String jsonBody) {
    final CommandWrapper commandWrapper = new CommandWrapperBuilder().updateCollateralProduct(collateralId).withJson(jsonBody).build();
    final CommandProcessingResult commandProcessingResult = this.commandsSourceWritePlatformService.logCommandSource(commandWrapper);
    return this.apiJsonSerializerService.serialize(commandProcessingResult);
}
Also used : CommandWrapperBuilder(org.apache.fineract.commands.service.CommandWrapperBuilder) CommandWrapper(org.apache.fineract.commands.domain.CommandWrapper) CommandProcessingResult(org.apache.fineract.infrastructure.core.data.CommandProcessingResult) Path(javax.ws.rs.Path) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) Operation(io.swagger.v3.oas.annotations.Operation) PUT(javax.ws.rs.PUT) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses) RequestBody(io.swagger.v3.oas.annotations.parameters.RequestBody)

Aggregations

CommandWrapperBuilder (org.apache.fineract.commands.service.CommandWrapperBuilder)309 CommandWrapper (org.apache.fineract.commands.domain.CommandWrapper)307 CommandProcessingResult (org.apache.fineract.infrastructure.core.data.CommandProcessingResult)299 Produces (javax.ws.rs.Produces)253 Consumes (javax.ws.rs.Consumes)251 Operation (io.swagger.v3.oas.annotations.Operation)199 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)193 Path (javax.ws.rs.Path)184 RequestBody (io.swagger.v3.oas.annotations.parameters.RequestBody)152 POST (javax.ws.rs.POST)121 PUT (javax.ws.rs.PUT)89 DELETE (javax.ws.rs.DELETE)61 GsonBuilder (com.google.gson.GsonBuilder)31 DateSerializer (org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer)30 UnrecognizedQueryParamException (org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException)28 Cell (org.apache.poi.ss.usermodel.Cell)13 Sheet (org.apache.poi.ss.usermodel.Sheet)13 JsonObject (com.google.gson.JsonObject)11 JsonElement (com.google.gson.JsonElement)10 ApiRequestJsonSerializationSettings (org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings)7