1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace VasilDakov\Speedy\Service\Shipment; |
6
|
|
|
|
7
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
8
|
|
|
use JMS\Serializer\Annotation as Serializer; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Class ShipmentPrice. |
12
|
|
|
* |
13
|
|
|
* @Serializer\AccessType("public_method") |
14
|
|
|
* |
15
|
|
|
* @author Vasil Dakov <[email protected]> |
16
|
|
|
* @copyright 2009-2022 Neutrino.bg |
17
|
|
|
* @version 1.0 |
18
|
|
|
* @psalm-suppress MissingConstructor |
19
|
|
|
* @psalm-suppress PropertyNotSetInConstructor |
20
|
|
|
*/ |
21
|
|
|
class ShipmentPrice |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @Serializer\Type("float") |
25
|
|
|
*/ |
26
|
|
|
private float $amount; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @Serializer\Type("float") |
30
|
|
|
*/ |
31
|
|
|
private float $vat; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @Serializer\Type("float") |
35
|
|
|
*/ |
36
|
|
|
private float $total; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @Serializer\Type("string") |
40
|
|
|
*/ |
41
|
|
|
private string $currency; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @Serializer\Type("ArrayCollection<string, VasilDakov\Speedy\Service\Shipment\ShipmentPriceAmount>") |
45
|
|
|
*/ |
46
|
|
|
private ArrayCollection $details; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @Serializer\Type("float") |
50
|
|
|
*/ |
51
|
|
|
private float $amountLocal; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @Serializer\Type("float") |
55
|
|
|
*/ |
56
|
|
|
private float $vatLocal; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @Serializer\Type("float") |
60
|
|
|
*/ |
61
|
|
|
private float $totalLocal; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @Serializer\Type("string") |
65
|
|
|
*/ |
66
|
|
|
private string $currencyLocal; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @Serializer\Type("ArrayCollection<string, VasilDakov\Speedy\Service\Shipment\ShipmentPriceAmount>") |
70
|
|
|
*/ |
71
|
|
|
private ArrayCollection $detailsLocal; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @Serializer\Type("integer") |
75
|
|
|
*/ |
76
|
|
|
private int $currencyExchangeRateUnit; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @Serializer\Type("float") |
80
|
|
|
*/ |
81
|
|
|
private float $currencyExchangeRate; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @var ?ReturnAmounts |
85
|
|
|
* |
86
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Shipment\ReturnAmounts") |
87
|
|
|
*/ |
88
|
|
|
private ?ReturnAmounts $returnAmounts = null; |
89
|
|
|
|
90
|
2 |
|
public function __construct() |
91
|
|
|
{ |
92
|
2 |
|
$this->details = new ArrayCollection(); |
93
|
2 |
|
$this->detailsLocal = new ArrayCollection(); |
94
|
|
|
} |
95
|
|
|
|
96
|
2 |
|
public function getAmount(): float |
97
|
|
|
{ |
98
|
2 |
|
return $this->amount; |
99
|
|
|
} |
100
|
|
|
|
101
|
4 |
|
public function setAmount(float $amount): void |
102
|
|
|
{ |
103
|
4 |
|
$this->amount = $amount; |
104
|
|
|
} |
105
|
|
|
|
106
|
2 |
|
public function getVat(): float |
107
|
|
|
{ |
108
|
2 |
|
return $this->vat; |
109
|
|
|
} |
110
|
|
|
|
111
|
3 |
|
public function setVat(float $vat): void |
112
|
|
|
{ |
113
|
3 |
|
$this->vat = $vat; |
114
|
|
|
} |
115
|
|
|
|
116
|
2 |
|
public function getTotal(): float |
117
|
|
|
{ |
118
|
2 |
|
return $this->total; |
119
|
|
|
} |
120
|
|
|
|
121
|
3 |
|
public function setTotal(float $total): void |
122
|
|
|
{ |
123
|
3 |
|
$this->total = $total; |
124
|
|
|
} |
125
|
|
|
|
126
|
2 |
|
public function getCurrency(): string |
127
|
|
|
{ |
128
|
2 |
|
return $this->currency; |
129
|
|
|
} |
130
|
|
|
|
131
|
2 |
|
public function setCurrency(string $currency): void |
132
|
|
|
{ |
133
|
2 |
|
$this->currency = $currency; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @codeCoverageIgnore |
138
|
|
|
*/ |
139
|
|
|
public function getDetails(): ArrayCollection |
140
|
|
|
{ |
141
|
|
|
return $this->details; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @codeCoverageIgnore |
146
|
|
|
*/ |
147
|
|
|
public function setDetails(ArrayCollection $details): void |
148
|
|
|
{ |
149
|
|
|
$this->details = $details; |
150
|
|
|
} |
151
|
|
|
|
152
|
2 |
|
public function getAmountLocal(): float |
153
|
|
|
{ |
154
|
2 |
|
return $this->amountLocal; |
155
|
|
|
} |
156
|
|
|
|
157
|
3 |
|
public function setAmountLocal(float $amountLocal): void |
158
|
|
|
{ |
159
|
3 |
|
$this->amountLocal = $amountLocal; |
160
|
|
|
} |
161
|
|
|
|
162
|
2 |
|
public function getVatLocal(): float |
163
|
|
|
{ |
164
|
2 |
|
return $this->vatLocal; |
165
|
|
|
} |
166
|
|
|
|
167
|
3 |
|
public function setVatLocal(float $vatLocal): void |
168
|
|
|
{ |
169
|
3 |
|
$this->vatLocal = $vatLocal; |
170
|
|
|
} |
171
|
|
|
|
172
|
2 |
|
public function getTotalLocal(): float |
173
|
|
|
{ |
174
|
2 |
|
return $this->totalLocal; |
175
|
|
|
} |
176
|
|
|
|
177
|
3 |
|
public function setTotalLocal(float $totalLocal): void |
178
|
|
|
{ |
179
|
3 |
|
$this->totalLocal = $totalLocal; |
180
|
|
|
} |
181
|
|
|
|
182
|
2 |
|
public function getCurrencyLocal(): string |
183
|
|
|
{ |
184
|
2 |
|
return $this->currencyLocal; |
185
|
|
|
} |
186
|
|
|
|
187
|
3 |
|
public function setCurrencyLocal(string $currencyLocal): void |
188
|
|
|
{ |
189
|
3 |
|
$this->currencyLocal = $currencyLocal; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* @codeCoverageIgnore |
194
|
|
|
*/ |
195
|
|
|
public function getDetailsLocal(): ArrayCollection |
196
|
|
|
{ |
197
|
|
|
return $this->detailsLocal; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* @codeCoverageIgnore |
202
|
|
|
*/ |
203
|
|
|
public function setDetailsLocal(ArrayCollection $detailsLocal): void |
204
|
|
|
{ |
205
|
|
|
$this->detailsLocal = $detailsLocal; |
206
|
|
|
} |
207
|
|
|
|
208
|
2 |
|
public function getCurrencyExchangeRateUnit(): int |
209
|
|
|
{ |
210
|
2 |
|
return $this->currencyExchangeRateUnit; |
211
|
|
|
} |
212
|
|
|
|
213
|
3 |
|
public function setCurrencyExchangeRateUnit(int $currencyExchangeRateUnit): void |
214
|
|
|
{ |
215
|
3 |
|
$this->currencyExchangeRateUnit = $currencyExchangeRateUnit; |
216
|
|
|
} |
217
|
|
|
|
218
|
2 |
|
public function getCurrencyExchangeRate(): float |
219
|
|
|
{ |
220
|
2 |
|
return $this->currencyExchangeRate; |
221
|
|
|
} |
222
|
|
|
|
223
|
3 |
|
public function setCurrencyExchangeRate(float $currencyExchangeRate): void |
224
|
|
|
{ |
225
|
3 |
|
$this->currencyExchangeRate = $currencyExchangeRate; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* @return ?ReturnAmounts |
230
|
|
|
*/ |
231
|
1 |
|
public function getReturnAmounts(): ?ReturnAmounts |
232
|
|
|
{ |
233
|
1 |
|
return $this->returnAmounts; |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @param ?ReturnAmounts $returnAmounts |
238
|
|
|
*/ |
239
|
|
|
public function setReturnAmounts(?ReturnAmounts $returnAmounts): void |
240
|
|
|
{ |
241
|
|
|
$this->returnAmounts = $returnAmounts; |
242
|
|
|
} |
243
|
|
|
} |
244
|
|
|
|