File tree Expand file tree Collapse file tree
Endpoint/PriceLists/UpdatePricelistRequest/UpdatePricelistRequest/Data Expand file tree Collapse file tree Original file line number Diff line number Diff line change 342342require_once __DIR__ . '/src/Component/ValueObject/TypeUnitRatio.php ' ;
343343require_once __DIR__ . '/src/Component/ValueObject/TypeVariantCodeRequest.php ' ;
344344require_once __DIR__ . '/src/Component/ValueObject/TypeVatRate.php ' ;
345+ require_once __DIR__ . '/src/Component/ValueObject/TypeVatRateNullable.php ' ;
345346require_once __DIR__ . '/src/Component/ValueObject/TypeWeight.php ' ;
346347require_once __DIR__ . '/src/Component/ValueObject/TypeWeightRequest.php ' ;
347348require_once __DIR__ . '/src/Component/ValueObject/TypeWeightUnlimited.php ' ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Shoptet \Api \Sdk \Php \Component \ValueObject ;
4+
5+ use Shoptet \Api \Sdk \Php \Exception \InvalidArgumentException ;
6+
7+ readonly class TypeVatRateNullable implements ValueObjectInterface
8+ {
9+ public function __construct (
10+ public ?string $ typeVatRateNullable ,
11+ ) {
12+ if ($ this ->typeVatRateNullable === null ) {
13+ return ;
14+ }
15+ if (!preg_match ('/^[0-9]+\.[0-9]{2}$/ ' , $ this ->typeVatRateNullable )) {
16+ throw new InvalidArgumentException (sprintf ('Invalid %s "%s". ' , 'typeVatRateNullable ' , $ this ->typeVatRateNullable ));
17+ }
18+ }
19+
20+ public function equals (self $ typeVatRateNullable ): bool
21+ {
22+ return $ typeVatRateNullable ->typeVatRateNullable === $ this ->typeVatRateNullable ;
23+ }
24+
25+ public function __toString (): string
26+ {
27+ return (string ) $ this ->typeVatRateNullable ;
28+ }
29+
30+ public function jsonSerialize (): string
31+ {
32+ return $ this ->__toString ();
33+ }
34+ }
Original file line number Diff line number Diff line change 33namespace Shoptet \Api \Sdk \Php \Endpoint \PriceLists \UpdatePricelistRequest \UpdatePricelistRequest \Data ;
44
55use Shoptet \Api \Sdk \Php \Component \Entity \Entity ;
6- use Shoptet \Api \Sdk \Php \Component \ValueObject \TypePriceNullable ;
6+ use Shoptet \Api \Sdk \Php \Component \ValueObject \TypeVatRateNullable ;
77use Shoptet \Api \Sdk \Php \Endpoint \PriceLists \UpdatePricelistRequest \UpdatePricelistRequest \Data \Item \OrderableAmount ;
88use Shoptet \Api \Sdk \Php \Endpoint \PriceLists \UpdatePricelistRequest \UpdatePricelistRequest \Data \Item \Price ;
99use Shoptet \Api \Sdk \Php \Endpoint \PriceLists \UpdatePricelistRequest \UpdatePricelistRequest \Data \Item \PriceWithVat ;
@@ -15,7 +15,7 @@ class Item extends Entity
1515{
1616 protected string $ code ;
1717 protected ?string $ currencyCode ;
18- protected ?TypePriceNullable $ vatRate ;
18+ protected ?TypeVatRateNullable $ vatRate ;
1919 protected ?bool $ includingVat ;
2020 protected ?OrderableAmount $ orderableAmount ;
2121 protected ?Sales $ sales ;
@@ -46,12 +46,12 @@ public function setCurrencyCode(?string $currencyCode): static
4646 return $ this ;
4747 }
4848
49- public function getVatRate (): ?TypePriceNullable
49+ public function getVatRate (): ?TypeVatRateNullable
5050 {
5151 return $ this ->vatRate ;
5252 }
5353
54- public function setVatRate (?TypePriceNullable $ vatRate ): static
54+ public function setVatRate (?TypeVatRateNullable $ vatRate ): static
5555 {
5656 $ this ->vatRate = $ vatRate ;
5757 return $ this ;
Original file line number Diff line number Diff line change 44
55use Shoptet \Api \Sdk \Php \Component \Entity \Entity ;
66use Shoptet \Api \Sdk \Php \Component \ValueObject \TypePriceNullable ;
7+ use Shoptet \Api \Sdk \Php \Component \ValueObject \TypeVatRateNullable ;
78
89class PurchasePrice extends Entity
910{
1011 protected ?TypePriceNullable $ price ;
11- protected ?TypePriceNullable $ vatRate ;
12+ protected ?TypeVatRateNullable $ vatRate ;
1213 protected ?bool $ includingVat ;
1314
1415 public function getPrice (): ?TypePriceNullable
@@ -22,12 +23,12 @@ public function setPrice(?TypePriceNullable $price): static
2223 return $ this ;
2324 }
2425
25- public function getVatRate (): ?TypePriceNullable
26+ public function getVatRate (): ?TypeVatRateNullable
2627 {
2728 return $ this ->vatRate ;
2829 }
2930
30- public function setVatRate (?TypePriceNullable $ vatRate ): static
31+ public function setVatRate (?TypeVatRateNullable $ vatRate ): static
3132 {
3233 $ this ->vatRate = $ vatRate ;
3334 return $ this ;
You can’t perform that action at this time.
0 commit comments