| | 1 | | using Syki.Back.Features.Academic.CreateStudent; |
| | 2 | | using Syki.Back.Features.Academic.CreateTeacher; |
| | 3 | |
|
| | 4 | | namespace Syki.Back.Features.Cross.SeedInstitutionData; |
| | 5 | |
|
| | 6 | | [CommandDescription("Realizar seed de usuários da instituição")] |
| 0 | 7 | | public record SeedInstitutionUsersCommand(Guid InstitutionId, Guid DireitoCourseOfferingId, Guid AdsCourseOfferingId) : |
| | 8 | |
|
| | 9 | | public class SeedInstitutionUsersCommandHandler( |
| | 10 | | CreateTeacherService createTeacherService, |
| | 11 | | CreateStudentService createStudentService) : ICommandHandler<SeedInstitutionUsersCommand> |
| | 12 | | { |
| | 13 | | public async Task Handle(CommandId commandId, SeedInstitutionUsersCommand command) |
| | 14 | | { |
| | 15 | | var id = command.InstitutionId; |
| | 16 | |
|
| | 17 | | var teachers = new List<string>() |
| | 18 | | { |
| | 19 | | "Davi Pessoa Ferraz", |
| | 20 | | "Luciete Bezerra Alves", |
| | 21 | | "Manuela Abath Valença", |
| | 22 | | "Paulo Marcelo Pedrosa de Almeida", |
| | 23 | | }; |
| | 24 | | foreach (var name in teachers) |
| | 25 | | { |
| | 26 | | await createTeacherService.Create(id, CreateTeacherIn.Seed(name)); |
| | 27 | | } |
| | 28 | |
|
| | 29 | | var direitoStudents = new List<string>() |
| | 30 | | { |
| | 31 | | "Alisson Aranda de Aguiar", |
| | 32 | | "Maria Júlia de Oliveira Melo", |
| | 33 | | "Everton Ian de Galhardo Filho", |
| | 34 | | "Alma Celeste Maldonado Mendonça", |
| | 35 | | }; |
| | 36 | | foreach (var name in direitoStudents) |
| | 37 | | { |
| | 38 | | await createStudentService.Create(id, CreateStudentIn.Seed(name, command.DireitoCourseOfferingId)); |
| | 39 | | } |
| | 40 | |
|
| | 41 | | var adsStudents = new List<string>() |
| | 42 | | { |
| | 43 | | "Simone Bezerra", |
| | 44 | | "Marcelo Lima Filho", |
| | 45 | | "Josilda Aragão Paz", |
| | 46 | | "Marlene de Oliveira", |
| | 47 | | "Miguel Gomes da Silva", |
| | 48 | | "Zaqueu do Vale Cavalcante", |
| | 49 | | }; |
| | 50 | | foreach (var name in adsStudents) |
| | 51 | | { |
| | 52 | | await createStudentService.Create(id, CreateStudentIn.Seed(name, command.AdsCourseOfferingId)); |
| | 53 | | } |
| | 54 | | } |
| | 55 | | } |