| | | 1 | | namespace Syki.Shared; |
| | | 2 | | |
| | | 3 | | public class CreateCourseOut : IApiDto<CreateCourseOut> |
| | | 4 | | { |
| | 2960 | 5 | | public Guid Id { get; set; } |
| | 1868 | 6 | | public string Name { get; set; } |
| | 1858 | 7 | | public CourseType Type { get; set; } |
| | 6822 | 8 | | public List<CreateCourseDisciplineOut> Disciplines { get; set; } |
| | | 9 | | |
| | | 10 | | public override bool Equals(object? obj) |
| | | 11 | | { |
| | 8 | 12 | | if (obj is null) return false; |
| | 4 | 13 | | return Id == ((CreateCourseOut)obj).Id; |
| | | 14 | | } |
| | | 15 | | |
| | | 16 | | public override int GetHashCode() |
| | | 17 | | { |
| | 2 | 18 | | return Id.ToHashCode(); |
| | | 19 | | } |
| | | 20 | | |
| | | 21 | | public override string ToString() |
| | | 22 | | { |
| | 2 | 23 | | return Name; |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | public static IEnumerable<(string, CreateCourseOut)> GetExamples() => |
| | 0 | 27 | | [ |
| | 0 | 28 | | ("Direito", |
| | 0 | 29 | | new CreateCourseOut |
| | 0 | 30 | | { |
| | 0 | 31 | | Id = Guid.CreateVersion7(), |
| | 0 | 32 | | Name = "Direito", |
| | 0 | 33 | | Type = CourseType.Bacharelado, |
| | 0 | 34 | | Disciplines = [new() { Id = Guid.NewGuid(), Name = "Direito Civil", Code = "F5FFCA51" }, new() { Id = Guid.N |
| | 0 | 35 | | }), |
| | 0 | 36 | | ("ADS", |
| | 0 | 37 | | new CreateCourseOut |
| | 0 | 38 | | { |
| | 0 | 39 | | Id = Guid.CreateVersion7(), |
| | 0 | 40 | | Name = "Análise e Desenvolvimento de Sistemas", |
| | 0 | 41 | | Type = CourseType.Tecnologo, |
| | 0 | 42 | | Disciplines = [new() { Id = Guid.NewGuid(), Name = "Programação Orientada a Objetos", Code = "2B7FBD49" }, n |
| | 0 | 43 | | }), |
| | 0 | 44 | | ]; |
| | | 45 | | |
| | | 46 | | public static implicit operator CreateCourseOut(OneOf<CreateCourseOut, ErrorOut> value) |
| | | 47 | | { |
| | 582 | 48 | | return value.Success; |
| | | 49 | | } |
| | | 50 | | } |
| | | 51 | | |
| | | 52 | | public class CreateCourseDisciplineOut |
| | | 53 | | { |
| | | 54 | | public Guid Id { get; set; } |
| | | 55 | | public string Name { get; set; } |
| | | 56 | | public string Code { get; set; } |
| | | 57 | | } |