feat: improved promotional and purchase vouchers

This commit is contained in:
Björn Fromme committed 2026-03-16 11:59:11 +01:00
1 parent 7df99521c4
commit fb983f23dd
15 files changed
+357 -137

No files matched your search

+24
View File
@@ -16,6 +16,9 @@ namespace App\BusProNet\Model;
*/
final readonly class PurchaseVoucher
{
public const TYPE_PURCHASE = 'Kauf';
public const TYPE_GOODWILL = 'Kulanz';
public function __construct(
public string $voucherNumber,
public string $redemptionCode,
@@ -24,4 +27,25 @@ final readonly class PurchaseVoucher
public string $type,
) {
}
/**
* Checks if this voucher is a purchase voucher.
*
* Purchase vouchers (Kauf) are aggregated into <gutscheine>.
*/
public function isPurchase(): bool
{
return self::TYPE_PURCHASE === $this->type;
}
/**
* Checks if this voucher is a goodwill voucher.
*
* Goodwill vouchers (Kulanz) must be treated as promo vouchers and added
* per participant as <aktionscode>, not aggregated into <gutscheine>.
*/
public function isGoodwill(): bool
{
return self::TYPE_GOODWILL === $this->type;
}
}