/// <summary> /// this method is used to get all the base features of given employee /// </summary> /// <param name="employeeId">employee guid</param> /// <returns>it will return all base features list </returns> public async Task <List <string> > GetEmployeeBaseFeaturesAsync(Guid employeeId) { var basicConfiguration = new BasicConfiguration(); var employeeDepartmentDesignationId = (await _employeeRepository.GetEmployeeByIdAsync(employeeId))?.DepartmentDesignationId; if (employeeDepartmentDesignationId.HasValue) { var employeeLevel = (await _levelRepository.GetLevelIdMappedToDesignationDepartment(employeeDepartmentDesignationId.Value)).LevelId; if (employeeLevel > 0) { basicConfiguration = await _levelService.GetFeaturesMappedToLevelAsync(employeeLevel); } } var result = new List <string>(); if (basicConfiguration != null) { result = JsonConvert.DeserializeObject <List <string> >(basicConfiguration.AccessibleFeaturesList); } return(result); }
public async Task <ActionResult <FeatureLevelDetailsDto> > GetFeaturesMappedToLevelAsync(int levelId) { var result = await _levelService.GetFeaturesMappedToLevelAsync(levelId); return(Ok(result)); }