refactor use cases

This commit is contained in:
2026-01-08 15:34:51 +01:00
parent d984ab24a8
commit 52e9a2f6a7
362 changed files with 5192 additions and 8409 deletions

View File

@@ -1,4 +1,3 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import { Result } from '@core/shared/application/Result';
import type { UseCase } from '@core/shared/application';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
@@ -27,11 +26,8 @@ export type UpdateDriverProfileErrorCode =
export class UpdateDriverProfileUseCase
implements UseCase<UpdateDriverProfileInput, void, UpdateDriverProfileErrorCode>
{
constructor(
private readonly driverRepository: IDriverRepository,
private readonly logger: Logger,
private readonly output: UseCaseOutputPort<UpdateDriverProfileResult>,
) {}
constructor(private readonly driverRepository: IDriverRepository,
private readonly logger: Logger) {}
async execute(
input: UpdateDriverProfileInput,
@@ -67,8 +63,6 @@ export class UpdateDriverProfileUseCase
await this.driverRepository.update(updated);
this.output.present(updated);
return Result.ok(undefined);
} catch (error) {
const message = error instanceof Error ? error.message : 'Failed to update driver profile';