← back to Watches

schema/watch-schema.json

188 lines

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Omega Watch Database Schema",
  "type": "object",
  "required": ["watches", "metadata"],
  "properties": {
    "watches": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "model",
          "series",
          "reference",
          "yearIntroduced",
          "description",
          "priceHistory",
          "specifications"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$",
            "description": "Unique identifier for the watch"
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "description": "Full model name"
          },
          "series": {
            "type": "string",
            "enum": [
              "Speedmaster",
              "Seamaster",
              "Constellation",
              "De Ville",
              "Railmaster",
              "Flightmaster",
              "Cosmic",
              "Genève",
              "Specialty"
            ],
            "description": "Watch series/collection"
          },
          "reference": {
            "type": "string",
            "description": "Official reference number"
          },
          "yearIntroduced": {
            "type": "integer",
            "minimum": 1848,
            "maximum": 2100,
            "description": "Year the watch was introduced"
          },
          "description": {
            "type": "string",
            "description": "Brief description"
          },
          "detailedDescription": {
            "type": "string",
            "description": "Detailed description (optional)"
          },
          "imageUrl": {
            "type": "string",
            "format": "uri",
            "description": "Image URL (optional)"
          },
          "priceHistory": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": ["year", "price", "condition", "source"],
              "properties": {
                "year": {
                  "type": "integer",
                  "minimum": 1848,
                  "maximum": 2100
                },
                "price": {
                  "type": "number",
                  "minimum": 0
                },
                "condition": {
                  "type": "string",
                  "enum": ["new", "vintage", "prototype"]
                },
                "source": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "specifications": {
            "type": "object",
            "required": ["caseSize", "caseMaterial", "movement"],
            "properties": {
              "caseSize": {
                "type": "string",
                "description": "Case diameter with unit"
              },
              "caseMaterial": {
                "type": "string",
                "description": "Material of the case"
              },
              "movement": {
                "type": "string",
                "description": "Movement type and calibre"
              },
              "waterResistance": {
                "type": "string",
                "description": "Water resistance rating"
              },
              "crystal": {
                "type": "string",
                "description": "Crystal material"
              },
              "dialColor": {
                "type": "string",
                "description": "Dial color"
              },
              "bezel": {
                "type": "string",
                "description": "Bezel type"
              },
              "lugWidth": {
                "type": "string",
                "description": "Lug width"
              },
              "thickness": {
                "type": "string",
                "description": "Case thickness"
              },
              "powerReserve": {
                "type": "string",
                "description": "Power reserve duration"
              },
              "weight": {
                "type": "string",
                "description": "Weight"
              },
              "features": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Key features"
              }
            }
          }
        }
      }
    },
    "metadata": {
      "type": "object",
      "required": ["totalWatches", "collections", "lastUpdated"],
      "properties": {
        "totalWatches": {
          "type": "integer",
          "minimum": 0
        },
        "collections": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "lastUpdated": {
          "type": "string",
          "format": "date"
        },
        "notes": {
          "type": "string"
        }
      }
    }
  }
}