Thomas Kaul
6 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
12 additions and
1 deletions
-
apps/api/src/app/order/order.service.ts
-
prisma/migrations/20250907093545_removed_redundant_currency_from_order/migration.sql
|
@ -95,7 +95,6 @@ export class OrderService { |
|
|
accountId?: string; |
|
|
accountId?: string; |
|
|
assetClass?: AssetClass; |
|
|
assetClass?: AssetClass; |
|
|
assetSubClass?: AssetSubClass; |
|
|
assetSubClass?: AssetSubClass; |
|
|
currency?: string; |
|
|
|
|
|
symbol?: string; |
|
|
symbol?: string; |
|
|
tags?: { id: string }[]; |
|
|
tags?: { id: string }[]; |
|
|
updateAccountBalance?: boolean; |
|
|
updateAccountBalance?: boolean; |
|
@ -184,6 +183,10 @@ export class OrderService { |
|
|
delete data.comment; |
|
|
delete data.comment; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (data.currency === data.SymbolProfile.connectOrCreate.create.currency) { |
|
|
|
|
|
delete data.currency; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
delete data.symbol; |
|
|
delete data.symbol; |
|
|
delete data.tags; |
|
|
delete data.tags; |
|
|
delete data.updateAccountBalance; |
|
|
delete data.updateAccountBalance; |
|
@ -703,6 +706,9 @@ export class OrderService { |
|
|
|
|
|
|
|
|
delete data.assetClass; |
|
|
delete data.assetClass; |
|
|
delete data.assetSubClass; |
|
|
delete data.assetSubClass; |
|
|
|
|
|
|
|
|
|
|
|
// TODO: Remove currency?
|
|
|
|
|
|
|
|
|
delete data.symbol; |
|
|
delete data.symbol; |
|
|
delete data.tags; |
|
|
delete data.tags; |
|
|
|
|
|
|
|
|
|
@ -0,0 +1,5 @@ |
|
|
|
|
|
-- Remove redundant currency from the 'Order' table |
|
|
|
|
|
UPDATE "Order" |
|
|
|
|
|
SET "currency" = NULL |
|
|
|
|
|
FROM "SymbolProfile" |
|
|
|
|
|
WHERE "Order"."symbolProfileId" = "SymbolProfile"."id" AND "Order"."currency" = "SymbolProfile"."currency"; |