refactor core presenters
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { ITeamRepository } from '../../domain/repositories/ITeamRepository';
|
||||
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
|
||||
import type { AllTeamsResultDTO } from '../presenters/IAllTeamsPresenter';
|
||||
import type { GetAllTeamsOutputPort } from '../ports/output/GetAllTeamsOutputPort';
|
||||
import type { AsyncUseCase, Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
@@ -8,7 +8,7 @@ import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorC
|
||||
/**
|
||||
* Use Case for retrieving all teams.
|
||||
*/
|
||||
export class GetAllTeamsUseCase implements AsyncUseCase<void, AllTeamsResultDTO, 'REPOSITORY_ERROR'> {
|
||||
export class GetAllTeamsUseCase implements AsyncUseCase<void, GetAllTeamsOutputPort, 'REPOSITORY_ERROR'> {
|
||||
constructor(
|
||||
private readonly teamRepository: ITeamRepository,
|
||||
private readonly teamMembershipRepository: ITeamMembershipRepository,
|
||||
@@ -37,8 +37,9 @@ export class GetAllTeamsUseCase implements AsyncUseCase<void, AllTeamsResultDTO,
|
||||
}),
|
||||
);
|
||||
|
||||
const dto: AllTeamsResultDTO = {
|
||||
const dto: GetAllTeamsOutputPort = {
|
||||
teams: enrichedTeams,
|
||||
totalCount: enrichedTeams.length,
|
||||
};
|
||||
|
||||
this.logger.debug('Successfully retrieved all teams.');
|
||||
|
||||
Reference in New Issue
Block a user