diff --git a/src/subdomains/core/buy-crypto/process/services/buy-crypto.service.ts b/src/subdomains/core/buy-crypto/process/services/buy-crypto.service.ts index f3d499bb3f..78fcdf71df 100644 --- a/src/subdomains/core/buy-crypto/process/services/buy-crypto.service.ts +++ b/src/subdomains/core/buy-crypto/process/services/buy-crypto.service.ts @@ -342,7 +342,18 @@ export class BuyCryptoService implements OnModuleInit { (entity.amlCheck === CheckStatus.FAIL && dto.amlCheck === CheckStatus.GSHEET)) && !entity.isComplete && (update?.amlCheck !== entity.amlCheck || update.amlReason !== entity.amlReason) - ? { amlCheck: update.amlCheck, mailSendDate: null, amlReason: update.amlReason, comment: update.comment } + ? { + amlCheck: update.amlCheck, + mailSendDate: null, + amlReason: update.amlReason, + comment: update.comment, + ...(update.amlCheck === CheckStatus.PASS + ? { + priceDefinitionAllowedDate: + update.priceDefinitionAllowedDate ?? entity.priceDefinitionAllowedDate ?? new Date(), + } + : undefined), + } : undefined), isComplete: dto.isComplete, }; diff --git a/src/subdomains/core/sell-crypto/process/services/buy-fiat.service.ts b/src/subdomains/core/sell-crypto/process/services/buy-fiat.service.ts index 1e15117823..a710a87dde 100644 --- a/src/subdomains/core/sell-crypto/process/services/buy-fiat.service.ts +++ b/src/subdomains/core/sell-crypto/process/services/buy-fiat.service.ts @@ -208,7 +208,17 @@ export class BuyFiatService implements OnModuleInit { (entity.amlCheck === CheckStatus.FAIL && dto.amlCheck === CheckStatus.GSHEET)) && !entity.isComplete && (update?.amlCheck !== entity.amlCheck || update.amlReason !== entity.amlReason) - ? { amlCheck: update.amlCheck, mailSendDate: null, amlReason: update.amlReason } + ? { + amlCheck: update.amlCheck, + mailSendDate: null, + amlReason: update.amlReason, + ...(update.amlCheck === CheckStatus.PASS + ? { + priceDefinitionAllowedDate: + update.priceDefinitionAllowedDate ?? entity.priceDefinitionAllowedDate ?? new Date(), + } + : undefined), + } : undefined), isComplete: dto.isComplete, comment: update.comment, diff --git a/src/subdomains/generic/user/models/auth/auth.service.ts b/src/subdomains/generic/user/models/auth/auth.service.ts index dbf1f0734e..69189c7154 100644 --- a/src/subdomains/generic/user/models/auth/auth.service.ts +++ b/src/subdomains/generic/user/models/auth/auth.service.ts @@ -259,6 +259,12 @@ export class AuthService { const ipCountry = this.geoLocationService.getCountry(userIp); const language = await this.languageService.getLanguageByCountry(ipCountry); + // wallet the login originated from - determines mail branding (e.g. DFX vs. RealUnit); + // always resolve to a concrete wallet so branding follows the login source and never falls back to account history + const loginWallet = + (dto.wallet && (await this.walletService.getByIdOrName(undefined, dto.wallet))) || + (await this.walletService.getDefault()); + const userData = (await this.userDataService .getUsersByMail(dto.mail) @@ -268,9 +274,7 @@ export class AuthService { mail: dto.mail, language: dto.language ?? language, status: UserDataStatus.KYC_ONLY, - wallet: dto.wallet - ? await this.walletService.getByIdOrName(undefined, dto.wallet) - : await this.walletService.getDefault(), + wallet: loginWallet, })); if (dto.recommendationCode) await this.confirmRecommendationCode(dto.recommendationCode, userData); @@ -301,6 +305,7 @@ export class AuthService { context: MailContext.LOGIN, input: { userData, + wallet: loginWallet, title: `${MailTranslationKey.LOGIN}.title`, salutation: { key: `${MailTranslationKey.LOGIN}.salutation` }, texts: [