presseportale/app/Services/Web/PreisePageData.php
Kevin Adametz 0474d22347 Boost-Slot-Grenzen (5/3) + Kategorie-Boost zum halben Satz
Entscheidung 13.07.: verkauft wird nur, was sichtbar ist — max. 5
gleichzeitige Boosts je Startseite, 3 je Branchenseite (= die sichtbaren
Plaetze; Hero-Slider damit vertagt). Neue Stufe Kategorie-Boost (nur
Branchenseite, 6/10/18 Credits = 50 % aufgerundet); der Startseiten-Boost
(12/20/35) erscheint weiter auf Start- UND Branchenseite.

- boosts.placement (home/category, Bestand = home) + BoostPlacement-Enum;
  Preise/Slots in config/credits.php (boost_category, boost_slots)
- BoostService::slotAvailability() je Ausgabe (Portal x Sprache, Kategorie
  zusaetzlich je Rubrik); ausgebucht -> soldOut-Exception mit fruehestem
  freien Termin; Verlaengerungen halten ihren Slot, Stufen verlaengern
  unabhaengig; Kategorie-Boost invalidiert nur Kategorie-Caches
- Startseite zeigt nur Home-Boosts; Branchenseite: Kategorie-Boosts mit
  Vorrang (ihre 3 Slots sind die Garantie), Home-Boosts fuellen den Rest
- Add-on-Panel der PM-Seite: zwei Boost-Angebote, bei vollem Inventar
  "Derzeit ausgebucht — frei ab" statt Kauf-Buttons (serverseitig gegated);
  Buchungsseiten-Preisliste um die Kategorie-Staffel ergaenzt

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 12:28:03 +00:00

54 lines
1.9 KiB
PHP

<?php
namespace App\Services\Web;
use App\Enums\Tier;
use App\Models\Plan;
/**
* Datenaufbereitung der öffentlichen Preise-/Tarifseite: Abos (Plan-Modell),
* Einzel-PM (config/billing) und Add-on-Einzelkosten (config/credits).
* Inhalte liegen in lang/*\/pricing.php.
*/
class PreisePageData
{
/**
* @return array<string, mixed>
*/
public function build(): array
{
// Add-on-Einzelkosten aus der Credit-Ökonomie (1 Credit = 1 €).
$extraPm = collect(config('credits.extra_pm', []))
->map(static fn (int $credits, string $tier): array => [
'tier' => Tier::tryFrom($tier)?->label() ?? ucfirst($tier),
'credits' => $credits,
])
->values()
->all();
$staffel = static fn (array $table): array => collect($table)
->map(static fn (int $credits, int|string $days): array => [
'days' => (int) $days,
'credits' => $credits,
])
->values()
->all();
return [
'plans' => Plan::query()->active()->get(),
'singlePmPriceCents' => (int) config('billing.single_pm_price_cents'),
'extraPm' => $extraPm,
'boost' => $staffel(config('credits.boost', [])),
// Kategorie-Boost (nur Branchenseite, halber Satz — 13.07.2026).
'boostCategory' => $staffel(config('credits.boost_category', [])),
'proofPdf' => (int) config('credits.proof_pdf'),
'creditPacks' => config('credits.packs', []),
// TODO: Lineup/Preise hängen am Bookings-/Magic-Link-Rework — final abstimmen.
'morePaths' => [
'correction' => (int) config('credits.paths.correction'),
'update' => (int) config('credits.paths.update'),
'depublish' => (int) config('credits.depublish'),
],
];
}
}