@@ -37,6 +37,9 @@ |
||
| 37 | 37 | $this->maps = $this->loadArrayFromFile(__DIR__.'/map/restful.map.php'); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | + /** |
|
| 41 | + * @param string $decoratorName |
|
| 42 | + */ |
|
| 40 | 43 | public function factoryDecorator(Order $order, $decoratorName) |
| 41 | 44 | { |
| 42 | 45 | $className = __NAMESPACE__.'\\Decorator\\'.$decoratorName; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | - * @return Gpupo\Common\Entity\CollectionAbstract|null |
|
| 39 | + * @return null|EntityInterface |
|
| 40 | 40 | */ |
| 41 | 41 | public function findById($itemId) |
| 42 | 42 | { |
@@ -56,6 +56,9 @@ discard block |
||
| 56 | 56 | return $this->hydrate($sku); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string $type |
|
| 61 | + */ |
|
| 59 | 62 | protected function getDetail(EntityInterface $sku, $type) |
| 60 | 63 | { |
| 61 | 64 | $response = $this->perform($this->factoryMap('get'.$type, ['sku' => $sku->getId()])); |
@@ -102,6 +105,9 @@ discard block |
||
| 102 | 105 | ]), $entity->toJson()); |
| 103 | 106 | } |
| 104 | 107 | |
| 108 | + /** |
|
| 109 | + * @param string $type |
|
| 110 | + */ |
|
| 105 | 111 | public function saveDetail(Item $sku, $type) |
| 106 | 112 | { |
| 107 | 113 | $json = $sku->toJson($type); |
@@ -44,6 +44,9 @@ discard block |
||
| 44 | 44 | return $datetime->format('c'); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | + /** |
|
| 48 | + * @param string $key |
|
| 49 | + */ |
|
| 47 | 50 | protected function dateGet($key) |
| 48 | 51 | { |
| 49 | 52 | $value = $this->get($key); |
@@ -55,6 +58,9 @@ discard block |
||
| 55 | 58 | } |
| 56 | 59 | } |
| 57 | 60 | |
| 61 | + /** |
|
| 62 | + * @param string $move |
|
| 63 | + */ |
|
| 58 | 64 | protected function dateMove($move) |
| 59 | 65 | { |
| 60 | 66 | $date = new DateTime(); |
@@ -45,8 +45,8 @@ |
||
| 45 | 45 | $s = 'screenplay:'.$key; |
| 46 | 46 | $command = $app->find($s); |
| 47 | 47 | $t = new ArrayInput([ |
| 48 | - 'command' => $s, |
|
| 49 | - 'path' => $path, |
|
| 48 | + 'command' => $s, |
|
| 49 | + 'path' => $path, |
|
| 50 | 50 | ]); |
| 51 | 51 | |
| 52 | 52 | $command->run($t, $output); |
@@ -13,21 +13,21 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | return [ |
| 16 | - 'merchant' => [ |
|
| 17 | - 'name' => $native->getOriginSite(), |
|
| 18 | - 'marketplace' => 'NETSHOES', |
|
| 19 | - 'originNumber' => $native->getOriginNumber(), |
|
| 20 | - ], |
|
| 21 | - 'orderNumber' => $native->getId(), |
|
| 22 | - 'acceptedOffer' => $native->getItems()->toSchema(), |
|
| 23 | - 'orderStatus' => $native->getOrderStatus(), |
|
| 24 | - 'orderDate' => $native->getOrderDate(), |
|
| 25 | - 'customer' => $native->getShipping()->getCustomer()->toSchema(), |
|
| 26 | - 'billingAddress' => $native->getShipping()->getCustomer()->getAddress()->toSchema(), |
|
| 27 | - 'currency' => 'BRL', |
|
| 28 | - 'price' => $native->getTotalNet(), |
|
| 29 | - 'discount' => $native->getTotalDiscount(), |
|
| 30 | - 'quantity' => $native->getTotalQuantity(), |
|
| 31 | - 'freight' => $native->getTotalFreight(), |
|
| 32 | - 'total' => $native->getTotalGross(), |
|
| 33 | - ]; |
|
| 16 | + 'merchant' => [ |
|
| 17 | + 'name' => $native->getOriginSite(), |
|
| 18 | + 'marketplace' => 'NETSHOES', |
|
| 19 | + 'originNumber' => $native->getOriginNumber(), |
|
| 20 | + ], |
|
| 21 | + 'orderNumber' => $native->getId(), |
|
| 22 | + 'acceptedOffer' => $native->getItems()->toSchema(), |
|
| 23 | + 'orderStatus' => $native->getOrderStatus(), |
|
| 24 | + 'orderDate' => $native->getOrderDate(), |
|
| 25 | + 'customer' => $native->getShipping()->getCustomer()->toSchema(), |
|
| 26 | + 'billingAddress' => $native->getShipping()->getCustomer()->getAddress()->toSchema(), |
|
| 27 | + 'currency' => 'BRL', |
|
| 28 | + 'price' => $native->getTotalNet(), |
|
| 29 | + 'discount' => $native->getTotalDiscount(), |
|
| 30 | + 'quantity' => $native->getTotalQuantity(), |
|
| 31 | + 'freight' => $native->getTotalFreight(), |
|
| 32 | + 'total' => $native->getTotalGross(), |
|
| 33 | + ]; |
|
@@ -27,10 +27,10 @@ |
||
| 27 | 27 | public function getSchema() |
| 28 | 28 | { |
| 29 | 29 | return [ |
| 30 | - 'sellerCode' => 'integer', |
|
| 31 | - 'sellerName' => 'string', |
|
| 32 | - 'supplierCnpj' => 'string', |
|
| 33 | - 'supplierName' => 'string', |
|
| 30 | + 'sellerCode' => 'integer', |
|
| 31 | + 'sellerName' => 'string', |
|
| 32 | + 'supplierCnpj' => 'string', |
|
| 33 | + 'supplierName' => 'string', |
|
| 34 | 34 | ]; |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -45,14 +45,14 @@ |
||
| 45 | 45 | public function getSchema() |
| 46 | 46 | { |
| 47 | 47 | return [ |
| 48 | - 'address' => 'object', |
|
| 49 | - 'cellPhone' => 'string', |
|
| 50 | - 'customerName' => 'string', |
|
| 51 | - 'document' => 'string', |
|
| 52 | - 'landLine' => 'string', |
|
| 53 | - 'recipientName' => 'string', |
|
| 54 | - 'stateInscription' => 'string', |
|
| 55 | - 'tradeName' => 'string', |
|
| 48 | + 'address' => 'object', |
|
| 49 | + 'cellPhone' => 'string', |
|
| 50 | + 'customerName' => 'string', |
|
| 51 | + 'document' => 'string', |
|
| 52 | + 'landLine' => 'string', |
|
| 53 | + 'recipientName' => 'string', |
|
| 54 | + 'stateInscription' => 'string', |
|
| 55 | + 'tradeName' => 'string', |
|
| 56 | 56 | ]; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -43,14 +43,14 @@ |
||
| 43 | 43 | public function getSchema() |
| 44 | 44 | { |
| 45 | 45 | return [ |
| 46 | - 'city' => 'string', |
|
| 47 | - 'complement' => 'string', |
|
| 48 | - 'neighborhood' => 'string', |
|
| 49 | - 'number' => 'string', |
|
| 50 | - 'postalCode' => 'string', |
|
| 51 | - 'reference' => 'string', |
|
| 52 | - 'state' => 'string', |
|
| 53 | - 'street' => 'string', |
|
| 46 | + 'city' => 'string', |
|
| 47 | + 'complement' => 'string', |
|
| 48 | + 'neighborhood' => 'string', |
|
| 49 | + 'number' => 'string', |
|
| 50 | + 'postalCode' => 'string', |
|
| 51 | + 'reference' => 'string', |
|
| 52 | + 'state' => 'string', |
|
| 53 | + 'street' => 'string', |
|
| 54 | 54 | ]; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -51,17 +51,17 @@ |
||
| 51 | 51 | public function getSchema() |
| 52 | 52 | { |
| 53 | 53 | return [ |
| 54 | - 'shippingCode' => 'integer', |
|
| 55 | - 'customer' => 'object', |
|
| 56 | - 'freightAmount' => 'number', |
|
| 57 | - 'invoice' => 'object', |
|
| 58 | - 'items' => 'object', |
|
| 59 | - 'sender' => 'object', |
|
| 60 | - 'status' => 'string', |
|
| 61 | - 'transport' => 'object', |
|
| 62 | - 'country' => 'string', |
|
| 63 | - 'cancellationReason' => 'string', |
|
| 64 | - 'devolutionItems' => 'object', |
|
| 54 | + 'shippingCode' => 'integer', |
|
| 55 | + 'customer' => 'object', |
|
| 56 | + 'freightAmount' => 'number', |
|
| 57 | + 'invoice' => 'object', |
|
| 58 | + 'items' => 'object', |
|
| 59 | + 'sender' => 'object', |
|
| 60 | + 'status' => 'string', |
|
| 61 | + 'transport' => 'object', |
|
| 62 | + 'country' => 'string', |
|
| 63 | + 'cancellationReason' => 'string', |
|
| 64 | + 'devolutionItems' => 'object', |
|
| 65 | 65 | ]; |
| 66 | 66 | } |
| 67 | 67 | |