canConfirmOrder = $canConfirmOrder; $this->generateOrderStepsProcessor = $generateOrderStepsProcessor; $this->fetchesOrder = $fetchesOrder; $this->updatesOrderStep = $updatesOrderStep; } public function execute(int $orderId, array $contract_obligation_list = [], array $orderRoles=[] ){ $order_object = new OrderObject(0,'','',0,0, '',$orderId,0,0); $this->canConfirmOrder->passes($order_object); $order = $this->fetchesOrder->execute(['id'=>$order_object->getId()]); //Only Processing Step is created at this point $orderStep = $order->orderSteps[0]; $orderStepObject = new OrderStepsObject( $order->id, 0, $orderStep->reference, true, $orderStep->sequence, OrderStatus::COMPLETE, 0, date('Y-m-d H:i:s'), $orderStep->id, $orderStep->hash_id ); //Update PROCESSING to completed $updatedOrderStep = $this->updatesOrderStep->execute($orderStep, $orderStepObject); //Generate Order Steps base on Contract from Unity $this->generateOrderStepsProcessor->execute($order, $contract_obligation_list, $orderRoles); } }