Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix 5.16.1 - Backport MAINT-32405 #491

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [5.16.1](https://github.com/Backbase/stream-services/compare/5.16.0...5.16.1)
### Fixed
- Fixed missing explicit state mappings for BaseProduct related classes

## [5.15.0](https://github.com/Backbase/stream-services/compare/5.15.0...5.15.0)
### Changed
- Updated legal entities specs for service agreement to include purpose field
Expand All @@ -25,6 +29,7 @@ All notable changes to this project will be documented in this file.
## [5.11.0](https://github.com/Backbase/stream-services/compare/5.10.0...5.11.0)
### Changed
- feature - improved payment ingestion to allow for joint owner accounts to be shared.

## [5.10.0](https://github.com/Backbase/stream-services/compare/5.9.1...5.10.0)
### Added
- Introducing Grand Central customer canonical model: Processing the `PartyUpsertEvent` using the Legal Entity Saga via the [legal-entity-composition-service](stream-compositions/services/legal-entity-composition-service)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public interface ProductMapper {
@Mapping(source = "debitCardsItems", target = "debitCards")
@Mapping(source = ProductMapperConstants.ACCOUNT_HOLDER_NAME, target = ProductMapperConstants.ACCOUNT_HOLDER_NAMES)
@Mapping(source = ProductMapperConstants.PAN_SUFFIX, target = ProductMapperConstants.NUMBER)
@Mapping(source = "state.state", target = ProductMapperConstants.STATE_ID)
PostArrangement toPresentation(CurrentAccount currentAccount);

@Mapping(source = ProductMapperConstants.EXTERNAL_ID, target = ProductMapperConstants.ID)
Expand All @@ -77,6 +78,7 @@ public interface ProductMapper {
@Mapping(source = ProductMapperConstants.DEBIT_CARDS_ITEMS, target = ProductMapperConstants.DEBIT_CARDS)
@Mapping(source = ProductMapperConstants.ACCOUNT_HOLDER_NAME, target = ProductMapperConstants.ACCOUNT_HOLDER_NAMES)
@Mapping(source = ProductMapperConstants.PAN_SUFFIX, target = ProductMapperConstants.NUMBER)
@Mapping(source = "state.state", target = ProductMapperConstants.STATE_ID)
@InheritConfiguration
PostArrangement toPresentation(SavingsAccount savingsAccount);

Expand All @@ -85,15 +87,16 @@ public interface ProductMapper {
@Mapping(source = ProductMapperConstants.LEGAL_ENTITIES, target = ProductMapperConstants.LEGAL_ENTITY_IDS)
@Mapping(source = ProductMapperConstants.ACCOUNT_HOLDER_NAME, target = ProductMapperConstants.ACCOUNT_HOLDER_NAMES)
@Mapping(source = "debitCard", qualifiedByName = "mapDebitCardNumber", target = ProductMapperConstants.NUMBER)
@Mapping(source = "state.state", target = ProductMapperConstants.STATE_ID)
@InheritConfiguration
PostArrangement toPresentation(DebitCard debitCard);


@Mapping(source = ProductMapperConstants.EXTERNAL_ID, target = ProductMapperConstants.ID)
@Mapping(source = ProductMapperConstants.PRODUCT_TYPE_EXTERNAL_ID, target = ProductMapperConstants.PRODUCT_ID)
@Mapping(source = ProductMapperConstants.LEGAL_ENTITIES, target = ProductMapperConstants.LEGAL_ENTITY_IDS)
@Mapping(source = ProductMapperConstants.ACCOUNT_HOLDER_NAME, target = ProductMapperConstants.ACCOUNT_HOLDER_NAMES)
@Mapping(source = "creditCard", qualifiedByName = "mapCreditCardNumber", target = ProductMapperConstants.NUMBER)
@Mapping(source = "state.state", target = ProductMapperConstants.STATE_ID)
@InheritConfiguration
PostArrangement toPresentation(CreditCard creditCard);

Expand All @@ -102,6 +105,7 @@ public interface ProductMapper {
@Mapping(source = ProductMapperConstants.LEGAL_ENTITIES, target = ProductMapperConstants.LEGAL_ENTITY_IDS)
@Mapping(source = ProductMapperConstants.ACCOUNT_HOLDER_NAME, target = ProductMapperConstants.ACCOUNT_HOLDER_NAMES)
@Mapping(source = ProductMapperConstants.PAN_SUFFIX, target = ProductMapperConstants.NUMBER)
@Mapping(source = "state.state", target = ProductMapperConstants.STATE_ID)
@InheritConfiguration
PostArrangement toPresentation(TermDeposit termDeposit);

Expand All @@ -110,6 +114,7 @@ public interface ProductMapper {
@Mapping(source = ProductMapperConstants.LEGAL_ENTITIES, target = ProductMapperConstants.LEGAL_ENTITY_IDS)
@Mapping(source = "currentInvestment.amount", target = "currentInvestmentValue")
@Mapping(source = ProductMapperConstants.PAN_SUFFIX, target = ProductMapperConstants.NUMBER)
@Mapping(source = "state.state", target = ProductMapperConstants.STATE_ID)
@InheritConfiguration
PostArrangement toPresentation(InvestmentAccount investmentAccount);

Expand All @@ -119,6 +124,7 @@ public interface ProductMapper {
@Mapping(source = ProductMapperConstants.LEGAL_ENTITIES, target = ProductMapperConstants.LEGAL_ENTITY_IDS)
@Mapping(source = ProductMapperConstants.ACCOUNT_HOLDER_NAME, target = ProductMapperConstants.ACCOUNT_HOLDER_NAMES)
@Mapping(source = ProductMapperConstants.PAN_SUFFIX, target = ProductMapperConstants.NUMBER)
@Mapping(source = "state.state", target = ProductMapperConstants.STATE_ID)
@InheritConfiguration
PostArrangement toPresentation(Loan loan);

Expand All @@ -136,6 +142,7 @@ public interface ProductMapper {
ArrangementItem toArrangementItem(ArrangementPutItem arrangementItemPut);

@Mapping(source = ProductMapperConstants.EXTERNAL_ID, target = ProductMapperConstants.EXTERNAL_ARRANGEMENT_ID)
@Mapping(source = "state.state", target = ProductMapperConstants.EXTERNAL_STATE_ID)
ArrangementItem toPresentationWithWeirdSpellingError(Product product);

@Mapping(source = ProductMapperConstants.EXTERNAL_ARRANGEMENT_ID, target = ProductMapperConstants.EXTERNAL_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ private void buildBaseProduct(BaseProduct baseProduct) {
.externalId("prod_ext_id")
.productTypeExternalId("prod_type_ext_id")
.legalEntities(List.of(buildLegalEntityReference("le_ext_id_1"), buildLegalEntityReference("le_ext_id_2")))
.state(new BaseProductState().state("prod_state"))
// Here externalStateId and state are set because in arrangement-pull-integration-service
// in the AccountStatusMapper, both fields are set with the same state value in the 3
// ACTIVE, INACTIVE and CLOSED enums
.state(new BaseProductState().externalStateId("prod_state").state("prod_state"))
.additions(Map.of("add_prop_1", "add_val_1", "add_prop_2", "add_val_2"))
.name("prod_name")
.currency("USD")
Expand Down Expand Up @@ -268,8 +271,8 @@ void map_AccountArrangementItemBase_To_AccountArrangementItem() {
void map_Product_To_AccountArrangementItem() {
Product source = buildProduct();
ArrangementItem target = productMapper.toPresentationWithWeirdSpellingError(source);
Assertions.assertEquals(target.getExternalArrangementId(), source.getExternalId());
Assertions.assertEquals(target.getExternalStateId(), source.getState().getExternalStateId());
Assertions.assertEquals(source.getExternalId(), target.getExternalArrangementId());
Assertions.assertEquals(source.getState().getExternalStateId(), target.getExternalStateId());
}

@Test
Expand Down
Loading