using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces.Job; using PARR.TemplateMatcher.Services.Interfaces; namespace PARR.TemplateMatcher.Services.Implemetaions { internal class JobGroupValidatorService : IJobGroupValidatorService { private readonly ILogger logger; private readonly IJobGroupRepository jobGroupService; public JobGroupValidatorService( ILogger logger, IJobGroupRepository jobGroupService ) { this.logger = logger; this.jobGroupService = jobGroupService; } public async Task IsValidJobGroupAsync(Guid jobGroupId) { var isExist = await jobGroupService.GetAsync(jobGroupId); if (isExist == null) { logger.LogError($"Не найдена регалментная работа {nameof(jobGroupId)}: {jobGroupId}"); return false; } return true; } } }