private bool ValidateOrderRequest(Customer customer, OrderRequest order) { bool productsExist = ValidateProducts(order); if (!productsExist) { return(false); } var taxes = calculator.CalculateTaxes(order, customer); var discount = calculator.CalculateDiscount(order, customer); bool approvalResponse = orderApproval.Approve(new ApproveRequest { Customer = customer, Order = order, Taxes = taxes, Discount = discount }); return(approvalResponse); }
public async Task <WorkflowStatus> ProcessAuditorApproval( [ActivityTrigger] DurableActivityContext context, ILogger log) { var data = context.GetInput <ProcessAuditorApprovalData>(); if (data.ApprovalEventData.Result) { await _approvalService.Approve(data.WorkflowId, data.ApprovalEventData.Auditor); } else { await _approvalService.Deny(data.WorkflowId, data.ApprovalEventData.Auditor); } if (await _approvalService.IsParticipantInWaitingState(data.WorkflowId)) { return(WorkflowStatus.InApproval); } await _approvalService.SetStatus(data.WorkflowId, WorkflowStatus.ApprovalCompleted); return(WorkflowStatus.ApprovalCompleted); }
public Task Approve([FromBody] NotificationApprovalViewModel inputModel) => approvalService.Approve(inputModel.Id, Guid.Parse(LoggedUserId));
private async Task ApproveCost(Guid costId, UserIdentity userIdentity) { await _approvalService.Approve(costId, userIdentity, BuType.Pg, SourceSystem.Coupa); }