# Clarifying Questions: Mobile (iOS & Android) Back-Camera QR Scanner for Master ID & Items

**Classification:** `T2 · S2 — Cross-Platform Mobile QR/Barcode Scanner (iOS Safari & Android Chrome) for WMS Master ID & Asset Inventory`

These questions clarify the technical deployment, device permissions, and mobile UX before generating `research.md`, `PRD.md`, and `plan.md`.

---

### Group 1: Who and Pain (Architecture, Network & Hardware)

1. **Architecture & Delivery Method:**
   How do you want warehouse workers on iPhone and Android to access the scanner?
   - **Option A (Recommended — Mobile Web / PWA):** Workers open Safari (iOS) or Chrome (Android) and navigate to the web app, or tap "Add to Home Screen" to run it full-screen like an app. No App Store or APK installation needed; works directly with your Laravel backend.
   - **Option B (Capacitor / Hybrid Native Wrapper):** Package the web app with Capacitor into an `.apk` for Android and `.ipa` for iOS. Gives native camera plugins and offline caching, but requires Apple Developer account ($99/yr) and Android APK sideloading.
   - **Option C (Dedicated Mobile App Flutter/React Native):** Build a separate native mobile app from scratch connecting via REST API.

2. **Network Setup & Camera HTTPS Security:**
   Mobile browsers (Safari on iOS and Chrome on Android) **strictly block back-camera access** unless the site is served over a secure connection (`HTTPS`). Since you are running on local XAMPP (`Management-warehouse`):
   - How will phones connect to your server?
     - [ ] Local Wi-Fi using HTTPS with a local SSL certificate (e.g. `mkcert` on `https://192.168.x.x` or local DNS)
     - [ ] Cloud-hosted server with a valid SSL domain (e.g. `https://wms.yourcompany.com`)
     - [ ] Secure tunnel for testing (e.g. Cloudflare Tunnel, ngrok, or Tailscale HTTPS)
     - [ ] Need setup guidance on how to enable HTTPS for local mobile camera testing

3. **Lighting & Warehouse Physical Conditions:**
   Warehouses often have dim lighting between tall storage racks.
   - Do operators need a quick 1-tap **Flashlight / Torch** button directly over the camera feed? (Torch is supported natively in Android Chrome and iOS 16+ Safari via MediaStream track constraints).

---

### Group 2: Scope and Wedge (QR Structure, Recognition & Workflow)

4. **QR Code Content / Payload Structure:**
   What exact text or data is encoded inside your physical QR labels?
   - **Format 1 (Plain Serial / Code):** e.g. `OIL 001` or `POS-88201`
   - **Format 2 (Web URL / Deep Link):** e.g. `https://wms.company.com/master-ids/OIL-001` or `https://.../scan?serial=POS-88201`
   - **Format 3 (JSON Payload):** e.g. `{"master_id":"OIL 001", "site":"HQ"}`
   - **Format 4 (Mixed):** Some are 1D standard barcodes (Code 128) and some are 2D QR codes.

5. **Scanning Workflow (Master ID vs. Individual Item):**
   When the back camera detects a QR code:
   - If it detects a **Master ID** QR code: Should it display the Master ID details card plus the checklist of all attached items (e.g., 18 components)?
   - If it detects a **Single Item** QR code (e.g. Slip Printer serial): Should it display the item details AND highlight which Master ID box it belongs to?

6. **Single Scan vs. Continuous Batch Audit Mode:**
   - **Single Scan Mode:** Camera scans 1 code -> stops camera -> shows full asset details -> user clicks "Scan Another" to restart.
   - **Continuous Live Mode (Rapid Scan):** Camera stays open continuously; when a code enters the viewfinder, it plays a green flash + beep, updates a mini-card or bottom drawer, and immediately waits for the next box.

---

### Group 3: Constraints and Goals (UX, Haptics & Mobile Screen Layout)

7. **Mobile Screen Layout (iPhone / Android Portrait):**
   On a mobile phone held in one hand, which layout works best for your staff?
   - **Layout A (Top Camera + Bottom Slide-Up Sheet):** Camera takes up top 55% of the screen; scanned asset details slide up from the bottom sheet without navigating away.
   - **Layout B (Full-Screen Camera with Floating Card):** Full-screen camera viewfinder with a floating overlay card that pops up when an asset is identified.
   - **Layout C (Current Split Stack):** Camera on top, scrolling down to view results below.

8. **Multi-Camera Lens Switching (iPhone Pro Wide vs Ultra-Wide):**
   Newer iPhones (iPhone 12 Pro through 16 Pro) have 3 rear lenses (0.5x ultra-wide, 1x main wide, 3x/5x telephoto). iOS Safari sometimes defaults to the 0.5x lens, which cannot focus on small QR codes up close.
   - Should we include 1x / 2x digital zoom toggles and smart lens selection (`facingMode: { ideal: "environment" }`) to guarantee crisp macro focus on iPhone?

9. **Operator Audio & Haptic Feedback:**
   - Should the phone emit a high-frequency confirmation beep (`Web Audio API`) and a distinct double-vibration pulse (`navigator.vibrate`) upon successful scan so the worker knows it succeeded without looking at the screen?
