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