diff --git a/accountant/accountant-app/src/main/resources/application.yml b/accountant/accountant-app/src/main/resources/application.yml index a2b0499a6..48b7e0347 100644 --- a/accountant/accountant-app/src/main/resources/application.yml +++ b/accountant/accountant-app/src/main/resources/application.yml @@ -112,3 +112,5 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} \ No newline at end of file diff --git a/api/api-app/src/main/resources/application.yml b/api/api-app/src/main/resources/application.yml index 1e6b9190e..157d4c5ba 100644 --- a/api/api-app/src/main/resources/application.yml +++ b/api/api-app/src/main/resources/application.yml @@ -144,6 +144,8 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} api: crypto: key: ${api_crypto_key:0e1fd29572ec8c85970d76e3433e96ee} diff --git a/auth-gateway/auth-gateway-app/src/main/resources/application.yml b/auth-gateway/auth-gateway-app/src/main/resources/application.yml index 3948349e6..31b1ae63b 100644 --- a/auth-gateway/auth-gateway-app/src/main/resources/application.yml +++ b/auth-gateway/auth-gateway-app/src/main/resources/application.yml @@ -77,4 +77,6 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} pre-auth-client-secret: ${PRE_AUTH_CLIENT_SECRET} diff --git a/bc-gateway/bc-gateway-app/src/main/resources/application-otc.yml b/bc-gateway/bc-gateway-app/src/main/resources/application-otc.yml index a0d9063bc..cfada5e5f 100644 --- a/bc-gateway/bc-gateway-app/src/main/resources/application-otc.yml +++ b/bc-gateway/bc-gateway-app/src/main/resources/application-otc.yml @@ -93,3 +93,5 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} \ No newline at end of file diff --git a/bc-gateway/bc-gateway-app/src/main/resources/application.yml b/bc-gateway/bc-gateway-app/src/main/resources/application.yml index a8eb6cc2f..1071efc90 100644 --- a/bc-gateway/bc-gateway-app/src/main/resources/application.yml +++ b/bc-gateway/bc-gateway-app/src/main/resources/application.yml @@ -126,6 +126,8 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} swagger: authUrl: ${SWAGGER_AUTH_URL:https://api.opex.dev/auth}/realms/opex/protocol/openid-connect/token} diff --git a/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/bcgateway/ports/postgres/impl/CurrencyHandlerImplV2.kt b/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/bcgateway/ports/postgres/impl/CurrencyHandlerImplV2.kt index 489846882..74c781798 100644 --- a/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/bcgateway/ports/postgres/impl/CurrencyHandlerImplV2.kt +++ b/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/bcgateway/ports/postgres/impl/CurrencyHandlerImplV2.kt @@ -121,7 +121,7 @@ class CurrencyHandlerImplV2( return@executeAndAwait null } - if (!request.depositDescription.isNullOrEmpty() && !request.withdrawDescription.isNullOrEmpty()) { + if (!request.depositDescription.isNullOrEmpty() || !request.withdrawDescription.isNullOrEmpty()) { currencyOnChainGatewayLocalizationRepository.save( CurrencyOnChainGatewayLocalizationModel( gatewayId = gateway.id!!, diff --git a/common/src/main/kotlin/co/nilin/opex/common/proxy/CustomMessageClient.kt b/common/src/main/kotlin/co/nilin/opex/common/proxy/CustomMessageClient.kt index 089d6291d..178c1da8b 100644 --- a/common/src/main/kotlin/co/nilin/opex/common/proxy/CustomMessageClient.kt +++ b/common/src/main/kotlin/co/nilin/opex/common/proxy/CustomMessageClient.kt @@ -2,18 +2,18 @@ package co.nilin.opex.common.proxy import co.nilin.opex.common.config.CommonWebClient import co.nilin.opex.common.data.MessageTranslation +import co.nilin.opex.common.utils.typeRef import kotlinx.coroutines.reactive.awaitFirst import org.springframework.beans.factory.annotation.Qualifier import org.springframework.beans.factory.annotation.Value import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty -import org.springframework.core.ParameterizedTypeReference import org.springframework.stereotype.Component @Component @ConditionalOnProperty(name = ["app.custom-message.enabled"], havingValue = "true", matchIfMissing = false) class CustomMessageClient( - @Qualifier("CommonWebClient") private val webClient: CommonWebClient + @Qualifier("CommonWebClient") private val webClient: CommonWebClient ) { @Value("\${app.custom-message.base-url}") private lateinit var customMessageBaseUrl: String @@ -22,9 +22,9 @@ class CustomMessageClient( it.queryParam("last-update", lastUpdate) it.build() }.retrieve() - .onStatus({ t -> t.isError }, { it.createException() }) - .bodyToMono(typeRef>()) - .log() - .awaitFirst() + .onStatus({ t -> t.isError }, { it.createException() }) + .bodyToMono(typeRef>()) + .log() + .awaitFirst() } } diff --git a/common/src/main/kotlin/co/nilin/opex/common/proxy/ConfigClient.kt b/common/src/main/kotlin/co/nilin/opex/common/proxy/CustomUserLanguageClient.kt similarity index 72% rename from common/src/main/kotlin/co/nilin/opex/common/proxy/ConfigClient.kt rename to common/src/main/kotlin/co/nilin/opex/common/proxy/CustomUserLanguageClient.kt index 6a28796e5..4aec686f2 100644 --- a/common/src/main/kotlin/co/nilin/opex/common/proxy/ConfigClient.kt +++ b/common/src/main/kotlin/co/nilin/opex/common/proxy/CustomUserLanguageClient.kt @@ -2,15 +2,16 @@ package co.nilin.opex.common.proxy import co.nilin.opex.common.config.CommonWebClient import co.nilin.opex.common.data.WebConfig +import co.nilin.opex.common.utils.typeRef import kotlinx.coroutines.reactive.awaitFirst import org.springframework.beans.factory.annotation.Qualifier -import org.springframework.core.ParameterizedTypeReference +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.stereotype.Component -inline fun typeRef(): ParameterizedTypeReference = object : ParameterizedTypeReference() {} @Component -class ConfigClient( +@ConditionalOnProperty(name = ["app.custom-user-language.enabled"], havingValue = "true", matchIfMissing = false) +class CustomUserLanguageClient( @Qualifier("CommonWebClient") private val webClient: CommonWebClient ) { diff --git a/common/src/main/kotlin/co/nilin/opex/common/service/WebConfigCacheService.kt b/common/src/main/kotlin/co/nilin/opex/common/service/WebConfigCacheService.kt index 89a7e8ee8..b27a9f1f8 100644 --- a/common/src/main/kotlin/co/nilin/opex/common/service/WebConfigCacheService.kt +++ b/common/src/main/kotlin/co/nilin/opex/common/service/WebConfigCacheService.kt @@ -1,8 +1,9 @@ package co.nilin.opex.common.service import co.nilin.opex.common.data.WebConfig -import co.nilin.opex.common.proxy.ConfigClient +import co.nilin.opex.common.proxy.CustomUserLanguageClient import kotlinx.coroutines.runBlocking +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.scheduling.annotation.Scheduled import org.springframework.stereotype.Service @@ -11,9 +12,10 @@ object GlobalWebConfigCache { var webConfig: WebConfig? = null } +@ConditionalOnProperty(name = ["app.custom-user-language.enabled"], havingValue = "true", matchIfMissing = false) @Service class WebConfigService( - private val configClient: ConfigClient, + private val configClient: CustomUserLanguageClient, ) { @Scheduled(fixedDelay = 5 * 60 * 1000) diff --git a/common/src/main/kotlin/co/nilin/opex/common/utils/ProxyUtils.kt b/common/src/main/kotlin/co/nilin/opex/common/utils/ProxyUtils.kt new file mode 100644 index 000000000..d8460685a --- /dev/null +++ b/common/src/main/kotlin/co/nilin/opex/common/utils/ProxyUtils.kt @@ -0,0 +1,5 @@ +package co.nilin.opex.common.utils + +import org.springframework.core.ParameterizedTypeReference + +inline fun typeRef(): ParameterizedTypeReference = object : ParameterizedTypeReference() {} diff --git a/device-management/device-management-app/src/main/resources/application.yml b/device-management/device-management-app/src/main/resources/application.yml index 762d30f75..922caeb87 100644 --- a/device-management/device-management-app/src/main/resources/application.yml +++ b/device-management/device-management-app/src/main/resources/application.yml @@ -108,4 +108,9 @@ app: url: lb://opex-auth cert-url: http://keycloak:8080/realms/opex/protocol/openid-connect/certs client-id: none - client-secret: none \ No newline at end of file + client-secret: none + custom-message: + enabled: ${CUSTOM_MESSAGE_ENABLED:false} + base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} \ No newline at end of file diff --git a/docker-compose-otc.yml b/docker-compose-otc.yml index 296198477..3bf37981c 100644 --- a/docker-compose-otc.yml +++ b/docker-compose-otc.yml @@ -38,6 +38,7 @@ services: - AUTH_JWK_ENDPOINT=${JWK_ENDPOINT} - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} extra_hosts: - "host.docker.internal:host-gateway" depends_on: @@ -99,6 +100,7 @@ services: - OMNI_URL=${OMNI_URL} - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} extra_hosts: - "host.docker.internal:host-gateway" depends_on: diff --git a/docker-compose.yml b/docker-compose.yml index b9078536e..b5b7c0f25 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -266,6 +266,9 @@ services: - SWAGGER_AUTH_URL=$KEYCLOAK_FRONTEND_URL - TRADE_VOLUME_CALCULATION_CURRENCY=${TRADE_VOLUME_CALCULATION_CURRENCY} - WITHDRAW_VOLUME_CALCULATION_CURRENCY=${WITHDRAW_VOLUME_CALCULATION_CURRENCY} + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} networks: - default depends_on: @@ -310,6 +313,9 @@ services: - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 - REDIS_HOST=redis - SYMBOLS=BTC_USDT,ETH_USDT,BTC_IRT,ETH_IRT,USDT_IRT,ETH_BUSD,BTC_BUSD,BNB_BUSD + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} networks: - default depends_on: @@ -329,6 +335,9 @@ services: - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 - REDIS_HOST=redis-duo - SYMBOLS=SOL_USDT,DOGE_USDT,TON_USDT + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} networks: - default depends_on: @@ -352,6 +361,9 @@ services: - VAULT_HOST=vault - SYMBOLS=BTC_USDT,ETH_USDT,BTC_IRT,ETH_IRT,USDT_IRT,ETH_BUSD,BTC_BUSD,BNB_BUSD - TOKEN_ISSUER_URL=${KC_ISSUER_URL} + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} networks: - default depends_on: @@ -407,6 +419,9 @@ services: - PRE_AUTH_CLIENT_SECRET=${KC_PRE_AUTH_CLIENT_SECRET} - TOKEN_ISSUER_URL=${KC_ISSUER_URL} - CAPTCHA_ENABLED=${CAPTCHA_ENABLED} + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} volumes: - auth-gateway-keys:/app/keys depends_on: @@ -438,6 +453,9 @@ services: - WITHDRAW_BANK_ACCOUNT_VALIDATION=${WITHDRAW_BANK_ACCOUNT_VALIDATION} - TOTAL_ASSET_CALCULATION_CURRENCY=${TOTAL_ASSET_CALCULATION_CURRENCY} - TOKEN_ISSUER_URL=${KC_ISSUER_URL} + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} depends_on: - kafka-1 - kafka-2 @@ -463,6 +481,9 @@ services: - VAULT_HOST=vault - SWAGGER_AUTH_URL=$KEYCLOAK_FRONTEND_URL - TOKEN_ISSUER_URL=${KC_ISSUER_URL} + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} depends_on: - kafka-1 - kafka-2 @@ -493,6 +514,9 @@ services: - TOTAL_ASSET_CALCULATION_CURRENCY=${TOTAL_ASSET_CALCULATION_CURRENCY} - TOKEN_ISSUER_URL=${KC_ISSUER_URL} - APP_BASE_URL=${APP_BASE_URL} + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} depends_on: - consul - vault @@ -516,6 +540,9 @@ services: - SWAGGER_AUTH_URL=$KEYCLOAK_FRONTEND_URL - ADDRESS_EXP_TIME=100 - TOKEN_ISSUER_URL=${KC_ISSUER_URL} + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} depends_on: - kafka-1 - kafka-2 @@ -551,6 +578,9 @@ services: - SMTP_PROXY_ENABLED=${SMTP_PROXY_ENABLED} - TOKEN_ISSUER_URL=${KC_ISSUER_URL} - OTP_CODE_RESPONSE_ENABLED=${OTP_CODE_RESPONSE_ENABLED} + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} depends_on: - consul - postgres-otp @@ -579,6 +609,9 @@ services: - TOKEN_ISSUER_URL=${KC_ISSUER_URL} - MOBILE_IDENTITY_INQUIRY=${MOBILE_IDENTITY_INQUIRY} - PERSONAL_IDENTITY_INQUIRY=${PERSONAL_IDENTITY_INQUIRY} + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} depends_on: - kafka-1 - kafka-2 @@ -603,6 +636,9 @@ services: - BACKEND_USER=${BACKEND_USER} - VAULT_HOST=vault - SWAGGER_AUTH_URL=$KEYCLOAK_FRONTEND_URL + - CUSTOM_MESSAGE_URL=${CUSTOM_MESSAGE_URL} + - CUSTOM_MESSAGE_ENABLED=${CUSTOM_MESSAGE_ENABLED} + - CUSTOM_USER_LANGUAGE_ENABLED=${CUSTOM_USER_LANGUAGE_ENABLED} depends_on: - kafka-1 - kafka-2 diff --git a/market/market-app/src/main/resources/application.yml b/market/market-app/src/main/resources/application.yml index 42f5d3622..1a8bda75e 100644 --- a/market/market-app/src/main/resources/application.yml +++ b/market/market-app/src/main/resources/application.yml @@ -96,5 +96,7 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} swagger: authUrl: ${SWAGGER_AUTH_URL:https://api.opex.dev/auth}/realms/opex/protocol/openid-connect/token} diff --git a/matching-engine/matching-engine-app/src/main/resources/application.yml b/matching-engine/matching-engine-app/src/main/resources/application.yml index 45eced541..2e1778e5c 100644 --- a/matching-engine/matching-engine-app/src/main/resources/application.yml +++ b/matching-engine/matching-engine-app/src/main/resources/application.yml @@ -29,3 +29,5 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} diff --git a/matching-gateway/matching-gateway-app/src/main/resources/application.yml b/matching-gateway/matching-gateway-app/src/main/resources/application.yml index 0e75bcc66..694ddba54 100644 --- a/matching-gateway/matching-gateway-app/src/main/resources/application.yml +++ b/matching-gateway/matching-gateway-app/src/main/resources/application.yml @@ -97,6 +97,8 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} swagger: authUrl: ${SWAGGER_AUTH_URL:https://api.opex.dev/auth}/realms/opex/protocol/openid-connect/token} diff --git a/otp/otp-app/src/main/resources/application.yml b/otp/otp-app/src/main/resources/application.yml index b9109cfad..938ee736f 100644 --- a/otp/otp-app/src/main/resources/application.yml +++ b/otp/otp-app/src/main/resources/application.yml @@ -67,3 +67,5 @@ otp: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} \ No newline at end of file diff --git a/profile/profile-app/src/main/resources/application.yml b/profile/profile-app/src/main/resources/application.yml index f4b00c7ab..bdcdb5251 100644 --- a/profile/profile-app/src/main/resources/application.yml +++ b/profile/profile-app/src/main/resources/application.yml @@ -71,6 +71,8 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} management: endpoints: diff --git a/wallet/wallet-app/src/main/resources/application-otc.yml b/wallet/wallet-app/src/main/resources/application-otc.yml index ffd08c5c9..897c91f95 100644 --- a/wallet/wallet-app/src/main/resources/application-otc.yml +++ b/wallet/wallet-app/src/main/resources/application-otc.yml @@ -121,6 +121,8 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} logging: level: root: INFO diff --git a/wallet/wallet-app/src/main/resources/application.yml b/wallet/wallet-app/src/main/resources/application.yml index 8c4c6c27a..488d21278 100644 --- a/wallet/wallet-app/src/main/resources/application.yml +++ b/wallet/wallet-app/src/main/resources/application.yml @@ -165,6 +165,8 @@ app: custom-message: enabled: ${CUSTOM_MESSAGE_ENABLED:false} base-url: ${CUSTOM_MESSAGE_URL} + custom-user-language: + enabled: ${CUSTOM_USER_LANGUAGE_ENABLED:false} logging: level: root: INFO diff --git a/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/dao/OffChainGatewayRepository.kt b/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/dao/OffChainGatewayRepository.kt index b28413a4e..8df546227 100644 --- a/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/dao/OffChainGatewayRepository.kt +++ b/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/dao/OffChainGatewayRepository.kt @@ -31,12 +31,12 @@ interface OffChainGatewayRepository : ReactiveCrudRepository? diff --git a/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/impl/OffChainGatewayManagerImpl.kt b/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/impl/OffChainGatewayManagerImpl.kt index 76e78d67f..cede1053e 100644 --- a/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/impl/OffChainGatewayManagerImpl.kt +++ b/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/impl/OffChainGatewayManagerImpl.kt @@ -81,7 +81,7 @@ class OffChainGatewayManagerImpl( val gateway = offChainGatewayRepository.save(input.toModel()).awaitFirstOrNull() ?: throw OpexError.BadRequest.exception("Error in saving gateway") - if (!currencyGateway.depositDescription.isNullOrEmpty() && !currencyGateway.withdrawDescription.isNullOrEmpty()) { + if (!currencyGateway.depositDescription.isNullOrEmpty() || !currencyGateway.withdrawDescription.isNullOrEmpty()) { offChainGatewayLocalizationRepository.save( OffChainGatewayLocalizationModel( gatewayId = gateway.id!!,