From a515a5cf8736b25128f369561b55708667e030b2 Mon Sep 17 00:00:00 2001 From: "fabio.d.mota" Date: Mon, 22 Apr 2024 16:14:34 +0100 Subject: [PATCH] fix(backend): Mapping Country to iso code --- .../dto/ShareDTOs/InputSharingBusinessPartnerDTO.java | 2 +- .../valueaddedservice/service/logic/ShareLogicService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/eclipse/tractusx/valueaddedservice/dto/ShareDTOs/InputSharingBusinessPartnerDTO.java b/src/main/java/org/eclipse/tractusx/valueaddedservice/dto/ShareDTOs/InputSharingBusinessPartnerDTO.java index f7f1142..d881157 100644 --- a/src/main/java/org/eclipse/tractusx/valueaddedservice/dto/ShareDTOs/InputSharingBusinessPartnerDTO.java +++ b/src/main/java/org/eclipse/tractusx/valueaddedservice/dto/ShareDTOs/InputSharingBusinessPartnerDTO.java @@ -38,7 +38,7 @@ public class InputSharingBusinessPartnerDTO implements Serializable { @Schema(example = "BPN-NUMBER") private String bpn; - @Schema(example = "Portugal") + @Schema(example = "PT") private String country; diff --git a/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/ShareLogicService.java b/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/ShareLogicService.java index 9d7bfe3..6897c61 100644 --- a/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/ShareLogicService.java +++ b/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/ShareLogicService.java @@ -96,7 +96,7 @@ private ShareDTO setShareDTO(InputSharingBusinessPartnerDTO bp, List da shareDTO.setBpn(bp.getBpn()); shareDTO.setCountry(bp.getCountry()); dataDTOS.forEach(dataDTO -> { - if(Objects.equals(dataDTO.getCountry(), bp.getCountry())){ + if(Objects.equals(dataDTO.getIso2(), bp.getCountry())){ ShareRatingDTO shareRatingDTO = new ShareRatingDTO(); shareRatingDTO.setDataSourceName(dataDTO.getDataSourceName()); shareRatingDTO.setScore(dataDTO.getScore());