Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Refactoring

Thomas47d71405e1d9
diff --git a/apps/api/src/app/core/date-query.interface.ts b/apps/api/src/app/core/date-query.interface.ts
new file mode 100644
index 0000000000..7145d41114
--- /dev/null
+++ b/apps/api/src/app/core/date-query.interface.ts
@@ -0,0 +1,5 @@
+export interface DateQuery {
+ gte?: Date;
+ in?: Date[];
+ lt?: Date;
+}
diff --git a/apps/api/src/app/core/get-value-object.interface.ts b/apps/api/src/app/core/get-value-object.interface.ts
index 0e4d66d844..8072a5ea60 100644
--- a/apps/api/src/app/core/get-value-object.interface.ts
+++ b/apps/api/src/app/core/get-value-object.interface.ts
@@ -1,5 +1,5 @@
export interface GetValueObject {
date: Date;
- symbol: string;
marketPrice: number;
+ symbol: string;
}
diff --git a/apps/api/src/app/core/get-value-params.interface.ts b/apps/api/src/app/core/get-value-params.interface.ts
index ffe57c3f26..bff9272060 100644
--- a/apps/api/src/app/core/get-value-params.interface.ts
+++ b/apps/api/src/app/core/get-value-params.interface.ts
@@ -1,8 +1,8 @@
import { Currency } from '@prisma/client';
export interface GetValueParams {
+ currency: Currency;
date: Date;
symbol: string;
- currency: Currency;
userCurrency: Currency;
}
diff --git a/apps/api/src/app/core/get-values-params.interface.ts b/apps/api/src/app/core/get-values-params.interface.ts
index ee1d550d78..b09d26af90 100644
--- a/apps/api/src/app/core/get-values-params.interface.ts
+++ b/apps/api/src/app/core/get-values-params.interface.ts
@@ -1,9 +1,9 @@
-import { DateQuery } from '@ghostfolio/api/app/core/market-data.service';
+import { DateQuery } from '@ghostfolio/api/app/core/date-query.interface';
import { Currency } from '@prisma/client';
export interface GetValuesParams {
+ currencies: { [symbol: string]: Currency };
dateQuery: DateQuery;
symbols: string[];
- currencies: { [symbol: string]: Currency };
userCurrency: Currency;
}
diff --git a/apps/api/src/app/core/market-data.service.ts b/apps/api/src/app/core/market-data.service.ts
index 6b4a916a3c..e493b2aa7e 100644
--- a/apps/api/src/app/core/market-data.service.ts
+++ b/apps/api/src/app/core/market-data.service.ts
@@ -2,6 +2,7 @@ import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { resetHours } from '@ghostfolio/common/helper';
import { Injectable } from '@nestjs/common';
import { MarketData } from '@prisma/client';
+import { DateQuery } from './date-query.interface';
@Injectable()
export class MarketDataService {
@@ -16,8 +17,8 @@ export class MarketDataService {
}): Promise<MarketData> {
return await this.prisma.marketData.findFirst({
where: {
- date: resetHours(date),
- symbol
+ symbol,
+ date: resetHours(date)
}
});
}
@@ -47,9 +48,3 @@ export class MarketDataService {
});
}
}
-
-export interface DateQuery {
- gte?: Date;
- lt?: Date;
- in?: Date[];
-}