using ReAct_PME.Infrastructure;
using ReAct_PME.Domain;


namespace ReAct_PME.Application
{
    public partial class DT_WORK_FORCE_ROLEService(IDT_WORK_FORCE_ROLERepository dt_work_force_roleRepository) : IDT_WORK_FORCE_ROLEService
    {
		#region CRUD de la table DT_WORK_FORCE_ROLE
		public async Task<bool> Create_Async(DT_WORK_FORCE_ROLE_DTO dt_work_force_role)
		{
			if (await dt_work_force_roleRepository.GetById_Async(dt_work_force_role.ID_WORK_FORCE_ROLE) != null)
			{
				return false;
			}
			return await dt_work_force_roleRepository.Create_Async(dt_work_force_role);
		}

		public async Task<bool> Update_Async(Guid ID_WORK_FORCE_ROLE, DT_WORK_FORCE_ROLE_DTO updatedDT_WORK_FORCE_ROLE)
		{
			return await dt_work_force_roleRepository.Update_Async(ID_WORK_FORCE_ROLE, updatedDT_WORK_FORCE_ROLE);
		}

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

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

		public async Task<DT_WORK_FORCE_ROLE_DTO?> GetById_Async(Guid ID_WORK_FORCE_ROLE)
		{
			return await dt_work_force_roleRepository.GetById_Async(ID_WORK_FORCE_ROLE);
		}

		#endregion

		#region By_ID_WORK_FORCE
		public async Task<IEnumerable<DT_WORK_FORCE_ROLE_DTO>> GetAll_By_ID_WORK_FORCE_Async(Guid ID_WORK_FORCE)
		{
			return await dt_work_force_roleRepository.GetAll_By_ID_WORK_FORCE_Async(ID_WORK_FORCE);
		}

		public async Task<int> GetCount_By_ID_WORK_FORCE_Async(Guid ID_WORK_FORCE)
		{
			return await dt_work_force_roleRepository.GetCount_By_ID_WORK_FORCE_Async(ID_WORK_FORCE);
		}

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

		#endregion

		#region By_ID_ROLE
		public async Task<IEnumerable<DT_WORK_FORCE_ROLE_DTO>> GetAll_By_ID_ROLE_Async(Guid ID_ROLE)
		{
			return await dt_work_force_roleRepository.GetAll_By_ID_ROLE_Async(ID_ROLE);
		}

		public async Task<int> GetCount_By_ID_ROLE_Async(Guid ID_ROLE)
		{
			return await dt_work_force_roleRepository.GetCount_By_ID_ROLE_Async(ID_ROLE);
		}

		public async Task<bool> Delete_By_ID_ROLE_Async(Guid ID_ROLE)
		{
			return await dt_work_force_roleRepository.Delete_By_ID_ROLE_Async(ID_ROLE);
		}

		#endregion



    }
}
