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>
50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\BoostPlacement;
|
|
use App\Models\Boost;
|
|
use App\Models\PressRelease;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Boost>
|
|
*/
|
|
class BoostFactory extends Factory
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'press_release_id' => PressRelease::factory(),
|
|
'user_id' => User::factory(),
|
|
'placement' => BoostPlacement::Home,
|
|
'days' => 7,
|
|
'credits_charged' => 12,
|
|
'starts_at' => now(),
|
|
'ends_at' => now()->addDays(7),
|
|
];
|
|
}
|
|
|
|
public function expired(): static
|
|
{
|
|
return $this->state(fn (): array => [
|
|
'starts_at' => now()->subDays(14),
|
|
'ends_at' => now()->subDay(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Kategorie-Boost (nur Branchenseite, halber Satz).
|
|
*/
|
|
public function category(): static
|
|
{
|
|
return $this->state(fn (): array => [
|
|
'placement' => BoostPlacement::Category,
|
|
'credits_charged' => 6,
|
|
]);
|
|
}
|
|
}
|