website refactor

This commit is contained in:
2026-01-16 12:55:48 +01:00
parent 0208334c59
commit 20a42c52fd
83 changed files with 1610 additions and 1238 deletions

View File

@@ -0,0 +1,20 @@
import { Result } from '@core/shared/application/Result';
import type { Driver } from '../../domain/entities/Driver';
import type { IDriverRepository } from '../../domain/repositories/IDriverRepository';
export type GetDriverInput = {
driverId: string;
};
export class GetDriverUseCase {
constructor(private readonly driverRepository: IDriverRepository) {}
async execute(input: GetDriverInput): Promise<Result<Driver | null>> {
try {
const driver = await this.driverRepository.findById(input.driverId);
return Result.ok(driver);
} catch (error) {
return Result.err(error instanceof Error ? error : new Error(String(error)));
}
}
}