Skip to content

FINERACT-2293: Migrate client address module to new command pipeline#5657

Open
avivijay19 wants to merge 1 commit intoapache:developfrom
avivijay19:FINERACT-2293
Open

FINERACT-2293: Migrate client address module to new command pipeline#5657
avivijay19 wants to merge 1 commit intoapache:developfrom
avivijay19:FINERACT-2293

Conversation

@avivijay19
Copy link
Contributor

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!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

@Slf4j
@Component
@RequiredArgsConstructor
public class ClientAddressCreateCommandHandler implements CommandHandler<ClientAddressRequest, ClientAddressCreateResponse> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about ClientAddressCreateRequest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Retry(name = "commandClientAddressCreate", fallbackMethod = "fallback")
@Override
@Transactional
public ClientAddressCreateResponse handle(Command<ClientAddressRequest> command) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment

@Slf4j
@Component
@RequiredArgsConstructor
public class ClientAddressUpdateCommandHandler implements CommandHandler<ClientAddressRequest, ClientAddressUpdateResponse> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClientAddressUpdateRequest

import org.apache.fineract.portfolio.address.filter.ClientAddressSearchParam;

public interface AddressReadPlatformService {
public interface AddressReadService {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about ClientAddressReadService?

@Service
@RequiredArgsConstructor
public class AddressReadPlatformServiceImpl implements AddressReadPlatformService {
public class AddressReadServiceImpl implements AddressReadService {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment

public interface ClientAddressWriteService {

CommandProcessingResult addClientAddress(Long clientId, Long addressTypeId, JsonCommand command);
ClientAddressCreateResponse createClientAddress(ClientAddressRequest request);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants