Browse Source

Merge branch 'main' into feature/no-quotes-for-closed-holdings

pull/7816/head
Thomas Kaul 1 week ago
committed by GitHub
parent
commit
7352c6893c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      apps/api/src/services/market-data/market-data.service.ts
  3. 2
      apps/api/src/services/queues/data-gathering/data-gathering.service.ts
  4. 8
      prisma/migrations/20261005000000_updated_indexes_of_market_data/migration.sql
  5. 3
      prisma/schema.prisma

1
CHANGELOG.md

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the portfolio snapshot calculation to get the quotes of active holdings only - Improved the portfolio snapshot calculation to get the quotes of active holdings only
- Improved the performance of getting the latest market data by optimizing the indexes of the market data table
- Deprecated `SymbolProfile` in favor of `assetProfile` in the endpoint `POST api/v1/activities` - Deprecated `SymbolProfile` in favor of `assetProfile` in the endpoint `POST api/v1/activities`
- Upgraded `Nx` from version `23.1.1` to `23.2.1` - Upgraded `Nx` from version `23.1.1` to `23.2.1`

2
apps/api/src/services/market-data/market-data.service.ts

@ -248,7 +248,7 @@ export class MarketDataService {
state: state as MarketDataState state: state as MarketDataState
}, },
where: { where: {
dataSource_date_symbol: { dataSource_symbol_date: {
dataSource: dataSource as DataSource, dataSource: dataSource as DataSource,
date: date as Date, date: date as Date,
symbol: symbol as string symbol: symbol as string

2
apps/api/src/services/queues/data-gathering/data-gathering.service.ts

@ -348,7 +348,7 @@ export class DataGatheringService {
}, },
update: { marketPrice, isCarriedForward: false }, update: { marketPrice, isCarriedForward: false },
where: { where: {
dataSource_date_symbol: { dataSource_symbol_date: {
dataSource, dataSource,
symbol, symbol,
date: startOfUtcDate date: startOfUtcDate

8
prisma/migrations/20261005000000_updated_indexes_of_market_data/migration.sql

@ -0,0 +1,8 @@
-- CreateIndex
CREATE UNIQUE INDEX "MarketData_dataSource_symbol_date_key" ON "MarketData"("dataSource", "symbol", "date");
-- DropIndex
DROP INDEX "MarketData_dataSource_symbol_idx";
-- DropIndex
DROP INDEX "MarketData_dataSource_date_symbol_key";

3
prisma/schema.prisma

@ -173,9 +173,8 @@ model MarketData {
state MarketDataState @default(CLOSE) state MarketDataState @default(CLOSE)
symbol String symbol String
@@unique([dataSource, date, symbol]) @@unique([dataSource, symbol, date])
@@index([dataSource]) @@index([dataSource])
@@index([dataSource, symbol])
@@index([date]) @@index([date])
@@index([state]) @@index([state])
@@index([symbol]) @@index([symbol])

Loading…
Cancel
Save