# Real Products Database Update

## Summary
Updated the product_packages table and seeded with real pricing data for all AFINET services.

## Changes Made

### 1. Database Migrations
- **2026_02_23_115543**: Changed `service_category` from ENUM to VARCHAR(50) to support more categories
- **2026_02_23_115629**: Added new fields:
  - `contention_ratio` (VARCHAR) - For shared services (e.g., "1:15")
  - `effective_bandwidth_mbps` (DECIMAL) - Actual bandwidth for shared services
  - `burst_speed_mbps` (INTEGER) - Maximum burst speed for burst packages
  - `min_bandwidth_mbps` (INTEGER) - Minimum bandwidth for variable speed packages
  - `max_bandwidth_mbps` (INTEGER) - Maximum bandwidth for variable speed packages

### 2. New Seeder: RealProductPackagesSeeder
Created comprehensive seeder with 20 real products across 4 categories:

#### Magellan Metro-VPN (8 packages)
- 40Mbps: $85.00/month
- 100Mbps: $152.00/month
- 200Mbps: $274.00/month
- 300Mbps: $375.00/month
- 600Mbps: $457.00/month
- 1000Mbps: $522.00/month
- 2000Mbps: $963.00/month
- NNI Connection 1000Mbps: $80.00/month

#### Shared Business Broadband (4 packages)
- Channel 50 (3.33Mbps effective): $67.98/month
- Channel 100 (6.67Mbps effective): $135.96/month
- Channel 200 (13.33Mbps effective): $271.91/month
- Channel 250 (16.67Mbps effective): $339.89/month

#### Dedicated Burst Internet (3 packages)
- 20/100Mbps: $407.87/month
- 30/150Mbps: $611.80/month
- 40/200Mbps: $815.74/month

#### Custom Enterprise Services (5 packages)
- Dedicated Internet Access (DIA) - Custom pricing
- IP Transit (IPT) - Custom pricing
- Dark Fibre Lease - Custom pricing
- International Private Line Circuit (IPLC) - Custom pricing
- InterCity-VPN - Custom pricing

### 3. Product Attributes

#### Feasibility-Based Products
- `requires_feasibility_check`: true
- `has_fixed_pricing`: true
- Available for high and medium feasibility
- Includes: Magellan, Shared Broadband, Dedicated Burst

#### Custom Enterprise Products
- `requires_feasibility_check`: false
- `has_fixed_pricing`: false
- Not available for any feasibility level (custom quote only)
- Includes: DIA, IP Transit, Dark Fibre, IPLC, InterCity-VPN

### 4. Service Categories
- `metro_vpn` - Magellan Metro-VPN products
- `shared_broadband` - Shared Business Broadband products
- `dedicated_burst` - Dedicated Burst Internet products
- `custom_enterprise` - Custom enterprise services

## Order Flow Integration

### High Feasibility
- Shows "Order Now" button
- Direct to checkout
- Fixed pricing displayed

### Medium Feasibility
- Shows "Request Quote" button
- Extension cost needs calculation
- Base pricing displayed

### Low Feasibility
- Shows alternative solutions
- Contact sales option
- No direct ordering

### Custom Enterprise
- Always "Request Custom Quote"
- No feasibility check required
- No pricing displayed

## Frontend Integration

The product details page (`afinet-portal/src/app/(portal)/products/[id]/page.js`) now checks:
1. `service_category === 'custom_enterprise'` OR product name matches custom enterprise list
2. Feasibility status from localStorage
3. Displays appropriate buttons and messaging

## Running the Seeder

```bash
# Run just the product seeder
php artisan db:seed --class=RealProductPackagesSeeder

# Or run all seeders
php artisan db:seed
```

## Verification

After seeding, verify:
1. 20 products created
2. All prices are correct
3. Service categories are set
4. Feasibility flags are correct
5. Custom enterprise products have null pricing

## Notes

- All prices are in USD
- Installation fees and router prices are included
- Contract minimum months vary by product type
- Features are stored as JSON arrays
- Custom enterprise products require manual quotation

---

Last Updated: 2026-02-23
