diff --git a/apps/api/src/app/portfolio/current-rate.service.spec.ts b/apps/api/src/app/portfolio/current-rate.service.spec.ts index 2fc931071..d87ee7ccc 100644 --- a/apps/api/src/app/portfolio/current-rate.service.spec.ts +++ b/apps/api/src/app/portfolio/current-rate.service.spec.ts @@ -107,7 +107,8 @@ describe('CurrentRateService', () => { currentRateService = new CurrentRateService( dataProviderService, - marketDataService + marketDataService, + null ); }); diff --git a/apps/api/src/app/portfolio/current-rate.service.ts b/apps/api/src/app/portfolio/current-rate.service.ts index 501e2c062..f32bc18c5 100644 --- a/apps/api/src/app/portfolio/current-rate.service.ts +++ b/apps/api/src/app/portfolio/current-rate.service.ts @@ -25,6 +25,7 @@ export class CurrentRateService { @Inject(REQUEST) private readonly request: RequestWithUser ) {} + // TODO: Pass user instead of using this.request.user public async getValues({ dataGatheringItems, dateQuery @@ -43,7 +44,7 @@ export class CurrentRateService { if (includeToday) { promises.push( this.dataProviderService - .getQuotes({ items: dataGatheringItems, user: this.request.user }) + .getQuotes({ items: dataGatheringItems, user: this.request?.user }) .then((dataResultProvider) => { const result: GetValueObject[] = []; diff --git a/apps/api/src/app/portfolio/portfolio-calculator-baln-buy-and-sell.spec.ts b/apps/api/src/app/portfolio/portfolio-calculator-baln-buy-and-sell.spec.ts index 07b53b4de..60956a9d6 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator-baln-buy-and-sell.spec.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator-baln-buy-and-sell.spec.ts @@ -21,7 +21,7 @@ describe('PortfolioCalculator', () => { let exchangeRateDataService: ExchangeRateDataService; beforeEach(() => { - currentRateService = new CurrentRateService(null, null); + currentRateService = new CurrentRateService(null, null, null); exchangeRateDataService = new ExchangeRateDataService( null, diff --git a/apps/api/src/app/portfolio/portfolio-calculator-baln-buy.spec.ts b/apps/api/src/app/portfolio/portfolio-calculator-baln-buy.spec.ts index c60f99990..ecbe2851c 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator-baln-buy.spec.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator-baln-buy.spec.ts @@ -21,7 +21,7 @@ describe('PortfolioCalculator', () => { let exchangeRateDataService: ExchangeRateDataService; beforeEach(() => { - currentRateService = new CurrentRateService(null, null); + currentRateService = new CurrentRateService(null, null, null); exchangeRateDataService = new ExchangeRateDataService( null, diff --git a/apps/api/src/app/portfolio/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts b/apps/api/src/app/portfolio/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts index b6ee34622..c1e3a71c7 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts @@ -34,7 +34,7 @@ describe('PortfolioCalculator', () => { let exchangeRateDataService: ExchangeRateDataService; beforeEach(() => { - currentRateService = new CurrentRateService(null, null); + currentRateService = new CurrentRateService(null, null, null); exchangeRateDataService = new ExchangeRateDataService( null, diff --git a/apps/api/src/app/portfolio/portfolio-calculator-googl-buy.spec.ts b/apps/api/src/app/portfolio/portfolio-calculator-googl-buy.spec.ts index 9a12bdc83..2a6eeaedb 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator-googl-buy.spec.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator-googl-buy.spec.ts @@ -34,7 +34,7 @@ describe('PortfolioCalculator', () => { let exchangeRateDataService: ExchangeRateDataService; beforeEach(() => { - currentRateService = new CurrentRateService(null, null); + currentRateService = new CurrentRateService(null, null, null); exchangeRateDataService = new ExchangeRateDataService( null, diff --git a/apps/api/src/app/portfolio/portfolio-calculator-no-orders.spec.ts b/apps/api/src/app/portfolio/portfolio-calculator-no-orders.spec.ts index 4b6d243f3..bc860b2aa 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator-no-orders.spec.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator-no-orders.spec.ts @@ -21,7 +21,7 @@ describe('PortfolioCalculator', () => { let exchangeRateDataService: ExchangeRateDataService; beforeEach(() => { - currentRateService = new CurrentRateService(null, null); + currentRateService = new CurrentRateService(null, null, null); exchangeRateDataService = new ExchangeRateDataService( null, diff --git a/apps/api/src/app/portfolio/portfolio-calculator-novn-buy-and-sell-partially.spec.ts b/apps/api/src/app/portfolio/portfolio-calculator-novn-buy-and-sell-partially.spec.ts index 2f93096d9..d73db8c2c 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator-novn-buy-and-sell-partially.spec.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator-novn-buy-and-sell-partially.spec.ts @@ -21,7 +21,7 @@ describe('PortfolioCalculator', () => { let exchangeRateDataService: ExchangeRateDataService; beforeEach(() => { - currentRateService = new CurrentRateService(null, null); + currentRateService = new CurrentRateService(null, null, null); exchangeRateDataService = new ExchangeRateDataService( null, diff --git a/apps/api/src/app/portfolio/portfolio-calculator-novn-buy-and-sell.spec.ts b/apps/api/src/app/portfolio/portfolio-calculator-novn-buy-and-sell.spec.ts index ada9acc16..253b47346 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator-novn-buy-and-sell.spec.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator-novn-buy-and-sell.spec.ts @@ -21,7 +21,7 @@ describe('PortfolioCalculator', () => { let exchangeRateDataService: ExchangeRateDataService; beforeEach(() => { - currentRateService = new CurrentRateService(null, null); + currentRateService = new CurrentRateService(null, null, null); exchangeRateDataService = new ExchangeRateDataService( null, diff --git a/apps/api/src/app/portfolio/portfolio-calculator.spec.ts b/apps/api/src/app/portfolio/portfolio-calculator.spec.ts index 1537fb8fe..dfe3f3466 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator.spec.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator.spec.ts @@ -10,7 +10,7 @@ describe('PortfolioCalculator', () => { let exchangeRateDataService: ExchangeRateDataService; beforeEach(() => { - currentRateService = new CurrentRateService(null, null); + currentRateService = new CurrentRateService(null, null, null); exchangeRateDataService = new ExchangeRateDataService( null,