Files
fewo-stommer/app/Enums/DiscountType.php
T
Lars StommerandClaude Opus 5.5 7d0bc93abc Offers by their own rules, seasonal photos per section, theme authoring tooling
- Special offers: kinds (rule, fixed dates, gap filler), package price, priority, highlight;
  GapFinder detects calendar gaps (optionally waiving the minimum stay); OfferShowcase decides
  what the website advertises and prices fixed dates/gaps with PriceCalculator; offers section
  shows them side by side, as a list or rotating; hero can show the top offer. Appearances no
  longer carry a featured offer.
- Sections get stable ids; appearances set photos per section ("Bilder je Baustein") and
  sections can be limited to appearances. Photo pickers show thumbnails everywhere.
- Themes: themes:make (scaffold, never overwrites), themes:check (contract, build, markup,
  colours, external resources, WCAG contrast), themes:preview (signed links per page and
  appearance), signed ?theme= preview and preview action in the site form, inherited colour
  tokens in the admin. Base CSS split into theme.css + reusable theme-base.css.
- docs/THEME-ERSTELLUNG.md: binding guide for building additional themes elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:51:38 +02:00

40 lines
1.2 KiB
PHP

<?php
namespace App\Enums;
use Filament\Support\Contracts\HasLabel;
enum DiscountType: string implements HasLabel
{
/** discount_value = percent of the accommodation price */
case Percent = 'percent';
/** discount_value = euro cents off the stay */
case AmountPerStay = 'amount_per_stay';
/** discount_value = special price per night in euro cents */
case NightlyRate = 'nightly_rate';
/** discount_value = number of cheapest nights that are free */
case FreeNights = 'free_nights';
/** discount_value = package price in euro cents for all nights of the stay */
case FixedStayPrice = 'fixed_stay_price';
public function getLabel(): string
{
return match ($this) {
self::Percent => 'Rabatt in %',
self::AmountPerStay => 'Rabatt in € pro Aufenthalt',
self::NightlyRate => 'Sonderpreis pro Nacht',
self::FreeNights => 'Gratis-Nächte',
self::FixedStayPrice => 'Pauschalpreis für den Aufenthalt',
};
}
public function isMoney(): bool
{
return in_array($this, [self::AmountPerStay, self::NightlyRate, self::FixedStayPrice], true);
}
}