From 80ae9adaa62728a52b6095aed3124dad18fbc09c Mon Sep 17 00:00:00 2001 From: Daniel Chiuratto Seabra Date: Tue, 19 Nov 2024 12:51:14 +0100 Subject: [PATCH] MAINT-32872: Fix productTypeName mapping (#487) Co-authored-by: Daniel Chiuratto Seabra --- CHANGELOG.md | 4 ++++ .../ReactiveProductCatalogService.java | 15 ++------------- .../mappings/arrangement-manager-stubs.json | 4 ++-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ac6ab5d4..9407b84f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. +## [6.5.0](https://github.com/Backbase/stream-services/compare/6.4.0...6.5.0) +### Fixed +- Fixed productTypeName mapping when ingesting Product data into arrangement-manager + ## [6.4.0](https://github.com/Backbase/stream-services/compare/6.3.0...6.4.0) ### Fixed - Fixed setting internal id for creatorLE before creating SA diff --git a/stream-product-catalog/product-catalog-core/src/main/java/com/backbase/stream/productcatalog/ReactiveProductCatalogService.java b/stream-product-catalog/product-catalog-core/src/main/java/com/backbase/stream/productcatalog/ReactiveProductCatalogService.java index f2b046125..6abb8b37a 100644 --- a/stream-product-catalog/product-catalog-core/src/main/java/com/backbase/stream/productcatalog/ReactiveProductCatalogService.java +++ b/stream-product-catalog/product-catalog-core/src/main/java/com/backbase/stream/productcatalog/ReactiveProductCatalogService.java @@ -63,25 +63,14 @@ private Flux getProductKindFlux() { */ public Mono setupProductCatalog(ProductCatalog productCatalog) { return getProductCatalog().flatMap(existingProductCatalog -> { - - List newProductKinds = new ArrayList<>(); - if (productCatalog.getProductKinds() != null) { - newProductKinds = productCatalog.getProductKinds().stream() - .filter(newProductKind -> existingProductCatalog.getProductKinds().stream() - .noneMatch(productKind -> - productKind.getExternalKindId().equals(newProductKind.getExternalKindId()))) - .collect(Collectors.toList()); - } List newProductTypes = new ArrayList<>(); if (productCatalog.getProductTypes() != null) { newProductTypes = productCatalog.getProductTypes().stream() .filter(newProductType -> existingProductCatalog.getProductTypes().stream() .noneMatch(productType -> - productType.getExternalProductId().equals(newProductType.getExternalProductId()))) - .collect(Collectors.toList()); + productType.getExternalProductId().equals(newProductType.getExternalProductId()))).toList(); } - // Ensure products kinds are created first List finalNewProductTypes = newProductTypes; return getProductKindFlux().collectList().flatMap(productKinds -> createProductTypes(finalNewProductTypes, productKinds).collectList().flatMap(productTypes -> { productCatalog.setProductTypes(productTypes); @@ -170,7 +159,7 @@ public Mono createProductType(ProductType productType, List