/// <summary>
        /// Retrieves ONLY the specified system department.
        /// </summary>
        /// <param name="id">System department unique identifier (GUID).</param>
        /// <param name="flattenHierarchy">True ~ Return departments in a flattened list. False ~ Return departments in parent/child hierarchy.</param>
        /// <param name="includeSubDepartments">True ~ include associated sub-departments. False ~ do NOT include associated sub-deparments.</param>
        /// <param name="includeDeletedItems">True ~ Include system departments that have been 'deleted'. False ~ Only include 'non-deleted' system departments.</param>
        /// <returns></returns>
        public async Task <SystemDepartmentModel> GetItem(string id, bool includeSubDepartments = true, bool includeDeletedItems = false)
        {
            var systemDepartments = await _systemDepartmentsManager.GetItemsAsync();

            if (systemDepartments == null || !systemDepartments.Any())
            {
                throw new DepartmentsNotFoundException();
            }
            var systemDepartmentsModel = SystemDepartmentModel.Construct(systemDepartments);

            var systemDepartment = systemDepartments.SingleOrDefault(x => x.Id == id);

            if (systemDepartment == null || systemDepartment.IsDeleted)
            {
                throw new DepartmentNotFoundException(id);
            }


            var systemDepartmentModel = new SystemDepartmentModel(systemDepartment);

            if (includeSubDepartments)
            {
                systemDepartmentModel.SubDepartments = await GetSubDepartments(systemDepartmentsModel, systemDepartmentModel, id);
            }

            return(systemDepartmentModel);
        }
        /// <summary>
        /// Retrieves all system departments.
        /// </summary>
        /// <param name="flattenHierarchy">True ~ Return departments in a flattened list. False ~ Return departments in parent/child hierarchy.</param>
        /// <param name="includeDeletedItems">True ~ Include system departments that have been 'deleted'. False ~ Only include 'non-deleted' system departments.</param>
        /// <returns></returns>
        public async Task <IEnumerable <SystemDepartmentModel> > GetItems(bool flattenHierarchy = false, bool includeDeletedItems = false)
        {
            var systemDepartments = await _systemDepartmentsManager.GetItemsAsync();

            if (systemDepartments == null || !systemDepartments.Any())
            {
                throw new DepartmentsNotFoundException();
            }

            var systemDepartmentsModel = SystemDepartmentModel.Construct(systemDepartments);    //  Utilize flattened list of system departments to search (only hit DB once).

            if (!flattenHierarchy)
            {
                systemDepartments = systemDepartments.Where(x => x.ParentId == null);                      // Start with parent level items.
            }
            var model = new List <SystemDepartmentModel>();

            foreach (SystemDepartment systemDepartment in systemDepartments)
            {
                var systemDepartmentModel = new SystemDepartmentModel(systemDepartment);
                if (!flattenHierarchy)
                {
                    systemDepartmentModel.SubDepartments = await GetSubDepartments(systemDepartmentsModel, systemDepartmentModel, systemDepartment.Id);
                }
                model.Add(systemDepartmentModel);
            }

            return(model);
        }