{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://developer.reits.tech/schemas/contracts/v1/market-slice.v1.schema.json",
  "title": "MarketSlice",
  "type": "object",
  "additionalProperties": false,
  "required": ["sliceId", "symbol", "venue", "interval", "startAt", "endAt", "dataAsOf", "recordCount", "storageUri", "checksum", "licenseClass", "status"],
  "properties": {
    "sliceId": { "type": "string", "minLength": 1, "maxLength": 160 },
    "symbol": { "type": "string", "minLength": 1, "maxLength": 64 },
    "venue": { "type": "string", "minLength": 1, "maxLength": 32 },
    "interval": { "type": "string", "pattern": "^[1-9][0-9]*(m|h|d)$" },
    "startAt": { "type": "string", "format": "date-time" },
    "endAt": { "type": "string", "format": "date-time" },
    "dataAsOf": { "type": "string", "format": "date-time" },
    "recordCount": { "type": "integer", "minimum": 0 },
    "storageUri": { "type": "string", "pattern": "^(s3|https)://" },
    "checksum": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
    "licenseClass": { "type": "string", "enum": ["public", "licensed", "restricted"] },
    "status": { "type": "string", "enum": ["staging", "ready", "rejected", "expired"] }
  }
}
