diff --git a/finpik-api/src/main/java/finpik/resolver/loanproduct/application/impl/CreateRecommendLoanProductUseCaseImpl.java b/finpik-api/src/main/java/finpik/resolver/loanproduct/application/impl/CreateRecommendLoanProductUseCaseImpl.java index f52e9e8..85d5e61 100644 --- a/finpik-api/src/main/java/finpik/resolver/loanproduct/application/impl/CreateRecommendLoanProductUseCaseImpl.java +++ b/finpik-api/src/main/java/finpik/resolver/loanproduct/application/impl/CreateRecommendLoanProductUseCaseImpl.java @@ -2,7 +2,11 @@ import finpik.RecommendedLoanProduct; import finpik.dto.CreateRecommendedLoanProductEvent; +import finpik.entity.enums.LoanProductBadge; +import finpik.error.enums.ErrorCode; +import finpik.error.exception.BusinessException; import finpik.repository.loanproduct.LoanProductRepository; +import finpik.repository.profile.ProfileRepository; import finpik.resolver.loanproduct.application.CreateRecommendLoanProductUseCase; import finpik.sse.service.SseEmitterService; import lombok.RequiredArgsConstructor; @@ -22,6 +26,7 @@ public class CreateRecommendLoanProductUseCaseImpl implements CreateRecommendLoanProductUseCase { private final LoanProductRepository loanProductRepository; + private final ProfileRepository profileRepository; private final SseEmitterService sseEmitterService; @Async @@ -45,7 +50,17 @@ public void execute(CreateRecommendedLoanProductEvent event) { ) ).toList(); - loanProductRepository.saveAllRecommendedLoanProduct(event.profileId(), recommendedLoanProductList); + List recommendedLoanProducts = + loanProductRepository.saveAllRecommendedLoanProduct(event.profileId(), recommendedLoanProductList); + + RecommendedLoanProduct first = recommendedLoanProducts.stream() + .filter(it -> + it.getLoanProductBadges().contains(LoanProductBadge.LOWEST_MIN_INTEREST_RATE) + ).findFirst().orElseThrow(() -> new BusinessException(ErrorCode.INVALID_ANNUAL_INCOME)); + + profileRepository.updateProfileAfterRecommend( + event.profileId(), recommendedLoanProductList.size(), first.getMinInterestRate() + ); sseEmitterService.notifyRecommendationCompleted( event.eventId(), diff --git a/finpik-api/src/main/java/finpik/resolver/profile/application/dto/ProfileResultDto.java b/finpik-api/src/main/java/finpik/resolver/profile/application/dto/ProfileResultDto.java index e9730da..f08832c 100644 --- a/finpik-api/src/main/java/finpik/resolver/profile/application/dto/ProfileResultDto.java +++ b/finpik-api/src/main/java/finpik/resolver/profile/application/dto/ProfileResultDto.java @@ -7,6 +7,8 @@ import finpik.entity.enums.PurposeOfLoan; import lombok.Getter; +import java.time.LocalDateTime; + @Getter public class ProfileResultDto { Long profileId; @@ -20,6 +22,9 @@ public class ProfileResultDto { Integer profileSeq; ProfileColor profileColor; Integer annualIncome; + LocalDateTime createdAt; + Integer recommendedLoanProductCount; + Float minInterestRate; public ProfileResultDto(Profile profile) { profileId = profile.getId(); @@ -33,5 +38,8 @@ public ProfileResultDto(Profile profile) { profileColor = profile.getProfileColor(); profileSeq = profile.getSeq(); annualIncome = profile.getOccupationDetail().getAnnualIncome(); + createdAt = profile.getCreatedAt(); + recommendedLoanProductCount = profile.getRecommendedLoanProductCount(); + minInterestRate = profile.getMinInterestRate(); } } diff --git a/finpik-api/src/main/java/finpik/resolver/profile/resolver/result/ProfileResult.java b/finpik-api/src/main/java/finpik/resolver/profile/resolver/result/ProfileResult.java index c6de810..8c86e98 100644 --- a/finpik-api/src/main/java/finpik/resolver/profile/resolver/result/ProfileResult.java +++ b/finpik-api/src/main/java/finpik/resolver/profile/resolver/result/ProfileResult.java @@ -7,6 +7,8 @@ import finpik.resolver.profile.application.dto.ProfileResultDto; import lombok.Builder; +import java.time.LocalDateTime; + @Builder public record ProfileResult( Long profileId, @@ -19,7 +21,10 @@ public record ProfileResult( Integer profileSeq, String profileName, ProfileColor profileColor, - Integer annualIncome + Integer annualIncome, + LocalDateTime createdAt, + Integer recommendedLoanProductCount, + Float minInterestRate ) { public static ProfileResult of(ProfileResultDto profile) { @@ -35,6 +40,9 @@ public static ProfileResult of(ProfileResultDto profile) { .profileSeq(profile.getProfileSeq()) .profileColor(profile.getProfileColor()) .annualIncome(profile.getAnnualIncome()) + .createdAt(profile.getCreatedAt()) + .recommendedLoanProductCount(profile.getRecommendedLoanProductCount()) + .minInterestRate(profile.getMinInterestRate()) .build(); } } diff --git a/finpik-api/src/main/resources/graphql/profile.graphqls b/finpik-api/src/main/resources/graphql/profile.graphqls index d6d6789..cd0b738 100644 --- a/finpik-api/src/main/resources/graphql/profile.graphqls +++ b/finpik-api/src/main/resources/graphql/profile.graphqls @@ -69,6 +69,9 @@ type ProfileResult { profileSeq: Int! profileName: String! profileColor: ProfileColor! + createdAt: DateTime! + recommendedLoanProductCount: Int! + minInterestRate: Float! } enum Occupation { diff --git a/finpik-common/src/main/java/finpik/error/enums/ErrorCode.java b/finpik-common/src/main/java/finpik/error/enums/ErrorCode.java index 82b0b14..05865bf 100644 --- a/finpik-common/src/main/java/finpik/error/enums/ErrorCode.java +++ b/finpik-common/src/main/java/finpik/error/enums/ErrorCode.java @@ -49,6 +49,7 @@ public enum ErrorCode { NOT_FOUND_LOAN_PRODUCT("대출 상품을 찾을 수 없습니다.", "LPD-0001", CustomHttpStatus.NOT_FOUND), NOT_CONVERT_KAFKA_MESSAGE_LOAN_PRODUCT("카프카에서 받은 추천 대출 상품 메세지를 컨버팅할 수 없습니다.", "LPD-0002", CustomHttpStatus.BAD_REQUEST), NOT_CONVERT_KAFKA_MESSAGE("카프카에 메세지를 보내기 위한 추천 대출 상품의 조건을 문자열로 변경이 실패했습니다.", "LPD-0003", CustomHttpStatus.BAD_REQUEST), + EMPTY_BADGES("추천된 상품에 뱃지를 받은 상품이 존재하지 않습니다.", "LPD-0004", CustomHttpStatus.BAD_REQUEST), //System ORDER_BY_PROPERTY_NOT_FOUND("정렬 조건을 찾을 수 없습니다. 개발자에게 문의 부탁드립니다.", "ITN-0001", CustomHttpStatus.INTERNAL_SERVER_ERROR),; diff --git a/finpik-domain/loanproduct/src/main/java/finpik/RecommendedLoanProduct.java b/finpik-domain/loanproduct/src/main/java/finpik/RecommendedLoanProduct.java index 09f51f2..2ba84c9 100644 --- a/finpik-domain/loanproduct/src/main/java/finpik/RecommendedLoanProduct.java +++ b/finpik-domain/loanproduct/src/main/java/finpik/RecommendedLoanProduct.java @@ -1,5 +1,6 @@ package finpik; +import finpik.entity.enums.LoanProductBadge; import finpik.util.Preconditions; import finpik.vo.InterestRate; import lombok.AccessLevel; @@ -7,6 +8,8 @@ import lombok.Getter; import lombok.NoArgsConstructor; +import java.util.ArrayList; +import java.util.List; import java.util.UUID; @Getter @@ -21,6 +24,7 @@ public class RecommendedLoanProduct { private InterestRate interestRate; private Long maxLoanLimitAmount; private Float similarity; + private List loanProductBadges; public static RecommendedLoanProduct of( Long profileId, @@ -33,6 +37,7 @@ public static RecommendedLoanProduct of( Float similarity ) { InterestRate interestRate = new InterestRate(maxInterestRate, minInterestRate); + List loanProductBadges = new ArrayList<>(); return new RecommendedLoanProduct( null, @@ -42,7 +47,8 @@ public static RecommendedLoanProduct of( Preconditions.require(productName, "productName must not be null"), interestRate, maxLoanLimitAmount, - Preconditions.require(similarity, "similarity must not be null") + Preconditions.require(similarity, "similarity must not be null"), + loanProductBadges ); } @@ -55,7 +61,8 @@ public static RecommendedLoanProduct rebuild( Float maxInterestRate, Float minInterestRate, Long maxLoanLimitAmount, - Float similarity + Float similarity, + List loanProductBadges ) { InterestRate interestRate = new InterestRate(maxInterestRate, minInterestRate); @@ -67,7 +74,8 @@ public static RecommendedLoanProduct rebuild( Preconditions.require(productName, "productName must not be null"), interestRate, maxLoanLimitAmount, - Preconditions.require(similarity, "similarity must not be null") + Preconditions.require(similarity, "similarity must not be null"), + loanProductBadges ); } diff --git a/finpik-domain/profile/src/main/java/finpik/entity/Profile.java b/finpik-domain/profile/src/main/java/finpik/entity/Profile.java index 4f5c378..f429c21 100644 --- a/finpik-domain/profile/src/main/java/finpik/entity/Profile.java +++ b/finpik-domain/profile/src/main/java/finpik/entity/Profile.java @@ -33,6 +33,8 @@ public class Profile { private ProfileColor profileColor; private OccupationDetail occupationDetail; private User user; + private Integer recommendedLoanProductCount; + private Float minInterestRate; private LocalDateTime createdAt; private LocalDateTime updatedAt; @@ -70,6 +72,8 @@ private static Profile create( require(spec.profileColor(), "profileColor must not be null."), occupationDetail, require(spec.user(), "user must not be null."), + spec.recommendedLoanProductCount(), + spec.minInterestRate(), spec.createdAt() == null ? createdAt : spec.createdAt(), spec.updatedAt() ); diff --git a/finpik-domain/profile/src/main/java/finpik/entity/policy/ProfileCreationSpec.java b/finpik-domain/profile/src/main/java/finpik/entity/policy/ProfileCreationSpec.java index c42dd98..4550112 100644 --- a/finpik-domain/profile/src/main/java/finpik/entity/policy/ProfileCreationSpec.java +++ b/finpik-domain/profile/src/main/java/finpik/entity/policy/ProfileCreationSpec.java @@ -31,6 +31,8 @@ public record ProfileCreationSpec( BusinessType businessType, EmploymentForm employmentForm, User user, + Integer recommendedLoanProductCount, + Float minInterestRate, LocalDateTime createdAt, LocalDateTime updatedAt ) { @@ -43,6 +45,9 @@ public static ProfileCreationSpec createNew( LocalDate employmentDate, Occupation occupation, EmploymentForm employmentForm, User user, BusinessType businessType ) { + Integer newRecommendedLoanProductCount = 0; + Float newMinInterestRate = 0.0f; + return new ProfileCreationSpec( null, desiredLoanAmount, loanProductUsageCount, totalLoanUsageAmount, creditScore, @@ -50,7 +55,8 @@ public static ProfileCreationSpec createNew( loanProductUsageStatus, purposeOfLoan, profileColor, annualIncome, businessStartDate, employmentDate, occupation, businessType, - employmentForm, user, null, null + employmentForm, user, newRecommendedLoanProductCount, + newMinInterestRate, null, null ); } @@ -61,8 +67,8 @@ public static ProfileCreationSpec rebuild( LoanProductUsageStatus loanProductUsageStatus, PurposeOfLoan purposeOfLoan, ProfileColor profileColor, Integer annualIncome, LocalDate businessStartDate, LocalDate employmentDate, Occupation occupation, BusinessType businessType, - EmploymentForm employmentForm, User user, - LocalDateTime createdAt, LocalDateTime updatedAt + EmploymentForm employmentForm, User user, Integer recommendedLoanProductCount, + Float minInterestRate, LocalDateTime createdAt, LocalDateTime updatedAt ) { return new ProfileCreationSpec( id, desiredLoanAmount, loanProductUsageCount, @@ -71,7 +77,8 @@ public static ProfileCreationSpec rebuild( loanProductUsageStatus, purposeOfLoan, profileColor, annualIncome, businessStartDate, employmentDate, occupation, businessType, - employmentForm, user, createdAt, updatedAt + employmentForm, user, recommendedLoanProductCount, + minInterestRate, createdAt, updatedAt ); } } diff --git a/finpik-domain/profile/src/test/java/entity/ProfileListTest.java b/finpik-domain/profile/src/test/java/entity/ProfileListTest.java index 860e82e..43f3615 100644 --- a/finpik-domain/profile/src/test/java/entity/ProfileListTest.java +++ b/finpik-domain/profile/src/test/java/entity/ProfileListTest.java @@ -109,6 +109,8 @@ private Profile getDefaultProfile(Long profileId) { null, null, user, + 0, + 0.0f, LocalDateTime.now(), LocalDateTime.now() ); diff --git a/finpik-domain/profile/src/test/java/entity/ProfileTest.java b/finpik-domain/profile/src/test/java/entity/ProfileTest.java index 91ba0bd..205ab1e 100644 --- a/finpik-domain/profile/src/test/java/entity/ProfileTest.java +++ b/finpik-domain/profile/src/test/java/entity/ProfileTest.java @@ -104,6 +104,8 @@ void validateCredits() { null, EmploymentForm.CONTRACT, null, + 0, + 0.0f, LocalDateTime.now(), LocalDateTime.now() ); @@ -142,6 +144,8 @@ void determineCreditGradeStatusByScore() { null, EmploymentForm.CONTRACT, user, + 0, + 0.0f, LocalDateTime.now(), LocalDateTime.now() ); @@ -192,6 +196,8 @@ private Profile getDefaultProfile(User user) { null, null, user, + 0, + 0.0f, LocalDateTime.now(), LocalDateTime.now() ); diff --git a/finpik-domain/profile/src/test/java/entity/policy/ProfileCreationSpecTest.java b/finpik-domain/profile/src/test/java/entity/policy/ProfileCreationSpecTest.java index 6095c42..293dff8 100644 --- a/finpik-domain/profile/src/test/java/entity/policy/ProfileCreationSpecTest.java +++ b/finpik-domain/profile/src/test/java/entity/policy/ProfileCreationSpecTest.java @@ -1,21 +1,14 @@ package entity.policy; import finpik.entity.User; -import finpik.entity.enums.BusinessType; -import finpik.entity.enums.CreditGradeStatus; -import finpik.entity.enums.EmploymentForm; -import finpik.entity.enums.Gender; -import finpik.entity.enums.LoanProductUsageStatus; -import finpik.entity.enums.Occupation; -import finpik.entity.enums.ProfileColor; -import finpik.entity.enums.PurposeOfLoan; -import finpik.entity.enums.RegistrationType; +import finpik.entity.enums.*; import finpik.entity.policy.ProfileCreationSpec; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; @@ -43,6 +36,8 @@ void createTest() { Occupation occupation = Occupation.EMPLOYEE; EmploymentForm employmentForm = EmploymentForm.FULL_TIME; User user = new User(1L, "username", "user@example.com", Gender.MALE, RegistrationType.KAKAO, LocalDateTime.now(), LocalDate.of(1995, 1, 1)); + Float minInterestRate = 0.0f; + Integer recommendedLoanProductCount = 0; LocalDateTime createdAt = LocalDateTime.now(); LocalDateTime updatedAt = LocalDateTime.now(); BusinessType businessType = null; @@ -52,7 +47,8 @@ void createTest() { id, desiredLoanAmount, loanProductUsageCount, totalLoanUsageAmount, creditScore, profileName, seq, creditGradeStatus, loanProductUsageStatus, purposeOfLoan, profileColor, annualIncome, businessStartDate, employmentDate, - occupation, businessType, employmentForm, user, createdAt, updatedAt + occupation, businessType, employmentForm, user, + recommendedLoanProductCount, minInterestRate, createdAt, updatedAt ); //then diff --git a/finpik-infra/mysql/src/main/java/finpik/entity/profile/ProfileEntity.java b/finpik-infra/mysql/src/main/java/finpik/entity/profile/ProfileEntity.java index 9e278f6..f129ab9 100644 --- a/finpik-infra/mysql/src/main/java/finpik/entity/profile/ProfileEntity.java +++ b/finpik-infra/mysql/src/main/java/finpik/entity/profile/ProfileEntity.java @@ -85,6 +85,9 @@ public class ProfileEntity { @JoinColumn(name = "user_id") private UserEntity user; + private Integer recommendedLoanProductCount; + private Float minInterestRate; + @Column(updatable = false) private LocalDateTime createdAt; private LocalDateTime updatedAt; @@ -100,7 +103,8 @@ public static ProfileEntity from(Profile profile, UserEntity userEntity) { profile.getLoanProductUsageStatus(), profile.getPurposeOfLoan(), mapper.occupation(), profile.getProfileColor(), mapper.employmentDate(), mapper.businessStartDate(), mapper.businessType(), - userEntity, profile.getCreatedAt(), profile.getUpdatedAt() + userEntity, profile.getRecommendedLoanProductCount(), profile.getMinInterestRate(), + profile.getCreatedAt(), profile.getUpdatedAt() ); } @@ -110,7 +114,8 @@ public Profile toDomain() { creditScore, profileName, seq, creditGradeStatus, loanProductUsageStatus, purposeOfLoan, profileColor, annualIncome, businessStartDate, employmentDate, occupation, businessType, employmentForm, - user.toDomain(), createdAt, updatedAt + user.toDomain(), recommendedLoanProductCount, + minInterestRate, createdAt, updatedAt ); return Profile.withId(spec); @@ -140,4 +145,8 @@ public void updateAllFields(Profile profile) { public void updateSeq(Integer seq) { this.seq = seq; } + + public void updateRecommendedLoanProductCount(Integer recommendedLoanProductCount) { + this.recommendedLoanProductCount = recommendedLoanProductCount; + } } diff --git a/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/impl/CustomRecommendedLoanProductJpaRepositoryImpl.java b/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/impl/CustomRecommendedLoanProductJpaRepositoryImpl.java index 5a67c4f..b042464 100644 --- a/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/impl/CustomRecommendedLoanProductJpaRepositoryImpl.java +++ b/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/impl/CustomRecommendedLoanProductJpaRepositoryImpl.java @@ -36,7 +36,8 @@ public Slice findAllByProfileId(Long productId loanProductEntity.maxInterestRate, loanProductEntity.minInterestRate, loanProductEntity.maxLoanLimitAmount, - recommendedLoanProductEntity.similarity + recommendedLoanProductEntity.similarity, + recommendedLoanProductEntity.loanProductBadgeList )) .from(recommendedLoanProductEntity) .where(recommendedLoanProductEntity.profileId.eq(productId)) diff --git a/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/projection/RecommendedLoanProductProjection.java b/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/projection/RecommendedLoanProductProjection.java index 1d304b7..e595039 100644 --- a/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/projection/RecommendedLoanProductProjection.java +++ b/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/projection/RecommendedLoanProductProjection.java @@ -1,5 +1,8 @@ package finpik.jpa.repository.loanproduct.projection; +import finpik.entity.enums.LoanProductBadge; + +import java.util.List; import java.util.UUID; public record RecommendedLoanProductProjection( @@ -11,6 +14,7 @@ public record RecommendedLoanProductProjection( Float minInterestRate, Float maxInterestRate, Long maxLoanLimitAmount, - Float similarity + Float similarity, + List loanProductBadges ) { } diff --git a/finpik-infra/mysql/src/main/java/finpik/repository/loanproduct/impl/LoanProductRepositoryImpl.java b/finpik-infra/mysql/src/main/java/finpik/repository/loanproduct/impl/LoanProductRepositoryImpl.java index 953f5de..2f81413 100644 --- a/finpik-infra/mysql/src/main/java/finpik/repository/loanproduct/impl/LoanProductRepositoryImpl.java +++ b/finpik-infra/mysql/src/main/java/finpik/repository/loanproduct/impl/LoanProductRepositoryImpl.java @@ -132,7 +132,8 @@ private List toDomainFrom( p.getInterestRate().maxInterestRate(), p.getInterestRate().minInterestRate(), p.getMaxLoanLimitAmount(), - p.getSimilarity() + p.getSimilarity(), + p.getLoanProductBadges() )) .toList(); } @@ -155,7 +156,8 @@ public Slice findAllRecommendedLoanProductSliceByProfile product.maxInterestRate(), product.minInterestRate(), product.maxLoanLimitAmount(), - product.similarity() + product.similarity(), + product.loanProductBadges() ) ) .toList(); diff --git a/finpik-infra/mysql/src/main/java/finpik/repository/profile/ProfileRepository.java b/finpik-infra/mysql/src/main/java/finpik/repository/profile/ProfileRepository.java index 35117c7..78c23c2 100644 --- a/finpik-infra/mysql/src/main/java/finpik/repository/profile/ProfileRepository.java +++ b/finpik-infra/mysql/src/main/java/finpik/repository/profile/ProfileRepository.java @@ -25,4 +25,10 @@ public interface ProfileRepository { void deleteById(Long id); void deleteAllById(List idList); + + void updateProfileAfterRecommend( + Long profileId, + Integer recommendedLoanProductCount, + Float minInterestRate + ); } diff --git a/finpik-infra/mysql/src/main/java/finpik/repository/profile/impl/ProfileRepositoryImpl.java b/finpik-infra/mysql/src/main/java/finpik/repository/profile/impl/ProfileRepositoryImpl.java index 011c8a6..924d9bd 100644 --- a/finpik-infra/mysql/src/main/java/finpik/repository/profile/impl/ProfileRepositoryImpl.java +++ b/finpik-infra/mysql/src/main/java/finpik/repository/profile/impl/ProfileRepositoryImpl.java @@ -135,4 +135,16 @@ public void deleteById(Long id) { public void deleteAllById(List idList) { profileEntityJpaRepository.deleteAllById(idList); } + + @Override + public void updateProfileAfterRecommend( + Long profileId, + Integer recommendedLoanProductCount, + Float minInterestRate + ) { + ProfileEntity profileEntity = profileEntityJpaRepository.findById(profileId) + .orElseThrow(() -> new BusinessException(ErrorCode.NOT_FOUND_PROFILE)); + + profileEntity.updateRecommendedLoanProductCount(recommendedLoanProductCount); + } } diff --git a/finpik-infra/mysql/src/test/java/entity/profile/ProfileEntityTest.java b/finpik-infra/mysql/src/test/java/entity/profile/ProfileEntityTest.java index e38325a..9e6043b 100644 --- a/finpik-infra/mysql/src/test/java/entity/profile/ProfileEntityTest.java +++ b/finpik-infra/mysql/src/test/java/entity/profile/ProfileEntityTest.java @@ -77,6 +77,8 @@ private Profile getDefaultProfile() { null, null, user, + 0, + 0.0, LocalDateTime.now(), LocalDateTime.now() ); diff --git a/finpik-infra/redis/src/main/java/finpik/service/loanproduct/dto/CachedRecommendedLoanProduct.java b/finpik-infra/redis/src/main/java/finpik/service/loanproduct/dto/CachedRecommendedLoanProduct.java index fc918e6..f6ae419 100644 --- a/finpik-infra/redis/src/main/java/finpik/service/loanproduct/dto/CachedRecommendedLoanProduct.java +++ b/finpik-infra/redis/src/main/java/finpik/service/loanproduct/dto/CachedRecommendedLoanProduct.java @@ -1,8 +1,10 @@ package finpik.service.loanproduct.dto; import finpik.RecommendedLoanProduct; +import finpik.entity.enums.LoanProductBadge; import lombok.Builder; +import java.util.List; import java.util.UUID; @Builder @@ -15,7 +17,8 @@ public record CachedRecommendedLoanProduct( Float minInterestRate, Float maxInterestRate, Long maxLoanLimitAmount, - Float similarity + Float similarity, + List loanProductBadges ) { public RecommendedLoanProduct toDomain() { @@ -28,7 +31,8 @@ public RecommendedLoanProduct toDomain() { maxInterestRate, minInterestRate, maxLoanLimitAmount, - similarity + similarity, + loanProductBadges ); } @@ -43,6 +47,7 @@ public static CachedRecommendedLoanProduct from(RecommendedLoanProduct recommend .maxInterestRate(recommendedLoanProduct.getInterestRate().maxInterestRate()) .maxLoanLimitAmount(recommendedLoanProduct.getMaxLoanLimitAmount()) .similarity(recommendedLoanProduct.getSimilarity()) + .loanProductBadges(recommendedLoanProduct.getLoanProductBadges()) .build(); } }