DeliverySet::getVatRate()   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
 * Внимание! При явном указании дифференциальной стоимости доставки игнорируется тег priced, а так же настройки Личного Кабинета.
13
 * Если у вас одинаковые условия по стоимости доставки для всех заявок, тогда вы можете задать их глобально в Личном Кабинете
14
 *
15
 * @see https://api.dalli-service.com/v1/doc/createbasket
16
 * @see \DalliSDK\Models\Below
17
 * @JMS\XmlRoot("deliveryset")
18
 */
19
class DeliverySet
20
{
21
    use Fillable;
22
23
    /**
24
     * Стоимость в случае полного выкупа
25
     *
26
     * @JMS\XmlAttribute()
27
     * @JMS\Type("float")
28
     * @JMS\SerializedName("above_price")
29
     */
30
    private float $abovePrice;
31
32
    /**
33
     * Стоимость в случае возврата
34
     *
35
     * @JMS\XmlAttribute()
36
     * @JMS\Type("float")
37
     * @JMS\SerializedName("return_price")
38
     */
39
    private float $returnPrice;
40
41
    /**
42
     * Ставка НДС для позиции Доставка
43
     *
44
     * @JMS\XmlAttribute()
45
     * @JMS\Type("int")
46
     * @JMS\SerializedName("VATrate")
47
     */
48
    private ?int $vatRate = null;
49
50
    /**
51
     * Граница стоимости настроек
52
     *
53
     * @JMS\Type("array<DalliSDK\Models\Below>")
54
     * @JMS\XmlList(inline = true, entry = "below")
55
     * @var \DalliSDK\Models\Below[]
56
     */
57
    private array $belows = [];
58
59
    /**
60
     * @return float
61
     */
62 2
    public function getAbovePrice(): float
63
    {
64 2
        return $this->abovePrice;
65
    }
66
67
    /**
68
     * @return float
69
     */
70 2
    public function getReturnPrice(): float
71
    {
72 2
        return $this->returnPrice;
73
    }
74
75
    /**
76
     * @return int|null
77
     */
78 4
    public function getVatRate(): ?int
79
    {
80 4
        return $this->vatRate;
81
    }
82
83
    /**
84
     * @return array
85
     */
86 3
    public function getBelows(): array
87
    {
88 3
        return $this->belows;
89
    }
90
91
    /**
92
     * @param float $abovePrice
93
     *
94
     * @return DeliverySet
95
     */
96 1
    public function setAbovePrice(float $abovePrice): DeliverySet
97
    {
98 1
        $this->abovePrice = $abovePrice;
99 1
        return $this;
100
    }
101
102
    /**
103
     * @param float $returnPrice
104
     *
105
     * @return DeliverySet
106
     */
107 1
    public function setReturnPrice(float $returnPrice): DeliverySet
108
    {
109 1
        $this->returnPrice = $returnPrice;
110 1
        return $this;
111
    }
112
113
    /**
114
     * @param int|null $vatRate
115
     *
116
     * @return DeliverySet
117
     */
118 2
    public function setVatRate(?int $vatRate): DeliverySet
119
    {
120 2
        $this->vatRate = $vatRate;
121 2
        return $this;
122
    }
123
124
    /**
125
     * @param array $belows
126
     *
127
     * @return DeliverySet
128
     */
129 2
    public function setBelows(array $belows): DeliverySet
130
    {
131 2
        $this->belows = $belows;
132 2
        return $this;
133
    }
134
}
135