public async Task CompleteRepairApprovalTaskAsync(AuditRepairModel model)
 {
     var taskId = await GetTaskIdAsync(model.IncidentId);
     var value = new
     {
         Status = "Completed",
         PercentComplete = 1,
         TaskOutcome = model.Result.ToString()
     };
     await UpdateTaskAsync(taskId, value);
 }
        public async Task<ActionResult> AuditRepair(AuditRepairModel model)
        {
            var sharePointToken = await AuthenticationHelper.GetAccessTokenAsync(AppSettings.DemoSiteServiceResourceId);
            Dashboard dashboardModel = new Dashboard(sharePointToken);

            var tasksService = new TasksService(sharePointToken);
            await tasksService.CompleteRepairApprovalTaskAsync(model);

            if (model.Result == ApprovalResult.Approved)
                await dashboardModel.ApproveRepairAsync(model.IncidentId);

            return RedirectToAction("Index");
        }