protected function preBuild()
 {
     $this->entityDTO->isPending = $this->entity->isPending();
     $this->entityDTO->isProcessing = $this->entity->isProcessing();
     $this->entityDTO->isPartiallyShipped = $this->entity->isPartiallyShipped();
     $this->entityDTO->isShipped = $this->entity->isShipped();
     $this->entityDTO->isComplete = $this->entity->isComplete();
     $this->entityDTO->isCanceled = $this->entity->isCanceled();
 }
예제 #2
0
 public function getOrderStatusType()
 {
     return OrderStatusType::pending();
 }
예제 #3
0
 private function setOrderShippedStatus()
 {
     if ($this->isFullyShipped()) {
         $this->setStatus(OrderStatusType::shipped());
     } else {
         $this->setStatus(OrderStatusType::partiallyShipped());
     }
 }
 public function handle(SetOrderStatusCommand $command)
 {
     $this->orderService->setOrderStatus($command->getOrderId(), OrderStatusType::createById($command->getOrderStatusTypeId()));
 }
예제 #5
0
 public function testSetOrderStatusLocksAttachments()
 {
     $order1 = $this->getPersistedOrderWith2ItemsWithAttachments();
     $this->setCountLogger();
     $this->orderService->setOrderStatus($order1->getId(), OrderStatusType::canceled());
     $this->assertTrue($order1->getStatus()->isCanceled());
     $this->assertTrue($order1->getOrderItems()[0]->getAttachments()[0]->isLocked());
     $this->assertTrue($order1->getOrderItems()[1]->getAttachments()[0]->isLocked());
     $this->assertSame(10, $this->getTotalQueries());
 }
예제 #6
0
 public function testCreateByIdThrowsExceptionWhenInvalid()
 {
     $this->setExpectedException(InvalidArgumentException::class);
     OrderStatusType::createById(999);
 }