feat(templateTaskGenerator): Написан TemplateTaskGenerator, читает очередь Mq parr-template-task-generator при получении id регламентной работы проверяет несозданные шаблоны. При наличии таковых пишет сообщение в очередь parr-template-generator

This commit is contained in:
Mikhail Kuznetsov
2025-08-26 12:04:26 +10:00
parent a6385ea39a
commit 446a5579f3
21 changed files with 465 additions and 6 deletions

View File

@@ -0,0 +1,36 @@
using Microsoft.Extensions.Logging;
using PARR.DAL.Services.Interfaces.Job;
namespace PARR.TemplateTaskGenerator.Services
{
internal class ValidatorService : IValidatorService
{
private readonly ILogger<ValidatorService> logger;
private readonly IJobService jobService;
public ValidatorService(
ILogger<ValidatorService> logger,
IJobService jobService
)
{
this.logger = logger;
this.jobService = jobService;
}
public async Task<bool> IsValidAsync(Guid jobId)
{
var isExist = await jobService.GetAsync(jobId);
if (isExist == null)
{
logger.LogError($"Не найдена регалментная работа {nameof(jobId)}: {jobId}");
return false;
}
return true;
}
}
}