Issues (24)

src/Requests/DeliveryCostRequest.php (2 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace DalliSDK\Requests;
6
7
use DalliSDK\Responses\DeliveryCostResponse;
8
use JMS\Serializer\Annotation as JMS;
9
10
/**
11
 * Запрос на предварительный расчет стоимости
12
 *
13
 * @see https://api.dalli-service.com/v1/doc/cost-delivery
14
 * @JMS\XmlRoot("deliverycost")
15
 */
16
class DeliveryCostRequest extends AbstractRequest implements RequestInterface
17
{
18
    public const RESPONSE_CLASS = DeliveryCostResponse::class;
19
20
    /**
21
     * Идентификатор партнера, может принимать значения
22
     * @JMS\Type("string")
23
     */
24
    private ?string $partner = null;
25
26
    /**
27
     * Полный адрес получателя. Доступен только для собственной доставки Dalli
28
     *
29
     * @JMS\Type("string")
30
     */
31
    private ?string $to = null;
32
33
    /**
34
     * Город доставки в текстовом виде. Не рекомендуется
35
     *
36
     * @deprecated Не рекомендуется
37
     * @JMS\Type("string")
38
     * @JMS\SerializedName("townto")
39
     */
40
    private ?string $townTo = null;
41
42
    /**
43
     * Код ФИАС. Рекомендуем использовать именно его, а не текстовое название города
44
     *
45
     * @JMS\Type("string")
46
     */
47
    private ?string $fias = null;
48
49
    /**
50
     * КЛАДР
51
     *
52
     * @JMS\Type("string")
53
     */
54
    private ?string $kladr = null;
55
56
    /**
57
     * Код пункта выдачи заказов
58
     *
59
     * @JMS\Type("string")
60
     * @JMS\SerializedName("pvzcode")
61
     */
62
    private ?string $pvzCode = null;
63
64
    /**
65
     * Код города в системе СДЕК(можно указывать только при доставке СДЕКом)
66
     *
67
     * @JMS\Type("int")
68
     * @JMS\SerializedName("cdekcityid")
69
     */
70
    private ?int $cdekCityId = null;
71
72
    /**
73
     * Область
74
     *
75
     * @JMS\Type("string")
76
     * @JMS\SerializedName("oblname")
77
     */
78
    private ?string $oblName = null;
79
80
    /**
81
     * Вес заказа, кг
82
     *
83
     * @JMS\Type("float")
84
     */
85
    private ?float $weight = null;
86
87
    /**
88
     * Код адреса забора.
89
     * Чтобы получить код адреса - обратитесь к вашему менеджеру.
90
     * Требуется для расчёта стоимости внутригородской доставки по Екатеринбургу и Нижнему Новгороду
91
     *
92
     * @JMS\Type("string")
93
     * @JMS\SerializedName("sendercode")
94
     */
95
    private ?string $senderCode = null;
96
97
    /**
98
     * Стоимость заказа
99
     *
100
     * @JMS\Type("int")
101
     */
102
    private ?int $price = null;
103
104
    /**
105
     * Объявленная стоимость заказа
106
     *
107
     * @JMS\Type("int")
108
     */
109
    private ?int $inshprice = null;
110
111
    /**
112
     * Оплата картой (используется для запроса стоимости доставки только DS), может принимать значения:
113
     *  NO - наличными (значение по-умолчанию)
114
     *  YES - картой
115
     *
116
     * @JMS\Type("string")
117
     * @JMS\SerializedName("cashservices")
118
     */
119
    private ?string $cashServices = 'NO';
120
121
    /**
122
     * Длина, см
123
     *
124
     * @JMS\Type("int")
125
     */
126
    private ?int $length = null;
127
128
    /**
129
     * Ширина, см
130
     *
131
     * @JMS\Type("int")
132
     */
133
    private ?int $width = null;
134
135
    /**
136
     * Высота, см
137
     *
138
     * @JMS\Type("int")
139
     */
140
    private ?int $height = null;
141
142
    /**
143
     * Тип доставки, может принимать значения (бесполезен при output x2):
144
     *  KUR - курьерская доставка
145
     *  PVZ - пункт выдачи заказов ПВЗ
146
     *
147
     * @JMS\Type("string")
148
     * @JMS\SerializedName("typedelivery")
149
     */
150
    private ?string $typeDelivery = null;
151
152
    /**
153
     * Запрос базовой стоимости доставки (используется для запроса стоимости доставки только DS), может принимать значения:
154
     *  NO - Полная стоимость, включающая все комиссии (значение по-умолчанию)
155
     *  YES - Базовая стоимость доставки без доп услуг
156
     *
157
     * @JMS\Type("string")
158
     * @JMS\SerializedName("withouttax")
159
     */
160
    private ?string $withoutTax = null;
161
162
    /**
163
     * Меняет формат ответа
164
     *  x2 - расширенный формат. Обязателен для Почты России
165
     *
166
     * @JMS\Type("string")
167
     * @JMS\SerializedName("output")
168
     */
169
    private ?string $output = null;
170
171
    /**
172
     * @return string|null
173
     */
174 1
    public function getPartner(): ?string
175
    {
176 1
        return $this->partner;
177
    }
178
179
    /**
180
     * @param string|null $partner
181
     *
182
     * @return DeliveryCostRequest
183
     */
184 1
    public function setPartner(?string $partner): DeliveryCostRequest
185
    {
186 1
        $this->partner = $partner;
187 1
        return $this;
188
    }
189
190
    /**
191
     * @return string|null
192
     */
193 1
    public function getTo(): ?string
194
    {
195 1
        return $this->to;
196
    }
197
198
    /**
199
     * @param string|null $to
200
     *
201
     * @return DeliveryCostRequest
202
     */
203 1
    public function setTo(?string $to): DeliveryCostRequest
204
    {
205 1
        $this->to = $to;
206 1
        return $this;
207
    }
208
209
    /**
210
     * @return string|null
211
     * @deprecated Не рекомендуется
212
     */
213 1
    public function getTownTo(): ?string
214
    {
215 1
        return $this->townTo;
0 ignored issues
show
Deprecated Code introduced by
The property DalliSDK\Requests\DeliveryCostRequest::$townTo has been deprecated: Не рекомендуется ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

215
        return /** @scrutinizer ignore-deprecated */ $this->townTo;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
216
    }
217
218
    /**
219
     *
220
     * @param string|null $townTo
221
     *
222
     * @return DeliveryCostRequest
223
     * @deprecated Не рекомендуется
224
     *
225
     */
226 1
    public function setTownTo(?string $townTo): DeliveryCostRequest
227
    {
228 1
        $this->townTo = $townTo;
0 ignored issues
show
Deprecated Code introduced by
The property DalliSDK\Requests\DeliveryCostRequest::$townTo has been deprecated: Не рекомендуется ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

228
        /** @scrutinizer ignore-deprecated */ $this->townTo = $townTo;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
229 1
        return $this;
230
    }
231
232
    /**
233
     * @return string|null
234
     */
235 1
    public function getFias(): ?string
236
    {
237 1
        return $this->fias;
238
    }
239
240
    /**
241
     * @param string|null $fias
242
     *
243
     * @return DeliveryCostRequest
244
     */
245 1
    public function setFias(?string $fias): DeliveryCostRequest
246
    {
247 1
        $this->fias = $fias;
248 1
        return $this;
249
    }
250
251
    /**
252
     * @return string|null
253
     */
254 1
    public function getKladr(): ?string
255
    {
256 1
        return $this->kladr;
257
    }
258
259
    /**
260
     * @param string|null $kladr
261
     *
262
     * @return DeliveryCostRequest
263
     */
264 1
    public function setKladr(?string $kladr): DeliveryCostRequest
265
    {
266 1
        $this->kladr = $kladr;
267 1
        return $this;
268
    }
269
270
    /**
271
     * @return string|null
272
     */
273 1
    public function getPvzCode(): ?string
274
    {
275 1
        return $this->pvzCode;
276
    }
277
278
    /**
279
     * @param string|null $pvzCode
280
     *
281
     * @return DeliveryCostRequest
282
     */
283 1
    public function setPvzCode(?string $pvzCode): DeliveryCostRequest
284
    {
285 1
        $this->pvzCode = $pvzCode;
286 1
        return $this;
287
    }
288
289
    /**
290
     * @return int|null
291
     */
292 1
    public function getCdekCityId(): ?int
293
    {
294 1
        return $this->cdekCityId;
295
    }
296
297
    /**
298
     * @param int|null $cdekCityId
299
     *
300
     * @return DeliveryCostRequest
301
     */
302 1
    public function setCdekCityId(?int $cdekCityId): DeliveryCostRequest
303
    {
304 1
        $this->cdekCityId = $cdekCityId;
305 1
        return $this;
306
    }
307
308
    /**
309
     * @return string|null
310
     */
311 1
    public function getOblName(): ?string
312
    {
313 1
        return $this->oblName;
314
    }
315
316
    /**
317
     * @param string|null $oblName
318
     *
319
     * @return DeliveryCostRequest
320
     */
321 1
    public function setOblName(?string $oblName): DeliveryCostRequest
322
    {
323 1
        $this->oblName = $oblName;
324 1
        return $this;
325
    }
326
327
    /**
328
     * @return float|null
329
     */
330 1
    public function getWeight(): ?float
331
    {
332 1
        return $this->weight;
333
    }
334
335
    /**
336
     * @param float|null $weight
337
     *
338
     * @return DeliveryCostRequest
339
     */
340 1
    public function setWeight(?float $weight): DeliveryCostRequest
341
    {
342 1
        $this->weight = $weight;
343 1
        return $this;
344
    }
345
346
    /**
347
     * @return string|null
348
     */
349 1
    public function getSenderCode(): ?string
350
    {
351 1
        return $this->senderCode;
352
    }
353
354
    /**
355
     * @param string|null $senderCode
356
     *
357
     * @return DeliveryCostRequest
358
     */
359 1
    public function setSenderCode(?string $senderCode): DeliveryCostRequest
360
    {
361 1
        $this->senderCode = $senderCode;
362 1
        return $this;
363
    }
364
365
    /**
366
     * @return int|null
367
     */
368 1
    public function getPrice(): ?int
369
    {
370 1
        return $this->price;
371
    }
372
373
    /**
374
     * @param int|null $price
375
     *
376
     * @return DeliveryCostRequest
377
     */
378 1
    public function setPrice(?int $price): DeliveryCostRequest
379
    {
380 1
        $this->price = $price;
381 1
        return $this;
382
    }
383
384
    /**
385
     * @return int|null
386
     */
387 1
    public function getInshprice(): ?int
388
    {
389 1
        return $this->inshprice;
390
    }
391
392
    /**
393
     * @param int|null $inshprice
394
     *
395
     * @return DeliveryCostRequest
396
     */
397 1
    public function setInshprice(?int $inshprice): DeliveryCostRequest
398
    {
399 1
        $this->inshprice = $inshprice;
400 1
        return $this;
401
    }
402
403
    /**
404
     * @return string|null
405
     */
406 1
    public function getCashServices(): ?string
407
    {
408 1
        return $this->cashServices;
409
    }
410
411
    /**
412
     * @param string|null $cashServices
413
     *
414
     * @return DeliveryCostRequest
415
     */
416 1
    public function setCashServices(?string $cashServices): DeliveryCostRequest
417
    {
418 1
        $this->cashServices = $cashServices;
419 1
        return $this;
420
    }
421
422
    /**
423
     * @return int|null
424
     */
425 1
    public function getLength(): ?int
426
    {
427 1
        return $this->length;
428
    }
429
430
    /**
431
     * @param int|null $length
432
     *
433
     * @return DeliveryCostRequest
434
     */
435 1
    public function setLength(?int $length): DeliveryCostRequest
436
    {
437 1
        $this->length = $length;
438 1
        return $this;
439
    }
440
441
    /**
442
     * @return int|null
443
     */
444 1
    public function getWidth(): ?int
445
    {
446 1
        return $this->width;
447
    }
448
449
    /**
450
     * @param int|null $width
451
     *
452
     * @return DeliveryCostRequest
453
     */
454 1
    public function setWidth(?int $width): DeliveryCostRequest
455
    {
456 1
        $this->width = $width;
457 1
        return $this;
458
    }
459
460
    /**
461
     * @return int|null
462
     */
463 1
    public function getHeight(): ?int
464
    {
465 1
        return $this->height;
466
    }
467
468
    /**
469
     * @param int|null $height
470
     *
471
     * @return DeliveryCostRequest
472
     */
473 1
    public function setHeight(?int $height): DeliveryCostRequest
474
    {
475 1
        $this->height = $height;
476 1
        return $this;
477
    }
478
479
    /**
480
     * @return string|null
481
     */
482 1
    public function getTypeDelivery(): ?string
483
    {
484 1
        return $this->typeDelivery;
485
    }
486
487
    /**
488
     * @param string|null $typeDelivery
489
     *
490
     * @return DeliveryCostRequest
491
     */
492 1
    public function setTypeDelivery(?string $typeDelivery): DeliveryCostRequest
493
    {
494 1
        $this->typeDelivery = $typeDelivery;
495 1
        return $this;
496
    }
497
498
    /**
499
     * @return string|null
500
     */
501 1
    public function getWithoutTax(): ?string
502
    {
503 1
        return $this->withoutTax;
504
    }
505
506
    /**
507
     * @param string|null $withoutTax
508
     *
509
     * @return DeliveryCostRequest
510
     */
511 1
    public function setWithoutTax(?string $withoutTax): DeliveryCostRequest
512
    {
513 1
        $this->withoutTax = $withoutTax;
514 1
        return $this;
515
    }
516
517
    /**
518
     * @return string|null
519
     */
520 1
    public function getOutput(): ?string
521
    {
522 1
        return $this->output;
523
    }
524
525
    /**
526
     * @param string|null $output
527
     *
528
     * @return DeliveryCostRequest
529
     */
530 1
    public function setOutput(?string $output): DeliveryCostRequest
531
    {
532 1
        $this->output = $output;
533 1
        return $this;
534
    }
535
}
536