finishes 13 and 14
This commit is contained in:
51
database/factories/SessionFactory.php
Normal file
51
database/factories/SessionFactory.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\Session;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* Factory for generating Session test data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Session>
|
||||
*/
|
||||
final class SessionFactory extends Factory
|
||||
{
|
||||
protected $model = Session::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => User::factory(),
|
||||
'category_id' => Category::factory(),
|
||||
'screening_id' => null,
|
||||
'status' => 'in_progress',
|
||||
'score' => null,
|
||||
'result' => null,
|
||||
'basic_info' => null,
|
||||
'additional_comments' => null,
|
||||
'completed_at' => null,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the session is completed.
|
||||
*/
|
||||
public function completed(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'status' => 'completed',
|
||||
'score' => 8,
|
||||
'result' => 'consult_leadership',
|
||||
'completed_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user