{
  "title": "Job",
  "description": "A job in the Katapult Pro software",
  "type": "object",
  "properties": {
    "connections": {
      "description": "Lines which connect two node endpoints",
      "type": "object",
      "patternProperties": {
        "^.{1,}": {
          "description": "The unique identifier for each connection",
          "type": "object",
          "properties": {
            "attributes": {
              "description": "A variable list of properties and values based on job models and user input",
              "type": "object",
              "properties": {
                "connection_type": {
                  "description": "Specifies the type of the connection. Options are editable, but common types are listed here.",
                  "type": "object",
                  "patternProperties": {
                    "^.{1,}": {
                      "description": "The unique identifier of the property (multiple attributes of each property are possible, but only one connection_type will exist).",
                      "type": "string",
                      "enum": [
                        "aerial cable",
                        "overlash",
                        "slack span",
                        "overhead guy",
                        "pole to pole guy",
                        "underground cable",
                        "reference",
                        "down guy",
                        "pushbrace"
                      ]
                    }
                  }
                },
                "$comment": "As stated above, attributes is a flexible object that can contain multiple properties depending on user configuration"
              }
            },
            "button": {
              "description": "Id of the button which created the connection",
              "type": "string"
            },
            "node_id_1": {
              "description": "The id of the first node in the connection",
              "type": "string"
            },
            "node_id_2": {
              "description": "The id of the second node in the connection",
              "type": "string"
            },
            "sections": {
              "description": "The location of measurements taken along the connection",
              "type": "object",
              "patternProperties": {
                "^(midpoint_section|.{1,})": {
                  "description": "The unique identifier for each section. If the identifier is midpoint_section it is considered to be at the midpoint of the connection",
                  "type": "object",
                  "properties": {
                    "latitude": {
                      "description": "The latitude of the section in decimal degrees",
                      "type": "number",
                      "minimum": -90,
                      "maximum": 90
                    },
                    "longitude": {
                      "description": "The longitude of the section in decimal degrees",
                      "type": "number",
                      "minimum": -180,
                      "maximum": 180
                    },
                    "multi_attributes": {
                      "description": "A variable list of properties and values based on job models and what attributes are placed on the section. Identical to Node and Connection 'attributes'",
                      "type": "object"
                    },
                    "photos": {
                      "description": "A list of photo keys associated to this section",
                      "type": "object",
                      "properties": {
                        "association": {
                          "description": "The type of association for this photo. Main photos contain the current heights for this location, manual photos were manually associated by the user. Default value is true, to denote ordinary association",
                          "enum": ["main", "manual", true]
                        }
                      }
                    }
                  },
                  "required": ["latitude", "longitude"]
                }
              }
            }
          },
          "required": ["node_id_1", "node_id_2"]
        }
      }
    },
    "date_created": {
      "description": "Date the job was created",
      "type": "number"
    },
    "geohash": {
      "description": "A lookup containing the location and map style information for nodes, connections and sections",
      "type": "object"
    },
    "job_creator": {
      "description": "The identifier of the models that define the attributes available for a job",
      "type": "string"
    },
    "job_owner": {
      "description": "The id of the company who created the job",
      "type": "string"
    },
    "name": {
      "description": "The name of the job",
      "type": "string"
    },
    "nodes": {
      "description": "Unique points on the map",
      "type": "object",
      "patternProperties": {
        "^.{1,}": {
          "description": "The unique identifier for each node",
          "type": "object",
          "properties": {
            "attributes": {
              "description": "A variable list of properties and values based on job models and user input",
              "type": "object",
              "properties": {
                "node_type": {
                  "description": "Specifies the type of the node. Options are editable, but common types are listed here.",
                  "type": "object",
                  "patternProperties": {
                    "^.{1,}": {
                      "description": "The unique identifier of the property (multiple attributes of each property are possible, but only one node_type will exist).",
                      "type": "string",
                      "enum": [
                        "existing anchor",
                        "new anchor",
                        "slack loop",
                        "splice",
                        "pole",
                        "building attachment",
                        "bridge attachment",
                        "crossover",
                        "reference",
                        "pushbrace",
                        "doublewood pole",
                        "midspan takeoff",
                        "break point",
                        "handhole",
                        "manhole",
                        "obstacle",
                        "map note"
                      ]
                    }
                  }
                },
                "$comment": "As stated above, attributes is a flexible object that can contain multiple properties depending on user configuration"
              }
            },
            "button": {
              "description": "Id of the button which created the node",
              "type": "string"
            },
            "latitude": {
              "description": "The latitude of the node in decimal degrees",
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "longitude": {
              "description": "The longitude of the node in decimal degrees",
              "type": "number",
              "minimum": -180,
              "maximum": 180
            },
            "photos": {
              "description": "A list of photo keys associated to this node",
              "type": "object",
              "properties": {
                "association": {
                  "description": "The type of association for this photo. Main photos contain the current heights for this location, manual photos were manually associated by the user. Default value is true, to denote ordinary association",
                  "enum": ["main", "manual", true]
                }
              }
            }
          },
          "required": ["latitude", "longitude"]
        }
      }
    },
    "photos": {
      "description": "A list of all the photos that have been uploaded to the job",
      "type": "object",
      "patternProperties": {
        "^.{1,}": {
          "description": "The unique identifier for each photo",
          "type": "object",
          "properties": {
            "associated_locations": {
              "description": "A list of ids of nodes or sections that are associated to the photo",
              "type": "object"
            },
            "camera_id": {
              "description": "The id for the camera used to take the photo",
              "type": "string"
            },
            "camera_make": {
              "description": "The make for the camera used to take the photo",
              "type": "string"
            },
            "camera_model": {
              "description": "The model for the camera used to take the photo",
              "type": "string"
            },
            "camera_serial_number": {
              "description": "The serial number for the camera used to take the photo",
              "type": "string"
            },
            "date_taken": {
              "description": "The epoch time for the date the photo was taken, stored by the camera in seconds",
              "type": "number"
            },
            "filename": {
              "description": "The original filename for the photo",
              "type": "string"
            },
            "focal_length": {
              "description": "The focal length of the photo",
              "type": "number"
            },
            "folder_id": {
              "description": "The id of the folder the photo was uploaded to",
              "type": "string"
            },
            "image_height": {
              "description": "The original height of the photo",
              "type": "number"
            },
            "image_width": {
              "description": "The original width of the photo",
              "type": "number"
            },
            "iso": {
              "description": "The iso of the photo",
              "type": "number"
            },
            "orientation": {
              "description": "The original orientation of the photo",
              "type": "number"
            },
            "original_size": {
              "description": "The original file size in bytes",
              "type": "number"
            },
            "photofirst_data": {
              "description": "A list of markers that vary by model. Photo classification markers along with equipment, wires and other attachments",
              "type": "object",
              "properties": {
                "$comment": "Many customizable properties can exist, but most important properties listed here.",
                "wire": {
                  "description": "A list of wire markers on the photo with information regarding the wire",
                  "type": "object",
                  "patternProperties": {
                    "^.{1,}": {
                      "description": "The unique identifier for each wire",
                      "type": "object",
                      "properties": {
                        "_trace": {
                          "description": "The unique identifier of the trace that connects wires across the photos",
                          "type": "string"
                        },
                        "_measured_height": {
                          "description": "The height of the item in decimal inches",
                          "type": "number"
                        },
                        "_manual_height": {
                          "description": "The height of the item in decimal inches measured and entered manually by the user. To be used for height if _measured_height does not exist",
                          "type": "number"
                        },
                        "wire_spec": {
                          "description": "The the type of wire, which correlates to a specification",
                          "type": "string"
                        },
                        "pixel_selection": {
                          "description": "The position of the marker in the photo",
                          "type": "Array"
                        }
                      }
                    }
                  }
                },
                "messenger": {
                  "description": "A list of messenger markers on the photo that includes information on the wire inside that messenger",
                  "type": "object",
                  "patternProperties": {
                    "^.{1,}": {
                      "description": "The unique identifier for each messenger",
                      "type": "object",
                      "properties": {
                        "_children": {
                          "description": "An object of item children. Can contain wires",
                          "type": "object"
                        },
                        "_measured_height": {
                          "description": "The height of the item in decimal inches",
                          "type": "number"
                        },
                        "_manual_height": {
                          "description": "The height of the item in decimal inches measured and entered manually by the user. To be used for height if _measured_height does not exist",
                          "type": "number"
                        },
                        "messenger_spec": {
                          "description": "The the type of messenger, which correlates to a specification",
                          "type": "string"
                        },
                        "pixel_selection": {
                          "description": "The position of the marker in the photo",
                          "type": "Array"
                        }
                      }
                    }
                  }
                },
                "insulator": {
                  "description": "A list of insulator markers on the photo that includes information on the wire inside that insulator",
                  "type": "object",
                  "patternProperties": {
                    "^.{1,}": {
                      "description": "The unique identifier for each insulator",
                      "type": "object",
                      "properties": {
                        "_children": {
                          "description": "An object of item children. Can contain messengers or wires",
                          "type": "object"
                        },
                        "_measured_height": {
                          "description": "The height of the item in decimal inches",
                          "type": "number"
                        },
                        "_manual_height": {
                          "description": "The height of the item in decimal inches measured and entered manually by the user. To be used for height if _measured_height does not exist",
                          "type": "number"
                        },
                        "insulator_spec": {
                          "description": "The the type of insulator, which correlates to a specification",
                          "type": "string"
                        },
                        "pixel_selection": {
                          "description": "The position of the marker in the photo",
                          "type": "Array"
                        },
                        "bearing": {
                          "description": "The bearing of the insulator on the pole",
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "arm": {
                  "description": "A list of arm markers on the photo that includes information on insulators and wires on that arm",
                  "type": "object",
                  "patternProperties": {
                    "^.{1,}": {
                      "description": "The unique identifier for each arm",
                      "type": "object",
                      "properties": {
                        "_children": {
                          "description": "An object of item children. Can contain insulators, messengers or wires",
                          "type": "object"
                        },
                        "_measured_height": {
                          "description": "The height of the item in decimal inches",
                          "type": "number"
                        },
                        "_manual_height": {
                          "description": "The height of the item in decimal inches measured and entered manually by the user. To be used for height if _measured_height does not exist",
                          "type": "number"
                        },
                        "arm_spec": {
                          "description": "The the type of arm, which correlates to a specification",
                          "type": "string"
                        },
                        "pixel_selection": {
                          "description": "The position of the marker in the photo",
                          "type": "Array"
                        },
                        "bearing": {
                          "description": "The bearing of the arm on the pole",
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "equipment": {
                  "description": "A list of the equipment markers on the photo and some information regarding the equipment",
                  "type": "object"
                },
                "pole_top": {
                  "description": "A list of pole_top markers. Either the top of pole or top of extension (depending on pole_top_extension property)",
                  "type": "object",
                  "patternProperties": {
                    "^.{1,}": {
                      "description": "The unique identifier for each pole top",
                      "type": "object",
                      "properties": {
                        "_measured_height": {
                          "description": "The height of the item in decimal inches",
                          "type": "number"
                        },
                        "_manual_height": {
                          "description": "The height of the item in decimal inches measured and entered manually by the user. To be used for height if _measured_height does not exist",
                          "type": "number"
                        },
                        "pixel_selection": {
                          "description": "The position of the marker in the photo",
                          "type": "Array"
                        },
                        "pole_top_extension": {
                          "description": "Boolean defining whether the marker is at the top of the pole, or top of the pole top extension",
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "shutter_speed": {
              "description": "The shutter speed for the photo",
              "type": "number"
            },
            "status": {
              "description": "The current upload status of the photo",
              "type": "string"
            },
            "synced_time": {
              "description": "The real world time the photo was taken based on sync photo adjustments",
              "type": "number"
            },
            "upload_date": {
              "description": "The date the photo was uploaded",
              "type": "number"
            },
            "uploaded_by": {
              "description": "The id of the user that uploaded the photo",
              "type": "string"
            }
          }
        }
      }
    },
    "sharing": {
      "description": "List of companies with access to the job",
      "type": "object"
    },
    "traces": {
      "description": "A trace defines the connection between markers - connecting wires to each other throughout the job, or connecting equipment or guying attachments together on a single photo.",
      "type": "object",
      "properties": {
        "trace_data": {
          "description": "A list of the information for each specific trace",
          "type": "object",
          "patternProperties": {
            "^.{1,}": {
              "description": "The unique identifier for each trace. Stored on photo markers as '_trace'",
              "type": "object",
              "properties": {
                "_trace_type": {
                  "description": "The type of the trace",
                  "type": "string"
                },
                "cable_type": {
                  "description": "The cable type for the trace",
                  "type": "string"
                },
                "company": {
                  "description": "The company that owns the trace",
                  "type": "string"
                },
                "label": {
                  "description": "A user added custom label",
                  "type": "string"
                }
              },
              "required": ["_trace_type", "company"]
            }
          }
        },
        "trace_items": {
          "description": "A reverse lookup that allows you to find other photos that are a part of the trace",
          "type": "object",
          "patternProperties": {
            "^.{1,}": {
              "description": "The unique identifier for each trace",
              "type": "object",
              "patternProperties": {
                "description": "The unique identifier for each photo that is a part of the trace",
                "type": "object",
                "^.{1,}": {
                  "description": "The top level photofirst_data property. The value is the path to the marker on the photo",
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
