-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathPackageService.php
210 lines (182 loc) · 6.16 KB
/
PackageService.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?php
declare(strict_types=1);
namespace Inspirum\Balikobot\Service;
use DateTimeInterface;
use Inspirum\Balikobot\Model\OrderedShipment\OrderedShipment;
use Inspirum\Balikobot\Model\Package\Package;
use Inspirum\Balikobot\Model\Package\PackageCollection;
use Inspirum\Balikobot\Model\PackageData\PackageData;
use Inspirum\Balikobot\Model\PackageData\PackageDataCollection;
use Inspirum\Balikobot\Model\TransportCost\TransportCostCollection;
interface PackageService
{
/**
* Check if packages data are valid
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function checkPackages(PackageDataCollection $packages): void;
/**
* Add packages
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function addPackages(PackageDataCollection $packages): PackageCollection;
/**
* Drops packages
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function dropPackages(PackageCollection $packages): void;
/**
* Drops package
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function dropPackage(Package $package): void;
/**
* Drops package by its package ID
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function dropPackageByPackageId(string $carrier, string $packageId): void;
/**
* Drops packages by theirs package IDs
*
* @param list<string> $packageIds
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function dropPackagesByPackageIds(string $carrier, array $packageIds): void;
/**
* Order shipment for packages
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function orderShipment(PackageCollection $packages): OrderedShipment;
/**
* Order shipment for packages by theirs IDs
*
* @param list<string> $packageIds
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function orderShipmentByPackageIds(string $carrier, array $packageIds): OrderedShipment;
/**
* Get packages which was not yet sent
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getOverview(string $carrier): PackageCollection;
/**
* Get labels PDF link for packages
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getLabels(PackageCollection $packages): string;
/**
* Get labels PDF link for packages by theirs IDs
*
* @param list<string> $packageIds
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getLabelsByPackageIds(string $carrier, array $packageIds): string;
/**
* Get complete information about a package
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getPackageInfo(Package $package): PackageData;
/**
* Get complete information about a package by its package ID
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getPackageInfoByPackageId(string $carrier, string $packageId): PackageData;
/**
* Get complete information about a package by its carrier ID
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getPackageInfoByCarrierId(string $carrier, string $carrierId): PackageData;
/**
* Gets complete information about an ordered package
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getOrder(string $carrier, string $orderId): OrderedShipment;
/**
* Get PDF link with signed consignment delivery document by the recipient
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getProofOfDelivery(Package $package): string;
/**
* Get PDF links with signed consignment delivery document by the recipient
*
* @return list<string>
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getProofOfDeliveries(PackageCollection $packages): array;
/**
* Get PDF link with signed consignment delivery document by the recipient by carrier IDs
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getProofOfDeliveryByCarrierId(string $carrier, string $carrierId): string;
/**
* Get PDF links with signed consignment delivery document by the recipient by carrier ID
*
* @param list<string> $carrierIds
*
* @return list<string>
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getProofOfDeliveriesByCarrierIds(string $carrier, array $carrierIds): array;
/**
* Get the price of carriage at consignment level
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function getTransportCosts(PackageDataCollection $packages): TransportCostCollection;
/**
* Order a pickup for packages
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function orderPickup(
string $carrier,
DateTimeInterface $dateFrom,
DateTimeInterface $dateTo,
float $weight,
int $packageCount,
?string $message = null,
): void;
/**
* Order shipments from place B (typically supplier / previous consignee) to place A (shipping point)
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function orderB2AShipment(PackageDataCollection $packages): PackageCollection;
/**
* Order shipments from place B (typically supplier / previous consignee) to place C (address other than shipping point)
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function orderB2CShipment(PackageDataCollection $packages): PackageCollection;
/**
* Check if packages data are valid for B2A
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function checkB2APackages(PackageDataCollection $packages): void;
/**
* Check if packages data are valid for B2C
*
* @throws \Inspirum\Balikobot\Exception\Exception
*/
public function checkB2CPackages(PackageDataCollection $packages): void;
}