From 883519b559d5925555f55c269f1472b2526ed788 Mon Sep 17 00:00:00 2001 From: Paul Radt Date: Wed, 10 Apr 2024 15:39:03 +0200 Subject: [PATCH] Add unitPrice and unitCost properties to Product --- src/Models/Product.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/Models/Product.php b/src/Models/Product.php index a823d54..026a95e 100644 --- a/src/Models/Product.php +++ b/src/Models/Product.php @@ -19,6 +19,8 @@ class Product protected ?array $prices = null; /** @var Price[]|null */ protected ?array $costs = null; + protected ?Price $unitPrice = null; + protected ?Price $unitCost = null; protected ?Period $billingPeriod = null; protected ?Period $subscriptionPeriod = null; protected ?string $billingModel = null; @@ -103,6 +105,22 @@ public function getCosts(): ?array return $this->costs; } + /** + * @return Price|null + */ + public function getUnitPrice(): ?Price + { + return $this->unitPrice; + } + + /** + * @return Price|null + */ + public function getUnitCost(): ?Price + { + return $this->unitCost; + } + /** * @return Period|null */ @@ -247,6 +265,30 @@ public function setCosts(?array $costs): self return $this; } + /** + * @param Price|null $unitPrice + * + * @return self + */ + public function setUnitPrice(?Price $unitPrice): self + { + $this->unitPrice = $unitPrice; + + return $this; + } + + /** + * @param Price|null $unitCost + * + * @return self + */ + public function setUnitCost(?Price $unitCost): self + { + $this->unitCost = $unitCost; + + return $this; + } + /** * @param Period|null $billingPeriod *