using ReAct_PME.Infrastructure;
using ReAct_PME.Domain;


namespace ReAct_PME.Application
{
    public partial class DT_WORK_FORCEService(IDT_WORK_FORCERepository dt_work_forceRepository) : IDT_WORK_FORCEService
    {
		#region CRUD de la table DT_WORK_FORCE
		public async Task<bool> Create_Async(DT_WORK_FORCE_DTO dt_work_force)
		{
			if (await dt_work_forceRepository.GetById_Async(dt_work_force.ID_WORK_FORCE) != null)
			{
				return false;
			}
			return await dt_work_forceRepository.Create_Async(dt_work_force);
		}

		public async Task<bool> Update_Async(Guid ID_WORK_FORCE, DT_WORK_FORCE_DTO updatedDT_WORK_FORCE)
		{
			return await dt_work_forceRepository.Update_Async(ID_WORK_FORCE, updatedDT_WORK_FORCE);
		}

		public async Task<bool> Update_Password_Async(Guid ID_WORK_FORCE, DT_WORK_FORCE_DTO updatedDT_WORK_FORCE)
		{
			return await dt_work_forceRepository.Update_Password_Async(ID_WORK_FORCE, updatedDT_WORK_FORCE);
		}

		public async Task<bool> Delete_Async(Guid ID_WORK_FORCE)
		{
			return await dt_work_forceRepository.Delete_Async(ID_WORK_FORCE);
		}

		public async Task<IEnumerable<DT_WORK_FORCE_DTO>> GetAll_Async(bool IsActifOnly=false)
		{
			return await dt_work_forceRepository.GetAll_Async(IsActifOnly);
		}

		public async Task<DT_WORK_FORCE_DTO?> GetById_Async(Guid ID_WORK_FORCE)
		{
			return await dt_work_forceRepository.GetById_Async(ID_WORK_FORCE);
		}

		#endregion



    }
}
