# Checklist: Cooperative Member & User Info Expansion

## 1. Database Expansion
- [x] **Migration**: Create `2026_04_02_000001_expand_user_infos_table.php`:
    - Add `firstname`, `middlename`, `lastname`, `suffix`, `gender`, `dob` (date).
    - Add social accounts: `messenger_id`, `viber_number`, `tiktok_username`.
    - Add address components: `region`, `province`, `city`, `barangay`.
    - Add family: `civil_status`, `children_count` (int), `education_level`, `course`, `school`, `year_last_attended`.
    - Add livelihood: `livelihood_source`, `last_company`, `last_position`, `last_employment_year`.
    - Add government: `tin`, `philhealth_id`, `gov_id`.
    - Add emergency contact info: `emergency_contact_name`, `emergency_contact_address`, `emergency_contact_phone`, `emergency_contact_relation`, `emergency_contact_user_id` (nullable foreign key).
- [x] **Migration**: Create `2026_04_02_000002_expand_cooperative_members_table.php`:
    - Add `membership_type`, `membership_level`, `officer_position`, `officer_level`, `concurrent_position`, `concurrent_level`, `cooperative_name_alt`, `cooperative_position`, `year_beginning`.

## 2. Model Updates
- [x] **App/Models/Market/UserInfo.php**:
    - Update `$fillable` array with new fields.
    - Add `emergencyContactUser()` relation (BelongsTo User).
- [x] **App/Models/Market/CooperativeMember.php**:
    - Update `$fillable` with new membership fields.

## 3. Controller Logic
- [x] **App/Http/Controllers/Market/UserInfoController.php**:
    - Update `updateUserInfo` to handle newly added fields.
    - Implement logic in `updateUserInfo` to automatically populate `emergency_contact_user_id` if the `emergency_contact_phone` matches a registered user's `mobile_number`.
- [x] **App/Http/Controllers/Market/CooperativeController.php**:
    - Ensure membership field updates are supported in `joinCooperative` and `addMember` endpoints.

## 4. UI Redesign (Vue 3)
- [x] **Resources/js/Pages/UserInfoEdit.vue**:
    - Group fields into expandable sections or card groups (Personal, Social, Family/Education, Livelihood, etc.).
    - Implement the "Emergency Contact" section with a visual cue if linked to a system user.

## 5. Seeders
- [x] **Database/Seeders/UpdateUserInfoSeeder.php**:
    - Ensure sample data from `README.md` (Rex Moran Loba) can be seeded into a test user profile.

## 6. Execution & Build
- [ ] Run migrations: `docker compose exec bukidbountyapp php artisan migrate`
- [ ] Run build: `npm run build`
- [ ] Restart: `docker restart bukidbountyapp`
