feat(templateMatcher,dal): Первая реализация SyncTemplatesForJobGroup для сгруппированных типов групп регламентных работ.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Services.Interfaces.Job;
|
||||
using PARR.TemplateMatcher.Services.Interfaces;
|
||||
|
||||
namespace PARR.TemplateMatcher.Services.Implemetaions
|
||||
{
|
||||
internal class JobGroupValidatorService : IJobGroupValidatorService
|
||||
{
|
||||
private readonly ILogger<IJobValidatorService> logger;
|
||||
private readonly IJobGroupService jobGroupService;
|
||||
|
||||
public JobGroupValidatorService(
|
||||
ILogger<IJobValidatorService> logger,
|
||||
IJobGroupService jobGroupService
|
||||
)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.jobGroupService = jobGroupService;
|
||||
}
|
||||
public async Task<bool> IsValidJobGroupAsync(Guid jobGroupId)
|
||||
{
|
||||
var isExist = await jobGroupService.GetAsync(jobGroupId);
|
||||
|
||||
if (isExist == null)
|
||||
{
|
||||
logger.LogError($"Не найдена регалментная работа {nameof(jobGroupId)}: {jobGroupId}");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace PARR.TemplateMatcher.Services.Implemetaions
|
||||
this.logger = logger;
|
||||
this.jobService = jobService;
|
||||
}
|
||||
public async Task<bool> IsValidAsync(Guid jobId)
|
||||
public async Task<bool> IsValidJobAsync(Guid jobId)
|
||||
{
|
||||
var isExist = await jobService.GetAsync(jobId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user