add conjob insignia

This commit is contained in:
Kittapath 2023-09-08 12:48:17 +07:00
parent 42b1ae87fa
commit ffac27ef76
4 changed files with 70 additions and 18 deletions

View file

@ -290,22 +290,5 @@ namespace BMA.EHR.Insignia.Service.Controllers
return Success();
}
public async Task NotifyInsignia()
{
var insigniaPeriods = await _context.InsigniaPeriods.AsQueryable()
.ToListAsync();
foreach (var insigniaPeriod in insigniaPeriods)
{
if (insigniaPeriod.StartDate.AddDays(-insigniaPeriod.Amount).Date == DateTime.Now.Date)
{
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08db721d-ae67-4ed1-8b3c-490f44a73e65"),
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}"
);
}
}
}
}
}