| | 1 | | using Syki.Back.Features.Cross.CreateUser; |
| | 2 | | using Syki.Back.Features.Academic.CallWebhooks; |
| | 3 | | using Syki.Back.Features.Academic.CreateCourse; |
| | 4 | | using Syki.Back.Features.Academic.CreateCampus; |
| | 5 | | using Syki.Back.Features.Academic.CreateTeacher; |
| | 6 | | using Syki.Back.Features.Academic.CreateStudent; |
| | 7 | | using Syki.Back.Features.Academic.CreateClassroom; |
| | 8 | | using Syki.Back.Features.Academic.CreateDiscipline; |
| | 9 | | using Syki.Back.Features.Academic.CreateNotification; |
| | 10 | | using Syki.Back.Features.Academic.CreateCourseOffering; |
| | 11 | | using Syki.Back.Features.Academic.CreateAcademicPeriod; |
| | 12 | | using Syki.Back.Features.Academic.CreateCourseCurriculum; |
| | 13 | | using Syki.Back.Features.Academic.CreateWebhookSubscription; |
| | 14 | |
|
| | 15 | | namespace Syki.Back.Features.Cross.CreateInstitution; |
| | 16 | |
|
| | 17 | | public class Institution : Entity |
| | 18 | | { |
| 2862 | 19 | | public Guid Id { get; set; } |
| 1076 | 20 | | public string Name { get; set; } |
| 1070 | 21 | | public DateTime CreatedAt { get; set; } |
| 0 | 22 | | public List<Campus> Campi { get; set; } |
| 0 | 23 | | public List<Course> Courses { get; set; } |
| 0 | 24 | | public List<SykiUser> Users { get; set; } |
| 0 | 25 | | public List<SykiStudent> Students { get; set; } |
| 1552 | 26 | | public InstitutionConfigs Configs { get; set; } |
| 0 | 27 | | public List<SykiTeacher> Teachers { get; set; } |
| 0 | 28 | | public List<Classroom> Classrooms { get; set; } |
| 0 | 29 | | public List<Discipline> Disciplines { get; set; } |
| 0 | 30 | | public List<Notification> Notifications { get; set; } |
| 0 | 31 | | public List<WebhookSubscription> Webhooks { get; set; } |
| 0 | 32 | | public List<WebhookCall> WebhookCalls { get; set; } |
| 0 | 33 | | public List<CourseOffering> CourseOfferings { get; set; } |
| 0 | 34 | | public List<AcademicPeriod> AcademicPeriods { get; set; } |
| 0 | 35 | | public List<CourseCurriculum> CourseCurriculums { get; set; } |
| | 36 | |
|
| 952 | 37 | | public Institution() { } |
| | 38 | |
|
| 594 | 39 | | public Institution(Guid id, string name) |
| | 40 | | { |
| 594 | 41 | | Id = id; |
| 594 | 42 | | Name = name; |
| 594 | 43 | | CreatedAt = DateTime.UtcNow; |
| 594 | 44 | | Configs = new InstitutionConfigs(Id, 7, 70); |
| | 45 | |
|
| 594 | 46 | | AddDomainEvent(new InstitutionCreatedDomainEvent(Id)); |
| 594 | 47 | | } |
| | 48 | |
|
| | 49 | | public InstitutionOut ToOut() |
| | 50 | | { |
| 474 | 51 | | return new() |
| 474 | 52 | | { |
| 474 | 53 | | Id = Id, |
| 474 | 54 | | Name = Name, |
| 474 | 55 | | CreatedAt = CreatedAt, |
| 474 | 56 | | NoteLimit = Configs.NoteLimit, |
| 474 | 57 | | FrequencyLimit = Configs.FrequencyLimit, |
| 474 | 58 | | }; |
| | 59 | | } |
| | 60 | | } |