feat: fold purchase and promo voucher fields into one code field

This commit is contained in:
fromme committed 2026-10-06 10:41:30 +02:00
1 parent 93512b8345
commit 21d756a2e3
21 files changed
+801 -432

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace App\Enum;
/**
* What a code typed into the booking voucher field is, as far as its format tells.
*
* Kauf vs. Kulanz is not visible in the code; BusPro tells them apart when the purchase code is checked.
*/
enum VoucherCodeKind: string
{
// Aktionsgutschein, checked with AKTIONSGUTSCHEIN and sent as the participant's <aktionscode>
case Promo = 'promo';
// Kauf- or Kulanzgutschein, checked with GUTSCHEINPRUEFUNGEINLOESUNG
case Purchase = 'purchase';
// Cannot be either, so it is rejected without asking BusPro
case Malformed = 'malformed';
}