Feature/extend market data with currencies preset by activities count and date (#3460)

* Extend market data with currencies preset by activities count and date

* Update changelog
pull/3489/head
Eduardo Marinho 7 months ago committed by GitHub
parent e5d8faf2dc
commit 873fd53715
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Added
- Extended the historical market data table with currencies preset by date and activities count in the admin control panel
### Changed
- Improved the language localization for German (`de`)

@ -409,30 +409,49 @@ export class AdminService {
by: ['dataSource', 'symbol']
});
const marketData: AdminMarketDataItem[] = this.exchangeRateDataService
.getCurrencyPairs()
.map(({ dataSource, symbol }) => {
const marketDataItemCount =
marketDataItems.find((marketDataItem) => {
return (
marketDataItem.dataSource === dataSource &&
marketDataItem.symbol === symbol
);
})?._count ?? 0;
const marketDataPromise: Promise<AdminMarketDataItem>[] =
this.exchangeRateDataService
.getCurrencyPairs()
.map(async ({ dataSource, symbol }) => {
const currency = symbol.replace(DEFAULT_CURRENCY, '');
const { _count, _min } = await this.prismaService.order.aggregate({
_count: true,
_min: {
date: true
},
where: {
SymbolProfile: {
currency
}
}
});
return {
dataSource,
marketDataItemCount,
symbol,
assetClass: AssetClass.LIQUIDITY,
countriesCount: 0,
currency: symbol.replace(DEFAULT_CURRENCY, ''),
id: undefined,
name: symbol,
sectorsCount: 0
};
});
const marketDataItemCount =
marketDataItems.find((marketDataItem) => {
return (
marketDataItem.dataSource === dataSource &&
marketDataItem.symbol === symbol
);
})?._count ?? 0;
return {
currency,
dataSource,
marketDataItemCount,
symbol,
activitiesCount: _count as number,
assetClass: AssetClass.LIQUIDITY,
assetSubClass: AssetSubClass.CASH,
countriesCount: 0,
date: _min.date,
id: undefined,
name: symbol,
sectorsCount: 0
};
});
const marketData = await Promise.all(marketDataPromise);
return { marketData, count: marketData.length };
}

@ -6,13 +6,13 @@ export interface AdminMarketData {
}
export interface AdminMarketDataItem {
activitiesCount?: number;
activitiesCount: number;
assetClass?: AssetClass;
assetSubClass?: AssetSubClass;
countriesCount: number;
currency: string;
dataSource: DataSource;
date?: Date;
date: Date;
id: string;
isBenchmark?: boolean;
marketDataItemCount: number;

Loading…
Cancel
Save