FINERACT-2293: New command processing - create client address#6049
FINERACT-2293: New command processing - create client address#6049nidhiii128 wants to merge 1 commit into
Conversation
da0273f to
54d08b9
Compare
Please run: Before any PR or changes, please always run these two commands and make sure there is green build! |
54d08b9 to
d064384
Compare
|
@adamsaghy @vidakovic please review |
| } | ||
|
|
||
| public CommandWrapperBuilder addClientAddress(final long clientId, final long addressTypeId) { | ||
| public CommandWrapperBuilder addClientAddress(final Long clientId, final Long addressTypeId) { |
There was a problem hiding this comment.
Why do we need this when we migrate to new command processing?
|
|
||
| CommandProcessingResult addClientAddress(Long clientId, Long addressTypeId, JsonCommand command); | ||
|
|
||
| CommandProcessingResult addNewClientAddress(Client client, JsonCommand command); |
There was a problem hiding this comment.
Nope, belongs to legacy command processing.
|
|
||
| CommandProcessingResult addNewClientAddress(Client client, JsonCommand command); | ||
|
|
||
| CommandProcessingResult updateClientAddress(Long clientId, JsonCommand command); |
There was a problem hiding this comment.
Nope, belongs to legacy command processing.
| @@ -53,27 +53,6 @@ public class AddressWritePlatformServiceImpl implements AddressWritePlatformServ | |||
| private final ClientAddressRepositoryWrapper clientAddressRepositoryWrapper; | |||
| private final AddressCommandFromApiJsonDeserializer fromApiJsonDeserializer; | |||
There was a problem hiding this comment.
Nope, manual JSON parsing. We want to get away from this.
| } | ||
|
|
||
| @Override | ||
| public CommandProcessingResult addNewClientAddress(final Client client, final JsonCommand command) { |
There was a problem hiding this comment.
Nope, belongs to legacy command processing.
| import org.mockito.Mock; | ||
| import org.mockito.junit.jupiter.MockitoExtension; | ||
|
|
||
| @ExtendWith(MockitoExtension.class) |
There was a problem hiding this comment.
Same comment as in the PR #6085 concerning testing.
| @@ -265,14 +264,14 @@ public static PostClientsResponse createClient(final RequestSpecification reques | |||
| // Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long, | |||
| // org.apache.fineract.client.models.PostLoansLoanIdRequest) | |||
| @Deprecated(forRemoval = true) | |||
| public static PostClientClientIdAddressesResponse createClientAddress(final RequestSpecification requestSpec, | |||
| public static HashMap<String, Object> createClientAddress(final RequestSpecification requestSpec, | |||
There was a problem hiding this comment.
This looks wrong. We lost the type information and the whole idea of this code change is to have proper types in the first place. Something is wrong in the REST API resource class!
| .stateProvinceId(Long.valueOf(stateId)).isActive(addressIsActive); | ||
| PostClientClientIdAddressesResponse response = ClientHelper.createClientAddress(requestSpec, responseSpec, clientId.longValue(), | ||
| addressTypeId, request); | ||
| HashMap<String, Object> response = ClientHelper.createClientAddress(requestSpec, responseSpec, clientId.longValue(), addressTypeId, |
There was a problem hiding this comment.
This looks wrong. We lost the type information and the whole idea of this code change is to have proper types in the first place. Something is wrong in the REST API resource class!
JIRA: https://issues.apache.org/jira/browse/FINERACT-2293
Migrates the create client address endpoint (POST /v1/client/{clientId}/addresses?type={addressTypeId})
from the legacy JsonCommand command-processing path to the new typed fineract-command framework.
Scope (PR 1 of 2 for FINERACT-2293)
template module (FINERACT-2564) pattern
AddressWritePlatformService (no remaining callers)
addNewClientAddress(Client, JsonCommand) kept on AddressWritePlatformService since it is
still called by the client creation flow (ClientWritePlatformServiceJpaRepositoryImpl).
That migration is out of scope here.
Pattern follows the merged template-module reference (#5851).
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.