FINERACT-2293: Migrate client address module to new command pipeline#5657
FINERACT-2293: Migrate client address module to new command pipeline#5657avivijay19 wants to merge 1 commit intoapache:developfrom
Conversation
...c/main/java/org/apache/fineract/portfolio/address/service/ClientAddressWriteServiceImpl.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/fineract/portfolio/address/service/ClientAddressWriteServiceImpl.java
Outdated
Show resolved
Hide resolved
...rovider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResource.java
Outdated
Show resolved
Hide resolved
71d9801 to
602cd1a
Compare
602cd1a to
91c3b39
Compare
| @Slf4j | ||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class ClientAddressCreateCommandHandler implements CommandHandler<ClientAddressRequest, ClientAddressCreateResponse> { |
There was a problem hiding this comment.
How about ClientAddressCreateRequest?
| @Retry(name = "commandClientAddressCreate", fallbackMethod = "fallback") | ||
| @Override | ||
| @Transactional | ||
| public ClientAddressCreateResponse handle(Command<ClientAddressRequest> command) { |
| @Slf4j | ||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class ClientAddressUpdateCommandHandler implements CommandHandler<ClientAddressRequest, ClientAddressUpdateResponse> { |
There was a problem hiding this comment.
ClientAddressUpdateRequest
| import org.apache.fineract.portfolio.address.filter.ClientAddressSearchParam; | ||
|
|
||
| public interface AddressReadPlatformService { | ||
| public interface AddressReadService { |
There was a problem hiding this comment.
How about ClientAddressReadService?
| @Service | ||
| @RequiredArgsConstructor | ||
| public class AddressReadPlatformServiceImpl implements AddressReadPlatformService { | ||
| public class AddressReadServiceImpl implements AddressReadService { |
| public interface ClientAddressWriteService { | ||
|
|
||
| CommandProcessingResult addClientAddress(Long clientId, Long addressTypeId, JsonCommand command); | ||
| ClientAddressCreateResponse createClientAddress(ClientAddressRequest request); |
There was a problem hiding this comment.
We are not running out of disk space... even if the request classes for 2 different commands have exactly the same attributes... put them in 2 different classes... sometimes duplication is your friend... because next week someone will have the idea of adding something to the create command... or update... or both... and: the automatic handler selection won't work properly here.
| resilience4j.retry.instances.commandCacheSwitch.exponential-backoff-multiplier=${FINERACT_COMMAND_CACHE_SWITCH_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER:2} | ||
| resilience4j.retry.instances.commandCacheSwitch.retryExceptions=${FINERACT_COMMAND_CACHE_SWITCH_RETRY_EXCEPTIONS:org.springframework.dao.ConcurrencyFailureException,org.eclipse.persistence.exceptions.OptimisticLockException,jakarta.persistence.OptimisticLockException,org.springframework.orm.jpa.JpaOptimisticLockingFailureException} | ||
|
|
||
| # client address |
There was a problem hiding this comment.
not entirely sure why you just didn't move it to the end of last command, but before the general command related configs start... at the moment we are only 2 people working on this... so I guess it's fine... if we had more this would create some Git conflict chaos.
Description
Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.