From 101f8a088de8145a79b1408fba190cb0b75271b6 Mon Sep 17 00:00:00 2001 From: LeeJaeHyeok97 Date: Thu, 18 Jan 2024 15:23:23 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20financialProduct=20=EB=B6=81=EB=A7=88?= =?UTF-8?q?=ED=81=AC=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20saving=5Fterm=2012?= =?UTF-8?q?=EA=B0=9C=EC=9B=94=20=EC=9D=B8=20=EA=B2=83=EB=A7=8C=20=EC=B6=9C?= =?UTF-8?q?=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/FinancialProductBookmarkRes.java | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/finfellows/domain/bookmark/dto/FinancialProductBookmarkRes.java b/src/main/java/com/finfellows/domain/bookmark/dto/FinancialProductBookmarkRes.java index 0956bce..9b55aaf 100644 --- a/src/main/java/com/finfellows/domain/bookmark/dto/FinancialProductBookmarkRes.java +++ b/src/main/java/com/finfellows/domain/bookmark/dto/FinancialProductBookmarkRes.java @@ -52,27 +52,33 @@ public static List toDto(List option.getSavingsTerm() != null && option.getSavingsTerm().equals(12)); + + if (hasSavingTerm12) { + String bankName = financialProduct.getBankName(); + String bankLogoUrl = bankRepository.findByBankName(bankName) != null ? bankRepository.findByBankName(bankName).getBankLogoUrl() : null; + + // Use the first option as the representative option + FinancialProductOption representativeOption = financialProduct.getFinancialProductOption().get(0); + + results.add(FinancialProductBookmarkRes.builder() + .isLiked(Boolean.TRUE) + .financialProductId(financialProductId) + .financialProductType(financialProduct.getFinancialProductType()) + .companyName(bankName) + .productName(financialProduct.getProductName()) + .interestRate(representativeOption.getInterestRate()) + .maximumPreferredInterestRate(representativeOption.getMaximumPreferredInterestRate()) + .bankLogoUrl(bankLogoUrl) + .build()); + + // Add the financialProductId to the included set + includedFinancialProductIds.add(financialProductId); + } } }