feat(api,dal): в JobGroup добавлено свойство UserTimeZoneOffsetMinutes, доработан контроллер. EsppScheduleTransformService - доработка с учетом offset

This commit is contained in:
Mikhail Trubnikov
2026-02-09 15:48:30 +10:00
parent 25f3ebc372
commit 897dd4c4e3
12 changed files with 4309 additions and 174 deletions

View File

@@ -1,5 +1,6 @@
using FluentValidation;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json.Linq;
using PARR.API.Contracts.V1.Requests;
using PARR.DAL.Contracts;
using PARR.DAL.Services.Interfaces;
@@ -123,6 +124,14 @@ namespace PARR.API.Validators
return true;
}).WithMessage("Некорректное значение периода распределения");
RuleFor(t => t.UserTimeZoneOffsetMinutes)
.Must((entity, value, c) =>
{
// если IsResponseAreaTimezone == true, то поле UserTimeZoneOffsetMinutes обязательно.
// если IsResponseAreaTimezone == false, то UserTimeZoneOffsetMinutes должно быть null
return (entity.IsWorkGroupTimezone && value != null) || (!entity.IsWorkGroupTimezone && value == null);
}).WithMessage("Некорректное значение."); ;
}
}
}