# Local Development Admin Credentials

**Environment:** Local Development (showprima_dev)
**Created:** 2025-11-05
**Status:** ✅ Active

---

## Admin Accounts

### Super Admin (Full Access)
```
Email:    admin@globalgala.com
Password: password1234
Role:     super_admin
Access:   Full system access
```

### Staff User (View Only)
```
Email:    staff@globalgala.com
Password: password1234
Role:     staff
Access:   View-only permissions
```

### MBS Admin (Customer & Order Management)
```
Email:    mbs@globalgala.com
Password: password12345
Role:     mbs_admin
Access:   Customer and order management
```

---

## Login URLs

### Admin Dashboard
```
http://localhost:3001/login
```

### API Authentication
```
POST http://localhost:8000/api/admin/auth/login
Content-Type: application/json

{
  "email": "admin@globalgala.com",
  "password": "password1234"
}
```

---

## Database State

**Migrations:** ✅ All 11 pending migrations completed
**Seeders:** ✅ AdminRoleSeeder + AdminSeeder run
**Roles:** ✅ 3 roles created (super_admin, staff, mbs_admin)
**Admins:** ✅ 3 admin accounts created

---

## Recent Changes

### Migrations Run (2025-11-05)
- ✅ `2025_10_30_205810_add_revolut_order_id_to_seat_reservations_table`
- ✅ `2025_10_31_124326_add_revolut_metadata_to_events`
- ✅ `2025_10_31_124400_add_structured_address_to_venues`
- ✅ `2025_11_03_131603_create_homepage_sections_table`
- ✅ `2025_11_03_211512_add_bank_transfer_fields_to_orders_table`
- ✅ `2025_11_03_214956_add_payment_mode_to_seat_reservations_table`
- ✅ `2025_11_04_122714_add_payment_gateway_to_seat_reservations`
- ✅ `2025_11_04_135939_create_admin_password_resets_table`
- ✅ `2025_11_04_171047_add_optional_fees_to_reservations_and_orders`
- ✅ `2025_11_04_172805_create_fee_waiver_audit_log_table`
- ✅ `2025_11_04_185730_add_fee_config_to_events_table`

---

## Password Configuration

Passwords are configured in `.env`:
```bash
SEED_SUPER_ADMIN_PASSWORD=password1234
SEED_STAFF_PASSWORD=password1234
SEED_MBS_ADMIN_PASSWORD=password12345
```

**To change passwords:**
1. Update password in `.env`
2. Re-run seeder: `php artisan db:seed --class=AdminSeeder`

---

## Troubleshooting

### Issue: "Invalid credentials"

**Check:**
1. Email is correct (not `admin@local.com` - use `admin@globalgala.com`)
2. Password matches `.env` configuration
3. Admin account exists in database
4. Admin is active (`is_active = 1`)

**Verify:**
```bash
mysql -u showprima -p'e8NHZmyguogWUMdRRoZh7wYXtJCnwvxUb@c' showprima_dev \
  -e "SELECT id, email, name, is_active FROM admins WHERE email = 'admin@globalgala.com';"
```

### Issue: Migrations not applied

**Run:**
```bash
# Backup first
./scripts/backup-db.sh

# Run migrations
php artisan migrate --force

# Verify
php artisan migrate:status
```

### Issue: No admin accounts

**Re-seed:**
```bash
php artisan db:seed --class=AdminRoleSeeder
php artisan db:seed --class=AdminSeeder
```

---

## API Testing

### Test Login via API
```bash
curl -X POST http://localhost:8000/api/admin/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@globalgala.com",
    "password": "password1234"
  }'
```

**Expected Response:**
```json
{
  "success": true,
  "data": {
    "admin": {
      "id": 1,
      "email": "admin@globalgala.com",
      "name": "Super Admin",
      "role": "super_admin"
    },
    "token": "eyJ0eXAiOiJKV1QiLCJhbGc..."
  }
}
```

---

## Security Notes

⚠️ **These are development credentials only!**

**For Production:**
- Generate strong random passwords (32+ characters)
- Store in secure password manager
- Use environment variables, never commit to git
- Enable 2FA for admin accounts
- Regularly rotate passwords

**Password Requirements:**
- Minimum 12 characters
- Cannot be weak passwords (password, 123456, etc.)
- Validated by seeder before creating accounts

---

**Last Updated:** 2025-11-05
**Environment:** Local Development Only
