//--------------------------------------------------------------------
//     此代码由T4模板自动生成  byzhouhang 20210918
//	   生成时间 2022-07-01 15:33:04 
//     对此文件的更改可能会导致不正确的行为，并且如果重新生成代码，这些更改将会丢失。
//--------------------------------------------------------------------

using IRaCIS.Core.Domain.Models;
using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Domain.Share;
using System.Linq.Expressions;
using IRaCIS.Core.Infra.EFCore.Common;
using System.Linq;

namespace IRaCIS.Core.Application.Service
{
    /// <summary>
    /// 一致性分析配置表
    /// </summary>	
    [ApiExplorerSettings(GroupName = "Trial")]
    public class TaskConsistentRuleService : BaseService, ITaskConsistentRuleService
    {

        private readonly IRepository<TaskConsistentRule> _taskConsistentRuleRepository;
        private readonly IRepository<VisitTask> _visitTaskRepository;
        private readonly IRepository<SubjectUser> _subjectUserRepository;
        private readonly IRepository<Subject> _subjectRepository;
        private readonly IRepository<Enroll> _enrollRepository;

        public TaskConsistentRuleService(IRepository<VisitTask> visitTaskRepository, IRepository<Enroll> enrollRepository, IRepository<TaskConsistentRule> taskConsistentRuleRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<Subject> subjectRepository)
        {
            _taskConsistentRuleRepository = taskConsistentRuleRepository;
            _visitTaskRepository = visitTaskRepository;
            _subjectUserRepository = subjectUserRepository;
            _subjectRepository = subjectRepository;
            _enrollRepository = enrollRepository;
        }


        /// <summary>
        /// 一致性分析列表  (自身 组内  最后勾选 产生的任务)
        /// </summary>
        /// <param name="queryVisitTask"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PageOutput<AnalysisTaskView>> GetAnalysisTaskList(VisitTaskQuery queryVisitTask)
        {
            var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId)
                .Where(t => t.IsAnalysisCreate)

               .WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
               .WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
               .WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
               .WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
               .WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
               .WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
               .WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
               .WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
               .WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
               .WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
               .WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate.Value.AddDays(1))
               .ProjectTo<AnalysisTaskView>(_mapper.ConfigurationProvider);

