Feature/extend admin endpoint by asset profile count per data provider (#4676)

* Extend admin endpoint by asset profile count per data provider

* Update changelog
This commit is contained in:
Felix Jordan 2025-05-08 21:08:19 +06:00 committed by GitHub
parent 8e76bd82eb
commit aadd9f56a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 6 deletions

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased ## Unreleased
### Added
- Added the asset profile count per data provider to the endpoint `GET api/v1/admin`
### Changed ### Changed
- Improved the language localization for Catalan (`ca`) - Improved the language localization for Catalan (`ca`)

View File

@ -143,15 +143,30 @@ export class AdminService {
this.countUsersWithAnalytics() this.countUsersWithAnalytics()
]); ]);
const dataProviders = await Promise.all(
dataSources.map(async (dataSource) => {
const dataProviderInfo = this.dataProviderService
.getDataProvider(dataSource)
.getDataProviderInfo();
const assetProfileCount = await this.prismaService.symbolProfile.count({
where: {
dataSource
}
});
return { return {
...dataProviderInfo,
assetProfileCount
};
})
);
return {
dataProviders,
settings, settings,
transactionCount, transactionCount,
userCount, userCount,
dataProviders: dataSources.map((dataSource) => {
return this.dataProviderService
.getDataProvider(dataSource)
.getDataProviderInfo();
}),
version: environment.version version: environment.version
}; };
} }

View File

@ -1,7 +1,7 @@
import { DataProviderInfo } from './data-provider-info.interface'; import { DataProviderInfo } from './data-provider-info.interface';
export interface AdminData { export interface AdminData {
dataProviders: DataProviderInfo[]; dataProviders: (DataProviderInfo & { assetProfileCount: number })[];
settings: { [key: string]: boolean | object | string | string[] }; settings: { [key: string]: boolean | object | string | string[] };
transactionCount: number; transactionCount: number;
userCount: number; userCount: number;