# 商品規格甚麼放主商品，甚麼逐款記？

共通註記留一份，黑白兩款電線長度各自記，商品頁才不會說錯。

## 先找真正每款都一樣的事實

假設燈具兩款共用 NOTE-W 註記編號；黑款電線 1 米，白款 2 米。NOTE-W 只是一個已提供編號，沒有任何保養建議。主商品記共通註記，電線米數逐款記；只有每款已知而且相同，才列共通電線長度。

已填燈具規格表

| 記錄 | 共通註記 | 電線米數 | 欄位所屬 |
| --- | --- | --- | --- |
| Lamp | NOTE-W | 沒有共通值 | 主商品 |
| black | NOTE-W | 1 | 款式 |
| white | NOTE-W | 2 | 款式 |

## 逐款顯示，不自行承接不明值

主商品若寫電線 1 米，白款便錯。逐款留 1、2 米可以正確顯示，共通來源 NOTE-W 仍只記一份。選款式另須核貨款身分，電線欄位不會選出 SKU。

1. 列已提供商品事實
2. 逐款比較
3. 有差別欄位逐款記
4. 各款顯示自己的已知值

某款欠值，不能借另一款頂替。

白款也有已核 1 米電線，共通值是多少？

1 米，兩款已知值相同。但這個共通值不改款式編號或存量。

## 整理欄位分層需求

完整素材比較不同、相同及白款未知長度。製作商品目錄前可用來訂主商品與逐款展示欄位，營運 SKU 主檔仍另有負責。

本例電線值限 1 至 1,000 整米或 null。白款 null 時，沒有共通值，白款待核，不猜 1 米。這裏不換算單位、不解讀法律註記，也不作供應商聲稱。

商討目錄欄位時可用本需求表；要加嚴欄位限制，再看原有值覆核例子。

## 完整本地記錄與逐項結果

```json
{
  "issuer": "Astera Technology",
  "resource": "ops-product-field-owner-scope",
  "locale": "zh-HK",
  "contract": "假設燈具兩款共用 NOTE-W 註記編號；黑款電線 1 米，白款 2 米。NOTE-W 只是一個已提供編號，沒有任何保養建議。主商品記共通註記，電線米數逐款記；只有每款已知而且相同，才列共通電線長度。",
  "input": {
    "product": "Lamp",
    "sharedNote": "NOTE-W",
    "variants": [
      {
        "id": "black",
        "cableMetres": 1
      },
      {
        "id": "white",
        "cableMetres": 2
      }
    ]
  },
  "output": {
    "ok": true,
    "state": "complete",
    "result": {
      "product": "Lamp",
      "sharedNote": "NOTE-W",
      "commonCableMetres": null,
      "variants": [
        {
          "id": "black",
          "cableMetres": 1,
          "sharedNote": "NOTE-W",
          "decision": "known"
        },
        {
          "id": "white",
          "cableMetres": 2,
          "sharedNote": "NOTE-W",
          "decision": "known"
        }
      ]
    },
    "trace": [
      {
        "id": "black",
        "cableMetres": 1,
        "sharedNote": "NOTE-W",
        "decision": "known"
      },
      {
        "id": "white",
        "cableMetres": 2,
        "sharedNote": "NOTE-W",
        "decision": "known"
      }
    ]
  },
  "verificationCases": [
    {
      "name": "baseline",
      "input": {
        "product": "Lamp",
        "sharedNote": "NOTE-W",
        "variants": [
          {
            "id": "black",
            "cableMetres": 1
          },
          {
            "id": "white",
            "cableMetres": 2
          }
        ]
      },
      "expected": {
        "ok": true,
        "state": "complete",
        "result": {
          "product": "Lamp",
          "sharedNote": "NOTE-W",
          "commonCableMetres": null,
          "variants": [
            {
              "id": "black",
              "cableMetres": 1,
              "sharedNote": "NOTE-W",
              "decision": "known"
            },
            {
              "id": "white",
              "cableMetres": 2,
              "sharedNote": "NOTE-W",
              "decision": "known"
            }
          ]
        }
      }
    },
    {
      "name": "material-edit",
      "input": {
        "product": "Lamp",
        "sharedNote": "NOTE-W",
        "variants": [
          {
            "id": "black",
            "cableMetres": 1
          },
          {
            "id": "white",
            "cableMetres": 1
          }
        ]
      },
      "expected": {
        "ok": true,
        "state": "complete",
        "result": {
          "product": "Lamp",
          "sharedNote": "NOTE-W",
          "commonCableMetres": 1,
          "variants": [
            {
              "id": "black",
              "cableMetres": 1,
              "sharedNote": "NOTE-W",
              "decision": "known"
            },
            {
              "id": "white",
              "cableMetres": 1,
              "sharedNote": "NOTE-W",
              "decision": "known"
            }
          ]
        }
      }
    },
    {
      "name": "fresh-boundary",
      "input": {
        "product": "Lamp",
        "sharedNote": "NOTE-W",
        "variants": [
          {
            "id": "black",
            "cableMetres": 1
          },
          {
            "id": "white",
            "cableMetres": null
          }
        ]
      },
      "expected": {
        "ok": true,
        "state": "unknown",
        "result": {
          "product": "Lamp",
          "sharedNote": "NOTE-W",
          "commonCableMetres": null,
          "variants": [
            {
              "id": "black",
              "cableMetres": 1,
              "sharedNote": "NOTE-W",
              "decision": "known"
            },
            {
              "id": "white",
              "cableMetres": null,
              "sharedNote": "NOTE-W",
              "decision": "unknown"
            }
          ]
        }
      }
    }
  ],
  "meaningOfNull": "該欄位未知或沒有已建立的值；請按逐項結果判斷。",
  "businessSideEffects": false
}
```
