wip
This commit is contained in:
13
packages/racing/application/use-cases/GetAllTeamsQuery.ts
Normal file
13
packages/racing/application/use-cases/GetAllTeamsQuery.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { ITeamRepository } from '../../domain/repositories/ITeamRepository';
|
||||
import type { GetAllTeamsQueryResultDTO } from '../dto/TeamCommandAndQueryDTO';
|
||||
|
||||
export class GetAllTeamsQuery {
|
||||
constructor(
|
||||
private readonly teamRepository: ITeamRepository,
|
||||
) {}
|
||||
|
||||
async execute(): Promise<GetAllTeamsQueryResultDTO> {
|
||||
const teams = await this.teamRepository.findAll();
|
||||
return teams;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user