using OrderCriterias;
using System.Collections.ObjectModel;
namespace ManagerInterfaces
{
///
/// All methods to handle answers
/// /!\ all methods returns a task
///
/// a DTO, Entity or Model answer
public interface IAnswerManager
{
///
/// get the number of answers
///
/// the number of answers
public int getNbAnswers();
///
/// get a part of all answers
///
/// the actual page
/// number of answers in a page
/// the order criteria
///
/// a set of the number of page and
/// all answers in the database for
/// the page nb (or null if the page
/// does not exist (<=> (nb-1)*count outside
/// boundaries (0, getNbElement()-1)))
///
public Task<(int nbPages, IEnumerable? answers)> getAnswers(int nb, int count, AnswerOrderCriteria orderCriteria = AnswerOrderCriteria.ById);
///
/// get some answers that answer to a question
///
/// the id of the question
///
/// a set of all answers that answer to this question
///
public Task?> getAnswersByIdQuestion(int id);
///
/// modified an answer with an id
///
/// the id of the answer
/// an answer that contains all modified properties
///
/// the answer (modified) that corresponde
/// to the id or null if there isn't any
///
public Task updateAnswer(int id, T answer);
///
/// delete an answer with an id
///
/// the id of the answer
///
/// the answer deleted that corresponde
/// to the id or null if there isn't any
///
public Task removeAnswer(int id);
///
/// delete an answer
///
/// the answer to delete
/// the answer removed or null if there wasn't any
public Task removeAnswer(T answer);
///
/// add an answer
///
/// the answer to add
///
/// the element that corresponde to
/// the answer added or the answer equal to this
/// answer if this answer was already added
///
public Task addAnswer(T answer);
///
/// get an answer with an id
///
/// the id of the answer
///
/// the answer that corresponde
/// to the id or null if there isn't any
///
public Task getAnswer(int id);
}
}