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>
32 lines
929 B
PHP
32 lines
929 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Household;
|
|
|
|
use App\Models\HouseholdMember;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class StoreHouseholdMemberRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'user_id' => ['nullable', 'integer', 'exists:users,id'],
|
|
'full_name' => ['required_without:user_id', 'nullable', 'string', 'max:191'],
|
|
'relationship' => ['required', Rule::in([
|
|
HouseholdMember::RELATIONSHIP_SPOUSE,
|
|
HouseholdMember::RELATIONSHIP_CHILD,
|
|
HouseholdMember::RELATIONSHIP_PARENT,
|
|
HouseholdMember::RELATIONSHIP_SIBLING,
|
|
HouseholdMember::RELATIONSHIP_OTHER,
|
|
])],
|
|
'date_of_birth' => ['nullable', 'date', 'before:today'],
|
|
];
|
|
}
|
|
}
|