Skip to content

Commit 55e1e41

Browse files
committed
Move vatScheme to correct element.
1 parent 7ac56f1 commit 55e1e41

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

src/Api/Builders/StockItemAdvertsInfoBuilder.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Olsgreen\AutoTrader\Api\Builders;
44

55
use Olsgreen\AutoTrader\Api\Enums\ReservationStatuses;
6+
use Olsgreen\AutoTrader\Api\Enums\VatSchemes;
67

78
class StockItemAdvertsInfoBuilder extends AbstractBuilder
89
{
@@ -12,6 +13,8 @@ class StockItemAdvertsInfoBuilder extends AbstractBuilder
1213

1314
protected $retailAdverts;
1415

16+
protected $vatScheme;
17+
1518
protected $reservationStatus;
1619

1720
protected $dueDate;
@@ -65,6 +68,26 @@ public function setReservationStatus($status): self
6568
return $this;
6669
}
6770

71+
public function setVatScheme($scheme): self
72+
{
73+
$schemes = new VatSchemes();
74+
75+
if (!$schemes->contains($scheme)) {
76+
throw new \Exception(
77+
sprintf('\'%s\' is an invalid VAT scheme.', $scheme)
78+
);
79+
}
80+
81+
$this->vatScheme = $scheme;
82+
83+
return $this;
84+
}
85+
86+
public function getVatScheme(): string
87+
{
88+
return $this->vatScheme;
89+
}
90+
6891
public function setStockInDate($date): self
6992
{
7093
if (isset($date) && !($date instanceof \DateTime)) {
@@ -102,6 +125,7 @@ public function toArray(): array
102125
$this->validate();
103126

104127
return $this->filterPrepareOutput([
128+
'vatScheme' => $this->vatScheme,
105129
'reservationStatus' => $this->reservationStatus,
106130
'forecourtPrice' => $this->forecourtPrice->toArray(),
107131
'retailAdverts' => $this->retailAdverts->toArray(),

src/Api/Builders/StockItemRetailAdvertsInfoBuilder.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ class StockItemRetailAdvertsInfoBuilder extends AbstractBuilder
2525

2626
protected $vatStatus;
2727

28-
protected $vatScheme;
29-
3028
protected $priceOnApplication;
3129

3230
protected $suppliedPrice;
@@ -92,26 +90,6 @@ public function getVatStatus(): string
9290
return $this->vatStatus;
9391
}
9492

95-
public function setVatScheme($scheme): StockItemRetailAdvertsInfoBuilder
96-
{
97-
$schemes = new VatSchemes();
98-
99-
if (!$schemes->contains($scheme)) {
100-
throw new \Exception(
101-
sprintf('\'%s\' is an invalid VAT schemes.', $scheme)
102-
);
103-
}
104-
105-
$this->vatScheme = $scheme;
106-
107-
return $this;
108-
}
109-
110-
public function getVatScheme(): string
111-
{
112-
return $this->vatScheme;
113-
}
114-
11593
public function setPriceOnApplication($state): StockItemRetailAdvertsInfoBuilder
11694
{
11795
$this->priceOnApplication = boolval($state);
@@ -192,7 +170,6 @@ public function toArray(): array
192170
return $this->filterPrepareOutput([
193171
'suppliedPrice' => $this->suppliedPrice->toArray(),
194172
'vatStatus' => $this->vatStatus,
195-
'vatScheme' => $this->vatScheme,
196173
'priceOnApplication' => $this->priceOnApplication,
197174
'attentionGrabber' => $this->attentionGrabber,
198175
'description' => $this->description,

0 commit comments

Comments
 (0)