| | | 1 | | using LGDXRobotCloud.Data.Models.Business.Administration; |
| | | 2 | | using LGDXRobotCloud.Data.Models.Business.Automation; |
| | | 3 | | using LGDXRobotCloud.Data.Models.DTOs.V1.Responses; |
| | | 4 | | |
| | | 5 | | namespace LGDXRobotCloud.Data.Models.Business.Navigation; |
| | | 6 | | |
| | | 7 | | public record RobotBusinessModel |
| | | 8 | | { |
| | | 9 | | public required Guid Id { get; set; } |
| | | 10 | | |
| | | 11 | | public required string Name { get; set; } |
| | | 12 | | |
| | | 13 | | public required int RealmId { get; set; } |
| | | 14 | | |
| | | 15 | | public required string RealmName { get; set; } |
| | | 16 | | |
| | | 17 | | public required bool IsProtectingHardwareSerialNumber { get; set; } |
| | | 18 | | |
| | | 19 | | public required RobotCertificateBusinessModel RobotCertificate { get; set; } |
| | | 20 | | |
| | | 21 | | public RobotSystemInfoBusinessModel? RobotSystemInfo { get; set; } |
| | | 22 | | |
| | | 23 | | public RobotChassisInfoBusinessModel? RobotChassisInfo { get; set; } |
| | | 24 | | |
| | | 25 | | public required IEnumerable<AutoTaskListBusinessModel> AssignedTasks { get; set; } = []; |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | public static class RobotBusinessModelExtensions |
| | | 29 | | { |
| | | 30 | | public static RobotDto ToDto(this RobotBusinessModel robot) |
| | 0 | 31 | | { |
| | 0 | 32 | | return new RobotDto { |
| | 0 | 33 | | Id = robot.Id, |
| | 0 | 34 | | Name = robot.Name, |
| | 0 | 35 | | Realm = new RealmSearchDto { |
| | 0 | 36 | | Id = robot.RealmId, |
| | 0 | 37 | | Name = robot.RealmName, |
| | 0 | 38 | | }, |
| | 0 | 39 | | IsProtectingHardwareSerialNumber = robot.IsProtectingHardwareSerialNumber, |
| | 0 | 40 | | RobotCertificate = robot.RobotCertificate.ToDto(), |
| | 0 | 41 | | RobotSystemInfo = robot.RobotSystemInfo?.ToDto(), |
| | 0 | 42 | | RobotChassisInfo = robot.RobotChassisInfo?.ToDto(), |
| | 0 | 43 | | AssignedTasks = robot.AssignedTasks.Select(a => a.ToDto()).ToList(), |
| | 0 | 44 | | }; |
| | 0 | 45 | | } |
| | | 46 | | } |