{
  "format": "localmes-backup",
  "version": 1,
  "app": "Local MES 1.1",
  "exportedAt": "2026-10-10T00:20:00.000Z",
  "data": {
    "products": [
      {
        "id": "prd-1001",
        "code": "P-1001",
        "name": "鋁合金軸承座",
        "unit": "pcs",
        "notes": "PLM P-1001 A 版（DWG-1001 A、WI-1001 A）；BOM：AL6061 0.8 kg／件",
        "routing": [
          {
            "id": "op-1001-10",
            "name": "CNC 加工",
            "workCenterId": "wc-cnc1",
            "idealCycleSeconds": 90
          },
          {
            "id": "op-1001-20",
            "name": "去毛邊",
            "workCenterId": "wc-deb",
            "idealCycleSeconds": 20
          },
          {
            "id": "op-1001-30",
            "name": "最終檢驗",
            "workCenterId": "wc-ins",
            "idealCycleSeconds": 30
          }
        ]
      }
    ],
    "workCenters": [
      {
        "id": "wc-cnc1",
        "code": "WC-CNC1",
        "name": "CNC 立式加工中心 #1",
        "location": "A棟 1F",
        "status": "Available",
        "notes": "EMS EQ-CNC01；APS 資源 CNC-01",
        "equipmentId": "EQ-CNC01",
        "shiftMinutes": 480
      },
      {
        "id": "wc-cnc2",
        "code": "WC-CNC2",
        "name": "CNC 立式加工中心 #2",
        "location": "A棟 1F",
        "status": "Available",
        "notes": "EMS EQ-CNC02（PM-CNC02-Q 主軸軸承更換）；APS 資源 CNC-02",
        "equipmentId": "EQ-CNC02",
        "shiftMinutes": 480
      },
      {
        "id": "wc-deb",
        "code": "WC-DEB",
        "name": "自動去毛邊",
        "location": "A棟 1F",
        "status": "Available",
        "notes": "EMS EQ-DEB01；APS 資源 DEB-01",
        "equipmentId": "EQ-DEB01",
        "shiftMinutes": 480
      },
      {
        "id": "wc-ins",
        "code": "WC-INS",
        "name": "最終檢驗（CMM）",
        "location": "品保室",
        "status": "Available",
        "notes": "EMS EQ-CMM01；QMS PLAN-1001 A",
        "equipmentId": "EQ-CMM01",
        "shiftMinutes": 480
      }
    ],
    "materials": [
      {
        "id": "mat-al",
        "code": "RM-AL6061",
        "name": "AL6061 鋁棒 Ø60",
        "lotNumber": "AL-2610-A",
        "unit": "kg",
        "quantity": 0,
        "minQuantity": 0,
        "notes": "倉庫由 WMS 管理；此處只記現場收料與耗用"
      }
    ],
    "orders": [
      {
        "id": "wo-021",
        "number": "WO-2610-021",
        "productId": "prd-1001",
        "productName": "鋁合金軸承座",
        "productCode": "P-1001",
        "unit": "pcs",
        "lotNumber": "FG-1001-2610C",
        "targetQuantity": 200,
        "startDate": "2026-10-07",
        "dueDate": "2026-10-11",
        "priority": "High",
        "status": "InProgress",
        "notes": "東昇機械 SO-2610-015（150 件）；PLM P-1001 @ A；投入 200 件含篩選餘量",
        "operations": [
          {
            "id": "op-1001-10",
            "name": "CNC 加工",
            "workCenterId": "wc-cnc1",
            "idealCycleSeconds": 90
          },
          {
            "id": "op-1001-20",
            "name": "去毛邊",
            "workCenterId": "wc-deb",
            "idealCycleSeconds": 20
          },
          {
            "id": "op-1001-30",
            "name": "最終檢驗",
            "workCenterId": "wc-ins",
            "idealCycleSeconds": 30
          }
        ],
        "releasedAt": "2026-10-06T01:00:00.000Z",
        "releasedBy": "生管 陳課長"
      },
      {
        "id": "wo-022",
        "number": "WO-2610-022",
        "productId": "prd-1001",
        "productName": "鋁合金軸承座",
        "productCode": "P-1001",
        "unit": "pcs",
        "lotNumber": "FG-1001-2610D",
        "targetQuantity": 80,
        "startDate": "2026-10-12",
        "dueDate": "2026-10-12",
        "priority": "Urgent",
        "status": "Draft",
        "notes": "東昇機械急單 SO-2610-018；待 APS 方案核准後放行（CNC-02 保養停機）",
        "operations": [
          {
            "id": "op-1001-10",
            "name": "CNC 加工",
            "workCenterId": "wc-cnc1",
            "idealCycleSeconds": 90
          },
          {
            "id": "op-1001-20",
            "name": "去毛邊",
            "workCenterId": "wc-deb",
            "idealCycleSeconds": 20
          },
          {
            "id": "op-1001-30",
            "name": "最終檢驗",
            "workCenterId": "wc-ins",
            "idealCycleSeconds": 30
          }
        ]
      }
    ],
    "productionLogs": [
      {
        "id": "log-001",
        "orderId": "wo-021",
        "operationId": "op-1001-10",
        "workCenterId": "wc-cnc1",
        "idealCycleSeconds": 90,
        "date": "2026-10-07",
        "shift": "Day",
        "operator": "王小明",
        "goodQty": 99,
        "scrapQty": 1,
        "plannedMinutes": 240,
        "downtimeMinutes": 15,
        "downtimeReason": "Setup",
        "materialUsages": [
          {
            "materialId": "mat-al",
            "quantity": 80
          }
        ],
        "notes": "換治具後首件確認；尺寸超差 1 件",
        "voided": false,
        "createdAt": "2026-10-07T02:30:00.000Z"
      },
      {
        "id": "log-002",
        "orderId": "wo-021",
        "operationId": "op-1001-10",
        "workCenterId": "wc-cnc1",
        "idealCycleSeconds": 90,
        "date": "2026-10-08",
        "shift": "Day",
        "operator": "王小明",
        "goodQty": 99,
        "scrapQty": 1,
        "plannedMinutes": 240,
        "downtimeMinutes": 0,
        "downtimeReason": "None",
        "materialUsages": [
          {
            "materialId": "mat-al",
            "quantity": 80
          }
        ],
        "notes": "刀具崩刃 1 件",
        "voided": false,
        "createdAt": "2026-10-08T03:30:00.000Z"
      },
      {
        "id": "log-003",
        "orderId": "wo-021",
        "operationId": "op-1001-20",
        "workCenterId": "wc-deb",
        "idealCycleSeconds": 20,
        "date": "2026-10-08",
        "shift": "Evening",
        "operator": "李美華",
        "goodQty": 198,
        "scrapQty": 0,
        "plannedMinutes": 120,
        "downtimeMinutes": 0,
        "downtimeReason": "None",
        "materialUsages": [],
        "notes": "",
        "voided": false,
        "createdAt": "2026-10-08T04:30:00.000Z"
      },
      {
        "id": "log-004",
        "orderId": "wo-021",
        "operationId": "op-1001-30",
        "workCenterId": "wc-ins",
        "idealCycleSeconds": 30,
        "date": "2026-10-09",
        "shift": "Day",
        "operator": "李美華",
        "goodQty": 198,
        "scrapQty": 0,
        "plannedMinutes": 120,
        "downtimeMinutes": 0,
        "downtimeReason": "None",
        "materialUsages": [],
        "notes": "198 件移交 WMS 成品收貨（保留）",
        "voided": false,
        "createdAt": "2026-10-09T05:30:00.000Z"
      }
    ],
    "qualityChecks": [
      {
        "id": "qc-1",
        "orderId": "wo-021",
        "operationId": "op-1001-30",
        "date": "2026-10-09",
        "inspector": "品保 林組長",
        "sampleQty": 5,
        "rejectedQty": 1,
        "defect": "內孔 Ø35.026 mm 超規（上限 35.020）",
        "result": "Fail",
        "disposition": "Open",
        "notes": "QMS INSP-0002／NC-0001；整批 198 件於 WMS 隔離區保留，待篩選"
      }
    ],
    "stockMovements": [
      {
        "id": "4d4d075e-9302-4417-aa40-b3cadd25a161",
        "materialId": "mat-al",
        "materialCode": "RM-AL6061",
        "materialName": "AL6061 鋁棒 Ø60",
        "lotNumber": "AL-2610-A",
        "unit": "kg",
        "date": "2026-09-10",
        "recordedAt": "2026-10-10T08:37:19.761Z",
        "delta": 0,
        "before": 0,
        "after": 0,
        "reason": "期初：現場無存料",
        "operator": "倉管 張小姐",
        "source": "Opening",
        "logId": "",
        "orderId": ""
      },
      {
        "id": "14ac3585-19e5-4236-b0ad-5b5ca9dad3d3",
        "materialId": "mat-al",
        "materialCode": "RM-AL6061",
        "materialName": "AL6061 鋁棒 Ø60",
        "lotNumber": "AL-2610-A",
        "unit": "kg",
        "date": "2026-10-06",
        "recordedAt": "2026-10-10T08:37:19.761Z",
        "delta": 160,
        "before": 0,
        "after": 160,
        "reason": "WMS 發料 PK-0001 → WO-2610-021（160 kg = 200 件 × 0.8）",
        "operator": "倉管 張小姐",
        "source": "Manual",
        "logId": "",
        "orderId": ""
      },
      {
        "id": "81ac34ad-2397-46b7-bb73-36866211dece",
        "materialId": "mat-al",
        "materialCode": "RM-AL6061",
        "materialName": "AL6061 鋁棒 Ø60",
        "lotNumber": "AL-2610-A",
        "unit": "kg",
        "date": "2026-10-07",
        "recordedAt": "2026-10-10T08:37:19.761Z",
        "delta": -80,
        "before": 160,
        "after": 80,
        "reason": "WO-2610-021 · CNC 加工",
        "operator": "王小明",
        "source": "Consumption",
        "logId": "log-001",
        "orderId": "wo-021"
      },
      {
        "id": "736144af-4bac-46a6-8205-ad9429fc39c3",
        "materialId": "mat-al",
        "materialCode": "RM-AL6061",
        "materialName": "AL6061 鋁棒 Ø60",
        "lotNumber": "AL-2610-A",
        "unit": "kg",
        "date": "2026-10-08",
        "recordedAt": "2026-10-10T08:37:19.761Z",
        "delta": -80,
        "before": 80,
        "after": 0,
        "reason": "WO-2610-021 · CNC 加工",
        "operator": "王小明",
        "source": "Consumption",
        "logId": "log-002",
        "orderId": "wo-021"
      }
    ],
    "auditEvents": [
      {
        "id": "ev-release-WO-2610-021",
        "recordedAt": "2026-10-06T02:00:00.000Z",
        "action": "release",
        "entity": "WO-2610-021",
        "operator": "生管 陳課長",
        "reason": "WMS PK-0001 備料完成"
      }
    ]
  }
}