Browse Source

Merge branch 'main' into feature/improve-portfolio-evolution-chart

pull/1362/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
35059ac273
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 10
      apps/api/src/app/portfolio/portfolio.controller.ts
  3. 8
      apps/api/src/app/portfolio/portfolio.service.ts
  4. 9
      prisma/migrations/20221016065824_removed_rakuten_from_data_source/migration.sql
  5. 1
      prisma/schema.prisma

1
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

10
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<PortfolioPerformanceResponse> {
const performanceInformation = await this.portfolioService.getPerformanceV2(
{
dateRange,
impersonationId
}
);
const performanceInformation = await this.portfolioService.getPerformance({
dateRange,
impersonationId
});
if (
impersonationId ||

8
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
});

9
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;

1
prisma/schema.prisma

@ -206,7 +206,6 @@ enum DataSource {
GHOSTFOLIO
GOOGLE_SHEETS
MANUAL
RAKUTEN
RAPID_API
YAHOO
}

Loading…
Cancel
Save