refactor dtos to ports
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
|
||||
import type { RejectTeamJoinRequestCommandDTO } from '../dtos/RejectTeamJoinRequestCommandDTO';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
|
||||
import type { RejectTeamJoinRequestInputPort } from '../ports/input/RejectTeamJoinRequestInputPort';
|
||||
|
||||
export class RejectTeamJoinRequestUseCase {
|
||||
constructor(
|
||||
private readonly membershipRepository: ITeamMembershipRepository,
|
||||
) {}
|
||||
|
||||
async execute(command: RejectTeamJoinRequestCommandDTO): Promise<Result<void, ApplicationErrorCode<'NO_ERROR'>>> {
|
||||
async execute(command: RejectTeamJoinRequestInputPort): Promise<Result<void, ApplicationErrorCode<'NO_ERROR'>>> {
|
||||
const { requestId } = command;
|
||||
await this.membershipRepository.removeJoinRequest(requestId);
|
||||
return Result.ok(undefined);
|
||||
|
||||
Reference in New Issue
Block a user