1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace VasilDakov\Speedy\Service\Shipment; |
6
|
|
|
|
7
|
|
|
use DateTime; |
8
|
|
|
use JMS\Serializer\Annotation as Serializer; |
9
|
|
|
use VasilDakov\Speedy\Error; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Class CreateShipmentResponse. |
13
|
|
|
* |
14
|
|
|
* @Serializer\AccessType("public_method") |
15
|
|
|
* |
16
|
|
|
* @author Vasil Dakov <[email protected]> |
17
|
|
|
* @copyright 2009-2022 Neutrino.bg |
18
|
|
|
* |
19
|
|
|
* @version 1.0 |
20
|
|
|
*/ |
21
|
|
|
class CreateShipmentResponse |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var ?string |
25
|
|
|
* |
26
|
|
|
* @Serializer\Type("string") |
27
|
|
|
* |
28
|
|
|
* @Serializer\Accessor(getter="getId", setter="setId") |
29
|
|
|
*/ |
30
|
|
|
private ?string $id = ''; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @Serializer\Type("array") |
34
|
|
|
*/ |
35
|
|
|
private ?array $parcels = null; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Shipment\ShipmentPrice") |
39
|
|
|
* |
40
|
|
|
* @Serializer\Accessor(getter="getPrice", setter="setPrice") |
41
|
|
|
*/ |
42
|
|
|
private ?ShipmentPrice $price = null; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @Serializer\Type("DateTime<'Y-m-d'>") |
46
|
|
|
*/ |
47
|
|
|
private ?\DateTime $pickupDate = null; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @Serializer\Type("DateTime") |
51
|
|
|
*/ |
52
|
|
|
private ?\DateTime $deliveryDeadline = null; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Error") |
56
|
|
|
*/ |
57
|
|
|
private ?Error $error = null; |
58
|
|
|
|
59
|
2 |
|
public function setId(?string $id): void |
60
|
|
|
{ |
61
|
2 |
|
$this->id = $id; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getId(): ?string |
65
|
|
|
{ |
66
|
|
|
return $this->id; |
67
|
|
|
} |
68
|
|
|
|
69
|
1 |
|
public function getParcels(): ?array |
70
|
|
|
{ |
71
|
1 |
|
return $this->parcels; |
72
|
|
|
} |
73
|
|
|
|
74
|
1 |
|
public function setParcels(array $parcels = []): void |
75
|
|
|
{ |
76
|
1 |
|
$this->parcels = $parcels; |
77
|
|
|
} |
78
|
|
|
|
79
|
1 |
|
public function getPrice(): ?ShipmentPrice |
80
|
|
|
{ |
81
|
1 |
|
return $this->price; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param ?ShipmentPrice $price |
86
|
|
|
*/ |
87
|
2 |
|
public function setPrice(?ShipmentPrice $price): void |
88
|
|
|
{ |
89
|
2 |
|
$this->price = $price; |
90
|
|
|
} |
91
|
|
|
|
92
|
1 |
|
public function getPickupDate(): ?\DateTime |
93
|
|
|
{ |
94
|
1 |
|
return $this->pickupDate; |
95
|
|
|
} |
96
|
|
|
|
97
|
2 |
|
public function setPickupDate(\DateTime $pickupDate): void |
98
|
|
|
{ |
99
|
2 |
|
$this->pickupDate = $pickupDate; |
100
|
|
|
} |
101
|
|
|
|
102
|
1 |
|
public function getDeliveryDeadline(): ?\DateTime |
103
|
|
|
{ |
104
|
1 |
|
return $this->deliveryDeadline; |
105
|
|
|
} |
106
|
|
|
|
107
|
2 |
|
public function setDeliveryDeadline(\DateTime $deliveryDeadline): void |
108
|
|
|
{ |
109
|
2 |
|
$this->deliveryDeadline = $deliveryDeadline; |
110
|
|
|
} |
111
|
|
|
|
112
|
1 |
|
public function getError(): ?Error |
113
|
|
|
{ |
114
|
1 |
|
return $this->error; |
115
|
|
|
} |
116
|
|
|
|
117
|
1 |
|
public function setError(?Error $error = null): void |
118
|
|
|
{ |
119
|
1 |
|
$this->error = $error; |
120
|
|
|
} |
121
|
|
|
} |
122
|
|
|
|