refactor dashboard module

This commit is contained in:
2025-12-22 00:10:57 +01:00
parent 44ed8db555
commit b445d6dd37
6 changed files with 46 additions and 86 deletions

View File

@@ -97,14 +97,13 @@ export class DashboardOverviewUseCase {
private readonly getDriverStats: (
driverId: string,
) => DashboardDriverStatsAdapter | null,
private readonly output: UseCaseOutputPort<DashboardOverviewResult>,
) {}
async execute(
input: DashboardOverviewInput,
): Promise<
Result<
void,
DashboardOverviewResult,
ApplicationErrorCode<'DRIVER_NOT_FOUND' | 'REPOSITORY_ERROR', { message: string }>
>
> {
@@ -209,9 +208,7 @@ export class DashboardOverviewUseCase {
friends: friendsSummary,
};
this.output.present(result);
return Result.ok(undefined);
return Result.ok(result);
} catch (error) {
return Result.err({
code: 'REPOSITORY_ERROR',