feat: replace custom discount with absolute value in favor of percentage
This commit is contained in:
1 parent
d6c2cfaf1c
commit
f8ff4b82a3
15 files changed
+105
-50
No files matched your search
@@ -156,13 +156,14 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
#[Assert\Range(min: 1, max: 100)]
|
||||
private ?int $additionalServicesDiscount = null;
|
||||
|
||||
/** Absolute discount on the total, in minor units. Applied after the three section discounts. */
|
||||
#[ORM\Column(nullable: true)]
|
||||
#[Assert\Range(min: 1, max: 100)]
|
||||
private ?int $totalDiscount = null;
|
||||
#[Assert\Positive]
|
||||
private ?int $totalDiscountAmount = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
#[Assert\Expression(
|
||||
'null === this.getTotalDiscount() or (null !== value and "" !== value)',
|
||||
'null === this.getTotalDiscountAmount() or (null !== value and "" !== value)',
|
||||
message: 'Bitte eine Bezeichnung für den Rabatt angeben.',
|
||||
)]
|
||||
private ?string $totalDiscountLabel = null;
|
||||
@@ -649,14 +650,14 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTotalDiscount(): ?int
|
||||
public function getTotalDiscountAmount(): ?int
|
||||
{
|
||||
return $this->totalDiscount;
|
||||
return $this->totalDiscountAmount;
|
||||
}
|
||||
|
||||
public function setTotalDiscount(?int $totalDiscount): self
|
||||
public function setTotalDiscountAmount(?int $totalDiscountAmount): self
|
||||
{
|
||||
$this->totalDiscount = $totalDiscount;
|
||||
$this->totalDiscountAmount = $totalDiscountAmount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user