Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/Api/Request/WarehousePurchaseOrders.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Baselinker\Api\Request;

use Baselinker\Api\Client;
use Baselinker\Api\Response\Response;

class WarehousePurchaseOrders extends Client
{
public function getInventoryPurchaseOrders(array $data = []): Response
{
return new Response(
$this->post('getInventoryPurchaseOrders', $data)
);
}

public function getInventoryPurchaseOrderItems(int $orderId, ?int $page = null): Response
{
return new Response(
$this->post('getInventoryPurchaseOrderItems', [
'order_id' => $orderId,
'page' => $page,
])
);
}

public function getInventoryPurchaseOrderSeries(int $warehouseId): Response
{
return new Response(
$this->post('getInventoryPurchaseOrderSeries', [
'warehouse_id' => $warehouseId,
])
);
}
}
6 changes: 6 additions & 0 deletions src/Baselinker.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Baselinker\Api\Request\Orders;
use Baselinker\Api\Request\ProductCatalog;
use Baselinker\Api\Request\WarehouseDocuments;
use Baselinker\Api\Request\WarehousePurchaseOrders;

class Baselinker
{
Expand All @@ -29,6 +30,11 @@ public function warehouseDocuments(): WarehouseDocuments
return new WarehouseDocuments($this->config);
}

public function warehousePurchaseOrders(): WarehousePurchaseOrders
{
return new WarehousePurchaseOrders($this->config);
}

public function externalStorages(): ExternalStorages
{
return new ExternalStorages($this->config);
Expand Down
10 changes: 10 additions & 0 deletions tests/BaselinkerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Baselinker\Api\Request\Orders;
use Baselinker\Api\Request\ProductCatalog;
use Baselinker\Api\Request\WarehouseDocuments;
use Baselinker\Api\Request\WarehousePurchaseOrders;
use Baselinker\Baselinker;
use PHPUnit\Framework\TestCase;

Expand All @@ -32,6 +33,15 @@ public function testWarehouseDocuments(): void
$this->assertInstanceOf(WarehouseDocuments::class, $warehouseDocuments);
}

public function testWarehousePurchaseOrders(): void
{
$baselinker = new Baselinker('token');

$warehousePurchaseOrders = $baselinker->warehousePurchaseOrders();

$this->assertInstanceOf(WarehousePurchaseOrders::class, $warehousePurchaseOrders);
}

public function testExternalStorages(): void
{
$baselinker = new Baselinker('token');
Expand Down