...
This commit is contained in:
@@ -272,11 +272,12 @@ namespace Hushian.Application.Services
|
||||
|
||||
return Response;
|
||||
}
|
||||
public async Task<bool> FinishChat(int ChatID, int CompanyID)
|
||||
public async Task<bool> FinishChat(int ChatID, int CompanyID,int? ExperID)
|
||||
{
|
||||
var convModel = await _ConversationRepository.Get()
|
||||
.Include(inc => inc.ConversationResponses)
|
||||
.FirstOrDefaultAsync(w => w.ID == ChatID && w.CompanyID==CompanyID);
|
||||
if (ExperID.HasValue && !convModel.ConversationResponses.Any(a => a.ExperID == ExperID.Value)) return false;
|
||||
|
||||
if (convModel != null && convModel.Status != ConversationStatus.Finished)
|
||||
{
|
||||
@@ -293,8 +294,9 @@ namespace Hushian.Application.Services
|
||||
.Include(inc => inc.ConversationResponses)
|
||||
.FirstOrDefaultAsync(w =>
|
||||
w.ID == ChatID
|
||||
&& w.CompanyID == CompanyID
|
||||
&& ExperID.HasValue ? w.ConversationResponses.Any(a=>a.ExperID==ExperID.GetValueOrDefault()) :true);
|
||||
&& w.CompanyID == CompanyID);
|
||||
|
||||
if (ExperID.HasValue && !convModel.ConversationResponses.Any(a => a.ExperID == ExperID.Value)) return false;
|
||||
|
||||
if (convModel != null && convModel.Status == ConversationStatus.Finished)
|
||||
{
|
||||
|
Reference in New Issue
Block a user