{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "get-admin-customer.json",
  "title": "GET /admin/customer response",
  "description": "GET /admin/customer response の response body schema。ALPSの意味、be/var/fakeの観察値、Resource境界の実形状から導いたSemantic-Ex制約。",
  "type": "object",
  "properties": {
    "form": {
      "type": [
        "object",
        "array",
        "null"
      ],
      "title": "入力フォーム",
      "description": "Aura/WebForm由来のフォームオブジェクト。フレームワーク内部構造のためschemaでは存在と型のみを契約する。",
      "$comment": "Aura/WebForm由来の不透明フォーム表現。Resource境界ではフォームの存在とコンテキストだけを契約し、内部構造はフレームワーク境界に委ねるため追加キー制約を置かない。"
    },
    "sex": {
      "type": [
        "integer",
        "null"
      ],
      "title": "性別",
      "description": "1=男性, 2=女性, 3=その他, 4=回答しない Fake観察数値 2〜2; 観察値 '2'; null 3/5。",
      "example": 2,
      "minimum": 0
    },
    "kana02": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 32,
      "pattern": "^[ァ-ヶー　 ]*$",
      "title": "メイ",
      "description": "名のカタカナ読み。全角カタカナのみ許可（ひらがな入力時は自動変換）。日本の氏名入力に特有の読み仮名 Fake観察文字長 3〜3; 観察値 'アリス', 'ハナコ', 'タロウ'; null 18/31。",
      "example": "アリス"
    },
    "phoneNumber": {
      "title": "電話番号",
      "description": "日本の電話番号形式（ハイフン区切り） 日本の電話番号。Fake corpusはハイフンなし中心だが、入力ではハイフン付きも許容する。 Fake観察文字長 10〜10; 観察値 '0312345678', '0901234567', '0612345678'; null 18/33。",
      "type": [
        "string",
        "null"
      ],
      "pattern": "^0\\d{1,4}-?\\d{1,4}-?\\d{3,4}$",
      "minLength": 10,
      "maxLength": 13,
      "example": "0312345678"
    },
    "initialPoint": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "title": "初期ポイント",
      "description": "Fake観察数値 100〜100; 観察値 '100'。",
      "example": 100
    },
    "totalSpent": {
      "title": "累計購入金額",
      "description": "/admin/customer のレスポンスで返す累計購入金額。一覧、集計、CSV処理結果の規模を表す非負の数値。",
      "type": "integer",
      "minimum": 0,
      "maximum": 999999999,
      "example": 1200
    },
    "name02": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 80,
      "title": "名",
      "description": "顧客・受注・配送先・お問い合わせで共通使用される名 Fake観察文字長 1〜3; 観察値 'アリス', '太郎', '次郎', '花子', '三郎', '済'。",
      "example": "アリス"
    },
    "kana01": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 32,
      "pattern": "^[ァ-ヶー　 ]*$",
      "title": "セイ",
      "description": "姓のカタカナ読み。全角カタカナのみ許可（ひらがな入力時は自動変換）。日本の氏名入力に特有の読み仮名 Fake観察文字長 3〜3; 観察値 'ヤマダ', 'サトウ'; null 18/31。",
      "example": "ヤマダ"
    },
    "name01": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 80,
      "title": "姓",
      "description": "顧客・受注・配送先・お問い合わせで共通使用される姓 Fake観察文字長 2〜2; 観察値 '鈴木', '山田', '佐藤', '高橋', '退会'。",
      "example": "鈴木"
    },
    "favorites": {
      "type": [
        "array",
        "null"
      ],
      "title": "お気に入り商品一覧",
      "description": "/admin/customer のレスポンスで扱うお気に入り商品一覧。配列要素はALPS意味とFake観察に基づき、固定できない動的列は例外理由を台帳化する。",
      "items": {
        "type": "object",
        "title": "お気に入り商品",
        "description": "/admin/customer のレスポンスに含まれるお気に入り商品。親コレクション `favorites` の1行を表し、固定できる業務列はschema propertyで明示する。",
        "properties": {
          "productCode": {
            "title": "商品コード",
            "description": "SKU/品番。在庫管理や受注明細での識別に使用 商品を識別するSKU。Fake corpusではASCII英数・ハイフン中心で、受注明細/カート明細の結合キーになる。 Fake観察文字長 10〜26。",
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 64,
            "example": "sample-001"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 32,
            "title": "処理表示名",
            "description": "Fake観察文字長 1〜7; 観察値 'テスト管理者', '副管理者', '店舗オーナー', '削除済み管理者', 'Red', 'Blue', 'S', 'Color'。",
            "example": "テスト管理者"
          },
          "productName": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 128,
            "title": "商品名",
            "description": "商品の表示名 Fake観察文字長 6〜17。",
            "example": "サンプル商品 A"
          },
          "price02": {
            "title": "販売価格",
            "description": "実際の販売価格（税抜）。税計算・小計計算のベース Fake観察数値 800〜28000。",
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 999999999,
            "example": 3500
          },
          "mainImage": {
            "title": "メイン画像URI",
            "description": "/admin/customer の画面表示に使うメイン画像URI。業務エンティティそのものではなくテンプレート/一覧表示の補助値。",
            "type": [
              "string",
              "null"
            ],
            "format": "uri-reference",
            "minLength": 1,
            "maxLength": 2048,
            "example": "/products"
          },
          "unitPrice": {
            "title": "単価（表示/計算用）",
            "description": "明細1件あたりの単価。受注/カート明細・お気に入りスナップショットでは追加時点の price02 をスナップショットして保持する（後の値引きやマスタ改定に影響されない）。BeMart 側では `int` 円整数 Fake観察数値 1200〜9800; 観察値 '1200', '9800'。",
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 999999999,
            "example": 1200
          },
          "fileName": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 255,
            "title": "ファイル名",
            "description": "商品画像のファイル名 Fake観察文字長 12〜15; 観察値 'Mail/order.twig', 'Mail/entry.twig', 'sample-a.jpg', 'sample-b.jpg'。",
            "example": "Mail/order.twig"
          }
        },
        "additionalProperties": false,
        "$comment": "配列要素はFake/Resourceで観察された既知propertyに固定する。新しい列が必要になった場合はSemantic-Ex観察に追加してschemaを更新する。"
      },
      "minItems": 0
    },
    "postalCode": {
      "title": "郵便番号",
      "description": "日本の郵便番号。ハイフンなし7桁またはハイフン付き8桁 日本の郵便番号。入力フォームではハイフン有無をどちらも受け入れる。 Fake観察文字長 7〜8; 観察値 '1500001', '1000005', '5300001', '530-0001'; null 18/33。",
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{3}-?\\d{4}$",
      "example": "1500001"
    },
    "addr01": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 32,
      "title": "市区町村",
      "description": "都道府県より下位の市区町村名 Fake観察文字長 3〜7; 観察値 '渋谷区', '千代田区', '大阪市北区', '大阪市北区梅田'; null 18/33。",
      "example": "渋谷区"
    },
    "birth": {
      "title": "生年月日",
      "description": "会員の生年月日 Fake観察文字長 10〜10; 観察値 '1990-04-01', '1985-12-15'; null 18/28。",
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "example": "1990-04-01"
    },
    "customerId": {
      "type": [
        "string",
        "null"
      ],
      "title": "会員ID",
      "description": "dtb_customer.id の不透明な文字列ハンドル。BeMart の Entity 層は数値ではなく文字列として保持する（マスアサインメント防止のため、Session/AuthZ 経由で読み出し、リクエスト本文からは受け取らない）。Favorite / Cart / Order の所有者キーとして横断使用 Fake観察文字長 12〜32; 観察値 'customer-001', '0123456789abcdef0123456789abcdef', 'customer-002', 'favorite-list-customer', 'favorite-html-customer', 'fedcba9876543210fedcba9876543210', 'aaaaaaaa00000000bbbbbbbb11111111', '10000000aaaa1111bbbb2222cccc3333'。",
      "example": "customer-001",
      "minLength": 0,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9._:@/-]*$",
      "$comment": "BeMart/Fake境界で観察される不透明な文字列ID。DB採番値としての数値演算には使わない。"
    },
    "addr02": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 32,
      "title": "番地・建物名",
      "description": "番地・ビル名・部屋番号等の詳細住所 Fake観察文字長 5〜8; 観察値 '神宮前1-1-1', '丸の内2-2-2', '梅田1-1-1', '1-2-3'; null 18/33。",
      "example": "神宮前1-1-1"
    },
    "customerStatus": {
      "title": "会員ステータス",
      "description": "1=仮会員（メール未認証）, 2=本会員（認証済み）, 3=退会。退会時はメールアドレスが無効化される Fake観察数値 1〜2; 観察値 '2', '1'。",
      "type": "integer",
      "enum": [
        1,
        2,
        3
      ],
      "example": 2
    },
    "email": {
      "title": "メールアドレス",
      "description": "会員のログインIDを兼ねる。有効会員間で一意 ログインIDを兼ねるメールアドレス。会員登録・ログイン・通知で共通に使う。 Fake観察文字長 15〜58; 観察値 'bob@example.com', 'login-test@example.com', 'alice@example.com', 'carol@example.com', 'provisional@example.com', 'withdrawn-30000000aaaa3333bbbb4444cccc5555@example.invalid'。",
      "type": "string",
      "format": "email",
      "minLength": 3,
      "maxLength": 254,
      "example": "alice@example.com"
    },
    "pref": {
      "title": "都道府県",
      "description": "日本の都道府県（1=北海道〜47=沖縄県）。住所の最上位区分として顧客・受注・配送先で使用。配送料の地域区分（DeliveryFee）や税率の地域設定（TaxRule）にも使用 都道府県ID。住所フォームの未選択状態では0、確定住所では1〜47を使う。 Fake観察数値 13〜27; 観察値 '13', '27'; null 3/9。",
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 47,
      "example": 13
    },
    "favoriteCount": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "title": "お気に入り件数",
      "description": "/admin/customer のレスポンスで返すお気に入り件数。一覧・集計・処理結果の規模を表す非負整数。"
    },
    "companyName": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 32,
      "title": "会社名",
      "description": "法人顧客の社名。B2B取引やインボイスで使用 Fake観察文字長 10〜11; 観察値 'Acme Corp.', '株式会社EC-CUBE'; null 24/32。",
      "example": "Acme Corp."
    },
    "job": {
      "type": [
        "integer",
        "null"
      ],
      "title": "職業",
      "description": "1=公務員〜18=その他の18区分 Fake観察数値 7〜18; 観察値 '7', '18'; null 3/5。",
      "example": 7,
      "minimum": 0
    },
    "orders": {
      "type": [
        "array",
        "null"
      ],
      "title": "注文一覧",
      "description": "/admin/customer のレスポンスで扱う注文一覧。配列要素はALPS意味とFake観察に基づき、固定できない動的列は例外理由を台帳化する。",
      "items": {
        "type": "object",
        "title": "注文概要",
        "description": "/admin/customer のレスポンスに含まれる注文概要。親コレクション `orders` の1行を表し、固定できる業務列はschema propertyで明示する。",
        "properties": {
          "orderNo": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 64,
            "title": "注文番号",
            "description": "顧客向けの注文番号。フォーマットはカスタマイズ可能 Fake観察文字長 32〜32; 観察値 'past0000000000000000000000000001'。",
            "example": "past0000000000000000000000000001"
          },
          "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内で直接セットされステートマシン遷移の対象外 Fake観察数値 1〜1; 観察値 '1'。",
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 9,
            "example": 1
          },
          "orderDate": {
            "title": "注文日",
            "description": "注文確定日時 Fake観察文字長 19〜19; 観察値 '2026-04-01 10:00:00'。",
            "type": [
              "string",
              "null"
            ],
            "example": "2026-04-01 10:00:00",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}([ T]\\d{2}:\\d{2}:\\d{2}([+-]\\d{2}:?\\d{2}|Z)?)?$"
          },
          "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
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "title": "受注合計",
            "description": "受注合計金額。計算式: subtotal(商品税込合計) + deliveryFeeTotal(送料) + charge(手数料) - discount(値引き)。カートのtotalPriceとは別プロパティ Fake観察数値 12700〜12700; 観察値 '12700'。",
            "example": 12700,
            "minimum": 0,
            "maximum": 999999999
          },
          "itemCount": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 10000,
            "title": "明細件数",
            "description": "/admin/customer のレスポンスで返す明細件数。一覧・集計・処理結果の規模を表す非負整数。",
            "example": 1
          }
        },
        "additionalProperties": false,
        "$comment": "配列要素はFake/Resourceで観察された既知propertyに固定する。新しい列が必要になった場合はSemantic-Ex観察に追加してschemaを更新する。"
      },
      "minItems": 0
    },
    "orderCount": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 2147483647,
      "title": "注文件数",
      "description": "/admin/customer のレスポンスで返す注文件数。一覧・集計・処理結果の規模を表す非負整数。"
    },
    "csrfToken": {
      "title": "CSRFトークン",
      "description": "フォーム送信元を検証するトークン。Fake環境では deterministic な値を使う。",
      "type": "string",
      "minLength": 8,
      "maxLength": 160,
      "pattern": "^[A-Za-z0-9_.:-]+$",
      "example": "fake-csrf-token-bemart-2026"
    }
  },
  "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": [
    "csrfToken",
    "initialPoint",
    "totalSpent",
    "name02",
    "name01",
    "favorites",
    "addr01",
    "customerId",
    "customerStatus",
    "email",
    "favoriteCount",
    "orders",
    "orderCount"
  ]
}
