# ShopDB Documentation

**Last Updated:** 2025-12-11
**Current Status:** Database Migration Complete

---

## Quick Links

| Document | Purpose |
|----------|---------|
| [CLAUDE.md](../CLAUDE.md) | AI assistant context (start here) |
| [QUICK_REFERENCE.md](QUICK_REFERENCE.md) | Cheat sheets, common queries |
| [ASP_DEVELOPMENT_GUIDE.md](ASP_DEVELOPMENT_GUIDE.md) | Dev setup, VBScript patterns |
| [STANDARDS.md](STANDARDS.md) | Coding standards, security |
| [API.md](API.md) | REST API documentation |

---

## Current Architecture

```
machines table (unified)
  ├── Equipment (machinetypeid 1-15, pctypeid IS NULL)
  ├── PCs (machinetypeid 33-35, pctypeid IS NOT NULL)
  └── Network Devices (machinetypeid 16-20)

printers table (separate)
communications table (all network interfaces)
machinerelationships table (PC↔equipment links)
```

---

## Dev Environment

```bash
# Start dev environment
~/start-dev-env.sh

# Check status
~/status-dev-env.sh

# Access application
http://192.168.122.151:8080

# Connect to MySQL
docker exec -it dev-mysql mysql -u root -prootpassword shopdb
```

---

## Database Views

All views are defined in `sql/view_consolidation.sql`:

| View | Purpose |
|------|---------|
| `vw_equipment_list` | Equipment with details |
| `vw_pc_list` | PCs with OS/model info |
| `vw_printer_list` | Active printers |
| `vw_network_devices` | Network devices (APs, switches, etc.) |
| `vw_machine_detail` | Full machine info for detail pages |
| `vw_active_notifications` | Current notifications |
| `vw_warranty_status` | Warranty tracking |

---

## Archive

Historical documentation from completed migrations is in `archive/`:
- Phase 1-4 migration plans and summaries
- Bug fix records
- Session summaries

---

**Maintained By:** Development Team
