1 | <?php |
||
16 | final class InventoryClient |
||
17 | { |
||
18 | private const DEFAULT_ORGANIZATION_UUID = 'self'; |
||
19 | |||
20 | const BASE_URL = 'https://inventory.izettle.com/organizations/%s'; |
||
21 | |||
22 | const GET_HISTORY = self::BASE_URL . '/history/locations/%s'; |
||
23 | |||
24 | const GET_PRODUCT_INVENTORY = self::BASE_URL . '/inventory/locations/%s/products/%s'; |
||
25 | const GET_LOCATION_INVENTORY = self::BASE_URL . '/inventory/locations/%s'; |
||
26 | const POST_INVENTORY = self::BASE_URL . '/inventory'; |
||
27 | const POST_INVENTORY_BULK = self::BASE_URL . '/inventory/bulk'; |
||
28 | const PUT_INVENTORY = self::BASE_URL . '/inventory'; |
||
29 | const DELETE_PRODUCT_INVENTORY = self::BASE_URL . '/inventory/products/%s'; |
||
30 | |||
31 | const GET_LOCATIONS = self::BASE_URL . '/locations'; |
||
32 | const PUT_LOCATIONS = self::BASE_URL . '/locations/%s'; |
||
33 | |||
34 | const GET_SETTINGS = self::BASE_URL . '/settings'; |
||
35 | const POST_SETTINGS = self::BASE_URL . '/settings'; |
||
36 | const PUT_SETTINGS = self::BASE_URL . '/settings'; |
||
37 | |||
38 | /** |
||
39 | * @var IzettleClientInterface |
||
40 | */ |
||
41 | private $client; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | private $organizationUuid; |
||
47 | |||
48 | /** |
||
49 | * @var LocationBuilderInterface |
||
50 | */ |
||
51 | private $locationBuilder; |
||
52 | |||
53 | /** |
||
54 | * @var ProductBuilderInterface |
||
55 | */ |
||
56 | private $productBuilder; |
||
57 | |||
58 | /** |
||
59 | * @var HistoryBuilderInterface |
||
60 | */ |
||
61 | private $historyBuilder; |
||
62 | |||
63 | /** |
||
64 | * @var SettingsBuilderInterface |
||
65 | */ |
||
66 | private $settingsBuilder; |
||
67 | |||
68 | public function __construct( |
||
83 | |||
84 | public function setOrganizationUuid(UuidInterface $organizationUuid): void |
||
88 | |||
89 | public function resetOrganizationUuid(): void |
||
93 | |||
94 | /** |
||
95 | * @return Location[] |
||
96 | */ |
||
97 | public function getLocations(): array |
||
104 | |||
105 | public function getLocation(UuidInterface $locationUuid): Location |
||
112 | |||
113 | public function getProduct(UuidInterface $locationUuid, UuidInterface $productUuid): Product |
||
120 | |||
121 | public function getHistory(UuidInterface $locationUuid): History |
||
128 | |||
129 | public function getSettings(): Settings |
||
136 | } |
||
137 |