refactor dtos to ports
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user