| | 1 | | using Syki.Back.Features.Cross.CreateUser; |
| | 2 | | using Syki.Back.Features.Academic.CreateCourseOffering; |
| | 3 | |
|
| | 4 | | namespace Syki.Back.Features.Academic.CreateStudent; |
| | 5 | |
|
| | 6 | | /// <summary> |
| | 7 | | /// Representa um Aluno. |
| | 8 | | /// </summary> |
| | 9 | | public class SykiStudent |
| | 10 | | { |
| 762 | 11 | | public Guid Id { get; } |
| 1 | 12 | | public Guid InstitutionId { get; } |
| 162 | 13 | | public SykiUser User { get; } |
| 84 | 14 | | public Guid CourseOfferingId { get; } |
| 82 | 15 | | public CourseOffering CourseOffering { get; set; } |
| 143 | 16 | | public string Name { get; } |
| 285 | 17 | | public string EnrollmentCode { get; } |
| 3 | 18 | | public StudentStatus Status { get; } |
| 0 | 19 | | public decimal YieldCoefficient { get; set; } |
| | 20 | |
|
| 433 | 21 | | public SykiStudent( |
| 433 | 22 | | Guid id, |
| 433 | 23 | | Guid institutionId, |
| 433 | 24 | | string name, |
| 433 | 25 | | Guid courseOfferingId |
| 433 | 26 | | ) { |
| 433 | 27 | | Id = id; |
| 433 | 28 | | InstitutionId = institutionId; |
| 433 | 29 | | CourseOfferingId = courseOfferingId; |
| 433 | 30 | | Name = name; |
| 433 | 31 | | EnrollmentCode = $"{DateTime.Now.Year}{Guid.NewGuid().ToString()[..8].ToUpper()}"; |
| 433 | 32 | | Status = StudentStatus.Enrolled; |
| 433 | 33 | | } |
| | 34 | |
|
| | 35 | | public StudentOut ToOut() |
| | 36 | | { |
| 81 | 37 | | return new() |
| 81 | 38 | | { |
| 81 | 39 | | Id = Id, |
| 81 | 40 | | Name = Name, |
| 81 | 41 | | Email = User?.Email ?? "-", |
| 81 | 42 | | PhoneNumber = User?.PhoneNumber, |
| 81 | 43 | | EnrollmentCode = EnrollmentCode, |
| 81 | 44 | | CourseOfferingId = CourseOfferingId, |
| 81 | 45 | | CourseOffering = CourseOffering?.Course?.Name ?? "-", |
| 81 | 46 | | }; |
| | 47 | | } |
| | 48 | |
|
| | 49 | | public TeacherClassStudentOut ToTeacherClassStudentOut() |
| | 50 | | { |
| 29 | 51 | | return new() |
| 29 | 52 | | { |
| 29 | 53 | | Id = Id, |
| 29 | 54 | | Name = Name, |
| 29 | 55 | | ExamGrades = [], |
| 29 | 56 | | }; |
| | 57 | | } |
| | 58 | |
|
| | 59 | | public AcademicClassStudentOut ToAcademicClassStudentOut() |
| | 60 | | { |
| 1 | 61 | | return new() |
| 1 | 62 | | { |
| 1 | 63 | | Id = Id, |
| 1 | 64 | | Name = Name, |
| 1 | 65 | | ExamGrades = [], |
| 1 | 66 | | }; |
| | 67 | | } |
| | 68 | | } |