{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://theamateur.co.uk/schemas/dpl/dpl.call-sheet-1.schema.json",
  "title": "DPL call sheet (dpl.call-sheet/1)",
  "description": "What `dpl call-sheet <plan> [--day D] --format json` writes: for each shoot day the date and window, the places and how to get in, who is called when, the setups in order with clock times, the kit to bring, the light, the room-tone and voiceover tasks, the moves, the spare time and any open feasibility finding. Every member listed here is always written, or left out when null; nothing else appears.",
  "$comment": "Times are the plan's days worked through with the short-form profile's timing (the figures RDY-TIME holds against the day's window). A plan with no schedule has `timed` false, no days and a `notice`; its `scenes` list what each scene needs with no clock time.",
  "type": "object",
  "properties": {
    "format": {
      "type": "string",
      "const": "dpl.call-sheet/1"
    },
    "work_id": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "plan_hash": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "rules_version": {
      "type": "string"
    },
    "profile": {
      "type": "string"
    },
    "timed": {
      "type": "boolean"
    },
    "notice": {
      "type": [
        "string",
        "null"
      ]
    },
    "days": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CallSheetDay"
      }
    },
    "scenes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UntimedScene"
      }
    },
    "unscheduled_shots": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "open_findings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OpenFeasibility"
      }
    }
  },
  "required": [
    "format",
    "work_id",
    "title",
    "plan_hash",
    "rules_version",
    "profile",
    "timed",
    "days",
    "scenes",
    "unscheduled_shots",
    "open_findings"
  ],
  "additionalProperties": false,
  "$defs": {
    "CallSheetDay": {
      "type": "object",
      "description": "One shoot day.",
      "properties": {
        "id": {
          "type": "string"
        },
        "date": {
          "type": [
            "string",
            "null"
          ]
        },
        "weekday": {
          "type": [
            "string",
            "null"
          ]
        },
        "start": {
          "type": "string"
        },
        "end": {
          "type": "string"
        },
        "totals": {
          "$ref": "#/$defs/DayTotals"
        },
        "locations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PlaceNote"
          }
        },
        "calls": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PersonCall"
          }
        },
        "timeline": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TimelineEntry"
          }
        },
        "setups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SetupRun"
          }
        },
        "kit": {
          "$ref": "#/$defs/KitNeeded"
        },
        "light": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LightWindow"
          }
        },
        "tasks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TimelineEntry"
          }
        },
        "moves": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TimelineEntry"
          }
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "open_findings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OpenFeasibility"
          }
        }
      },
      "required": [
        "id",
        "start",
        "end",
        "totals",
        "locations",
        "calls",
        "timeline",
        "setups",
        "kit",
        "light",
        "tasks",
        "moves",
        "notes",
        "open_findings"
      ],
      "additionalProperties": false
    },
    "ClockSpan": {
      "type": "object",
      "description": "A span of clock time (\"09:30\" to \"11:00\").",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^[0-9]{2}:[0-9]{2}$",
          "description": "Clock time, 24-hour HH:MM."
        },
        "to": {
          "type": "string",
          "pattern": "^[0-9]{2}:[0-9]{2}$",
          "description": "Clock time, 24-hour HH:MM."
        }
      },
      "required": [
        "from",
        "to"
      ],
      "additionalProperties": false
    },
    "DayTotals": {
      "type": "object",
      "description": "How the day adds up, in minutes: the profile's own figures.",
      "properties": {
        "window_minutes": {
          "type": "number"
        },
        "preparation_minutes": {
          "type": "number"
        },
        "setup_minutes": {
          "type": "number"
        },
        "filming_minutes": {
          "type": "number"
        },
        "move_minutes": {
          "type": "number"
        },
        "wait_minutes": {
          "type": "number"
        },
        "work_minutes": {
          "type": "number"
        },
        "spare_minutes": {
          "type": "number"
        },
        "committed_minutes": {
          "type": "number"
        },
        "overrun_minutes": {
          "type": "integer"
        },
        "window_left_minutes": {
          "type": "number"
        }
      },
      "required": [
        "window_minutes",
        "preparation_minutes",
        "setup_minutes",
        "filming_minutes",
        "move_minutes",
        "wait_minutes",
        "work_minutes",
        "spare_minutes",
        "committed_minutes",
        "overrun_minutes",
        "window_left_minutes"
      ],
      "additionalProperties": false
    },
    "KitNeeded": {
      "type": "object",
      "description": "What to bring: the kit the day's shots use.",
      "properties": {
        "cameras": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "lens_multipliers": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "focal_mm": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "supports": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sound": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "lights": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "frame_rates": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "required": [
        "cameras",
        "lens_multipliers",
        "focal_mm",
        "supports",
        "sound",
        "lights",
        "frame_rates"
      ],
      "additionalProperties": false
    },
    "LightWindow": {
      "type": "object",
      "description": "The light a place gives on the day and how the filming sits in it.",
      "properties": {
        "location": {
          "type": "string"
        },
        "windows": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ClockSpan"
          }
        },
        "sun": {
          "type": [
            "string",
            "null"
          ]
        },
        "first_shot": {
          "type": "string"
        },
        "last_shot": {
          "type": "string"
        },
        "start": {
          "type": "string"
        },
        "end": {
          "type": "string"
        },
        "minutes_before": {
          "type": [
            "integer",
            "null"
          ]
        },
        "minutes_after": {
          "type": [
            "integer",
            "null"
          ]
        },
        "inside": {
          "type": "boolean"
        }
      },
      "required": [
        "location",
        "windows",
        "first_shot",
        "last_shot",
        "start",
        "end",
        "inside"
      ],
      "additionalProperties": false
    },
    "OpenFeasibility": {
      "type": "object",
      "description": "An open production-feasibility finding (people, light, kit, time, delivery, the coverage recipes) the crew should know about before the day.",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^f-[0-9a-f]{12}$"
        },
        "code": {
          "type": "string",
          "pattern": "^RDY-[A-Z0-9-]+$"
        },
        "severity": {
          "type": "string"
        },
        "scene": {
          "type": [
            "string",
            "null"
          ]
        },
        "shot": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "code",
        "severity",
        "message"
      ],
      "additionalProperties": false
    },
    "PersonCall": {
      "type": "object",
      "description": "When one person is wanted on a day, in which roles, and why then.",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "character": {
          "type": [
            "string",
            "null"
          ]
        },
        "call": {
          "type": "string"
        },
        "wrap": {
          "type": "string"
        },
        "first_for": {
          "type": "string"
        },
        "available": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ClockSpan"
          }
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "roles",
        "call",
        "wrap",
        "first_for",
        "available"
      ],
      "additionalProperties": false
    },
    "PlaceNote": {
      "type": "object",
      "description": "A place the day goes to, with the notes a crew needs to get in and work there.",
      "properties": {
        "id": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "setting": {
          "type": [
            "string",
            "null"
          ]
        },
        "access": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ClockSpan"
          }
        },
        "access_note": {
          "type": "string"
        },
        "acoustics": {
          "type": [
            "string",
            "null"
          ]
        },
        "quieter_position": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "usable_light": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ClockSpan"
          }
        },
        "sun": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "description",
        "access",
        "access_note",
        "usable_light"
      ],
      "additionalProperties": false
    },
    "SetupRun": {
      "type": "object",
      "description": "A camera position and the shots filmed from it, in the order the day films them.",
      "properties": {
        "setup": {
          "type": "string"
        },
        "start": {
          "type": "string"
        },
        "end": {
          "type": "string"
        },
        "location": {
          "type": [
            "string",
            "null"
          ]
        },
        "shots": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "device": {
          "type": [
            "string",
            "null"
          ]
        },
        "support": {
          "type": [
            "string",
            "null"
          ]
        },
        "lens": {
          "type": "string"
        },
        "people": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "speech": {
          "type": "boolean"
        },
        "fixed_start": {
          "type": [
            "string",
            "null"
          ]
        },
        "with_shot": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "setup",
        "start",
        "end",
        "shots",
        "lens",
        "people",
        "speech"
      ],
      "additionalProperties": false
    },
    "TimelineEntry": {
      "type": "object",
      "description": "One stretch of the day. kind is preparation, move, wait, location_setup, sound_check, shot or task.",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "preparation",
            "move",
            "wait",
            "location_setup",
            "sound_check",
            "shot",
            "task"
          ]
        },
        "start": {
          "type": "string"
        },
        "end": {
          "type": "string"
        },
        "minutes": {
          "type": "number"
        },
        "location": {
          "type": [
            "string",
            "null"
          ]
        },
        "setup": {
          "type": [
            "string",
            "null"
          ]
        },
        "shots": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "task": {
          "type": [
            "string",
            "null"
          ]
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "kind",
        "start",
        "end",
        "minutes",
        "note"
      ],
      "additionalProperties": false
    },
    "UntimedScene": {
      "type": "object",
      "description": "A scene of a plan that has no schedule: what is needed, with no clock time.",
      "properties": {
        "id": {
          "type": "string"
        },
        "purpose": {
          "type": "string"
        },
        "location": {
          "type": [
            "string",
            "null"
          ]
        },
        "place": {
          "anyOf": [
            {
              "$ref": "#/$defs/PlaceNote"
            },
            {
              "type": "null"
            }
          ]
        },
        "people": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "setups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UntimedSetup"
          }
        }
      },
      "required": [
        "id",
        "purpose",
        "people",
        "setups"
      ],
      "additionalProperties": false
    },
    "UntimedSetup": {
      "type": "object",
      "properties": {
        "setup": {
          "type": "string"
        },
        "shots": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "device": {
          "type": [
            "string",
            "null"
          ]
        },
        "support": {
          "type": [
            "string",
            "null"
          ]
        },
        "lens": {
          "type": "string"
        },
        "speech": {
          "type": "boolean"
        }
      },
      "required": [
        "setup",
        "shots",
        "lens",
        "speech"
      ],
      "additionalProperties": false
    }
  }
}
