This commit is contained in:
mmrbnjd
2025-07-29 00:00:16 +03:30
parent ea152671d6
commit cb8e8146b5
6 changed files with 281 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ namespace Hushian.Application.Services
IsRead = ss.IsRead,
text = ss.Text,
Type = ss.Type
})
}).ToList()
}).ToListAsync();
public async Task<List<ChatItemDto>> GetChatsByCompanyID(int CompanyID, ConversationStatus status)
@@ -88,7 +88,7 @@ namespace Hushian.Application.Services
IsRead = ss.IsRead,
text = ss.Text,
Type = ss.Type
})
}).ToList()
}).ToListAsync();
public async Task<List<ChatItemDto>> ChatsAwaitingOurResponse(int CompanyID)
@@ -122,7 +122,7 @@ namespace Hushian.Application.Services
IsRead = ss.IsRead,
text = ss.Text,
Type = ss.Type
})
}).ToList()
}).ToListAsync();
//------------------------
@@ -242,5 +242,20 @@ namespace Hushian.Application.Services
return Response;
}
public async Task<bool> FinishChat(int ChatID)
{
var convModel = await _ConversationRepository.Get()
.Include(inc => inc.ConversationResponses)
.FirstOrDefaultAsync(w => w.ID == ChatID);
if (convModel != null && convModel.Status != ConversationStatus.Finished)
{
convModel.Status = ConversationStatus.Finished;
convModel.FinishedDateTime = DateTime.Now;
return await _ConversationRepository.UPDATEBool(convModel);
}
return true;
}
}
}