Handling of event addons

This commit is contained in:
2026-08-12 17:18:45 +02:00
parent 085299336e
commit 6e4e6b645c
74 changed files with 3072 additions and 95 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace App\Enumerations;
/**
* Preismodus bei bestehender Umsatzsteuerpflicht: entweder ist die USt bereits im konfigurierten Beitrag
* enthalten (Brutto/„Supermarkt") oder sie wird bei der Preisermittlung aufgeschlagen (Netto). Gespeichert
* wird immer der finale Brutto-Beitrag; der Modus beeinflusst nur die Preisermittlung im Anmeldeprozess.
*/
enum VatPricingMode: string
{
case Inclusive = 'inclusive';
case AddOn = 'add_on';
public function label(): string
{
return match ($this) {
self::Inclusive => 'Inklusive Beiträge sind Endpreise (USt enthalten)',
self::AddOn => 'Aufschlagen USt wird auf die Beiträge aufgeschlagen',
};
}
/**
* Optionen für das Frontend: [['value' => ..., 'label' => ...], ...].
*
* @return array<int, array{value: string, label: string}>
*/
public static function options(): array
{
return array_map(
static fn (self $mode): array => [
'value' => $mode->value,
'label' => $mode->label(),
],
self::cases(),
);
}
}