Add personal application fields to members

This commit is contained in:
2026-01-25 05:52:40 +08:00
parent 65de7d9019
commit c2f0047ed9
10 changed files with 729 additions and 27 deletions

View File

@@ -33,18 +33,30 @@ class Member extends Model
// Identity type constants (病友/家長)
const IDENTITY_PATIENT = 'patient'; // 病友
const IDENTITY_PARENT = 'parent'; // 家長/父母
const IDENTITY_SOCIAL = 'social'; // 社會人士
const IDENTITY_OTHER = 'other'; // 其他
protected $fillable = [
'user_id',
'member_number',
'full_name',
'email',
'phone',
'phone_home',
'phone_fax',
'address_line_1',
'address_line_2',
'city',
'postal_code',
'birth_date',
'gender',
'occupation',
'employer',
'job_title',
'applied_at',
'emergency_contact_name',
'emergency_contact_phone',
'national_id',
'national_id_encrypted',
'national_id_hash',
'membership_started_at',
@@ -52,6 +64,7 @@ class Member extends Model
'membership_status',
'membership_type',
'identity_type',
'identity_other_text',
'guardian_member_id',
'disability_certificate_path',
'disability_certificate_status',
@@ -63,6 +76,8 @@ class Member extends Model
protected $casts = [
'membership_started_at' => 'date',
'membership_expires_at' => 'date',
'birth_date' => 'date',
'applied_at' => 'date',
'disability_verified_at' => 'datetime',
];
@@ -118,6 +133,8 @@ class Member extends Model
return match ($this->identity_type) {
self::IDENTITY_PATIENT => '病友',
self::IDENTITY_PARENT => '家長/父母',
self::IDENTITY_SOCIAL => '社會人士',
self::IDENTITY_OTHER => $this->identity_other_text ? '其他(' . $this->identity_other_text . '' : '其他',
default => '未設定',
};
}