58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\VerificationStatus;
|
|
use App\Models\Company;
|
|
use App\Models\User;
|
|
use App\Models\VerificationRequest;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<VerificationRequest>
|
|
*/
|
|
class VerificationRequestFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'company_id' => Company::factory(),
|
|
'submitted_by' => User::factory(),
|
|
'status' => VerificationStatus::PENDING,
|
|
];
|
|
}
|
|
|
|
public function pending(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'status' => VerificationStatus::PENDING,
|
|
]);
|
|
}
|
|
|
|
public function approved(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'status' => VerificationStatus::APPROVED,
|
|
]);
|
|
}
|
|
|
|
public function rejected(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'status' => VerificationStatus::REJECTED,
|
|
]);
|
|
}
|
|
|
|
public function needRevision(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'status' => VerificationStatus::NEED_REVISION,
|
|
]);
|
|
}
|
|
}
|