refactor use cases
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user