refactor page to use services

This commit is contained in:
2025-12-18 15:58:09 +01:00
parent f54fa5de5b
commit fc386db06a
45 changed files with 2254 additions and 1292 deletions

View File

@@ -0,0 +1,22 @@
import { DashboardOverviewViewModel } from '../../view-models/DashboardOverviewViewModel';
import { DashboardApiClient } from '../../api/dashboard/DashboardApiClient';
/**
* Dashboard Service
*
* Orchestrates dashboard operations by coordinating API calls and view model creation.
* All dependencies are injected via constructor.
*/
export class DashboardService {
constructor(
private readonly apiClient: DashboardApiClient
) {}
/**
* Get dashboard overview data with view model transformation
*/
async getDashboardOverview(): Promise<DashboardOverviewViewModel> {
const dto = await this.apiClient.getDashboardOverview();
return new DashboardOverviewViewModel(dto);
}
}