diff --git a/src/Repositories/InventoryRepository.php b/src/Repositories/InventoryRepository.php index 89ed2fe..06ae2bf 100644 --- a/src/Repositories/InventoryRepository.php +++ b/src/Repositories/InventoryRepository.php @@ -26,7 +26,7 @@ public function index( ?Id $colorIds = null ): iterable { $uri = uri('inventories', [], [ - 'item_types' => toString($itemTypes, ItemType::default()), + 'item_type' => toString($itemTypes, ItemType::default()), 'status' => toString($status, InventoryStatus::default()), 'category_id' => toString($categoryIds, Id::default()), 'color_id' => toString($colorIds, Id::default()), diff --git a/src/Repositories/OrderRepository.php b/src/Repositories/OrderRepository.php index 942a38f..85f8adb 100644 --- a/src/Repositories/OrderRepository.php +++ b/src/Repositories/OrderRepository.php @@ -95,9 +95,10 @@ public function findOrderItems(Order $order): iterable $itemsResponse = $this->gateway->get(uri('orders/{id}/items', ['id' => $order->orderId])); $items = []; - - foreach ($itemsResponse->getData() as $data) { - $items[] = $this->itemTransformer->toObject($data); + foreach ($itemsResponse->getData() as $key => $itemsDataSet) { + foreach ($itemsDataSet as $itemData) { + $items[$key][] = $this->itemTransformer->toObject($itemData); + } } return $items; diff --git a/src/ValueObjects/Address.php b/src/ValueObjects/Address.php index c3f2a89..652345d 100644 --- a/src/ValueObjects/Address.php +++ b/src/ValueObjects/Address.php @@ -13,6 +13,7 @@ public function __construct( public ?string $city = null, public ?string $state = null, public ?string $postalCode = null, + public ?string $phoneNumber = null, ) { } } diff --git a/src/ValueObjects/Cost.php b/src/ValueObjects/Cost.php index 44d4bdc..355c2e6 100644 --- a/src/ValueObjects/Cost.php +++ b/src/ValueObjects/Cost.php @@ -8,12 +8,16 @@ public function __construct( public ?string $currencyCode = null, public ?float $subtotal = null, public ?float $grandTotal = null, + public ?float $finalTotal = null, + public ?float $salesTax = null, + public ?float $salestaxCollectedByBl = null, public ?float $etc1 = null, public ?float $etc2 = null, public ?float $insurance = null, public ?float $shipping = null, public ?float $credit = null, public ?float $coupon = null, + public ?float $vat = null, public ?float $vatRate = null, public ?float $vatAmount = null, ) { diff --git a/src/ValueObjects/Order.php b/src/ValueObjects/Order.php index 068b7e5..d6d177f 100644 --- a/src/ValueObjects/Order.php +++ b/src/ValueObjects/Order.php @@ -28,7 +28,7 @@ public function __construct( public ?Shipping $shipping = null, public ?Cost $cost = null, public ?Cost $dispCost = null, - public ?bool $salesTaxCollectedByBl = null, + public ?bool $salestaxCollectedByBl = null, public ?bool $vatCollectedByBl = null, public ?iterable $items = null, public ?iterable $messages = null, diff --git a/src/ValueObjects/OrderItem.php b/src/ValueObjects/OrderItem.php index 7fe0e4d..ec2e4a2 100644 --- a/src/ValueObjects/OrderItem.php +++ b/src/ValueObjects/OrderItem.php @@ -21,6 +21,7 @@ public function __construct( public ?string $remarks = null, public ?string $description = null, public ?float $weight = null, + public ?float $orderCost = null, ) { } } diff --git a/src/ValueObjects/OrderMessage.php b/src/ValueObjects/OrderMessage.php index aa6e1db..425e487 100644 --- a/src/ValueObjects/OrderMessage.php +++ b/src/ValueObjects/OrderMessage.php @@ -7,6 +7,7 @@ class OrderMessage { public function __construct( + public ?string $messageID = null, public ?string $subject = null, public ?string $body = null, public ?string $from = null, diff --git a/tests/responses/order_message.json b/tests/responses/order_message.json index 295738d..3f74de7 100644 --- a/tests/responses/order_message.json +++ b/tests/responses/order_message.json @@ -1,4 +1,5 @@ { + "messageID": 123456, "subject":"Regarding BrickLink Order #3986441", "body":"Hello...", "from":"covariance1",