From 1697b7e1e00ce1f403e4de680a35ab2c7d66487f Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 15 May 2025 16:56:05 +0200 Subject: [PATCH] Feature/remove unused Order model (#4690) * Remove unused Order model --- apps/api/src/models/order.ts | 83 ------------------- .../api/src/services/interfaces/interfaces.ts | 21 +---- 2 files changed, 1 insertion(+), 103 deletions(-) delete mode 100644 apps/api/src/models/order.ts diff --git a/apps/api/src/models/order.ts b/apps/api/src/models/order.ts deleted file mode 100644 index 6e676210..00000000 --- a/apps/api/src/models/order.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { IOrder } from '@ghostfolio/api/services/interfaces/interfaces'; - -import { Account, SymbolProfile, Type as ActivityType } from '@prisma/client'; -import { v4 as uuidv4 } from 'uuid'; - -export class Order { - private account: Account; - private currency: string; - private fee: number; - private date: string; - private id: string; - private isDraft: boolean; - private quantity: number; - private symbol: string; - private symbolProfile: SymbolProfile; - private total: number; - private type: ActivityType; - private unitPrice: number; - - public constructor(data: IOrder) { - this.account = data.account; - this.currency = data.currency; - this.fee = data.fee; - this.date = data.date; - this.id = data.id || uuidv4(); - this.isDraft = data.isDraft; - this.quantity = data.quantity; - this.symbol = data.symbol; - this.symbolProfile = data.symbolProfile; - this.type = data.type; - this.unitPrice = data.unitPrice; - - this.total = this.quantity * data.unitPrice; - } - - public getAccount() { - return this.account; - } - - public getCurrency() { - return this.currency; - } - - public getDate() { - return this.date; - } - - public getFee() { - return this.fee; - } - - public getId() { - return this.id; - } - - public getIsDraft() { - return this.isDraft; - } - - public getQuantity() { - return this.quantity; - } - - public getSymbol() { - return this.symbol; - } - - getSymbolProfile() { - return this.symbolProfile; - } - - public getTotal() { - return this.total; - } - - public getType() { - return this.type; - } - - public getUnitPrice() { - return this.unitPrice; - } -} diff --git a/apps/api/src/services/interfaces/interfaces.ts b/apps/api/src/services/interfaces/interfaces.ts index fa7fc4d0..0eaa149a 100644 --- a/apps/api/src/services/interfaces/interfaces.ts +++ b/apps/api/src/services/interfaces/interfaces.ts @@ -4,26 +4,7 @@ import { } from '@ghostfolio/common/interfaces'; import { MarketState } from '@ghostfolio/common/types'; -import { - Account, - DataSource, - SymbolProfile, - Type as ActivityType -} from '@prisma/client'; - -export interface IOrder { - account: Account; - currency: string; - date: string; - fee: number; - id?: string; - isDraft: boolean; - quantity: number; - symbol: string; - symbolProfile: SymbolProfile; - type: ActivityType; - unitPrice: number; -} +import { DataSource } from '@prisma/client'; export interface IDataProviderHistoricalResponse { marketPrice: number;