private async Task AddAuditTrail(int workOrderId, bookingConfirmation bookingConfirmation) { var update = new JobStatusUpdate { EventTime = DrsHelpers.ConvertFromDrsTimeZone(bookingConfirmation.changedDate), RelatedWorkOrderId = workOrderId, TypeCode = JobStatusUpdateTypeCode.Other_0, OtherType = CustomJobStatusUpdates.AddNote, Comments = $"DRS: Appointment has been updated in DRS to {bookingConfirmation.planningWindowStart.ToDateTime()} - {bookingConfirmation.planningWindowEnd.ToDateTime()} Reason: {bookingConfirmation.bookingReason}" }; await _jobStatusUpdateGateway.CreateJobStatusUpdate(update); }
public async Task Execute(JobStatusUpdate jobStatusUpdate) { var workOrderId = int.Parse(jobStatusUpdate.RelatedWorkOrderReference.ID); var workOrder = await _repairsGateway.GetWorkOrder(workOrderId); var jsu = jobStatusUpdate.ToDb(workOrder); await _strategyFactory.ProcessActions(jsu); workOrder.IsSplit = jobStatusUpdate.IsSplit ?? workOrder.IsSplit; workOrder.IsOvertime = jobStatusUpdate.IsOvertime ?? workOrder.IsOvertime; await _repairsGateway.SaveChangesAsync(); await _jobStatusUpdateGateway.CreateJobStatusUpdate(jsu); }