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); + } } }