Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Task/remove deprecated symbol profile in create activity endpoint (#8125)
Thomas Kauld0b79653cccf
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ea70605fb6..f624679d7c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Changed+- Removed the deprecated `SymbolProfile` field from the endpoint `POST api/v1/activities`- Upgraded `ai` from version `7.0.114` to `7.0.127`### Fixeddiff --git a/apps/api/src/app/activities/activities.controller.ts b/apps/api/src/app/activities/activities.controller.tsindex 28ce890449..98c3f674bc 100644--- a/apps/api/src/app/activities/activities.controller.ts+++ b/apps/api/src/app/activities/activities.controller.ts@@ -38,6 +38,7 @@ import {import { Order } from '@prisma/client';import { parseISO } from 'date-fns';import { StatusCodes, getReasonPhrase } from 'http-status-codes';+import { omit } from 'lodash-es';import { ActivitiesFilterDto } from './activities-filter.dto';import { ActivitiesService } from './activities.service';@@ -314,7 +315,7 @@ export class ActivitiesController {}]);- return { ...activity, assetProfile };+ return { ...omit(activity, ['SymbolProfile']), assetProfile };}@HasPermission(permissions.updateActivity)diff --git a/apps/api/src/helper/object.helper.spec.ts b/apps/api/src/helper/object.helper.spec.tsindex 773b7905ae..630033053c 100644--- a/apps/api/src/helper/object.helper.spec.ts+++ b/apps/api/src/helper/object.helper.spec.ts@@ -3121,8 +3121,8 @@ describe('redactAttributes', () => {});// The endpoint POST api/v1/activities returns a row of the database with the- // asset profile and the deprecated relation to the symbol profile- it('should redact an activity with the asset profile and the relation to the symbol profile', () => {+ // asset profile+ it('should redact an activity with the asset profile', () => {expect(redactPaths({object: {@@ -3144,18 +3144,6 @@ describe('redactAttributes', () => {fee: 19.9,id: '8c623328-6035-4b5f-b6d5-702cc1c9c56b',quantity: 50,- SymbolProfile: {- comment: 'Reviewed by the administrator',- name: 'Apple Inc',- scraperConfiguration: {- headers: { Authorization: 'Bearer TOKEN' },- mode: 'lazy',- selector: '.price',- url: 'https://example.org/get_price'- },- symbol: 'AAPL',- symbolMapping: { YAHOO: 'AAPL' }- },type: 'BUY',unitPrice: 220.79},@@ -3175,13 +3163,6 @@ describe('redactAttributes', () => {fee: null,id: '8c623328-6035-4b5f-b6d5-702cc1c9c56b',quantity: null,- SymbolProfile: {- comment: null,- name: 'Apple Inc',- scraperConfiguration: null,- symbol: 'AAPL',- symbolMapping: null- },type: 'BUY',unitPrice: 220.79});diff --git a/apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts b/apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.tsindex 296925af92..eedc808772 100644--- a/apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts+++ b/apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts@@ -94,10 +94,6 @@ export class TransformDataSourceInResponseInterceptor<'items[*].dataSource','latestActivities[*].assetProfile.dataSource','settings["filters.dataSource"]',-- /* @deprecated */- 'SymbolProfile.dataSource',-'watchlist[*].dataSource']});diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.tsindex 4ecff6db60..48f69fd403 100644--- a/libs/common/src/lib/config.ts+++ b/libs/common/src/lib/config.ts@@ -184,16 +184,6 @@ export const DEFAULT_REDACTED_PATHS = ['settings.emergencyFund','settings.projectedTotalAmount','settings.savingsRate',-- /* @deprecated */- 'SymbolProfile.comment',-- /* @deprecated */- 'SymbolProfile.scraperConfiguration',-- /* @deprecated */- 'SymbolProfile.symbolMapping',-'totalBalanceInBaseCurrency','totalDividendInBaseCurrency','totalInterestInBaseCurrency',diff --git a/libs/common/src/lib/interfaces/responses/create-activity-response.interface.ts b/libs/common/src/lib/interfaces/responses/create-activity-response.interface.tsindex 198a2cef79..6e0571d094 100644--- a/libs/common/src/lib/interfaces/responses/create-activity-response.interface.ts+++ b/libs/common/src/lib/interfaces/responses/create-activity-response.interface.ts@@ -1,12 +1,7 @@-import type { Order, SymbolProfile } from '@ghostfolio/prisma/browser';+import type { Order } from '@ghostfolio/prisma/browser';import { EnhancedAssetProfile } from '../enhanced-asset-profile.interface';export interface CreateActivityResponse extends Order {assetProfile: EnhancedAssetProfile;-- /**- * @deprecated Use `assetProfile` instead- */- SymbolProfile: SymbolProfile;}