using System.Linq;

namespace Sevomin.Models.Repositories
{
    public interface IRepository<K, T>
    {
        void Add(T entity);
        T Find(K identifier);
        void Delete(T entity);
        void Save();
    }

    public interface IUserRepository : IRepository<string, User>
    {
        User FindWithConfirmationCode(string code);
    }

    public interface IJobRepository : IRepository<long ,Job>
    {
        Job GetEmptyJobFor(Avalin avalin);
        IQueryable<Job> ListAll();
        DovominJob Apply(Dovomin dovomin, Job job, string coverLetter);
    }

    public interface IParameterRepository : IRepository<long, Parameter>
    {
        IQueryable<Parameter> ListAll();
        void AddParametersToDovomin(Dovomin dovomin);
    }
}