44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Incentive;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class IncentiveFactory extends Factory
|
|
{
|
|
protected $model = Incentive::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'name' => 'Incentive '.$this->faker->city().' '.$this->faker->year(),
|
|
'description' => $this->faker->sentence(),
|
|
'terms' => $this->faker->paragraph(),
|
|
'qualification_start' => '2026-04-01',
|
|
'qualification_end' => '2026-07-31',
|
|
'calculation_end' => '2026-08-31',
|
|
'points_partner_onetime' => 600,
|
|
'points_abo_onetime' => 400,
|
|
'min_direct_partners' => 4,
|
|
'min_customer_abos' => 6,
|
|
'max_winners' => 30,
|
|
'status' => 1, // active
|
|
];
|
|
}
|
|
|
|
public function draft(): static
|
|
{
|
|
return $this->state(['status' => 0]);
|
|
}
|
|
|
|
public function active(): static
|
|
{
|
|
return $this->state(['status' => 1]);
|
|
}
|
|
|
|
public function closed(): static
|
|
{
|
|
return $this->state(['status' => 2]);
|
|
}
|
|
}
|