using OrderCriterias;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ManagerInterfaces
{
///
/// All methods to handle administrators
/// /!\ all methods returns a task
///
/// a DTO, Entity or Model administrator
public interface IAdministratorManager
{
///
/// get the number of administrators
///
/// the number of administrators
public int getNbAdmins();
///
/// add an administrator
///
/// the administrator to add
///
/// the element that correspond to
/// the administrator added or the administrator equal to this
/// administrator if this administrator was already added
///
public Task addAdmin(T admin);
///
/// remove an administrators
///
/// the administrator to remove
/// the administrator removed or null if there isn't any
public Task removeAdmin(T admin);
///
/// remove an administrator
///
/// the id of the administrator to remove
/// the administrator removed or null if there isn't any
public Task removeAdmin(int id);
///
/// get a part of all administrators
///
/// the actual page
/// number of administrators in a page
/// the order criteria
///
/// a set of the number of page and
/// all administrators 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? administrators)> getAdministrators(int page, int count, AdministratorOrderCriteria orderCriteria = AdministratorOrderCriteria.ById);
///
/// get an administrator by his identifier
///
/// the identifier of the administrator
/// the administrator that corresponde or null if there isn't any
public Task getAdministrator(int id);
///
/// get an administrator by his username
///
/// the username of the administrator
/// the administrator that corresponde or null if there isn't any
public Task getAdministratorByUsername(string username);
///
/// set the password of an administrator
///
/// the username of the administrator
/// the hash of the new password
///
/// true if the password was sucessful change
/// false otherwise (no administrator with this username
///
public Task setPassword(string username, string newHashedPassword);
///
/// upadte an administrator
///
/// the id of the administrator to update
/// the admin that contains all properties to modify
/// the administrator updated or null if he don't exist
public Task updateAdministrator(int id, T admin);
}
}