# Implementation Plan: HomeN8 Unified Stock Verification & Workflow Preservation

**Goal:** Ensure the Stock Verification creation dropdown displays "HomeN8 - HomeN8 (485 Master IDs, 5224 Items - PTT Oil & Café Amazon)" as the primary/only warehouse option (excluding virtual WH-AMZ), pre-selects it with live preview stats, and preserves all existing stock verification, scanning, and audit processes and workflows for both PTT Oil and Café Amazon devices.

---

## Task Breakdown

### Task 1: Controller & View Update for HomeN8 in Stock Verification Creation
- **Files:**
  - `app/Http/Controllers/VerifyStockController.php`
  - `resources/views/verify-stock/create.blade.php`
- **Spec:**
  - In `VerifyStockController::create()`, only active physical warehouses (excluding `WH-AMZ` or virtual retail network records) must be passed to the view.
  - Compute accurate Master IDs (485) and Items (5,224) for HomeN8 representing both PTT Oil and Café Amazon assets.
  - In `create.blade.php`:
    - Dropdown shows `HomeN8 - HomeN8 (485 Master IDs, 5224 Items - PTT Oil & Café Amazon)`.
    - If HomeN8 is the single active warehouse (or when `old()` is empty), auto-select HomeN8 so users immediately see HomeN8 selected.
    - Live preview box automatically renders the 485 Master IDs and 5,224 Equipment Items on page load.
    - Update instructions card text to reflect HomeN8 verifying both PTT Oil and Café Amazon.
  - In `VerifyStockController::index()`, warehouse filter dropdown only shows active physical warehouses (excluding `WH-AMZ`).

### Task 2: Warehouse Database & Import Command Alignment
- **Files:**
  - `app/Console/Commands/ImportAmzData.php`
  - Database cleanup script/migration or artisan command
- **Spec:**
  - In `ImportAmzData.php`, do not create or activate `WH-AMZ` as an active warehouse. Any Café Amazon Master IDs are stored and assigned under `HomeN8` (which is already done in line 315).
  - Deactivate or remove any dangling `WH-AMZ` record in the database (`status = 'inactive'` or delete if 0 relations).
  - Ensure HomeN8 remains the single source of truth for physical inventory holding 485 Master IDs and 5,224 Items.

### Task 3: Comprehensive Verification Workflow Tests
- **Files:**
  - `tests/Feature/VerifyStockAmzSessionTest.php`
  - `tests/Feature/HomeN8LocationDisplayTest.php`
- **Spec:**
  - Update `VerifyStockAmzSessionTest.php` to assert that:
    1. `verify-stock/create` renders `HomeN8` as selected/available with 485 Master IDs and 5,224 Items (PTT Oil & Café Amazon).
    2. `WH-AMZ` is NOT displayed in the verification dropdown.
    3. Creating a session for HomeN8 loads both PTT Oil and Café Amazon devices (318 AMZ + 167 Oil = 485 Master IDs).
    4. Scanning Master IDs (e.g., `AMZ441` and `OIL-010`) works seamlessly and marks them as MATCHED.
    5. Scanning component serial numbers (e.g. POS Amazon `IC25100041`, Slip Printer, Barcode Scanner) marks `is_correct_warehouse` as true and verifies as MATCHED.
    6. Confirming all expected items, completing sessions, and generating prep sheets all pass with 100% test success.
