| | 1 | | using System.ComponentModel.DataAnnotations; |
| | 2 | | using LGDXRobotCloud.Data.Models.Business.Navigation; |
| | 3 | |
|
| | 4 | | namespace LGDXRobotCloud.Data.Models.DTOs.V1.Commands; |
| | 5 | |
|
| | 6 | | public record WaypointUpdateDto |
| | 7 | | { |
| | 8 | | [MaxLength(100)] |
| | 9 | | [Required (ErrorMessage = "Please enter a name.")] |
| | 10 | | public required string Name { get; set; } |
| | 11 | |
|
| | 12 | | [Required (ErrorMessage = "Please enter a X coordinate.")] |
| | 13 | | public required double X { get; set; } |
| | 14 | |
|
| | 15 | | [Required (ErrorMessage = "Please enter a Y coordinate.")] |
| | 16 | | public required double Y { get; set; } |
| | 17 | |
|
| | 18 | | [Required (ErrorMessage = "Please enter a rotation.")] |
| | 19 | | public required double Rotation { get; set; } |
| | 20 | |
|
| | 21 | | public bool IsParking { get; set; } = false; |
| | 22 | |
|
| | 23 | | public bool HasCharger { get; set; } = false; |
| | 24 | |
|
| | 25 | | public bool IsReserved { get; set; } = false; |
| | 26 | | } |
| | 27 | |
|
| | 28 | | public static class WaypointUpdateDtoExtensions |
| | 29 | | { |
| | 30 | | public static WaypointUpdateBusinessModel ToBusinessModel(this WaypointUpdateDto model) |
| 0 | 31 | | { |
| 0 | 32 | | return new WaypointUpdateBusinessModel { |
| 0 | 33 | | Name = model.Name, |
| 0 | 34 | | X = model.X, |
| 0 | 35 | | Y = model.Y, |
| 0 | 36 | | Rotation = model.Rotation, |
| 0 | 37 | | IsParking = model.IsParking, |
| 0 | 38 | | HasCharger = model.HasCharger, |
| 0 | 39 | | IsReserved = model.IsReserved, |
| 0 | 40 | | }; |
| 0 | 41 | | } |
| | 42 | | } |