households + household_members tables. Resident endpoints to create one household (auto-resolves barangay from GPS), upload proof of residency, manage members. Admin endpoints to list/approve/reject. Approving fires HouseholdVerified event with a placeholder listener; Module 7 replaces the body with actual QR batch allocation. Approved households are immutable to residents; resubmitting after rejection resets to pending. 84 feature tests passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
30 lines
850 B
PHP
30 lines
850 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Household;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
use MatanYadaev\EloquentSpatial\Objects\Point;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Household>
|
|
*/
|
|
class HouseholdFactory extends Factory
|
|
{
|
|
protected $model = Household::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'uuid' => (string) Str::uuid(),
|
|
'head_user_id' => User::factory()->create(['role' => User::ROLE_RESIDENT])->id,
|
|
'address_line' => fake()->streetAddress(),
|
|
'coordinates' => new Point(14.6, 121.0, 4326),
|
|
'household_size' => fake()->numberBetween(1, 6),
|
|
'verification_status' => Household::VERIFICATION_PENDING,
|
|
];
|
|
}
|
|
}
|