using Microsoft.EntityFrameworkCore;
using Monitoring.Core.Domain.EventManagement;
using Monitoring.Infrastructure.Data;

namespace Monitoring.Features.AlarmManagement.Skippers;

internal sealed class CamerasViewedStatusSkipper(IDataContext dataContext) : ISkipper
{
	public async Task<bool> Test(AlarmScope scope, AlarmScopeStatus status)
	{
		var hasResponsiblePersons = await dataContext.ResponsiblePersons.AnyAsync(x =>
			x.AssetId == scope.AssetId
		);
		return !hasResponsiblePersons;
	}
}
