| | 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 | | { |
| 0 | 9 | | public required Guid Id { get; set; } |
| | 10 | |
|
| 0 | 11 | | public required string Name { get; set; } |
| | 12 | |
|
| 0 | 13 | | public required int RealmId { get; set; } |
| | 14 | |
|
| 0 | 15 | | public required string RealmName { get; set; } |
| | 16 | |
|
| 0 | 17 | | public required bool IsRealtimeExchange { get; set; } |
| | 18 | |
|
| 0 | 19 | | public required bool IsProtectingHardwareSerialNumber { get; set; } |
| | 20 | |
|
| 0 | 21 | | public required RobotCertificateBusinessModel RobotCertificate { get; set; } |
| | 22 | |
|
| 0 | 23 | | public RobotSystemInfoBusinessModel? RobotSystemInfo { get; set; } |
| | 24 | |
|
| 0 | 25 | | public RobotChassisInfoBusinessModel? RobotChassisInfo { get; set; } |
| | 26 | |
|
| 0 | 27 | | public required IEnumerable<AutoTaskListBusinessModel> AssignedTasks { get; set; } = []; |
| | 28 | | } |
| | 29 | |
|
| | 30 | | public static class RobotBusinessModelExtensions |
| | 31 | | { |
| | 32 | | public static RobotDto ToDto(this RobotBusinessModel robot) |
| | 33 | | { |
| | 34 | | return new RobotDto { |
| | 35 | | Id = robot.Id, |
| | 36 | | Name = robot.Name, |
| | 37 | | Realm = new RealmSearchDto { |
| | 38 | | Id = robot.RealmId, |
| | 39 | | Name = robot.RealmName, |
| | 40 | | }, |
| | 41 | | IsRealtimeExchange = robot.IsRealtimeExchange, |
| | 42 | | IsProtectingHardwareSerialNumber = robot.IsProtectingHardwareSerialNumber, |
| | 43 | | RobotCertificate = robot.RobotCertificate.ToDto(), |
| | 44 | | RobotSystemInfo = robot.RobotSystemInfo?.ToDto(), |
| | 45 | | RobotChassisInfo = robot.RobotChassisInfo?.ToDto(), |
| | 46 | | AssignedTasks = robot.AssignedTasks.Select(a => a.ToDto()).ToList(), |
| | 47 | | }; |
| | 48 | | } |
| | 49 | | } |