forked from VitorCarvalho67/Boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0bc43b
commit 18baf93
Showing
11 changed files
with
189 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...services/admin/GetCoordenadoresUseCase.ts → ...dules/services/admin/Get/Coordenadores.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
server/src/modules/services/admin/Get/CoordenasdoresNames.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { prisma } from "../../../../prisma/client"; | ||
import { AppError } from "../../../../errors/error"; | ||
import { Coordenador } from "@prisma/client"; | ||
|
||
export class GetCoordenadoresNamesUseCase { | ||
async execute(): Promise<Pick<Coordenador, 'name'>[]> { | ||
|
||
const coordenadores = await prisma.coordenador.findMany({}); | ||
|
||
return coordenadores.map(coordenador => { | ||
return { | ||
name: coordenador.name | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { prisma } from "../../../../prisma/client"; | ||
import { Curso } from "@prisma/client"; | ||
|
||
export class GetFullCursosUseCase { | ||
async execute(): Promise<Curso[]> { | ||
|
||
const cursos = await prisma.curso.findMany({}); | ||
|
||
return cursos; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { prisma } from "../../../../prisma/client"; | ||
import { Vaga } from "@prisma/client"; | ||
|
||
export class GetFullEstagiosUseCase { | ||
async execute(): Promise<Vaga[]> { | ||
|
||
const estagios = await prisma.vaga.findMany({}); | ||
|
||
return estagios; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { prisma } from "../../../../prisma/client"; | ||
import { Funcionario } from "@prisma/client"; | ||
|
||
export class GetFullFuncionariosUseCase { | ||
async execute(): Promise<Funcionario[]> { | ||
|
||
const funcionarios = await prisma.funcionario.findMany({}); | ||
|
||
return funcionarios; | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
.../services/admin/GetAllProfessorUseCase.ts → ...ules/services/admin/Get/ProfessorNames.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { prisma } from "../../../../prisma/client"; | ||
import { Professor } from "@prisma/client"; | ||
|
||
export class GetProfessoresUseCase { | ||
async execute(): Promise<Pick<Professor, 'name'>[]> { | ||
|
||
const professores = await prisma.professor.findMany({ | ||
where: { | ||
coordenador: { | ||
none: {} | ||
} | ||
} | ||
}); | ||
|
||
return professores.map(professor => { | ||
return { | ||
name: professor.name | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { prisma } from "../../../../prisma/client"; | ||
import { Turma } from "@prisma/client"; | ||
|
||
export class GetFullTurmasUseCase { | ||
async execute(): Promise<Turma[]> { | ||
|
||
const turmas = await prisma.turma.findMany({}); | ||
|
||
return turmas; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters