51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\IncentiveParticipant;
|
|
use App\Models\IncentivePointsLog;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class IncentivePointsLogFactory extends Factory
|
|
{
|
|
protected $model = IncentivePointsLog::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'participant_id' => IncentiveParticipant::factory(),
|
|
'type' => 'partner',
|
|
'source_type' => 'App\\User',
|
|
'source_id' => 1,
|
|
'source_label' => $this->faker->name(),
|
|
'month' => 4,
|
|
'year' => 2026,
|
|
'points_onetime' => 600,
|
|
'points_accumulated' => 0,
|
|
'is_storno' => false,
|
|
];
|
|
}
|
|
|
|
public function partner(): static
|
|
{
|
|
return $this->state([
|
|
'type' => 'partner',
|
|
'points_onetime' => 600,
|
|
]);
|
|
}
|
|
|
|
public function abo(): static
|
|
{
|
|
return $this->state([
|
|
'type' => 'abo',
|
|
'points_onetime' => 400,
|
|
]);
|
|
}
|
|
|
|
public function storno(): static
|
|
{
|
|
return $this->state([
|
|
'is_storno' => true,
|
|
]);
|
|
}
|
|
}
|