16 lines
726 B
TypeScript
16 lines
726 B
TypeScript
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
|
|
import type { RejectTeamJoinRequestCommandDTO } from '../dto/TeamCommandAndQueryDTO';
|
|
import { Result } from '@core/shared/application/Result';
|
|
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
|
|
|
export class RejectTeamJoinRequestUseCase {
|
|
constructor(
|
|
private readonly membershipRepository: ITeamMembershipRepository,
|
|
) {}
|
|
|
|
async execute(command: RejectTeamJoinRequestCommandDTO): Promise<Result<void, ApplicationErrorCode<'NO_ERROR'>>> {
|
|
const { requestId } = command;
|
|
await this.membershipRepository.removeJoinRequest(requestId);
|
|
return Result.ok(undefined);
|
|
}
|
|
} |