From d812b1cc5f6bf2992c09abd564dea3c3e3368a5d Mon Sep 17 00:00:00 2001 From: fatemeh imanipour Date: Sat, 9 May 2026 16:17:00 +0330 Subject: [PATCH 1/2] Add interceptors dependency to all related modules --- accountant/accountant-app/pom.xml | 4 ++++ accountant/pom.xml | 5 +++++ auth-gateway/auth-gateway-app/pom.xml | 4 ++++ bc-gateway/bc-gateway-app/pom.xml | 8 ++++++++ device-management/device-management-app/pom.xml | 4 ++++ device-management/pom.xml | 5 +++++ docker-compose.yml | 4 ++-- matching-gateway/matching-gateway-app/pom.xml | 4 ++++ otp/otp-app/pom.xml | 4 ++++ profile/pom.xml | 5 +++++ profile/profile-app/pom.xml | 4 ++++ user-management/pom.xml | 5 +++++ 12 files changed, 54 insertions(+), 2 deletions(-) diff --git a/accountant/accountant-app/pom.xml b/accountant/accountant-app/pom.xml index 67649ff75..f56aee06a 100644 --- a/accountant/accountant-app/pom.xml +++ b/accountant/accountant-app/pom.xml @@ -51,6 +51,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + org.springframework.cloud spring-cloud-starter-vault-config diff --git a/accountant/pom.xml b/accountant/pom.xml index 6eded39f6..edce57a88 100644 --- a/accountant/pom.xml +++ b/accountant/pom.xml @@ -82,6 +82,11 @@ error-handler ${error-hanlder.version} + + co.nilin.opex.utility + interceptors + ${interceptor.version} + org.springframework.cloud spring-cloud-dependencies diff --git a/auth-gateway/auth-gateway-app/pom.xml b/auth-gateway/auth-gateway-app/pom.xml index 0d31ffddd..0ff3a5ade 100644 --- a/auth-gateway/auth-gateway-app/pom.xml +++ b/auth-gateway/auth-gateway-app/pom.xml @@ -80,6 +80,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + com.auth0 java-jwt diff --git a/bc-gateway/bc-gateway-app/pom.xml b/bc-gateway/bc-gateway-app/pom.xml index 2bdccb667..0046a178b 100644 --- a/bc-gateway/bc-gateway-app/pom.xml +++ b/bc-gateway/bc-gateway-app/pom.xml @@ -138,6 +138,14 @@ micrometer-registry-prometheus runtime + + co.nilin.opex.utility + interceptors + + + co.nilin.opex.utility + error-handler + diff --git a/device-management/device-management-app/pom.xml b/device-management/device-management-app/pom.xml index 82e41ff4e..ff9b70048 100644 --- a/device-management/device-management-app/pom.xml +++ b/device-management/device-management-app/pom.xml @@ -78,6 +78,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + com.zaxxer HikariCP diff --git a/device-management/pom.xml b/device-management/pom.xml index d24596637..4800bfa7c 100644 --- a/device-management/pom.xml +++ b/device-management/pom.xml @@ -56,6 +56,11 @@ error-handler ${error-hanlder.version} + + co.nilin.opex.utility + interceptors + ${interceptor.version} + co.nilin.opex.device-management device-management-core diff --git a/docker-compose.yml b/docker-compose.yml index 63535e6e2..b9078536e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -546,8 +546,8 @@ services: - SMTP_USER=${SMTP_USER} - SMTP_PASS=${SMTP_PASS} - SMTP_FROM=${SMTP_FROM} - - SMTP_SOCKS_HOST=${SMTP_SOCKS_HOST} - - SMTP_SOCKS_PORT=${SMTP_SOCKS_PORT} + - SMTP_PROXY_HOST=${SMTP_PROXY_HOST} + - SMTP_PROXY_PORT=${SMTP_PROXY_PORT} - SMTP_PROXY_ENABLED=${SMTP_PROXY_ENABLED} - TOKEN_ISSUER_URL=${KC_ISSUER_URL} - OTP_CODE_RESPONSE_ENABLED=${OTP_CODE_RESPONSE_ENABLED} diff --git a/matching-gateway/matching-gateway-app/pom.xml b/matching-gateway/matching-gateway-app/pom.xml index 24e94ab58..86d029320 100644 --- a/matching-gateway/matching-gateway-app/pom.xml +++ b/matching-gateway/matching-gateway-app/pom.xml @@ -77,6 +77,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + io.mockk mockk diff --git a/otp/otp-app/pom.xml b/otp/otp-app/pom.xml index 1d3d72124..49cb4f0c0 100644 --- a/otp/otp-app/pom.xml +++ b/otp/otp-app/pom.xml @@ -87,6 +87,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + io.mockk mockk diff --git a/profile/pom.xml b/profile/pom.xml index 7ac615097..ffd3ab564 100644 --- a/profile/pom.xml +++ b/profile/pom.xml @@ -66,6 +66,11 @@ logging-handler ${logging-handler.version} + + co.nilin.opex.utility + error-handler + ${error-hanlder.version} + co.nilin.opex.utility interceptors diff --git a/profile/profile-app/pom.xml b/profile/profile-app/pom.xml index 685459a22..2b2412044 100644 --- a/profile/profile-app/pom.xml +++ b/profile/profile-app/pom.xml @@ -98,6 +98,10 @@ org.springframework.cloud spring-cloud-starter-vault-config + + co.nilin.opex.utility + error-handler + co.nilin.opex.utility interceptors diff --git a/user-management/pom.xml b/user-management/pom.xml index 0c0b0c5a4..fbb1146c0 100644 --- a/user-management/pom.xml +++ b/user-management/pom.xml @@ -49,6 +49,11 @@ error-handler ${error-hanlder.version} + + co.nilin.opex.utility + interceptors + ${interceptor.version} + co.nilin.opex.auth user-management-core From a7bd70f88b3f9723b694d03b37aea5996b9c0521 Mon Sep 17 00:00:00 2001 From: Amir Rajabi Date: Wed, 13 May 2026 16:27:59 +0330 Subject: [PATCH 2/2] Enable custom-user-language and fix localizations --- .../src/main/resources/application.yml | 2 ++ .../src/main/resources/application.yml | 2 ++ .../src/main/resources/application.yml | 2 ++ .../src/main/resources/application-otc.yml | 2 ++ .../src/main/resources/application.yml | 2 ++ .../postgres/impl/CurrencyHandlerImplV2.kt | 2 +- .../opex/common/proxy/CustomMessageClient.kt | 12 +++---- ...gClient.kt => CustomUserLanguageClient.kt} | 7 ++-- .../common/service/WebConfigCacheService.kt | 6 ++-- .../co/nilin/opex/common/utils/ProxyUtils.kt | 5 +++ .../src/main/resources/application.yml | 7 +++- docker-compose-otc.yml | 2 ++ docker-compose.yml | 36 +++++++++++++++++++ .../src/main/resources/application.yml | 2 ++ .../src/main/resources/application.yml | 2 ++ .../src/main/resources/application.yml | 2 ++ .../src/main/resources/application.yml | 2 ++ .../src/main/resources/application.yml | 2 ++ .../src/main/resources/application-otc.yml | 2 ++ .../src/main/resources/application.yml | 2 ++ .../postgres/dao/OffChainGatewayRepository.kt | 6 ++-- .../impl/OffChainGatewayManagerImpl.kt | 2 +- 22 files changed, 92 insertions(+), 17 deletions(-) rename common/src/main/kotlin/co/nilin/opex/common/proxy/{ConfigClient.kt => CustomUserLanguageClient.kt} (72%) create mode 100644 common/src/main/kotlin/co/nilin/opex/common/utils/ProxyUtils.kt 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!!,