diff --git a/CHANGELOG.md b/CHANGELOG.md index ca585fa5d..90d9d443d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Persisted the language on url change - Improved the portfolio evolution chart +- Removed the data source type `RAKUTEN` ## 1.204.1 - 15.10.2022 diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index abff3a420..ef0b586e5 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -238,12 +238,10 @@ export class PortfolioController { @Headers('impersonation-id') impersonationId: string, @Query('range') dateRange: DateRange = 'max' ): Promise { - const performanceInformation = await this.portfolioService.getPerformanceV2( - { - dateRange, - impersonationId - } - ); + const performanceInformation = await this.portfolioService.getPerformance({ + dateRange, + impersonationId + }); if ( impersonationId || diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 1a22f8f4b..a34d1e385 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -302,7 +302,7 @@ export class PortfolioService { }); } - public async getChartV2({ + public async getChart({ dateRange = 'max', impersonationId }: { @@ -881,7 +881,7 @@ export class PortfolioService { }; } - public async getPerformanceV2({ + public async getPerformance({ dateRange = 'max', impersonationId }: { @@ -945,7 +945,7 @@ export class PortfolioService { // currentNetPerformancePercent = currentNetPerformancePercent.mul(-1); // } - const historicalDataContainer = await this.getChartV2({ + const historicalDataContainer = await this.getChart({ dateRange, impersonationId }); @@ -1270,7 +1270,7 @@ export class PortfolioService { const userId = await this.getUserId(impersonationId, this.request.user.id); const user = await this.userService.user({ id: userId }); - const performanceInformation = await this.getPerformanceV2({ + const performanceInformation = await this.getPerformance({ impersonationId }); diff --git a/prisma/migrations/20221016065824_removed_rakuten_from_data_source/migration.sql b/prisma/migrations/20221016065824_removed_rakuten_from_data_source/migration.sql new file mode 100644 index 000000000..448e240ec --- /dev/null +++ b/prisma/migrations/20221016065824_removed_rakuten_from_data_source/migration.sql @@ -0,0 +1,9 @@ +-- AlterEnum +BEGIN; +CREATE TYPE "DataSource_new" AS ENUM ('ALPHA_VANTAGE', 'EOD_HISTORICAL_DATA', 'GHOSTFOLIO', 'GOOGLE_SHEETS', 'MANUAL', 'RAPID_API', 'YAHOO'); +ALTER TABLE "MarketData" ALTER COLUMN "dataSource" TYPE "DataSource_new" USING ("dataSource"::text::"DataSource_new"); +ALTER TABLE "SymbolProfile" ALTER COLUMN "dataSource" TYPE "DataSource_new" USING ("dataSource"::text::"DataSource_new"); +ALTER TYPE "DataSource" RENAME TO "DataSource_old"; +ALTER TYPE "DataSource_new" RENAME TO "DataSource"; +DROP TYPE "DataSource_old"; +COMMIT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 062d59b06..e17f060b7 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -206,7 +206,6 @@ enum DataSource { GHOSTFOLIO GOOGLE_SHEETS MANUAL - RAKUTEN RAPID_API YAHOO }