diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab45c2db..edd5cbd55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Extended the import functionality by tags +- Introduced the fuzzy search for the accounts endpoint - Refactored the fuzzy search for the holdings of the assistant - Improved the language localization for Polish (`pl`) +- Improved the language localization for Spanish (`es`) ## 2.189.0 - 2025-08-05 diff --git a/apps/api/src/app/account/account.controller.ts b/apps/api/src/app/account/account.controller.ts index 51a33fa9e..7b24ccdcb 100644 --- a/apps/api/src/app/account/account.controller.ts +++ b/apps/api/src/app/account/account.controller.ts @@ -89,6 +89,7 @@ export class AccountController { public async getAllAccounts( @Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId: string, @Query('dataSource') filterByDataSource?: string, + @Query('query') filterBySearchQuery?: string, @Query('symbol') filterBySymbol?: string ): Promise { const impersonationUserId = @@ -96,6 +97,7 @@ export class AccountController { const filters = this.apiService.buildFiltersFromQueryParams({ filterByDataSource, + filterBySearchQuery, filterBySymbol }); diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 3e69bb68b..784661e20 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -220,11 +220,27 @@ export class PortfolioService { userId: string; withExcludedAccounts?: boolean; }): Promise { - const accounts = await this.getAccounts({ + let accounts = await this.getAccounts({ filters, userId, withExcludedAccounts }); + + const searchQuery = filters.find(({ type }) => { + return type === 'SEARCH_QUERY'; + })?.id; + + if (searchQuery) { + const fuse = new Fuse(accounts, { + keys: ['name', 'platform.name'], + threshold: 0.3 + }); + + accounts = fuse.search(searchQuery).map(({ item }) => { + return item; + }); + } + let totalBalanceInBaseCurrency = new Big(0); let totalValueInBaseCurrency = new Big(0); let transactionCount = 0; diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index 47ced2075..fc7d38d4e 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -7581,7 +7581,7 @@ The equity contribution of your current investment (${equityValueRatio}%) exceeds ${thresholdMax}% - The equity contribution of your current investment (${equityValueRatio}%) exceeds ${thresholdMax}% + La contribución de renta variable de tu inversión actual (${equityValueRatio}%) supera el ${thresholdMax}% apps/client/src/app/pages/i18n/i18n-page.html 43 @@ -7589,7 +7589,7 @@ The equity contribution of your current investment (${equityValueRatio}%) is below ${thresholdMin}% - The equity contribution of your current investment (${equityValueRatio}%) is below ${thresholdMin}% + La contribución de renta variable de tu inversión actual (${equityValueRatio}%) está por debajo del ${thresholdMin}% apps/client/src/app/pages/i18n/i18n-page.html 47 @@ -7597,7 +7597,7 @@ The equity contribution of your current investment (${equityValueRatio}%) is within the range of ${thresholdMin}% and ${thresholdMax}% - The equity contribution of your current investment (${equityValueRatio}%) is within the range of ${thresholdMin}% and ${thresholdMax}% + La contribución de renta variable de tu inversión actual (${equityValueRatio}%) está dentro del rango entre ${thresholdMin}% y ${thresholdMax}% apps/client/src/app/pages/i18n/i18n-page.html 51 @@ -7605,7 +7605,7 @@ Fixed Income - Fixed Income + Renta fija apps/client/src/app/pages/i18n/i18n-page.html 55 @@ -7613,7 +7613,7 @@ The fixed income contribution of your current investment (${fixedIncomeValueRatio}%) exceeds ${thresholdMax}% - The fixed income contribution of your current investment (${fixedIncomeValueRatio}%) exceeds ${thresholdMax}% + La contribución de renta fija de tu inversión actual (${fixedIncomeValueRatio}%) supera el ${thresholdMax}% apps/client/src/app/pages/i18n/i18n-page.html 57 @@ -7621,7 +7621,7 @@ The fixed income contribution of your current investment (${fixedIncomeValueRatio}%) is below ${thresholdMin}% - The fixed income contribution of your current investment (${fixedIncomeValueRatio}%) is below ${thresholdMin}% + La contribución de renta fija de tu inversión actual (${fixedIncomeValueRatio}%) está por debajo del ${thresholdMin}% apps/client/src/app/pages/i18n/i18n-page.html 61 @@ -7629,7 +7629,7 @@ The fixed income contribution of your current investment (${fixedIncomeValueRatio}%) is within the range of ${thresholdMin}% and ${thresholdMax}% - The fixed income contribution of your current investment (${fixedIncomeValueRatio}%) is within the range of ${thresholdMin}% and ${thresholdMax}% + La contribución de renta fija de tu inversión actual (${fixedIncomeValueRatio}%) está dentro del rango entre ${thresholdMin}% y ${thresholdMax}% apps/client/src/app/pages/i18n/i18n-page.html 66 @@ -7637,7 +7637,7 @@ Investment: Base Currency - Investment: Base Currency + Inversión: Moneda base apps/client/src/app/pages/i18n/i18n-page.html 72 @@ -7645,7 +7645,7 @@ The major part of your current investment is not in your base currency (${baseCurrencyValueRatio}% in ${baseCurrency}) - The major part of your current investment is not in your base currency (${baseCurrencyValueRatio}% in ${baseCurrency}) + La mayor parte de tu inversión actual no está en tu moneda base (${baseCurrencyValueRatio}% en ${baseCurrency}) apps/client/src/app/pages/i18n/i18n-page.html 75 @@ -7653,7 +7653,7 @@ The major part of your current investment is in your base currency (${baseCurrencyValueRatio}% in ${baseCurrency}) - The major part of your current investment is in your base currency (${baseCurrencyValueRatio}% in ${baseCurrency}) + La mayor parte de tu inversión actual está en tu moneda base (${baseCurrencyValueRatio}% en ${baseCurrency}) apps/client/src/app/pages/i18n/i18n-page.html 79 @@ -7661,7 +7661,7 @@ Investment - Investment + Inversión apps/client/src/app/pages/i18n/i18n-page.html 82 @@ -7669,7 +7669,7 @@ Over ${thresholdMax}% of your current investment is in ${currency} (${maxValueRatio}%) - Over ${thresholdMax}% of your current investment is in ${currency} (${maxValueRatio}%) + Más del ${thresholdMax}% de tu inversión actual está en ${currency} (${maxValueRatio}%) apps/client/src/app/pages/i18n/i18n-page.html 84 @@ -7677,7 +7677,7 @@ The major part of your current investment is in ${currency} (${maxValueRatio}%) and does not exceed ${thresholdMax}% - The major part of your current investment is in ${currency} (${maxValueRatio}%) and does not exceed ${thresholdMax}% + La mayor parte de tu inversión actual está en ${currency} (${maxValueRatio}%) y no supera el ${thresholdMax}% apps/client/src/app/pages/i18n/i18n-page.html 88