            var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId) };

            var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);

            return (pageList);
        }


        /// <summary>
        /// 为自身一致性分析医生，选择Subejct 列表
        /// </summary>
        /// <param name="inQuery"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PageOutput<DoctorSelfConsistentSubjectView>> GetDoctorSelfConsistentRuleSubjectList(ConsistentQuery inQuery)
        {
            var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.Id == inQuery.TaskConsistentRuleId);

            var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj, inQuery.DoctorUserId).ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc);

            return pagedList;
        }





        /// <summary>
        /// 确认生成自身一致性分析任务
        /// </summary>
        /// <param name="inCommand"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IResponseOutput> ConfirmGenerateSelfConsistentTask(ConsistentConfirmGenerateCommand inCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
        {
            var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.Id == inCommand.TaskConsistentRuleId);
            var doctorUserId = inCommand.DoctorUserId;

            var list = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj, doctorUserId, inCommand.SubejctIdList).ToListAsync();

            //var (group, query) = GetIQueryableDoctorSelfConsistentRuleSubjectView(filterObj, inCommand.SubejctIdList);

            //var list = query.OrderByDescending(t => t.IsHaveGeneratedTask).ToList();

            foreach (var subject in list)
            {
                //处理 Subject 编号 

                var blindSubjectCode = string.Empty;

                var subjectTask = _visitTaskRepository.Where(t => t.SubjectId == subject.SubjectId).OrderByDescending(t => t.BlindSubjectCode).FirstOrDefault().IfNullThrowException();
                if (subjectTask.BlindSubjectCode != String.Empty)
                {
                    blindSubjectCode = subjectTask.BlindSubjectCode;
                }
                else
                {
                    var maxCodeStr = _visitTaskRepository.Where(t => t.TrialId == subject.TrialId).OrderByDescending(t => t.BlindSubjectCode).Select(t => t.BlindSubjectCode).FirstOrDefault();

                    int maxCodeInt = 0;
                    int.TryParse(maxCodeStr,out maxCodeInt);

                    blindSubjectCode = (maxCodeInt + 1).ToString($"D{filterObj.BlindSubjectNumberOfPlaces}");
                }

                subject.VisitTaskList= subject.VisitTaskList.Take(filterObj.PlanVisitCount).ToList();

                subject.VisitTaskList.ForEach(t =>
                 {
                     t.DoctorUserId = doctorUserId;
                     t.TaskConsistentRuleId = filterObj.Id;
                     t.BlindTrialSiteCode = filterObj.BlindTrialSiteCode;
                     t.BlindSubjectCode = blindSubjectCode;
                 });


                //最后一个访视添加全局

                var globalTask = (subject.VisitTaskList.Last()).Clone();
                globalTask.ReadingCategory = ReadingCategory.Global;
                globalTask.VisitTaskNum += ReadingCommon.TaskNumDic[ReadingCategory.Global];
                subject.VisitTaskList.Add(globalTask);

                await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
                {
                    TrialId = filterObj.TrialId,

                    ReadingCategory = GenerateTaskCategory.SelfConsistent,


                    //产生的过滤掉已经生成的
                    GenerataConsistentTaskList = subject.VisitTaskList.Where(t => t.IsHaveGeneratedTask == false).ToList()
                });

            }


            return ResponseOutput.Ok();


        }



        ///// <summary>
        ///// 组间一致性分析  选择Subejct 列表
        ///// </summary>
        ///// <param name="inQuery"></param>
        ///// <returns></returns>
        //[HttpPost]
        //public async Task<PageOutput<DoctorSelfConsistentSubjectView>> GetGroupConsistentRuleSubjectList(GroupConsistentQuery inQuery)
        //{
        //    var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == false);




        //    var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj).ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc);

        //    return pagedList;
        //}



        ///// <summary>
        ///// 确认生成组间一致性分析任务
        ///// </summary>
        ///// <param name="inCommand"></param>
        ///// <returns></returns>
        //[HttpPost]
        //public async Task<IResponseOutput> ConfirmGenerateGroupConsistentTask(GroupConsistentConfirmGenrateCommand inCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
        //{
        //    throw new BusinessValidationFailedException("正在更新开发ing,不允许操作");

        //    var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.TrialId == inCommand.TrialId && t.IsSelfAnalysis==false);

        //    var list = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj, null, inCommand.SubejctIdList).ToListAsync();



        //    foreach (var subject in list)
        //    {


        //        //subject.VisitTaskList.Take(filterObj.PlanVisitCount).ForEach(t =>
        //        //{
        //        //    t.DoctorUserId = doctorUserId;
        //        //    t.TaskConsistentRuleId = filterObj.Id;

        //        //});


        //        //最后一个访视添加全局
        //        //var globalTask = (subject.VisitTaskList[filterObj.PlanVisitCount - 1]).Clone();
        //        //globalTask.ReadingCategory = ReadingCategory.Global;
        //        //globalTask.VisitTaskNum += ReadingCommon.TaskNumDic[ReadingCategory.Global];
        //        //subject.VisitTaskList.Add(globalTask);

        //        await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
        //        {
        //            TrialId = filterObj.TrialId,

        //            ReadingCategory = GenerateTaskCategory.SelfConsistent,


        //            //产生的过滤掉已经生成的
        //            GenerataConsistentTaskList = subject.VisitTaskList.Where(t => t.IsHaveGeneratedTask == false).ToList()
        //        });

        //    }


        //    return ResponseOutput.Ok();


        //}




        /// <summary>
        /// 仅仅组内一致性时使用（
        /// </summary>
        /// <param name="filterObj"></param>
        /// <param name="doctorUserId"></param>
        /// <param name="subejctIdList"></param>
        /// <returns></returns>
        private IQueryable<DoctorSelfConsistentSubjectView> GetIQueryableDoctorSelfConsistentSubjectView(TaskConsistentRule filterObj, Guid doctorUserId, List<Guid>? subejctIdList = null)
        {
            var trialId = filterObj.TrialId;

            #region Subejct 维度

            Expression<Func<VisitTask, bool>> visitTaskFilter = t => t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Visit && t.DoctorUserId == doctorUserId &&
                                                                      t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect &&
                                                                      t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7) < DateTime.Now &&
                                                                      (t.ReReadingApplyState == ReReadingApplyState.Default || t.ReReadingApplyState == ReReadingApplyState.Reject);


            Expression<Func<VisitTask, bool>> subjectIsHaveGeneratedTaskFilter = c => c.IsAnalysisCreate;

            ////组间一致性
            //if (doctorUserId == null)
            //{
            //    subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c =>  c.IsSelfAnalysis == false);
            //}
            ////组内
            //else
            //{
            //    subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c => c.DoctorUserId == doctorUserId && c.IsSelfAnalysis == true);
            //}

            if (subejctIdList != null && subejctIdList?.Count > 0)
            {
                visitTaskFilter= visitTaskFilter.And(t => subejctIdList.Contains(t.SubjectId));
            }

            //所选访视数量 的访视  其中必有一个访视后有全局任务
            if (filterObj.IsHaveReadingPeriod == true)
            {
                visitTaskFilter = visitTaskFilter.And(t => t.Subject.SubjectVisitTaskList.Any(u => u.VisitTaskNum == t.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]
                                        && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7) < DateTime.Now));
            }

            //var globalWithVisitFilter = visitTaskFilter.And(t => t.VisitTaskNum <=)

            var subjectQuery = _subjectRepository.Where(t => t.TrialId == trialId && t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Count() >= filterObj.PlanVisitCount);


            var query = subjectQuery.Select(t => new DoctorSelfConsistentSubjectView()
            {
                TrialId = t.TrialId,
                SiteId = t.SiteId,
                SubjectCode = t.Code,
                TrialSiteCode = t.TrialSite.TrialSiteCode,
                SubjectId = t.Id,

                BlindSubjectCode=t.SubjectVisitTaskList.Where(t=>t.IsAnalysisCreate).OrderByDescending(t=>t.BlindSubjectCode).Select(t=>t.BlindSubjectCode).FirstOrDefault(),

                IsHaveGeneratedTask = t.SubjectVisitTaskList.Any(c =>  c.DoctorUserId == doctorUserId && c.IsSelfAnalysis == true),


                ValidVisitCount = t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Count(),

                VisitTaskList = t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Select(c => new VisitTaskSimpleDTO()
                {
                    Id = c.Id,
                    ReadingCategory = c.ReadingCategory,
                    ReadingTaskState = c.ReadingTaskState,
                    TaskBlindName = c.TaskBlindName,
                    TaskCode = c.TaskCode,
                    TaskName = c.TaskName,
                    TaskState = c.TaskState,
                    ArmEnum = c.ArmEnum,
                    SubjectId = c.SubjectId,
                    VisitTaskNum = c.VisitTaskNum,
                    TrialId = c.TrialId,

                    //自身一致性才有意义
                    //IsHaveGeneratedTask = c.Subject.SubjectVisitTaskList.Any(t => t.ConsistentAnalysisOriginalTaskId == c.Id),

                    GlobalVisitTaskList = c.Subject.SubjectVisitTaskList.Where(t => t.VisitTaskNum == c.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global] && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7) < DateTime.Now).Select(c => new VisitTaskSimpleDTO()
                    {
                        Id = c.Id,
                        ReadingCategory = c.ReadingCategory,
                        ReadingTaskState = c.ReadingTaskState,
                        TaskBlindName = c.TaskBlindName,
                        TaskCode = c.TaskCode,
                        TaskName = c.TaskName,
                        TaskState = c.TaskState,
                        ArmEnum = c.ArmEnum,
                        SubjectId = c.SubjectId,
                        VisitTaskNum = c.VisitTaskNum,
                        TrialId = c.TrialId,

                    }).ToList(),

                }).OrderBy(t => t.VisitTaskNum).ToList()
            });

            return query.OrderByDescending(t => t.IsHaveGeneratedTask);

            #endregion
        }



        [HttpPost]
        public async Task<TaskConsistentRuleBasic?> GetConsistentRule(TaskConsistentRuleQuery inQuery)
        {
            return await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == inQuery.IsSelfAnalysis).ProjectTo<TaskConsistentRuleBasic>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
        }

        /// <summary>
        /// 自身一致性分配 配置+  统计已经生成数量统计表
        /// </summary>
        /// <param name="inQuery"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<TaskConsistentRuleView>> GetSelfConsistentDoctorStatList(TaskConsistentRuleQuery inQuery)
        {
            var trialId = inQuery.TrialId;

            var taskConsistentRuleQueryable = from enroll in _repository.Where<Enroll>(t => t.TrialId == trialId)
                                              join user in _repository.Where<User>() on enroll.DoctorId equals user.DoctorId
                                              join taskConsistentRule in _repository.Where<TaskConsistentRule>(t => t.TrialId == trialId) on enroll.TrialId equals taskConsistentRule.TrialId
                                              select new TaskConsistentRuleView()
                                              {
                                                  Id = taskConsistentRule.Id,
                                                  CreateTime = taskConsistentRule.CreateTime,
                                                  BlindTrialSiteCode = taskConsistentRule.BlindTrialSiteCode,
                                                  BlindSubjectNumberOfPlaces = taskConsistentRule.BlindSubjectNumberOfPlaces,
                                                  CreateUserId = taskConsistentRule.CreateUserId,
                                                  IntervalWeeks = taskConsistentRule.IntervalWeeks,
                                                  IsEnable = taskConsistentRule.IsEnable,
                                                  PlanSubjectCount = taskConsistentRule.PlanSubjectCount,
                                                  Note = taskConsistentRule.Note,
                                                  TrialId = taskConsistentRule.TrialId,
                                                  UpdateTime = taskConsistentRule.UpdateTime,
                                                  UpdateUserId = taskConsistentRule.UpdateUserId,
                                                  IsGenerateGlobalTask = taskConsistentRule.IsGenerateGlobalTask,
                                                  IsHaveReadingPeriod = taskConsistentRule.IsHaveReadingPeriod,
                                                  PlanVisitCount = taskConsistentRule.PlanVisitCount,

                                                  GeneratedSubjectCount = taskConsistentRule.Trial.VisitTaskList.Where(t => t.IsAnalysisCreate && t.IsSelfAnalysis == true && t.DoctorUserId==user.Id).Select(t => t.SubjectId).Distinct().Count(),

                                                  AnalysisDoctorUser = new UserSimpleInfo()
                                                  {
                                                      UserId = user.Id,
                                                      UserCode = user.UserCode,
                                                      FullName = user.FullName,
                                                      UserName = user.UserName
                                                  }
                                              };



            //if (await _taskConsistentRuleRepository.AnyAsync(t => t.TrialId == inQuery.TrialId))
            //{
            //    var rule = await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId).ProjectTo<TaskConsistentRuleBatchAddOrEdit>(_mapper.ConfigurationProvider).FirstAsync();

            //    rule.IsBatchAdd = true;

            //    await BatchAddOrUpdateTaskConsistentRule(rule);
            //}

            //#endregion

            //var taskConsistentRuleQueryable = _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId)
            // .ProjectTo<TaskConsistentRuleView>(_mapper.ConfigurationProvider);

            return await taskConsistentRuleQueryable.ToListAsync();
        }



        //public async Task<IResponseOutput> BatchAddOrUpdateTaskConsistentRule(TaskConsistentRuleBatchAddOrEdit addOrEdit)
        //{
        //    var trialId = addOrEdit.TrialId;



        //    if (addOrEdit.IsBatchAdd)
        //    {
        //        var query = from enroll in _repository.Where<Enroll>(t => t.TrialId == trialId)
        //                    join user in _repository.Where<User>() on enroll.DoctorId equals user.DoctorId
        //                    join taskConsistentRule in _repository.Where<TaskConsistentRule>(t => t.TrialId == trialId) on user.Id equals taskConsistentRule.AnalysisDoctorUserId into c
        //                    from taskConsistentRule in c.DefaultIfEmpty()
        //                    select new
        //                    {
        //                        TrialId = enroll.TrialId,

        //                        DoctorUserId = user.Id,
        //                        //FullName = user.FullName,
        //                        //UserCode = user.UserCode,
        //                        //UserName = user.UserName,

        //                        IsHaveConfig = taskConsistentRule != null
        //                    };

        //        var doctorList = await query.ToListAsync();


        //        foreach (var doctor in doctorList)
        //        {
        //            if (!doctor.IsHaveConfig)
        //            {
        //                var verifyExp1 = new EntityVerifyExp<TaskConsistentRule>()
        //                {
        //                    VerifyExp = t => t.AnalysisDoctorUserId == doctor.DoctorUserId && t.TrialId == trialId,
        //                    VerifyMsg = "已有该医生配置，不允许继续增加"
        //                };

        //                addOrEdit.AnalysisDoctorUserId = doctor.DoctorUserId;
        //                addOrEdit.Id = Guid.Empty;

        //                var entity = await _taskConsistentRuleRepository.InsertOrUpdateAsync(addOrEdit, true, verifyExp1);
        //            }
        //        }
        //    }
        //    else
        //    {
        //        await _taskConsistentRuleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId, c => new TaskConsistentRule()
        //        {
        //            PlanSubjectCount = c.PlanSubjectCount,
        //            PlanVisitCount = c.PlanVisitCount,
        //            IntervalWeeks = c.IntervalWeeks,
        //            IsGenerateGlobalTask = c.IsGenerateGlobalTask,
        //            IsHaveReadingPeriod = c.IsHaveReadingPeriod

        //        }, true);
        //    }

        //    await _taskConsistentRuleRepository.SaveChangesAsync();

        //    return ResponseOutput.Ok();
        //}



        public async Task<IResponseOutput> AddOrUpdateTaskConsistentRule(TaskConsistentRuleAddOrEdit addOrEditTaskConsistentRule)
        {

            var verifyExp1 = new EntityVerifyExp<TaskConsistentRule>()
            {
                VerifyExp = t => t.TrialId == addOrEditTaskConsistentRule.TrialId && t.IsSelfAnalysis == addOrEditTaskConsistentRule.IsSelfAnalysis,
                VerifyMsg = "已有该项目配置，不允许继续增加"
            };

            if( await _visitTaskRepository.AnyAsync(t=>t.IsSelfAnalysis==addOrEditTaskConsistentRule.IsSelfAnalysis && t.TrialId == addOrEditTaskConsistentRule.TrialId))
            {
                return ResponseOutput.NotOk("已有Subject 生成了任务，不允许修改配置");
            }

            var entity = await _taskConsistentRuleRepository.InsertOrUpdateAsync(addOrEditTaskConsistentRule, true, verifyExp1);

            return ResponseOutput.Ok(entity.Id.ToString());

        }


        [HttpDelete("{taskConsistentRuleId:guid}")]
        public async Task<IResponseOutput> DeleteTaskConsistentRule(Guid taskConsistentRuleId)
        {
            var config = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.Id == taskConsistentRuleId);


            if (await _visitTaskRepository.AnyAsync(t => t.IsAnalysisCreate && t.TrialId == config.TrialId && t.IsSelfAnalysis == config.IsSelfAnalysis))
            {
                throw new BusinessValidationFailedException("已产生一致性分析任务，不允许删除");
            }



            var success = await _taskConsistentRuleRepository.DeleteFromQueryAsync(t => t.Id == taskConsistentRuleId, true);
            return ResponseOutput.Ok();
        }





    }
}
