feat(templateMatcher): Рефакторинг, основной метод синхронизации GroupedTemplateSynchronizer разбит на отдельные классы; Неиспользуемые шаблоны теперь привязываются к ЭК КОСМПЛЕКСЫ-[ЗО].
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.Core.Repositories.Interfaces.Job;
|
||||
using PARR.TemplateMatcher.Services.Interfaces;
|
||||
|
||||
namespace PARR.TemplateMatcher.Services.Implemetaions
|
||||
{
|
||||
internal class JobValidatorService : IJobValidatorService
|
||||
{
|
||||
private readonly ILogger<IJobValidatorService> logger;
|
||||
private readonly IJobRepository jobService;
|
||||
|
||||
public JobValidatorService(
|
||||
ILogger<IJobValidatorService> logger,
|
||||
IJobRepository jobService
|
||||
)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.jobService = jobService;
|
||||
}
|
||||
public async Task<bool> IsValidJobAsync(Guid jobId)
|
||||
{
|
||||
var isExist = await jobService.GetAsync(jobId);
|
||||
|
||||
if (isExist == null)
|
||||
{
|
||||
logger.LogError($"Не найдена регалментная работа {nameof(jobId)}: {jobId}");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user