simedkom/database/factories/CompanyFactory.php

72 lines
2.1 KiB
PHP

<?php
namespace Database\Factories;
use App\Enums\VerificationStatus;
use App\Models\Company;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Company>
*/
class CompanyFactory extends Factory
{
protected $model = Company::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'user_id' => User::factory(),
'name' => $this->faker->company(),
'email' => $this->faker->unique()->companyEmail(),
'address' => $this->faker->address(),
'director_name' => $this->faker->name(),
'director_nik' => $this->faker->numerify('################'),
'deed_incorporation' => $this->faker->numerify('AHU-#######.AH.##.##'),
'trade_license' => $this->faker->numerify('###/###/SIUP/####'),
'tax_id_number' => $this->faker->numerify('##.###.###.#-###.###'),
'taxable_enterprise' => $this->faker->numerify('###.###.###.###'),
'annual_tax_return' => $this->faker->numerify('SPT-####-########'),
'domicile_certificate' => $this->faker->numerify('###/###/DOMISILI/####'),
'profile' => $this->faker->numerify('PROFILE-####-########'),
'profile' => $this->faker->numerify('PROFILE-####-########'),
];
}
/**
* Indicate that the company is validated.
*/
public function validated(): static
{
return $this->state(fn (array $attributes) => [
'status' => VerificationStatus::APPROVED,
]);
}
/**
* Indicate that the company is rejected.
*/
public function rejected(): static
{
return $this->state(fn (array $attributes) => [
'status' => VerificationStatus::REJECTED,
]);
}
/**
* Indicate that the company is pending validation.
*/
public function pending(): static
{
return $this->state(fn (array $attributes) => [
'status' => VerificationStatus::PENDING,
]);
}
}