/// <summary>
        /// this method returns all the Reportees of an employee
        /// </summary>
        /// <param name="employeeId"></param>
        /// <returns></returns>
        public async Task <List <GetEmployeeListDto> > GetAllReporteeAsync(Guid employeeId)
        {
            var reportee = await _reportingManagerRepository.GetAllReporteeAsync(employeeId);

            List <GetEmployeeListDto> reporteeDetailsList = new List <GetEmployeeListDto>();

            foreach (var r in reportee)
            {
                var empDetails = await _employeeRepository.GetEmployeeInformationAsync(r);

                var reporteeDetails = new GetEmployeeListDto
                {
                    Name = string.Format("{0} {1} {2}", empDetails.FirstName, empDetails.MiddleName, empDetails.LastName),
                    Id   = empDetails.Id
                };
                reporteeDetailsList.Add(reporteeDetails);
            }
            return(reporteeDetailsList);
        }
        /// <summary>
        /// this method is used to soft delete an existing employee's data in the system
        /// </summary>
        /// <param name="employeeId">id to indentify the employee to be deleted</param>
        public async Task DeleteEmployeeAsync(Guid employeeId)
        {
            var empId = await _employeeRepository.GetEmployeeByIdAsync(employeeId);

            if (empId == null)
            {
                throw new Exception("Employee not found");
            }
            empId.IsDeleted = true;

            await _employeeRepository.SaveChangesAsync();

            var empSkills = await _employeeSkillRepository.GetEmployeeSkills(empId.Id);

            if (empSkills == null)
            {
                throw new Exception("Employee skills not found");
            }
            empSkills.IsDeleted = true;
            await _employeeSkillRepository.SaveChangesAsync();

            //* These methods of Project management Service (RemoveProjectManagerForEmployee,RemoveReportingManagerForEmployee,RemoveEmployeeFromProject) should have been used but we could not call the interface because of cyclic dependency*//
            // this will set ProjectReportingManager to null for employee who had this Employee as an ProjectReportingManager
            var reportee = await _reportingManagerRepository.GetAllReporteeAsync(empId.Id);

            foreach (var employee in reportee)
            {
                var empDetails = await _reportingManagerRepository.GetReportingManager(employee);

                _reportingManagerRepository.DeleteRecord(empDetails);
                await _reportingManagerRepository.SaveChangesAsync();
            }
            var listOfReportees = await _projectManagementRepository.GetAllReporteeAsync(empId.Id);

            foreach (var employee in listOfReportees)
            {
                employee.ProjectReportingManager = null;
                await _projectManagementRepository.SaveChangesAsync();
            }
            var empProject = await _projectManagementRepository.GetAllProjectsOfEmployee(empId.Id);

            foreach (var project in empProject)
            {
                if (project.IsManager == true)
                {
                    var listOfEmployees = await _projectManagementRepository.GetEmployeesOfProjectManager(empId.Id);

                    foreach (var employee in listOfEmployees)
                    {
                        employee.ProjectManager = null;
                        await _projectManagementRepository.SaveChangesAsync();
                    }

                    var projectManagement = await _projectManagementRepository.FindProjectEmployee((Guid)project.ProjectId, empId.Id);

                    var projectRequirement = await _projectRequirementsRepository.GetRequirement(projectManagement.RequirementId);

                    projectManagement.IsDeleted         = true;
                    projectManagement.AllocationEndDate = DateTime.UtcNow;

                    if (projectRequirement != null)
                    {
                        projectRequirement.IsFullfilled = false;
                    }

                    using (var ts = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
                    {
                        await _projectManagementRepository.SaveChangesAsync();

                        await _projectRequirementsRepository.SaveChangesAsync();

                        ts.Complete();
                    }
                }
            }
        }