Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ 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()
.awaitBodilessEntity()
}

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()
.awaitBodilessEntity()
}

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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Loading