| | 1 | | namespace Syki.Shared; |
| | 2 | |
|
| | 3 | | public class CampusOut |
| | 4 | | { |
| 1452 | 5 | | public Guid Id { get; set; } |
| | 6 | |
|
| | 7 | | /// <summary> |
| | 8 | | /// Nome |
| | 9 | | /// </summary> |
| 922 | 10 | | public string Name { get; set; } |
| | 11 | |
|
| 922 | 12 | | public BrazilState State { get; set; } |
| | 13 | |
|
| | 14 | | /// <summary> |
| | 15 | | /// Cidade |
| | 16 | | /// </summary> |
| 922 | 17 | | public string City { get; set; } |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Capacidade total de alunos |
| | 21 | | /// </summary> |
| 940 | 22 | | public int Capacity { get; set; } |
| | 23 | |
|
| | 24 | | /// <summary> |
| | 25 | | /// Total de alunos |
| | 26 | | /// </summary> |
| 636 | 27 | | public int Students { get; set; } |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Total de professores |
| | 31 | | /// </summary> |
| 624 | 32 | | public int Teachers { get; set; } |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// Taxa de ocupação |
| | 36 | | /// </summary> |
| 628 | 37 | | public decimal FillRate { get; set; } |
| | 38 | |
|
| | 39 | | public static IEnumerable<(string, CampusOut)> GetExamples() => |
| 0 | 40 | | [ |
| 0 | 41 | | ("Agreste", |
| 0 | 42 | | new CampusOut |
| 0 | 43 | | { |
| 0 | 44 | | Id = Guid.CreateVersion7(), |
| 0 | 45 | | Name = "Agreste", |
| 0 | 46 | | State = BrazilState.PE, |
| 0 | 47 | | City = "Caruaru", |
| 0 | 48 | | Capacity = 150, |
| 0 | 49 | | Students = 120, |
| 0 | 50 | | FillRate = 80, |
| 0 | 51 | | }), |
| 0 | 52 | | ("Suassuna", |
| 0 | 53 | | new CampusOut |
| 0 | 54 | | { |
| 0 | 55 | | Id = Guid.CreateVersion7(), |
| 0 | 56 | | Name = "Suassuna", |
| 0 | 57 | | State = BrazilState.PE, |
| 0 | 58 | | City = "Recife", |
| 0 | 59 | | Capacity = 500, |
| 0 | 60 | | Students = 234, |
| 0 | 61 | | FillRate = 46.80M, |
| 0 | 62 | | }), |
| 0 | 63 | | ]; |
| | 64 | |
|
| | 65 | | public string GetFillRate() |
| | 66 | | { |
| 0 | 67 | | return $"{FillRate.Format()}%"; |
| | 68 | | } |
| | 69 | |
|
| | 70 | | public override string ToString() |
| | 71 | | { |
| 0 | 72 | | return Name; |
| | 73 | | } |
| | 74 | |
|
| | 75 | | public static implicit operator CampusOut(OneOf<CampusOut, ErrorOut> value) |
| | 76 | | { |
| 2 | 77 | | return value.Success; |
| | 78 | | } |
| | 79 | | } |