{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "get-shopping-confirm.json",
  "title": "GET /shopping/confirm response",
  "description": "GET /shopping/confirm response の response body schema。ALPSの意味、be/var/fakeの観察値、Resource境界の実形状から導いたSemantic-Ex制約。",
  "type": "object",
  "properties": {
    "addPoint": {
      "type": [
        "integer",
        "null"
      ],
      "title": "付与ポイント",
      "description": "注文により付与されるポイント数。商品単価(税抜) x pointRate x 数量で明細ごとに計算し合算。利用ポイント分を控除。発送済み(DELIVERED)遷移時に会員のpointに加算 Fake観察数値 0〜127; 観察値 '127', '0'。",
      "example": 127,
      "minimum": 0,
      "maximum": 2147483647
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "title": "明細一覧",
      "description": "/shopping/confirm の親オブジェクト `` に含まれる明細配列。商品・カート・受注明細の文脈で解釈する。",
      "items": {
        "type": [
          "object",
          "null"
        ],
        "title": "明細",
        "description": "/shopping/confirm のレスポンスに含まれる明細。親コレクション `items` の1行を表し、固定できる業務列はschema propertyで明示する。",
        "properties": {
          "productName": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 128,
            "title": "商品名",
            "description": "商品の表示名 Fake観察文字長 6〜17。",
            "example": "サンプル商品 A"
          },
          "productCode": {
            "title": "商品コード",
            "description": "SKU/品番。在庫管理や受注明細での識別に使用 商品を識別するSKU。Fake corpusではASCII英数・ハイフン中心で、受注明細/カート明細の結合キーになる。 Fake観察文字長 10〜26。",
            "type": "string",
            "minLength": 0,
            "maxLength": 64,
            "example": "sample-001"
          },
          "quantity": {
            "title": "数量",
            "description": "購入数量。カート明細と受注明細で共通使用 Fake観察数値 1〜3; 観察値 '1', '2', '3'。",
            "type": "integer",
            "minimum": 1,
            "maximum": 999,
            "example": 1
          },
          "totalPrice": {
            "title": "カート合計金額",
            "description": "カート内の税込合計金額。PurchaseFlow.calculateTotal()で毎回再計算されるキャッシュ値。受注のtotalとは別プロパティ Fake観察数値 0〜3600; 観察値 '0', '1500', '3600'。",
            "type": "integer",
            "minimum": 0,
            "maximum": 999999999,
            "example": 0
          },
          "unitPrice": {
            "title": "単価（表示/計算用）",
            "description": "明細1件あたりの単価。受注/カート明細・お気に入りスナップショットでは追加時点の price02 をスナップショットして保持する（後の値引きやマスタ改定に影響されない）。BeMart 側では `int` 円整数 Fake観察数値 1200〜9800; 観察値 '1200', '9800'。",
            "type": "integer",
            "minimum": 0,
            "maximum": 999999999,
            "example": 1200
          }
        },
        "additionalProperties": false,
        "$comment": "配列要素はFake/Resourceで観察された既知propertyに固定する。新しい列が必要になった場合はSemantic-Ex観察に追加してschemaを更新する。"
      },
      "minItems": 0
    },
    "paymentMethodId": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "title": "支払方法ID",
      "description": "受注に紐づく支払方法マスタID。Fake/EC-CUBE境界ではDB採番値として扱う。",
      "example": 2
    },
    "customer": {
      "type": [
        "array",
        "null",
        "object"
      ],
      "title": "会員詳細",
      "description": "/shopping/confirm のレスポンスで扱う会員詳細。配列要素はALPS意味とFake観察に基づき、固定できない動的列は例外理由を台帳化する。",
      "items": {
        "type": "string",
        "title": "会員",
        "minLength": 0,
        "maxLength": 255,
        "description": "/shopping/confirm のレスポンスに含まれる会員。親コレクション `customer` の1行を表し、固定できる業務列はschema propertyで明示する。"
      },
      "minItems": 0,
      "$comment": "単一詳細画面では未選択/初期表示に空配列、取得済み状態にobjectが現れる。不透明な詳細構造は既知propertyを優先し、追加キーは互換境界として許容する。"
    },
    "deliveryFeeTotal": {
      "title": "送料合計",
      "description": "全配送先の送料合計（スナップショット）。deliveryFeeAmount（地域別送料）+ deliveryFee（商品別送料）×数量 の合計。DeliveryFeePreprocessorで計算。カートと受注の両方で使用 Fake観察数値 0〜800; 観察値 '600', '0', '500', '800', '700'。",
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 999999999,
      "example": 600
    },
    "usePoint": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "title": "使用ポイント",
      "description": "注文で使用するポイント数。実際の値引き額は usePoint x pointConversionRate（切り捨て）で計算され、不課税のポイント値引き明細として受注に追加 Fake観察数値 0〜0; 観察値 '0'。",
      "example": 0
    },
    "charge": {
      "title": "手数料",
      "description": "受注の決済手数料。paymentCharge（支払方法マスタの手数料）のスナップショット。PaymentChargePreprocessorにより受注作成時にコピーされる Fake観察数値 0〜300; 観察値 '0', '300', '200'。",
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 999999999,
      "example": 0
    },
    "paymentMethodName": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 255,
      "title": "支払方法名",
      "description": "支払方法の表示名 Fake観察文字長 4〜8; 観察値 '代金引換', 'クレジットカード', '検証失敗'。",
      "example": "代金引換"
    },
    "paymentTotal": {
      "type": [
        "integer",
        "null"
      ],
      "title": "支払合計",
      "description": "実際の支払金額。初期値はtotalと同値で、PointProcessorがポイント値引きのOrderItem（type=POINT_DISCOUNT、不課税）を追加後にPurchaseFlow.calculateTotal()で再計算される。計算式: total - (利用ポイント x pointConversionRate) Fake観察数値 12700〜12700; 観察値 '12700'。",
      "example": 12700,
      "minimum": 0,
      "maximum": 999999999
    },
    "preOrderId": {
      "type": [
        "string",
        "null"
      ],
      "title": "仮注文ID",
      "description": "購入フローの一時セッショントークン（SHA1ハッシュ）。カートと受注を紐づける。予約注文（pre-order）IDではない。チェックアウト開始時に生成、注文確定またはカート破棄で消去 Fake観察文字長 40〜40; 観察値 'deadbeefcafe1234567890abcdef01234567890a', 'deadbeefcafe1234567890abcdef01234567890b', 'aaaa00000000000000000000000000000000aaaa', 'past00000000000000000000000000000000past', 'deadbeefcafe1234567890abcdef01234567890c', 'bbbb00000000000000000000000000000000bbbb', 'cccc00000000000000000000000000000000cccc', 'aceface0000000000000000000000000000a11ce'。",
      "example": "deadbeefcafe1234567890abcdef01234567890a",
      "minLength": 0,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9._:@/-]*$",
      "$comment": "BeMart/Fake境界で観察される不透明な文字列ID。DB採番値としての数値演算には使わない。"
    },
    "tax": {
      "type": [
        "integer",
        "null"
      ],
      "title": "税額",
      "description": "受注全体の税額合計（非推奨）。明細ごとの税額集計と差異が生じる場合があるため、正確な税額はOrderItem明細ごとのtaxを集計すべき Fake観察数値 1100〜1100; 観察値 '1100'。",
      "example": 1100,
      "minimum": 0,
      "maximum": 999999999
    },
    "submitTo": {
      "type": [
        "object",
        "null"
      ],
      "title": "フォーム送信先リンク",
      "description": "/shopping/confirm のフォーム送信に使う送信先リンク。HTTPメソッドと遷移先をまとめ、unsafe操作の入口を明示する。",
      "properties": {
        "href": {
          "title": "リンクURI参照（URI参照）",
          "description": "ページのURLパス（Symfonyルート名。例: homepage, product_list）",
          "type": "string",
          "format": "uri-reference",
          "minLength": 1,
          "maxLength": 2048,
          "example": "/products"
        },
        "method": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "get",
            "post",
            "put",
            "patch",
            "delete",
            "GET",
            "POST",
            "PUT",
            "PATCH",
            "DELETE"
          ],
          "title": "HTTPメソッド",
          "description": "/shopping/confirm のリンクまたはフォーム送信で使うHTTPメソッド。GET/POST等の遷移方法を表す。"
        }
      },
      "additionalProperties": false,
      "required": [
        "href",
        "method"
      ]
    },
    "subtotal": {
      "type": [
        "integer",
        "null"
      ],
      "title": "商品小計",
      "description": "商品合計金額（税込）。送料・手数料・値引き適用前の商品明細（orderItemType=1）のみの合計。PurchaseFlow.calculateSubTotal()で計算。送料無料条件の判定基準にも使用（お届け先ごとに判定） Fake観察数値 11000〜11000; 観察値 '11000'。",
      "example": 11000,
      "minimum": 0,
      "maximum": 999999999
    },
    "transitionId": {
      "title": "ALPS遷移ID",
      "description": "このレスポンス/操作が対応するALPS遷移ID。クライアントの状態遷移追跡に使う。",
      "type": "string",
      "minLength": 2,
      "maxLength": 96,
      "pattern": "^(go|do)[A-Z][A-Za-z0-9]*$",
      "example": "doAddCartItem"
    },
    "discount": {
      "title": "値引き額",
      "description": "受注全体の値引き合計額。クーポン等による値引き Fake観察数値 0〜0; 観察値 '0'。",
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 999999999,
      "example": 0
    },
    "csrfToken": {
      "title": "処理識別子",
      "description": "フォーム送信の偽造を防ぐために送信元画面で発行されるトークン。Fake環境では deterministic な値を使う。",
      "type": [
        "string",
        "null"
      ],
      "minLength": 8,
      "maxLength": 160,
      "pattern": "^[A-Za-z0-9_.:-]+$",
      "example": "fake-csrf-token-bemart-2026"
    },
    "total": {
      "type": [
        "integer",
        "null"
      ],
      "title": "受注合計",
      "description": "受注合計金額。計算式: subtotal(商品税込合計) + deliveryFeeTotal(送料) + charge(手数料) - discount(値引き)。カートのtotalPriceとは別プロパティ Fake観察数値 12700〜12700; 観察値 '12700'。",
      "example": 12700,
      "minimum": 0,
      "maximum": 999999999
    }
  },
  "additionalProperties": false,
  "$defs": {
    "productCode": {
      "title": "商品コード",
      "description": "SKU/品番。在庫管理や受注明細での識別に使用 SKUとして在庫・カート・受注明細を接続する。Fake観察ではASCII英数とハイフン中心。",
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
      "example": "sample-001"
    },
    "email": {
      "title": "メールアドレス",
      "description": "会員のログインIDを兼ねる。有効会員間で一意 ログインID/通知先として使うためRFC準拠のemail形式。",
      "type": "string",
      "format": "email",
      "minLength": 3,
      "maxLength": 254,
      "example": "alice@example.com"
    },
    "postalCode": {
      "title": "郵便番号",
      "description": "日本の郵便番号。ハイフンなし7桁またはハイフン付き8桁 日本国内住所向け。ハイフンなし7桁またはハイフン付き8桁。",
      "type": "string",
      "pattern": "^\\d{3}-?\\d{4}$",
      "example": "1500001"
    },
    "phoneNumber": {
      "title": "電話番号",
      "description": "日本の電話番号形式（ハイフン区切り） 日本国内電話番号。Fakeはハイフンなし中心、入力ではハイフン付きも許容。",
      "type": "string",
      "pattern": "^0\\d{1,4}-?\\d{1,4}-?\\d{3,4}$",
      "minLength": 10,
      "maxLength": 13,
      "example": "0312345678"
    },
    "price": {
      "title": "金額",
      "description": "EC-CUBEの商品価格・送料・手数料・売上金額。日本円の整数金額として扱う。",
      "type": "integer",
      "minimum": 0,
      "maximum": 999999999,
      "example": 1200
    },
    "quantity": {
      "title": "数量",
      "description": "購入数量。カート明細と受注明細で共通使用 購入/調整数量。入力は1以上、調整後や集計では0以上を許容する場合がある。",
      "type": "integer",
      "minimum": 1,
      "maximum": 999,
      "example": 2
    },
    "nonNegativeInteger": {
      "title": "非負整数",
      "description": "件数、在庫、ページ番号、集計値など0以上の整数。",
      "type": "integer",
      "minimum": 0,
      "maximum": 2147483647,
      "example": 1
    },
    "opaqueId": {
      "title": "不透明ID",
      "description": "BeMart/Fake/アプリ層で外部に公開する文字列ID。DB採番値としての数値演算には使わない。",
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9._:@/-]+$",
      "example": "customer-001"
    },
    "dbId": {
      "title": "DB採番ID",
      "description": "EC-CUBEマスタや内部行を指す非負整数ID。表示やフォーム境界では文字列化される場合があるが、意味は採番ID。",
      "type": "integer",
      "minimum": 0,
      "maximum": 2147483647,
      "example": 1
    },
    "mixedBoundaryId": {
      "title": "互換境界ID",
      "description": "同一ResourceでFake文字列IDとEC-CUBE整数IDの両方が観察される互換境界専用ID。恒久的なドメイン型ではない。",
      "type": [
        "string",
        "integer"
      ],
      "minLength": 0,
      "maxLength": 128,
      "example": "pay-cod",
      "$comment": "mixedBoundaryIdは移行互換のための例外。可能ならopaqueIdまたはdbIdへ分解する。"
    },
    "pref": {
      "title": "都道府県ID",
      "description": "日本の都道府県（1=北海道〜47=沖縄県）。住所の最上位区分として顧客・受注・配送先で使用。配送料の地域区分（DeliveryFee）や税率の地域設定（TaxRule）にも使用 確定住所は1〜47。入力フォームの未選択初期値として0を許容する。",
      "type": "integer",
      "minimum": 0,
      "maximum": 47,
      "example": 13
    },
    "productStatus": {
      "title": "商品ステータス",
      "description": "1=公開（フロント表示）, 2=非公開（フロント非表示）, 3=廃止（論理削除、管理画面でもデフォルト非表示）",
      "type": "integer",
      "enum": [
        1,
        2,
        3
      ],
      "example": 1
    },
    "customerStatus": {
      "title": "会員ステータス",
      "description": "1=仮会員（メール未認証）, 2=本会員（認証済み）, 3=退会。退会時はメールアドレスが無効化される",
      "type": "integer",
      "enum": [
        1,
        2,
        3
      ],
      "example": 2
    },
    "orderStatus": {
      "title": "注文ステータス",
      "description": "1=新規受付, 3=注文取消, 4=対応中, 5=発送済み, 6=入金済み, 7=決済処理中, 8=購入処理中, 9=返品。Symfony Workflowステートマシンで遷移を制御。許可される遷移: pay(1->6), packing(1,6->4), cancel(1,4,6->3), back_to_in_progress(3->4), ship(1,6,4->5), return(5->9), cancel_return(9->5)。7と8はPurchaseFlow内で直接セットされステートマシン遷移の対象外 EC-CUBE受注状態。Fake/管理画面で扱う状態ID。",
      "type": "integer",
      "minimum": 1,
      "maximum": 9,
      "example": 1
    },
    "cartKey": {
      "title": "カートキー",
      "description": "カート分離キー。形式: {セッションプレフィックス}_{販売種別ID}。EC-CUBEは販売種別ごとにカートを分離するため、異なる販売種別の商品は別カートになる",
      "type": "string",
      "minLength": 3,
      "maxLength": 128,
      "pattern": "^.+_[0-9]+$",
      "example": "session-prefix-1_1"
    },
    "csrfToken": {
      "title": "CSRFトークン",
      "description": "フォーム送信元を検証するトークン。Fake環境では deterministic な値を使う。",
      "type": "string",
      "minLength": 8,
      "maxLength": 160,
      "pattern": "^[A-Za-z0-9_.:-]+$",
      "example": "fake-csrf-token-bemart-2026"
    },
    "uriReference": {
      "title": "URI参照",
      "description": "画面遷移・リダイレクト・リンク先を表す相対または絶対URI。",
      "type": "string",
      "format": "uri-reference",
      "minLength": 1,
      "maxLength": 2048,
      "example": "/products"
    },
    "transitionId": {
      "title": "ALPS遷移ID",
      "description": "alps.json に定義された safe/unsafe descriptor のID。",
      "type": "string",
      "minLength": 2,
      "maxLength": 96,
      "pattern": "^(go|do)[A-Z][A-Za-z0-9]*$",
      "example": "doAddCartItem"
    },
    "date": {
      "title": "日付",
      "description": "業務上の日付。",
      "type": "string",
      "format": "date",
      "example": "2026-01-01"
    },
    "dateTime": {
      "title": "日時",
      "description": "業務イベント発生日時。",
      "type": "string",
      "format": "date-time",
      "example": "2026-01-01T00:00:00+09:00"
    },
    "link": {
      "title": "ハイパーメディアリンク",
      "description": "ALPS遷移に対応するリンク。hrefはURI参照。",
      "type": "object",
      "required": [
        "href"
      ],
      "additionalProperties": false,
      "properties": {
        "href": {
          "title": "URI参照",
          "description": "画面遷移・リダイレクト・リンク先を表す相対または絶対URI。",
          "type": "string",
          "format": "uri-reference",
          "minLength": 1,
          "maxLength": 2048,
          "example": "/products"
        },
        "rel": {
          "type": "string",
          "minLength": 1,
          "maxLength": 96
        },
        "method": {
          "type": "string",
          "enum": [
            "get",
            "post",
            "put",
            "patch",
            "delete",
            "GET",
            "POST",
            "PUT",
            "PATCH",
            "DELETE"
          ]
        }
      }
    }
  },
  "$comment": "Derived from ALPS meaning, be/var/fake observation, and Resource schema shape.",
  "required": [
    "addPoint",
    "items",
    "paymentMethodId",
    "customer",
    "deliveryFeeTotal",
    "usePoint",
    "charge",
    "paymentMethodName",
    "paymentTotal",
    "preOrderId",
    "tax",
    "subtotal",
    "transitionId",
    "discount",
    "total"
  ]
}
