/// <inheritdoc/> public async Task <SwapShiftResponse> SubmitApprovalAsync( string jSession, string reqId, string personNumber, string status, string querySpan, Comments comments, Uri endpointUrl) { var telemetryProps = new Dictionary <string, string>() { { "KronosRequestId", reqId }, { "KronosPersonNumber", personNumber }, { "KronosStatus", status }, }; this.telemetryClient.TrackTrace($"SwapShiftActivity - SubmitApprovalAsync starts: {DateTime.UtcNow.ToString("O", CultureInfo.InvariantCulture)}", telemetryProps); string xmlRequest = CommonRequests.CreateUpdateStatusRequest(personNumber, reqId, status, querySpan, comments); var tupleResponse = await this.apiHelper.SendSoapPostRequestAsync( endpointUrl, SoapEnvOpen, xmlRequest, SoapEnvClose, jSession).ConfigureAwait(false); this.telemetryClient.TrackTrace($"SwapShiftActivity - SubmitApprovalAsync ends: {DateTime.UtcNow.ToString("O", CultureInfo.InvariantCulture)}", telemetryProps); return(tupleResponse.ProcessResponse <SwapShiftResponse>(this.telemetryClient)); }
/// <inheritdoc/> public async Task <FetchApprovalResponse> ApproveOrDenySwapShiftRequestsForUserAsync( Uri endPointUrl, string jSession, string queryDateSpan, string kronosPersonNumber, bool approved, Comments comments, string kronosId) { var status = approved ? ApiConstants.ApprovedStatus : ApiConstants.Refused; var swapShiftApprovalRequest = CommonRequests.CreateUpdateStatusRequest(kronosPersonNumber, kronosId, status, queryDateSpan, comments); var tupleResponse = await this.apiHelper.SendSoapPostRequestAsync( endPointUrl, SoapEnvOpen, swapShiftApprovalRequest, SoapEnvClose, jSession).ConfigureAwait(false); this.telemetryClient.TrackTrace( "ShiftSwapActivity - ApproveOrDenySwapShiftRequestsForUserAsync", new Dictionary <string, string>() { { "Response", tupleResponse.Item1 } }); return(tupleResponse.ProcessResponse <FetchApprovalResponse>(this.telemetryClient)); }
/// <inheritdoc/> public async Task <Models.ResponseEntities.OpenShiftRequest.ApproveDecline.Response> ApproveOrDenyOpenShiftRequestsForUserAsync( Uri endPointUrl, string jSession, string queryDateSpan, string kronosPersonNumber, bool approved, string kronosId, Comments comments) { var status = approved ? ApiConstants.ApprovedStatus : ApiConstants.Refused; var xmlOpenShiftApprovalRequest = CommonRequests.CreateUpdateStatusRequest(kronosPersonNumber, kronosId, status, queryDateSpan, comments); var tupleResponse = await this.apiHelper.SendSoapPostRequestAsync( endPointUrl, ApiConstants.SoapEnvOpen, xmlOpenShiftApprovalRequest, ApiConstants.SoapEnvClose, jSession).ConfigureAwait(false); this.telemetryClient.TrackTrace( "OpenShiftActivity - ApproveOrDenyOpenShiftRequestsForUserAsync", new Dictionary <string, string>() { { "Response", tupleResponse.Item1 } }); return(this.ProcessOpenShiftsApprovedDeclinedResponse(tupleResponse.Item1)); }