{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "マチシタテ 相談依頼データの設計案（独自形式・送信不可）",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "mode",
    "service_ids",
    "property_brief",
    "target_areas",
    "goal",
    "asset_manifest"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "mode": {
      "const": "preview_only"
    },
    "service_ids": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "enum": [
          "regional_research",
          "regional_flyer_roughs",
          "lp_structure",
          "budget_scenarios"
        ]
      }
    },
    "property_brief": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "display_name",
        "is_fictional",
        "description"
      ],
      "properties": {
        "display_name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500,
          "description": "物件の仮名。個人名を含めない。"
        },
        "is_fictional": {
          "const": true
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500,
          "description": "個人を特定しない、架空の物件概要。"
        }
      }
    },
    "target_areas": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500,
        "description": "市区町村または仮の地域名まで。番地・個人宅住所は不要。"
      }
    },
    "goal": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "description": "販促で比較・検討したい内容。"
    },
    "asset_manifest": {
      "type": "array",
      "maxItems": 20,
      "description": "資料本体やURLではなく、種類と利用権の状況のみ。未準備なら空配列。",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "asset_type",
          "rights_status",
          "availability"
        ],
        "properties": {
          "asset_type": {
            "enum": [
              "existing_flyer",
              "photo",
              "floorplan",
              "property_facts",
              "other"
            ]
          },
          "rights_status": {
            "enum": [
              "owned",
              "licensed",
              "permission_pending",
              "unknown"
            ]
          },
          "availability": {
            "enum": [
              "available",
              "not_ready"
            ]
          },
          "photo_type": {
            "enum": [
              "site",
              "exterior",
              "common_area",
              "interior",
              "other"
            ]
          },
          "origin": {
            "enum": [
              "customer_provided",
              "original_created",
              "ai_generated",
              "unknown"
            ]
          },
          "rights_verified": {
            "type": "boolean"
          },
          "sample_only": {
            "type": "boolean"
          }
        }
      }
    },
    "notes": {
      "type": "string",
      "maxLength": 1000,
      "description": "任意。個人情報、秘密情報、認証情報を含めない。"
    },
    "research_brief": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "topics": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "enum": [
              "daily_life",
              "transport",
              "shopping",
              "regional_statistics",
              "price_area_floorplan_comparison"
            ]
          }
        },
        "reference_date": {
          "type": "string",
          "maxLength": 500
        },
        "population": {
          "type": "string",
          "maxLength": 500
        },
        "comparison_scope": {
          "type": "string",
          "maxLength": 500
        },
        "data_sources": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "source_name": {
                "type": "string",
                "maxLength": 500
              },
              "reference_date": {
                "type": "string",
                "maxLength": 500
              },
              "population": {
                "type": "string",
                "maxLength": 500
              },
              "coverage": {
                "type": "string",
                "maxLength": 500
              },
              "verification_status": {
                "enum": [
                  "pending",
                  "verified"
                ]
              }
            }
          }
        }
      }
    },
    "lp_brief": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "content_topics": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "enum": [
              "daily_life",
              "transport",
              "shopping",
              "surroundings",
              "regional_statistics"
            ]
          }
        },
        "photo_gallery": {
          "enum": [
            "thumbnail_and_enlarge",
            "not_requested"
          ]
        },
        "comparison_fields": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "enum": [
              "price",
              "area",
              "floorplan"
            ]
          }
        }
      }
    },
    "lead_form_brief": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "purpose": {
          "const": "customer_property_leads"
        },
        "owner_preference": {
          "enum": [
            "customer",
            "undecided"
          ]
        },
        "delivery_preference": {
          "enum": [
            "direct_to_customer",
            "undecided"
          ]
        },
        "integration_preference": {
          "enum": [
            "undecided",
            "customer_owned_google_forms",
            "other_customer_owned_form"
          ]
        },
        "storage_preference": {
          "enum": [
            "customer_owned",
            "undecided"
          ]
        },
        "notify_customer_staff": {
          "type": "boolean"
        },
        "production_access": {
          "enum": [
            "minimum_required",
            "none",
            "undecided"
          ]
        },
        "handover_access_review": {
          "type": "boolean"
        }
      },
      "description": "希望条件だけを記載。メールアドレス・実フォームURL・権限トークンは含めない。接続や受付の状態を保証しない。"
    }
  }
}
