{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/car-gene-com/json-schema/car-gene-com-shop-listing-schema.json",
  "title": "ShopListing",
  "description": "店のメンバーが見る物件。問い合わせの件数を添える",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/car-gene-com-openapi.yml#/components/schemas/ShopListing",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "model": {
      "$ref": "#/$defs/ListingModel"
    },
    "grade": {
      "type": "string",
      "title": "Grade"
    },
    "price_yen": {
      "type": "integer",
      "title": "Price Yen"
    },
    "total_price_yen": {
      "type": "integer",
      "title": "Total Price Yen"
    },
    "first_registration_year": {
      "type": "integer",
      "title": "First Registration Year"
    },
    "first_registration_month": {
      "type": "integer",
      "title": "First Registration Month"
    },
    "mileage_km": {
      "type": "integer",
      "title": "Mileage Km"
    },
    "inspection_year": {
      "type": "integer",
      "title": "Inspection Year"
    },
    "inspection_month": {
      "type": "integer",
      "title": "Inspection Month"
    },
    "repair_history": {
      "type": "boolean",
      "title": "Repair History"
    },
    "transmission": {
      "type": "string",
      "enum": [
        "mt",
        "at",
        "cvt",
        "other"
      ],
      "title": "Transmission"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "published",
        "sold",
        "hidden"
      ],
      "title": "Status"
    },
    "published_at": {
      "type": "string",
      "format": "date-time",
      "title": "Published At"
    },
    "minor_change_name": {
      "type": "string",
      "title": "Minor Change Name"
    },
    "drivetrain": {
      "type": "string",
      "enum": [
        "ff",
        "fr",
        "mr",
        "rr",
        "4wd"
      ],
      "title": "Drivetrain"
    },
    "displacement_cc": {
      "type": "integer",
      "title": "Displacement Cc"
    },
    "fuel": {
      "type": "string",
      "enum": [
        "gasoline",
        "diesel",
        "hybrid",
        "ev",
        "other"
      ],
      "title": "Fuel"
    },
    "body_color": {
      "type": "string",
      "title": "Body Color"
    },
    "steering": {
      "type": "string",
      "enum": [
        "right",
        "left"
      ],
      "title": "Steering"
    },
    "doors": {
      "type": "integer",
      "title": "Doors"
    },
    "seats": {
      "type": "integer",
      "title": "Seats"
    },
    "warranty": {
      "type": "string",
      "title": "Warranty"
    },
    "maintenance": {
      "type": "string",
      "title": "Maintenance"
    },
    "equipment": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Equipment"
    },
    "description": {
      "type": "string",
      "title": "Description"
    },
    "stock_number": {
      "type": "string",
      "title": "Stock Number"
    },
    "sold_at": {
      "type": "string",
      "format": "date-time",
      "title": "Sold At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "photos": {
      "items": {
        "$ref": "#/$defs/Photo"
      },
      "type": "array",
      "title": "Photos"
    },
    "minor_change": {
      "$ref": "#/$defs/ListingMinorChange"
    },
    "catalog_grade": {
      "$ref": "#/$defs/GradeResponse"
    },
    "parts": {
      "items": {
        "$ref": "#/$defs/ListingPart"
      },
      "type": "array",
      "title": "Parts"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "share_expires_at": {
      "type": "string",
      "format": "date-time",
      "title": "Share Expires At"
    },
    "inquiry_count": {
      "type": "integer",
      "title": "Inquiry Count"
    },
    "new_inquiry_count": {
      "type": "integer",
      "title": "New Inquiry Count"
    }
  },
  "type": "object",
  "required": [
    "id",
    "model",
    "first_registration_year",
    "repair_history",
    "transmission",
    "status",
    "equipment",
    "updated_at",
    "photos",
    "parts",
    "created_at",
    "inquiry_count",
    "new_inquiry_count"
  ],
  "$defs": {
    "GradeResponse": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "chassis_code": {
          "type": "string",
          "title": "Chassis Code"
        },
        "displacement_cc": {
          "type": "integer",
          "title": "Displacement Cc"
        },
        "doors": {
          "type": "integer",
          "title": "Doors"
        },
        "transmission": {
          "type": "string",
          "title": "Transmission"
        },
        "drivetrain": {
          "type": "string",
          "title": "Drivetrain"
        },
        "seats": {
          "type": "integer",
          "title": "Seats"
        },
        "fuel_economy_km_l": {
          "type": "number",
          "title": "Fuel Economy Km L"
        },
        "weight_kg": {
          "type": "integer",
          "title": "Weight Kg"
        },
        "length_mm": {
          "type": "integer",
          "title": "Length Mm"
        },
        "width_mm": {
          "type": "integer",
          "title": "Width Mm"
        },
        "height_mm": {
          "type": "integer",
          "title": "Height Mm"
        },
        "price_yen": {
          "type": "integer",
          "title": "Price Yen"
        },
        "sale_start_year": {
          "type": "integer",
          "title": "Sale Start Year"
        },
        "sale_start_month": {
          "type": "integer",
          "title": "Sale Start Month"
        },
        "sale_end_year": {
          "type": "integer",
          "title": "Sale End Year"
        },
        "sale_end_month": {
          "type": "integer",
          "title": "Sale End Month"
        },
        "engine_code": {
          "type": "string",
          "title": "Engine Code"
        },
        "max_power": {
          "type": "string",
          "title": "Max Power"
        },
        "max_power_ps": {
          "type": "integer",
          "title": "Max Power Ps"
        },
        "max_torque": {
          "type": "string",
          "title": "Max Torque"
        },
        "max_torque_nm": {
          "type": "number",
          "title": "Max Torque Nm"
        },
        "tire_size_front": {
          "type": "string",
          "title": "Tire Size Front"
        },
        "tire_size_rear": {
          "type": "string",
          "title": "Tire Size Rear"
        },
        "source_url": {
          "type": "string",
          "title": "Source Url"
        },
        "edition_id": {
          "type": "string",
          "title": "Edition Id"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "source_url"
      ],
      "title": "GradeResponse",
      "description": "改良1つの中のグレード1行 (#1493)。公開ページの表の1行\n\n列は goo-net のカタログの表に合わせてある (DB の `model_grades`)。**数値の無い\n列は None** で、出典がその値を持たない (古い車の価格・燃費など)。\n販売開始・終了は月単位で、終了の None は「世代の終わりまで」。"
    },
    "ListingMinorChange": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "common_name": {
          "type": "string",
          "title": "Common Name"
        },
        "start_year": {
          "type": "integer",
          "title": "Start Year"
        },
        "start_month": {
          "type": "integer",
          "title": "Start Month"
        },
        "classifications": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Classifications"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "start_year",
        "classifications"
      ],
      "title": "ListingMinorChange",
      "description": "物件の改良。物件ページに呼び名と分類 (前期・後期など) を出す"
    },
    "ListingModel": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "chassis_code": {
          "type": "string",
          "title": "Chassis Code"
        },
        "start_year": {
          "type": "integer",
          "title": "Start Year"
        },
        "end_year": {
          "type": "integer",
          "title": "End Year"
        },
        "series_id": {
          "type": "string",
          "title": "Series Id"
        },
        "series_name": {
          "type": "string",
          "title": "Series Name"
        },
        "maker_id": {
          "type": "string",
          "title": "Maker Id"
        },
        "maker_name": {
          "type": "string",
          "title": "Maker Name"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "start_year",
        "series_id",
        "series_name",
        "maker_id",
        "maker_name"
      ],
      "title": "ListingModel",
      "description": "紐づけた世代。画面は `lib/model-metadata.ts` の見出しと同じ綴りで出す"
    },
    "ListingPart": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "part_id": {
          "type": "string",
          "title": "Part Id"
        },
        "part_key": {
          "type": "string",
          "title": "Part Key"
        },
        "manufacturer_name": {
          "type": "string",
          "title": "Manufacturer Name"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "part_number": {
          "type": "string",
          "title": "Part Number"
        },
        "note": {
          "type": "string",
          "title": "Note"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "ListingPart",
      "description": "装着パーツ 1 行。DB の商品ならメーカー名と品番も出る"
    },
    "Photo": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "s3key": {
          "type": "string",
          "title": "S3Key"
        },
        "width": {
          "type": "integer",
          "title": "Width"
        },
        "height": {
          "type": "integer",
          "title": "Height"
        }
      },
      "type": "object",
      "required": [
        "id",
        "s3key",
        "width",
        "height"
      ],
      "title": "Photo"
    }
  }
}