using ReAct_PME.Infrastructure;
using ReAct_PME.Domain;


namespace ReAct_PME.Application
{
    public partial class DT_CONVERSATIONService(IDT_CONVERSATIONRepository dt_conversationRepository) : IDT_CONVERSATIONService
    {
		#region CRUD de la table DT_CONVERSATION
		public async Task<bool> Create_Async(DT_CONVERSATION_DTO dt_conversation)
		{
			if (await dt_conversationRepository.GetById_Async(dt_conversation.ID_CONVERSATION) != null)
			{
				return false;
			}
			return await dt_conversationRepository.Create_Async(dt_conversation);
		}

		public async Task<bool> Update_Async(Guid ID_CONVERSATION, DT_CONVERSATION_DTO updatedDT_CONVERSATION)
		{
			return await dt_conversationRepository.Update_Async(ID_CONVERSATION, updatedDT_CONVERSATION);
		}

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

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

		public async Task<DT_CONVERSATION_DTO?> GetById_Async(Guid ID_CONVERSATION)
		{
			return await dt_conversationRepository.GetById_Async(ID_CONVERSATION);
		}

		#endregion

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

		#endregion



    }
}
