27 lines
969 B
TypeScript
27 lines
969 B
TypeScript
import type { DriversApiClient } from '../../api/drivers/DriversApiClient';
|
|
import type { DriverRegistrationStatusPresenter } from '../../presenters/DriverRegistrationStatusPresenter';
|
|
import type { DriverRegistrationStatusViewModel } from '../../view-models';
|
|
|
|
/**
|
|
* Driver Registration Service
|
|
*
|
|
* Orchestrates driver registration status operations by coordinating API calls and presentation logic.
|
|
* All dependencies are injected via constructor.
|
|
*/
|
|
export class DriverRegistrationService {
|
|
constructor(
|
|
private readonly apiClient: DriversApiClient,
|
|
private readonly statusPresenter: DriverRegistrationStatusPresenter
|
|
) {}
|
|
|
|
/**
|
|
* Get driver registration status for a specific race
|
|
*/
|
|
async getDriverRegistrationStatus(
|
|
driverId: string,
|
|
raceId: string
|
|
): Promise<DriverRegistrationStatusViewModel> {
|
|
const dto = await this.apiClient.getRegistrationStatus(driverId, raceId);
|
|
return this.statusPresenter.present(dto);
|
|
}
|
|
} |