Files
Verde-Web/app/Models/HouseholdMember.php
admin 4eb2d14e52 feat(backend): complete Module 4 (household registration)
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>
2026-04-30 00:06:37 +08:00

48 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class HouseholdMember extends Model
{
use HasFactory, SoftDeletes;
public const RELATIONSHIP_HEAD = 'head';
public const RELATIONSHIP_SPOUSE = 'spouse';
public const RELATIONSHIP_CHILD = 'child';
public const RELATIONSHIP_PARENT = 'parent';
public const RELATIONSHIP_SIBLING = 'sibling';
public const RELATIONSHIP_OTHER = 'other';
protected $fillable = [
'household_id',
'user_id',
'relationship',
'full_name',
'date_of_birth',
'joined_at',
];
protected function casts(): array
{
return [
'date_of_birth' => 'date',
'joined_at' => 'datetime',
];
}
public function household(): BelongsTo
{
return $this->belongsTo(Household::class);
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}