1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Neutrino package. |
5
|
|
|
* |
6
|
|
|
* (c) Vasil Dakov <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
declare(strict_types=1); |
13
|
|
|
|
14
|
|
|
namespace VasilDakov\Speedy\Model; |
15
|
|
|
|
16
|
|
|
use DateTime; |
17
|
|
|
use JMS\Serializer\Annotation as Serializer; |
18
|
|
|
use VasilDakov\Speedy\Error; |
19
|
|
|
use VasilDakov\Speedy\Service\Shipment\ShipmentAdditionalServices; |
20
|
|
|
use VasilDakov\Speedy\Service\Shipment\ShipmentPrice; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Class CalculationResult. |
24
|
|
|
* |
25
|
|
|
* @author Vasil Dakov <[email protected]> |
26
|
|
|
* @copyright 2009-2023 Neutrino.bg |
27
|
|
|
* |
28
|
|
|
* @version 1.0 |
29
|
|
|
* |
30
|
|
|
* @Serializer\AccessType("public_method") |
31
|
|
|
*/ |
32
|
|
|
class CalculationResult |
33
|
|
|
{ |
34
|
|
|
/** |
35
|
|
|
* @Serializer\Type("integer") |
36
|
|
|
*/ |
37
|
|
|
private int $serviceId; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Shipment\ShipmentAdditionalServices") |
41
|
|
|
*/ |
42
|
|
|
private ?ShipmentAdditionalServices $additionalServices = null; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Shipment\ShipmentPrice") |
46
|
|
|
*/ |
47
|
|
|
private ShipmentPrice $price; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @Serializer\Type("DateTime<'Y-m-d'>") |
51
|
|
|
*/ |
52
|
|
|
private \DateTime $pickupDate; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @Serializer\Type("DateTime<'Y-m-d\TH:i:sP'>") |
56
|
|
|
*/ |
57
|
|
|
private \DateTime $deliveryDeadline; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @var ?Error |
61
|
|
|
* |
62
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Error") |
63
|
|
|
*/ |
64
|
|
|
private ?Error $error = null; |
65
|
|
|
|
66
|
1 |
|
public function getServiceId(): int |
67
|
|
|
{ |
68
|
1 |
|
return $this->serviceId; |
69
|
|
|
} |
70
|
|
|
|
71
|
1 |
|
public function setServiceId(int $serviceId): void |
72
|
|
|
{ |
73
|
1 |
|
$this->serviceId = $serviceId; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @param ?ShipmentAdditionalServices $additionalServices |
78
|
|
|
*/ |
79
|
1 |
|
public function setAdditionalServices(?ShipmentAdditionalServices $additionalServices): void |
80
|
|
|
{ |
81
|
1 |
|
$this->additionalServices = $additionalServices; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @return ?ShipmentAdditionalServices |
86
|
|
|
*/ |
87
|
1 |
|
public function getAdditionalServices(): ?ShipmentAdditionalServices |
88
|
|
|
{ |
89
|
1 |
|
return $this->additionalServices; |
90
|
|
|
} |
91
|
|
|
|
92
|
1 |
|
public function setPrice(ShipmentPrice $price): void |
93
|
|
|
{ |
94
|
1 |
|
$this->price = $price; |
95
|
|
|
} |
96
|
|
|
|
97
|
1 |
|
public function getPrice(): ShipmentPrice |
98
|
|
|
{ |
99
|
1 |
|
return $this->price; |
100
|
|
|
} |
101
|
|
|
|
102
|
1 |
|
public function setPickupDate(\DateTime $pickupDate): void |
103
|
|
|
{ |
104
|
1 |
|
$this->pickupDate = $pickupDate; |
105
|
|
|
} |
106
|
|
|
|
107
|
1 |
|
public function getPickupDate(): \DateTime |
108
|
|
|
{ |
109
|
1 |
|
return $this->pickupDate; |
110
|
|
|
} |
111
|
|
|
|
112
|
1 |
|
public function setDeliveryDeadline(\DateTime $deliveryDeadline): void |
113
|
|
|
{ |
114
|
1 |
|
$this->deliveryDeadline = $deliveryDeadline; |
115
|
|
|
} |
116
|
|
|
|
117
|
1 |
|
public function getDeliveryDeadline(): \DateTime |
118
|
|
|
{ |
119
|
1 |
|
return $this->deliveryDeadline; |
120
|
|
|
} |
121
|
|
|
|
122
|
1 |
|
public function setError(?Error $error): void |
123
|
|
|
{ |
124
|
1 |
|
$this->error = $error; |
125
|
|
|
} |
126
|
|
|
|
127
|
1 |
|
public function getError(): ?Error |
128
|
|
|
{ |
129
|
1 |
|
return $this->error; |
130
|
|
|
} |
131
|
|
|
} |
132
|
|
|
|