========================================================
MULTI-CURRENCY SYSTEM - FILES TO UPLOAD TO CPANEL
========================================================

STEP 1: RUN SQL FIRST (MOST IMPORTANT!)
========================================
File: add_multi_currency_system.sql
Location: Root directory
Action: Open in phpMyAdmin → Select wessssyz_emm database → SQL tab → Paste and Run

This creates:
- currencies table (with 10 default currencies)
- user_currency_accounts table
- currency_transactions table
- Adds columns to transactions and users tables
- Creates USD accounts for all existing users


STEP 2: UPLOAD NEW MODEL FILES
===============================
1. core/app/Models/Currency.php
2. core/app/Models/UserCurrencyAccount.php
3. core/app/Models/CurrencyTransaction.php


STEP 3: UPLOAD NEW CONTROLLER
==============================
1. core/app/Http/Controllers/Admin/CurrencyController.php


STEP 4: UPLOAD NEW VIEW FILES
==============================
1. core/resources/views/admin/currency/index.blade.php
   (Create 'currency' folder first if it doesn't exist)

2. core/resources/views/admin/users/currency_accounts.blade.php
   (Should go in existing 'users' folder)


STEP 5: REPLACE EXISTING FILES (BACKUP FIRST!)
===============================================
1. core/app/Models/User.php
2. core/app/Http/Controllers/Admin/ManageUsersController.php
3. core/resources/views/admin/users/detail.blade.php
4. core/routes/admin.php


UPLOAD PATHS ON SERVER
======================
Server root: /home/wessssyz/bank.wessextrustint.org/

Examples:
- Currency.php goes to:
  /home/wessssyz/bank.wessextrustint.org/core/app/Models/Currency.php

- index.blade.php goes to:
  /home/wessssyz/bank.wessextrustint.org/core/resources/views/admin/currency/index.blade.php


FOLDER CREATION NEEDED
======================
You may need to create this folder:
/home/wessssyz/bank.wessextrustint.org/core/resources/views/admin/currency/


VERIFICATION AFTER UPLOAD
=========================
1. Check in phpMyAdmin:
   ☐ currencies table exists with 10 rows
   ☐ user_currency_accounts table exists
   ☐ currency_transactions table exists
   ☐ transactions table has new columns (currency_code, currency_symbol, exchange_rate)
   ☐ users table has new column (selected_currency)

2. Login as Admin:
   ☐ See "Currency Management" in menu (or access via URL)
   ☐ Go to Users → User Detail
   ☐ See "Currency Accounts" button
   ☐ Click it - should show user's currency accounts


QUICK TEST
==========
1. Login as admin
2. Go to: https://bank.wessextrustint.org/admin/currency
   (Should see currency management page with 10 currencies)

3. Go to: https://bank.wessextrustint.org/admin/users
   (Select any user → User Detail → Click "Currency Accounts")
   (Should see user's USD account with their current balance)


COMMON ISSUES
=============
Issue: "Currency Management" not accessible
Fix: Clear cache, check routes file uploaded correctly

Issue: User has no currency accounts
Fix: Run SQL migration, check user_currency_accounts table created

Issue: Currencies table empty
Fix: Re-run the INSERT statements from add_multi_currency_system.sql

Issue: Views not loading
Fix: Check folder structure, ensure 'currency' folder exists in views/admin/


FILE CHECKLIST
==============
Total: 11 files (4 new + 3 new views + 4 modified)

NEW FILES (7):
☐ Currency.php (Model)
☐ UserCurrencyAccount.php (Model)
☐ CurrencyTransaction.php (Model)
☐ CurrencyController.php (Controller)
☐ admin/currency/index.blade.php (View)
☐ admin/users/currency_accounts.blade.php (View)
☐ add_multi_currency_system.sql (Database)

MODIFIED FILES (4):
☐ User.php
☐ ManageUsersController.php
☐ admin/users/detail.blade.php
☐ admin.php (routes)


RECOMMENDED ORDER
=================
1. BACKUP existing files (User.php, ManageUsersController.php, detail.blade.php, admin.php)
2. RUN SQL migration in phpMyAdmin
3. UPLOAD all new files
4. REPLACE all modified files
5. CLEAR cache if possible
6. TEST admin access to currency management
7. TEST user currency accounts view
