12345678910111213141516171819202122232425262728293031 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using FluentValidation;
- using Hotline.Share.Dtos.FlowEngine;
- using Hotline.Application.Contracts.Validators;
- using Hotline.Share.Enums.FlowEngine;
- namespace Hotline.Application.Contracts.Validators.FlowEngine;
- public class StartWorkflowDtoValidator : AbstractValidator<StartWorkflowDto>
- {
- public StartWorkflowDtoValidator()
- {
- //RuleFor(d => d.DefinitionCode)
- // .NotEmpty().When(d => string.IsNullOrEmpty(d.DefinitionModuleCode));
- //RuleFor(d => d.DefinitionModuleCode)
- // .NotEmpty().When(d => string.IsNullOrEmpty(d.DefinitionCode));
- //RuleFor(d => d.DefinitionModuleCode).NotEmpty();
- //RuleFor(d => d.Title).NotEmpty();
- Include(new BasicWorkflowDtoValidator());
- RuleFor(d => d.NextStepCode).NotEmpty();
- RuleFor(d => d.IsSms).NotNull();
- RuleFor(d => d.IsStartCountersign).NotNull();
- RuleFor(d => d.NextHandlers.Count).LessThanOrEqualTo(1)
- .Unless(d => d.IsStartCountersign);
- }
- }
|