public IActionResult ClearHelpdesk([FromRoute] int id)
        {
            if (!IsAuthorized())
            {
                return(Unauthorized());
            }

            try
            {
                var facade   = new HelpdeskFacade();
                var response = facade.ForceCheckoutQueueRemove(id);

                switch (response.Status)
                {
                case HttpStatusCode.OK:
                    return(Ok(response));

                case HttpStatusCode.InternalServerError:
                    return(StatusCode(StatusCodes.Status500InternalServerError));
                }
                s_logger.Fatal("This code should be unreachable, unknown result has occured.");
            }
            catch (Exception ex)
            {
                s_logger.Error(ex, "Unable to clear helpdesk queue and/or check ins.");
            }
            return(StatusCode(StatusCodes.Status500InternalServerError));
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                var facade      = new HelpdeskFacade();
                var helpdeskIds = facade.GetHelpdesks().Helpdesks.Select(h => h.HelpdeskID).ToList();

                foreach (int id in helpdeskIds)
                {
                    ForceCheckoutQueueRemoveResponse result = facade.ForceCheckoutQueueRemove(id);
                    if (result.Status != HttpStatusCode.OK)
                    {
                        foreach (StatusMessage message in result.StatusMessages)
                        {
                            s_logger.Error(message);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                s_logger.Error(ex, "Unable to remove queue items and check-ins.");
            }
            return(Task.CompletedTask);
        }