using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Predictalytics.Domain.Entities;
using Predictalytics.Domain.Enums;

namespace Predictalytics.Domain.Interfaces;

public interface IJobRepository
{
    Task<BackgroundJob?> GetByIdAsync(int id, CancellationToken ct = default);
    Task<IReadOnlyList<BackgroundJob>> GetAllAsync(int skip = 0, int take = 50, CancellationToken ct = default);
    Task<BackgroundJob?> GetNextPendingJobAsync(JobType type, CancellationToken ct = default);
    Task AddAsync(BackgroundJob job, CancellationToken ct = default);
    Task UpdateAsync(BackgroundJob job, CancellationToken ct = default);
    Task ResetHungJobsAsync(CancellationToken ct = default);
}
