Build world campaigns rewards and recaps
This commit is contained in:
@@ -28,7 +28,10 @@ class WorldFactory extends Factory
|
||||
'slug' => Str::slug($title),
|
||||
'tagline' => $this->faker->sentence(6),
|
||||
'summary' => $this->faker->sentence(12),
|
||||
'teaser_title' => null,
|
||||
'teaser_summary' => null,
|
||||
'description' => $this->faker->paragraphs(2, true),
|
||||
'teaser_image_path' => null,
|
||||
'theme_key' => 'summer',
|
||||
'accent_color' => '#22c55e',
|
||||
'accent_color_secondary' => '#0f172a',
|
||||
@@ -38,7 +41,12 @@ class WorldFactory extends Factory
|
||||
'type' => World::TYPE_SEASONAL,
|
||||
'starts_at' => $startsAt,
|
||||
'ends_at' => $endsAt,
|
||||
'promotion_starts_at' => $startsAt,
|
||||
'promotion_ends_at' => $endsAt,
|
||||
'is_featured' => false,
|
||||
'is_active_campaign' => false,
|
||||
'is_homepage_featured' => false,
|
||||
'campaign_priority' => null,
|
||||
'accepts_submissions' => true,
|
||||
'participation_mode' => World::PARTICIPATION_MODE_MANUAL_APPROVAL,
|
||||
'submission_starts_at' => $startsAt->copy()->subDay(),
|
||||
@@ -53,6 +61,7 @@ class WorldFactory extends Factory
|
||||
'cta_label' => 'Explore world',
|
||||
'cta_url' => '/worlds',
|
||||
'badge_label' => null,
|
||||
'campaign_label' => null,
|
||||
'badge_description' => null,
|
||||
'badge_url' => null,
|
||||
'seo_title' => $title,
|
||||
@@ -73,6 +82,27 @@ class WorldFactory extends Factory
|
||||
]);
|
||||
}
|
||||
|
||||
public function activeCampaign(int $priority = 100): self
|
||||
{
|
||||
return $this->state(fn (): array => [
|
||||
'is_active_campaign' => true,
|
||||
'campaign_priority' => $priority,
|
||||
'promotion_starts_at' => Carbon::now()->subDays(2),
|
||||
'promotion_ends_at' => Carbon::now()->addDays(5),
|
||||
]);
|
||||
}
|
||||
|
||||
public function homepageFeatured(int $priority = 100): self
|
||||
{
|
||||
return $this->state(fn (): array => [
|
||||
'is_active_campaign' => true,
|
||||
'is_homepage_featured' => true,
|
||||
'campaign_priority' => $priority,
|
||||
'promotion_starts_at' => Carbon::now()->subDays(2),
|
||||
'promotion_ends_at' => Carbon::now()->addDays(5),
|
||||
]);
|
||||
}
|
||||
|
||||
public function current(): self
|
||||
{
|
||||
return $this->state(fn (): array => [
|
||||
|
||||
Reference in New Issue
Block a user