From 2906ce2ab369559ee576d65b2b7b3500a6386f95 Mon Sep 17 00:00:00 2001 From: Amir Rajabi Date: Sat, 2 Aug 2025 15:35:47 +0330 Subject: [PATCH] hot fix --- .../co/nilin/opex/profile/app/service/ProfileManagement.kt | 4 ++-- .../profile/core/data/profile/CompleteProfileRequest.kt | 2 +- .../profile/core/data/profile/CompleteProfileResponse.kt | 6 +++--- .../co/nilin/opex/profile/core/data/profile/Profile.kt | 2 +- .../co/nilin/opex/profile/ports/auth/impl/AuthProxyImpl.kt | 6 +++--- .../opex/profile/ports/postgres/imp/ProfileManagementImp.kt | 2 +- .../nilin/opex/profile/ports/postgres/model/base/Profile.kt | 3 ++- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/profile/profile-app/src/main/kotlin/co/nilin/opex/profile/app/service/ProfileManagement.kt b/profile/profile-app/src/main/kotlin/co/nilin/opex/profile/app/service/ProfileManagement.kt index 2a6ae4383..ddd05ef44 100644 --- a/profile/profile-app/src/main/kotlin/co/nilin/opex/profile/app/service/ProfileManagement.kt +++ b/profile/profile-app/src/main/kotlin/co/nilin/opex/profile/app/service/ProfileManagement.kt @@ -156,7 +156,7 @@ class ProfileManagement( ) ) if (verifyResponse.result) { - authProxy.updateEmail(userId, email) //TODO rollback in error ? + authProxy.updateEmail(userId, email) profilePersister.updateEmail(userId, email) } else throw OpexError.InvalidOTP.exception() } @@ -173,7 +173,7 @@ class ProfileManagement( throw OpexError.ProfileAlreadyCompleted.exception() } - val isIranian = request.nationality == NationalityType.IRANIAN.name + val isIranian = request.nationality == NationalityType.IRANIAN var useMobileIdentity = false var usePersonalIdentity = false diff --git a/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/CompleteProfileRequest.kt b/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/CompleteProfileRequest.kt index c1c8ec304..111f615e6 100644 --- a/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/CompleteProfileRequest.kt +++ b/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/CompleteProfileRequest.kt @@ -8,7 +8,7 @@ data class CompleteProfileRequest( var address: String? = null, var telephone: String? = null, var postalCode: String? = null, - var nationality: String, + var nationality: NationalityType, var identifier: String, var gender: Gender, var birthDate: LocalDateTime, diff --git a/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/CompleteProfileResponse.kt b/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/CompleteProfileResponse.kt index fe86ecfd2..ea0f43089 100644 --- a/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/CompleteProfileResponse.kt +++ b/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/CompleteProfileResponse.kt @@ -13,12 +13,12 @@ open class CompleteProfileResponse( var mobile: String? = null, var telephone: String? = null, var postalCode: String? = null, - var nationality: String? = null, + var nationality: NationalityType? = null, var identifier: String? = null, var gender: Gender? = null, var birthDate: LocalDateTime? = null, var status: UserStatus? = null, var kycLevel: KycLevel? = null, - var mobileIdentityMatch : Boolean? = false, - var personalIdentityMatch : Boolean? = false + var mobileIdentityMatch: Boolean? = false, + var personalIdentityMatch: Boolean? = false ) diff --git a/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/Profile.kt b/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/Profile.kt index 2ed002b01..d37eae120 100644 --- a/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/Profile.kt +++ b/profile/profile-core/src/main/kotlin/co/nilin/opex/profile/core/data/profile/Profile.kt @@ -15,7 +15,7 @@ data class Profile( var mobile: String? = null, var telephone: String? = null, var postalCode: String? = null, - var nationality: String? = null, + var nationality: NationalityType? = null, var identifier: String? = null, var gender: Gender? = null, var birthDate: LocalDateTime? = null, diff --git a/profile/profile-ports/profile-auth-proxy/src/main/kotlin/co/nilin/opex/profile/ports/auth/impl/AuthProxyImpl.kt b/profile/profile-ports/profile-auth-proxy/src/main/kotlin/co/nilin/opex/profile/ports/auth/impl/AuthProxyImpl.kt index 6fc55c460..094bbef80 100644 --- a/profile/profile-ports/profile-auth-proxy/src/main/kotlin/co/nilin/opex/profile/ports/auth/impl/AuthProxyImpl.kt +++ b/profile/profile-ports/profile-auth-proxy/src/main/kotlin/co/nilin/opex/profile/ports/auth/impl/AuthProxyImpl.kt @@ -14,7 +14,7 @@ class AuthProxyImpl(private val webClient: WebClient) : AuthProxy { private lateinit var baseUrl: String override suspend fun updateEmail(userId: String, email: String) { - webClient.put().uri("$baseUrl/v1/user/email") + webClient.put().uri("$baseUrl/v1/user/update/email") .contentType(MediaType.APPLICATION_JSON) .bodyValue(mapOf("userId" to userId, "email" to email)) .retrieve() @@ -22,7 +22,7 @@ class AuthProxyImpl(private val webClient: WebClient) : AuthProxy { } override suspend fun updateMobile(userId: String, mobile: String) { - webClient.put().uri("$baseUrl/v1/user/mobile") + webClient.put().uri("$baseUrl/v1/user/update/mobile") .contentType(MediaType.APPLICATION_JSON) .bodyValue(mapOf("userId" to userId, "mobile" to mobile)) .retrieve() @@ -30,7 +30,7 @@ class AuthProxyImpl(private val webClient: WebClient) : AuthProxy { } override suspend fun updateName(userId: String, firstName: String, lastName: String) { - webClient.put().uri("$baseUrl/v1/user/name") + webClient.put().uri("$baseUrl/v1/user/update/name") .contentType(MediaType.APPLICATION_JSON) .bodyValue(mapOf("userId" to userId, "firstName" to firstName, "lastName" to lastName)) .retrieve() diff --git a/profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/imp/ProfileManagementImp.kt b/profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/imp/ProfileManagementImp.kt index d53205490..ddcca340b 100644 --- a/profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/imp/ProfileManagementImp.kt +++ b/profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/imp/ProfileManagementImp.kt @@ -100,7 +100,7 @@ class ProfileManagementImp( return profileRepository.save(newProfileModel) .map { saved -> val response = convertProfileModelToCompleteProfileResponse(saved) - if (saved.nationality == NationalityType.IRANIAN.name) { + if (saved.nationality == NationalityType.IRANIAN) { response.kycLevel = KycLevel.Level2 } response diff --git a/profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/model/base/Profile.kt b/profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/model/base/Profile.kt index 641e3aa92..9d898d8a4 100644 --- a/profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/model/base/Profile.kt +++ b/profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/model/base/Profile.kt @@ -2,6 +2,7 @@ package co.nilin.opex.profile.ports.postgres.model.base import co.nilin.opex.profile.core.data.profile.Gender import co.nilin.opex.profile.core.data.kyc.KycLevel +import co.nilin.opex.profile.core.data.profile.NationalityType import co.nilin.opex.profile.core.data.profile.UserStatus import java.time.LocalDateTime @@ -14,7 +15,7 @@ open class Profile { var mobile: String? = null var telephone: String? = null var postalCode: String? = null - var nationality: String? = null + var nationality: NationalityType? = null var identifier: String? = null var gender: Gender? = null lateinit var birthDate: LocalDateTime