use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.
the class NotesApiResource method deleteNote.
@DELETE
@Path("{noteId}")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Delete a Resource Note", description = "Deletes a Resource Note")
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = NotesApiResourceSwagger.DeleteResourceTypeResourceIdNotesNoteIdResponse.class))) })
public String deleteNote(@PathParam("resourceType") @Parameter(description = "resourceType") final String resourceType, @PathParam("resourceId") @Parameter(description = "resourceId") final Long resourceId, @PathParam("noteId") @Parameter(description = "noteId") final Long noteId) {
final NoteType noteType = NoteType.fromApiUrl(resourceType);
if (noteType == null) {
throw new NoteResourceNotSupportedException(resourceType);
}
final CommandWrapper resourceDetails = getResourceDetails(noteType, resourceId);
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteNote(resourceDetails, resourceType, resourceId, noteId).build();
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
return this.toApiJsonSerializer.serialize(result);
}
use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.
the class NotesApiResource method updateNote.
@PUT
@Path("{noteId}")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Update a Resource Note", description = "Updates a Resource Note")
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = NotesApiResourceSwagger.PutResourceTypeResourceIdNotesNoteIdRequest.class)))
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = NotesApiResourceSwagger.PutResourceTypeResourceIdNotesNoteIdResponse.class))) })
public String updateNote(@PathParam("resourceType") @Parameter(description = "resourceType") final String resourceType, @PathParam("resourceId") @Parameter(description = "resourceId") final Long resourceId, @PathParam("noteId") @Parameter(description = "noteId") final Long noteId, @Parameter(hidden = true) final String apiRequestBodyAsJson) {
final NoteType noteType = NoteType.fromApiUrl(resourceType);
if (noteType == null) {
throw new NoteResourceNotSupportedException(resourceType);
}
final CommandWrapper resourceDetails = getResourceDetails(noteType, resourceId);
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateNote(resourceDetails, resourceType, resourceId, noteId).withJson(apiRequestBodyAsJson).build();
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
return this.toApiJsonSerializer.serialize(result);
}
use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.
the class TaxGroupApiResource method updateTaxGroup.
@PUT
@Path("{taxGroupId}")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Update Tax Group", description = "Updates Tax Group. Only end date can be up-datable and can insert new tax components.")
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TaxGroupApiResourceSwagger.PutTaxesGroupTaxGroupIdRequest.class)))
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxGroupApiResourceSwagger.PutTaxesGroupTaxGroupIdResponse.class))) })
public String updateTaxGroup(@PathParam("taxGroupId") @Parameter(description = "taxGroupId") final Long taxGroupId, @Parameter(hidden = true) final String apiRequestBodyAsJson) {
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateTaxGroup(taxGroupId).withJson(apiRequestBodyAsJson).build();
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
return this.toApiJsonSerializer.serialize(result);
}
use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.
the class TwoFactorConfigurationApiResource method updateConfiguration.
@PUT
public String updateConfiguration(final String apiRequestBodyAsJson) {
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateTwoFactorConfiguration().withJson(apiRequestBodyAsJson).build();
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
return this.toApiJsonSerializer.serialize(result);
}
use of org.apache.fineract.commands.service.CommandWrapperBuilder in project fineract by apache.
the class SmsApiResource method create.
@POST
public String create(final String apiRequestBodyAsJson) {
final CommandWrapper commandRequest = new CommandWrapperBuilder().createSms().withJson(apiRequestBodyAsJson).build();
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
return this.toApiJsonSerializer.serialize(result);
}
Aggregations