Inhaltliche Korrektur (8 Credits) und Update/Ergänzung (4 Credits) existieren als buchbare Leistungen noch nicht — sie folgen erst mit dem Bookings-/Magic-Link-Rework und fliegen bis dahin von der Preisliste. Depublizieren wird als Direktkauf in Euro abgerechnet (Stripe-Checkout über billing.depublication_price_cents), nicht in Credits: Die Seite zeigt jetzt 35 € aus derselben Preisquelle wie der Kauf-Flow statt der falschen 35 Credits. Ohne konfigurierten Preis verschwindet der Block komplett (wie das Angebot auf der PM-Detailseite). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
53 lines
2 KiB
PHP
53 lines
2 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', []),
|
|
// Depublizieren wird als Direktkauf in Euro abgerechnet (Stripe-
|
|
// Checkout), nicht in Credits — gleiche Preisquelle wie der Kauf-
|
|
// Flow. Null/0 = Angebot deaktiviert, dann zeigt die Seite nichts.
|
|
// Korrektur/Update folgen erst mit dem Bookings-/Magic-Link-Rework.
|
|
'depublicationPriceCents' => (int) config('billing.depublication_price_cents'),
|
|
];
|
|
}
|
|
}
|