vidakovic commented on code in PR #5657:
URL: https://github.com/apache/fineract/pull/5657#discussion_r2963971552
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResource.java:
##########
@@ -36,62 +36,53 @@
import jakarta.ws.rs.core.MediaType;
import java.util.List;
import lombok.RequiredArgsConstructor;
-import org.apache.fineract.commands.domain.CommandWrapper;
-import org.apache.fineract.commands.service.CommandWrapperBuilder;
-import
org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService;
-import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
-import
org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
-import
org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
+import org.apache.fineract.command.core.CommandPipeline;
+import
org.apache.fineract.portfolio.address.command.ClientAddressCreateCommand;
+import
org.apache.fineract.portfolio.address.command.ClientAddressUpdateCommand;
import org.apache.fineract.portfolio.address.data.AddressData;
+import org.apache.fineract.portfolio.address.data.ClientAddressCreateResponse;
+import org.apache.fineract.portfolio.address.data.ClientAddressUpdateResponse;
import org.apache.fineract.portfolio.address.filter.ClientAddressSearchParam;
-import
org.apache.fineract.portfolio.address.service.AddressReadPlatformServiceImpl;
+import org.apache.fineract.portfolio.address.service.AddressReadService;
import org.apache.fineract.portfolio.client.data.ClientAddressRequest;
import org.springframework.stereotype.Component;
@Path("/v1/client")
@Component
@Tag(name = "Clients Address", description = "Address module is an optional
module and can be configured into the system by using GlobalConfiguration
setting: enable-address. In order to activate Address module, we need to enable
the configuration, enable-address by setting its value to true.")
@RequiredArgsConstructor
+@Consumes({ MediaType.APPLICATION_JSON })
+@Produces({ MediaType.APPLICATION_JSON })
public class ClientAddressApiResource {
- private static final String RESOURCE_NAME_FOR_PERMISSIONS = "Address";
- private final PlatformSecurityContext context;
- private final AddressReadPlatformServiceImpl readPlatformService;
- private final DefaultToApiJsonSerializer<AddressData> toApiJsonSerializer;
- private final PortfolioCommandSourceWritePlatformService
commandsSourceWritePlatformService;
+ private final AddressReadService readPlatformService;
+ private final CommandPipeline commandPipeline;
@GET
@Path("addresses/template")
- @Consumes({ MediaType.APPLICATION_JSON })
- @Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Retrieve client address template", operationId =
"retrieveTemplateClientAddress")
public AddressData getAddressesTemplate() {
-
context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS);
return readPlatformService.retrieveTemplate();
-
}
@POST
@Path("/{clientid}/addresses")
- @Consumes({ MediaType.APPLICATION_JSON })
- @Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Create an address for a Client", operationId =
"createClientAddress", description = "Mandatory Fields : \n"
+ "type and clientId")
@RequestBody(required = true, content = @Content(schema =
@Schema(implementation = ClientAddressRequest.class)))
- @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation =
ClientAddressApiResourcesSwagger.PostClientClientIdAddressesResponse.class)))
- public CommandProcessingResult addClientAddress(@QueryParam("type")
@Parameter(description = "type") final long addressTypeId,
+ @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation = ClientAddressCreateResponse.class)))
Review Comment:
I am working with the authors of the compatibility checks to solve this.
This annotation needs to go.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]