OrderDelivery::getStatus()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DalliSDK\Models;
6
7
use DalliSDK\Traits\Fillable;
8
use JMS\Serializer\Annotation as JMS;
9
10
/**
11
 * Модель для ответа на "Запрос статусов доставки"
12
 *
13
 * @see https://api.dalli-service.com/v1/doc/request-delivery-status
14
 * @JMS\XmlRoot("order")
15
 */
16
class OrderDelivery
17
{
18
    use Fillable;
19
20
    /**
21
     * Номер заказа в системе учета ИМ
22
     *
23
     * @JMS\XmlAttribute()
24
     * @JMS\Type("string")
25
     * @JMS\SerializedName("orderno")
26
     */
27
    private string $orderNo;
28
29
    /**
30
     * Внутренний код заказа в системе Dalli; применяется для некоторых внутренних операций
31
     *
32
     * @JMS\XmlAttribute()
33
     * @JMS\Type("string")
34
     * @JMS\SerializedName("ordercode")
35
     */
36
    private string $orderCode;
37
38
    /**
39
     * Штрих-код заказа
40
     *
41
     * @JMS\XmlAttribute()
42
     * @JMS\Type("string")
43
     * @JMS\SerializedName("givencode")
44
     */
45
    private string $givenCode;
46
47
    /**
48
     * Штрих-код заказа
49
     *
50
     * @JMS\XmlAttribute()
51
     * @JMS\Type("string")
52
     * @JMS\SerializedName("awb")
53
     */
54
    private string $awb;
55
56
    /**
57
     * Дата создания заказа
58
     *
59
     * @JMS\XmlAttribute()
60
     * @JMS\Type("DateTimeImmutable<'Y-m-d'>")
61
     * @JMS\SerializedName("createdate")
62
     */
63
    private ?\DateTimeImmutable $createDate = null;
64
65
    /**
66
     * Контейнер информации об отправителе
67
     *
68
     * @JMS\Type("DalliSDK\Models\Sender")
69
     * @JMS\SerializedName("sender")
70
     */
71
    private Sender $sender;
72
73
    /**
74
     * Штрих-код заказа
75
     *
76
     * @JMS\Type("string")
77
     * @JMS\SerializedName("barcode")
78
     */
79
    private string $barcode;
80
81
    /**
82
     * Контейнер информации о получателе
83
     *
84
     * @JMS\Type("DalliSDK\Models\Receiver")
85
     * @JMS\SerializedName("receiver")
86
     */
87
    private Receiver $receiver;
88
89
    /**
90
     * Фактический вес заказа
91
     *
92
     * @JMS\Type("float")
93
     * @JMS\SerializedName("weight")
94
     */
95
    private float $weight;
96
97
    /**
98
     * Кол-во мест
99
     *
100
     * @JMS\Type("int")
101
     * @JMS\SerializedName("quantity")
102
     */
103
    private int $quantity;
104
105
    /**
106
     * Тип оплаты (CASH - наличными курьеру, CARD - картой курьеру, NO - курьер денег не берет)
107
     *
108
     * @JMS\Type("string")
109
     * @JMS\SerializedName("paytype")
110
     */
111
    private string $payType = 'CASH';
112
113
    /**
114
     * Тип доставки
115
     *
116
     * @JMS\Type("int")
117
     * @JMS\SerializedName("service")
118
     */
119
    private int $service;
120
121
    /**
122
     * Вложение; используется для справочной информации
123
     *
124
     * @JMS\Type("string")
125
     * @JMS\SerializedName("enclosure")
126
     */
127
    private ?string $enclosure = null;
128
129
    /**
130
     * Акт возврата
131
     *
132
     * @JMS\Type("DalliSDK\Models\Acta")
133
     * @JMS\SerializedName("acta")
134
     */
135
    private Acta $acta;
136
137
    /**
138
     * Наложенный платеж
139
     *
140
     * @JMS\Type("float")
141
     * @JMS\SerializedName("price")
142
     */
143
    private float $price;
144
145
    /**
146
     * Объявленная ценность
147
     *
148
     * @JMS\Type("float")
149
     * @JMS\SerializedName("inshprice")
150
     */
151
    private float $inshPrice;
152
153
    /**
154
     * Текстовое поле для внутренних нужд
155
     *
156
     * @JMS\Type("string")
157
     * @JMS\SerializedName("department")
158
     */
159
    private ?string $department = null;
160
161
    /**
162
     * Текстовое поле для внутренних нужд
163
     *
164
     * @JMS\Type("string")
165
     * @JMS\SerializedName("costcode")
166
     */
167
    private ?string $costCode = null;
168
169
    /**
170
     * Внешний код (используется при магистральных перевозках, межгороде, доставке через партнеров)
171
     *
172
     * @JMS\Type("string")
173
     * @JMS\SerializedName("outstrbarcode")
174
     */
175
    private ?string $outStrBarcode = null;
176
177
    /**
178
     * Комментарий получателя; дополнительная информация для курьера
179
     *
180
     * @JMS\Type("string")
181
     * @JMS\SerializedName("instruction")
182
     */
183
    private ?string $instruction = null;
184
185
    /**
186
     * Разрешение/запрет частичного выкупа.
187
     * Принимает значения:
188
     *  YES - когда частичный выкуп доступен,
189
     *  NO - если не доступен.
190
     * По-умолчанию берётся значение из карточки клиента
191
     *
192
     * @JMS\Type("string")
193
     * @JMS\SerializedName("acceptpartially")
194
     */
195
    private ?string $acceptpartially = null;
196
197
    /**
198
     * Контейнер информации о курьере
199
     *
200
     * @JMS\Type("DalliSDK\Models\Courier")
201
     * @JMS\SerializedName("courier")
202
     */
203
    private ?Courier $courier = null;
204
205
    /**
206
     * Контейнер стоимости доставки
207
     *
208
     * @JMS\Type("DalliSDK\Models\DeliveryPrice")
209
     * @JMS\SerializedName("deliveryprice")
210
     */
211
    private DeliveryPrice $deliveryPrice;
212
213
    /**
214
     * Текущий статус заказа
215
     *
216
     * @JMS\Type("DalliSDK\Models\Status")
217
     * @JMS\SerializedName("status")
218
     */
219
    private Status $status;
220
221
    /**
222
     * Контейнер хронологии изменений, содержит 1 или несколько элементов вида order->status
223
     *
224
     * @JMS\Type("DalliSDK\Models\StatusHistory")
225
     * @JMS\SerializedName("statushistory")
226
     */
227
    private StatusHistory $statusHistory;
228
229
    /**
230
     * Информация о доставке
231
     *
232
     * @JMS\Type("string")
233
     * @JMS\SerializedName("deliveredto")
234
     */
235
    private ?string $deliveredTo = null;
236
237
    /**
238
     * Дата доставки (Y-m-d)
239
     *
240
     * @JMS\Type("DateTimeImmutable<'Y-m-d'>")
241
     * @JMS\SerializedName("delivereddate")
242
     */
243
    private ?\DateTimeImmutable $deliveredDate = null;
244
245
    /**
246
     * Время доставки (H:i:s)
247
     *
248
     * @JMS\Type("string")
249
     * @JMS\SerializedName("deliveredtime")
250
     */
251
    private ?string $deliveredTime = null;
252
253
    /**
254
     * Ссылка на чек, в атрибутах указаны поля по отдельности
255
     *
256
     * @JMS\Type("DalliSDK\Models\Receipt")
257
     * @JMS\SerializedName("receipt")
258
     */
259
    private ?Receipt $receipt = null;
260
261
    /**
262
     * Контейнер товарных позиций
263
     *
264
     * @JMS\Type("array<DalliSDK\Models\Item>")
265
     * @JMS\XmlList(entry = "item")
266
     * @JMS\SerializedName("items")
267
     *
268
     * @var Item[]
269
     */
270
    private array $items;
271
272
    /**
273
     * Контейнер товарных мест
274
     *
275
     * @JMS\Type("array<DalliSDK\Models\Package>")
276
     * @JMS\XmlList(entry = "package")
277
     * @JMS\SerializedName("packages")
278
     *
279
     * @var Package[]
280
     */
281
    private ?array $packages = null;
282
283
    /**
284
     * @return string
285
     */
286 1
    public function getOrderNo(): string
287
    {
288 1
        return $this->orderNo;
289
    }
290
291
    /**
292
     * @return string
293
     */
294 1
    public function getOrderCode(): string
295
    {
296 1
        return $this->orderCode;
297
    }
298
299
    /**
300
     * @return string
301
     */
302 1
    public function getGivenCode(): string
303
    {
304 1
        return $this->givenCode;
305
    }
306
307
    /**
308
     * @return string
309
     */
310 1
    public function getAwb(): string
311
    {
312 1
        return $this->awb;
313
    }
314
315
    /**
316
     * @return Sender
317
     */
318 1
    public function getSender(): Sender
319
    {
320 1
        return $this->sender;
321
    }
322
323
    /**
324
     * @return string
325
     */
326 1
    public function getBarcode(): string
327
    {
328 1
        return $this->barcode;
329
    }
330
331
    /**
332
     * @return \DateTimeImmutable|null
333
     */
334 1
    public function getCreateDate(): ?\DateTimeImmutable
335
    {
336 1
        return $this->createDate;
337
    }
338
339
    /**
340
     * @return Receiver
341
     */
342 1
    public function getReceiver(): Receiver
343
    {
344 1
        return $this->receiver;
345
    }
346
347
    /**
348
     * @return float
349
     */
350 1
    public function getWeight(): float
351
    {
352 1
        return $this->weight;
353
    }
354
355
    /**
356
     * @return int
357
     */
358 1
    public function getQuantity(): int
359
    {
360 1
        return $this->quantity;
361
    }
362
363
    /**
364
     * @return string
365
     */
366 1
    public function getPayType(): string
367
    {
368 1
        return $this->payType;
369
    }
370
371
    /**
372
     * @return int
373
     */
374 1
    public function getService(): int
375
    {
376 1
        return $this->service;
377
    }
378
379
    /**
380
     * @return string|null
381
     */
382 1
    public function getEnclosure(): ?string
383
    {
384 1
        return $this->enclosure;
385
    }
386
387
    /**
388
     * @return Acta
389
     */
390 1
    public function getActa(): Acta
391
    {
392 1
        return $this->acta;
393
    }
394
395
    /**
396
     * @return float
397
     */
398 1
    public function getPrice(): float
399
    {
400 1
        return $this->price;
401
    }
402
403
    /**
404
     * @return float
405
     */
406 1
    public function getInshPrice(): float
407
    {
408 1
        return $this->inshPrice;
409
    }
410
411
    /**
412
     * @return string|null
413
     */
414 1
    public function getDepartment(): ?string
415
    {
416 1
        return $this->department;
417
    }
418
419
    /**
420
     * @return string|null
421
     */
422 1
    public function getCostCode(): ?string
423
    {
424 1
        return $this->costCode;
425
    }
426
427
    /**
428
     * @return string|null
429
     */
430 1
    public function getOutStrBarcode(): ?string
431
    {
432 1
        return $this->outStrBarcode;
433
    }
434
435
    /**
436
     * @return string|null
437
     */
438 1
    public function getInstruction(): ?string
439
    {
440 1
        return $this->instruction;
441
    }
442
443
    /**
444
     * @return string|null
445
     */
446 1
    public function getAcceptpartially(): ?string
447
    {
448 1
        return $this->acceptpartially;
449
    }
450
451
    /**
452
     * @return Courier|null
453
     */
454 1
    public function getCourier(): ?Courier
455
    {
456 1
        return $this->courier;
457
    }
458
459
    /**
460
     * @return DeliveryPrice
461
     */
462 1
    public function getDeliveryPrice(): DeliveryPrice
463
    {
464 1
        return $this->deliveryPrice;
465
    }
466
467
    /**
468
     * @return Status
469
     */
470 1
    public function getStatus(): Status
471
    {
472 1
        return $this->status;
473
    }
474
475
    /**
476
     * @return StatusHistory
477
     */
478 1
    public function getStatusHistory(): StatusHistory
479
    {
480 1
        return $this->statusHistory;
481
    }
482
483
    /**
484
     * @return string|null
485
     */
486 1
    public function getDeliveredTo(): ?string
487
    {
488 1
        return $this->deliveredTo;
489
    }
490
491
    /**
492
     * @return \DateTimeImmutable|null
493
     */
494 1
    public function getDeliveredDate(): ?\DateTimeImmutable
495
    {
496 1
        return $this->deliveredDate;
497
    }
498
499
    /**
500
     * @return string|null
501
     */
502 1
    public function getDeliveredTime(): ?string
503
    {
504 1
        return $this->deliveredTime;
505
    }
506
507
    /**
508
     * @return Receipt|null
509
     */
510 1
    public function getReceipt(): ?Receipt
511
    {
512 1
        return $this->receipt;
513
    }
514
515
    /**
516
     * @return array
517
     */
518 1
    public function getItems(): array
519
    {
520 1
        return $this->items;
521
    }
522
523
    /**
524
     * @return array|null
525
     */
526 1
    public function getPackages(): ?array
527
    {
528 1
        return $this->packages;
529
    }
530
}
531