using ReAct_PME.Infrastructure;
using ReAct_PME.Domain;


namespace ReAct_PME.Application
{
    public partial class DT_LOGSService(IDT_LOGSRepository dt_logsRepository) : IDT_LOGSService
    {
		#region CRUD de la table DT_LOGS
		public async Task<bool> Create_Async(DT_LOGS_DTO dt_logs)
		{
			if (await dt_logsRepository.GetById_Async(dt_logs.ID) != null)
			{
				return false;
			}
			return await dt_logsRepository.Create_Async(dt_logs);
		}

		public async Task<bool> Update_Async(Guid ID, DT_LOGS_DTO updatedDT_LOGS)
		{
			return await dt_logsRepository.Update_Async(ID, updatedDT_LOGS);
		}

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

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

		public async Task<DT_LOGS_DTO?> GetById_Async(Guid ID)
		{
			return await dt_logsRepository.GetById_Async(ID);
		}

		#endregion

		#region By_ID_WORK_FORCE
		public async Task<IEnumerable<DT_LOGS_DTO>> GetAll_By_ID_WORK_FORCE_Async(Guid ID_WORK_FORCE)
		{
			return await dt_logsRepository.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_logsRepository.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_logsRepository.Delete_By_ID_WORK_FORCE_Async(ID_WORK_FORCE);
		}

		#endregion



    }
}
