| | 1 | | using LGDXRobotCloud.Data.Models.DTOs.V1.Responses; |
| | 2 | |
|
| | 3 | | namespace LGDXRobotCloud.Data.Models.Business.Navigation; |
| | 4 | |
|
| | 5 | | public record WaypointListBusinessModel |
| | 6 | | { |
| | 7 | | public required int Id { get; set; } |
| | 8 | |
|
| | 9 | | public required string Name { get; set; } |
| | 10 | |
|
| | 11 | | public required int RealmId { get; set; } |
| | 12 | |
|
| | 13 | | public required string RealmName { get; set; } |
| | 14 | |
|
| | 15 | | public required double X { get; set; } |
| | 16 | |
|
| | 17 | | public required double Y { get; set; } |
| | 18 | |
|
| | 19 | | public required double Rotation { get; set; } |
| | 20 | |
|
| | 21 | | public required bool IsParking { get; set; } |
| | 22 | |
|
| | 23 | | public required bool HasCharger { get; set; } |
| | 24 | |
|
| | 25 | | public required bool IsReserved { get; set; } |
| | 26 | | } |
| | 27 | |
|
| | 28 | | public static class WaypointListBusinessModelExtensions |
| | 29 | | { |
| | 30 | | public static WaypointListDto ToDto(this WaypointListBusinessModel model) |
| 0 | 31 | | { |
| 0 | 32 | | return new WaypointListDto { |
| 0 | 33 | | Id = model.Id, |
| 0 | 34 | | Name = model.Name, |
| 0 | 35 | | Realm = new RealmSearchDto { |
| 0 | 36 | | Id = model.RealmId, |
| 0 | 37 | | Name = model.RealmName, |
| 0 | 38 | | }, |
| 0 | 39 | | X = model.X, |
| 0 | 40 | | Y = model.Y, |
| 0 | 41 | | Rotation = model.Rotation, |
| 0 | 42 | | IsParking = model.IsParking, |
| 0 | 43 | | HasCharger = model.HasCharger, |
| 0 | 44 | | IsReserved = model.IsReserved, |
| 0 | 45 | | }; |
| 0 | 46 | | } |
| | 47 | |
|
| | 48 | | public static IEnumerable<WaypointListDto> ToDto(this IEnumerable<WaypointListBusinessModel> models) |
| 0 | 49 | | { |
| 0 | 50 | | return models.Select(model => model.ToDto()); |
| 0 | 51 | | } |
| | 52 | | } |