refactor dtos to ports

This commit is contained in:
2025-12-19 13:07:38 +01:00
parent 08ec2af5bf
commit 2ab86ec9bd
42 changed files with 83 additions and 81 deletions

View File

@@ -1,9 +1,9 @@
import { Result } from '@core/shared/application/Result';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
import type { ITeamRepository } from '../../domain/repositories/ITeamRepository';
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
import type { ITeamRepository } from '../../domain/repositories/ITeamRepository';
import type { UpdateTeamCommandDTO } from '../dtos/UpdateTeamCommandDTO';
import type { UpdateTeamInputPort } from '../ports/input/UpdateTeamInputPort';
type UpdateTeamErrorCode = 'INSUFFICIENT_PERMISSIONS' | 'TEAM_NOT_FOUND';
@@ -13,7 +13,7 @@ export class UpdateTeamUseCase {
private readonly membershipRepository: ITeamMembershipRepository,
) {}
async execute(command: UpdateTeamCommandDTO): Promise<Result<void, ApplicationErrorCode<UpdateTeamErrorCode>>> {
async execute(command: UpdateTeamInputPort): Promise<Result<void, ApplicationErrorCode<UpdateTeamErrorCode>>> {
const { teamId, updates, updatedBy } = command;
const updaterMembership = await this.membershipRepository.getMembership(teamId, updatedBy);