feat(api,dal): в модель JobGroupType добавлено поле description. В job контроллерах убрано поле isUmbrella, добавлено JobType.

This commit is contained in:
Mikhail Trubnikov
2025-11-17 12:06:33 +10:00
parent 48c8741395
commit e24ce20d02
15 changed files with 4143 additions and 22 deletions

View File

@@ -1,11 +1,12 @@
using FluentValidation;
using PARR.API.Contracts.V1.Requests;
using PARR.DAL.Services.Interfaces.Job;
namespace PARR.API.Validators
{
public class JobGroupValidator : AbstractValidator<JobGroupRequest>
{
public JobGroupValidator()
public JobGroupValidator(IJobGroupTypeService jobGroupTypeService)
{
RuleFor(t => t.Name)
.NotNull().NotEmpty();
@@ -21,6 +22,10 @@ namespace PARR.API.Validators
RuleFor(t => t.TemplateDuration)
.NotNull().NotEmpty();
RuleFor(t => t.GroupTypeId)
.MustAsync(async (entity, value, c) => await jobGroupTypeService.GetAsync(value) != null)
.WithMessage("Указан несуществующий Id типа");
}
}
}