| | 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 FlowDetailCreateDto |
| | 7 | | { |
| | 8 | | [Required] |
| 0 | 9 | | public required int Order { get; set; } |
| | 10 | |
|
| | 11 | | [Required (ErrorMessage = "Please select a progress.")] |
| 0 | 12 | | public required int ProgressId { get; set; } |
| | 13 | |
|
| | 14 | | [Required] |
| 0 | 15 | | public required int AutoTaskNextControllerId { get; set; } |
| | 16 | |
|
| 0 | 17 | | public int? TriggerId { get; set; } |
| | 18 | | } |
| | 19 | |
|
| | 20 | | public static class FlowDetailCreateDtoExtensions |
| | 21 | | { |
| | 22 | | public static FlowDetailCreateBusinessModel ToBusinessModel(this FlowDetailCreateDto flowDetailCreateDto) |
| | 23 | | { |
| | 24 | | return new FlowDetailCreateBusinessModel { |
| | 25 | | Order = flowDetailCreateDto.Order, |
| | 26 | | ProgressId = flowDetailCreateDto.ProgressId, |
| | 27 | | AutoTaskNextControllerId = flowDetailCreateDto.AutoTaskNextControllerId, |
| | 28 | | TriggerId = flowDetailCreateDto.TriggerId, |
| | 29 | | }; |
| | 30 | | } |
| | 31 | | } |