| | 1 | | using System.ComponentModel.DataAnnotations; |
| | 2 | | using LGDXRobotCloud.Data.Models.Business.Automation; |
| | 3 | |
|
| | 4 | | namespace LGDXRobotCloud.Data.Models.DTOs.V1.Commands; |
| | 5 | |
|
| | 6 | | public record FlowDetailUpdateDto |
| | 7 | | { |
| 0 | 8 | | public int? Id { get; set; } |
| | 9 | |
|
| | 10 | | [Required] |
| 0 | 11 | | public required int Order { get; set; } |
| | 12 | |
|
| | 13 | | [Required (ErrorMessage = "Please select a progress.")] |
| 0 | 14 | | public required int ProgressId { get; set; } |
| | 15 | |
|
| | 16 | | [Required] |
| 0 | 17 | | public required int AutoTaskNextControllerId { get; set; } |
| | 18 | |
|
| 0 | 19 | | public int? TriggerId { get; set; } |
| | 20 | | } |
| | 21 | |
|
| | 22 | | public static class FlowDetailUpdateDtoExtensions |
| | 23 | | { |
| | 24 | | public static FlowDetailUpdateBusinessModel ToBusinessModel(this FlowDetailUpdateDto flowDetailUpdateDto) |
| | 25 | | { |
| | 26 | | return new FlowDetailUpdateBusinessModel { |
| | 27 | | Id = flowDetailUpdateDto.Id, |
| | 28 | | Order = flowDetailUpdateDto.Order, |
| | 29 | | ProgressId = flowDetailUpdateDto.ProgressId, |
| | 30 | | AutoTaskNextControllerId = flowDetailUpdateDto.AutoTaskNextControllerId, |
| | 31 | | TriggerId = flowDetailUpdateDto.TriggerId, |
| | 32 | | }; |
| | 33 | | } |
| | 34 | | } |