feat(api): JobControl переписан метод Create+Валидация

This commit is contained in:
Mikhail Kuznetsov
2025-09-11 16:03:51 +10:00
parent 76c289cef2
commit 39eb8ddc2c
10 changed files with 295 additions and 80 deletions

View File

@@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.Models.Job;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.Services.Interfaces.Job;
using PARR.DAL.Services.Interfaces.Unit;
@@ -28,9 +29,9 @@ namespace PARR.DAL.DomainServices.Implementations
this.templateService = templateService;
}
public async Task<IEnumerable<Guid>?> GetUnitsIdByJobFilterAsync(Guid jobId)
{
var result = new List<Guid>();
var job = await jobService
.Get().AsNoTracking()
@@ -44,6 +45,14 @@ namespace PARR.DAL.DomainServices.Implementations
if (job == null)
return null;
return await GetUnitsIdByJobFilterAsync(job);
}
public async Task<IEnumerable<Guid>?> GetUnitsIdByJobFilterAsync(Job job)
{
var result = new List<Guid>();
var baseQuery = unitService
.Get().AsNoTracking()
.Include(t => t.UnitValues)
@@ -110,6 +119,8 @@ namespace PARR.DAL.DomainServices.Implementations
return result;
}
public async Task<IEnumerable<Guid>?> GetUnitsIdForExistTemplatesByJobFilterAsync(Guid jobId)
{
var unitIdsMustBeCreated = await GetUnitsIdByJobFilterAsync(jobId);