{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Trailer",
  "type": "object",
  "properties": {
    "connectionId": {
      "type": "string",
      "description": "The ID of the connection that this record belongs to."
    },
    "id": {
      "title": "TrailerId",
      "type": "string",
      "format": "ulid"
    },
    "sourceId": {
      "title": "SourceId",
      "type": "string",
      "description": "The ID used to represent the entity in the source system."
    },
    "provider": {
      "type": "string",
      "description": "Every provider has a unique code to identify it across Terminal's system. You can find each provider's code under [provider details](/providers)."
    },
    "status": {
      "type": "string",
      "enum": ["active", "inactive"],
      "description": "The status in the providers system"
    },
    "name": {
      "type": "string"
    },
    "vin": {
      "title": "VIN",
      "type": "string"
    },
    "serialNumber": {
      "type": "string"
    },
    "make": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "year": {
      "type": "integer"
    },
    "groups": {
      "type": "array",
      "description": "The groups the trailer belongs to.",
      "items": {
        "title": "GroupId",
        "type": "string",
        "format": "ulid"
      }
    },
    "licensePlate": {
      "type": "object",
      "properties": {
        "state": {
          "title": "State",
          "type": "string",
          "enum": [
            "AL",
            "AK",
            "AS",
            "AZ",
            "AR",
            "CA",
            "CO",
            "CT",
            "DE",
            "FL",
            "GA",
            "GU",
            "HI",
            "ID",
            "IL",
            "IN",
            "IA",
            "KS",
            "KY",
            "LA",
            "ME",
            "MD",
            "MA",
            "MI",
            "MN",
            "MP",
            "MS",
            "MO",
            "MT",
            "NE",
            "NV",
            "NH",
            "NJ",
            "NM",
            "NY",
            "NC",
            "ND",
            "OH",
            "OK",
            "OR",
            "PA",
            "PR",
            "RI",
            "SC",
            "SD",
            "TN",
            "TX",
            "UT",
            "VT",
            "VA",
            "WA",
            "WV",
            "WI",
            "WY",
            "VI",
            "AB",
            "BC",
            "MB",
            "NB",
            "NL",
            "NS",
            "ON",
            "PE",
            "QC",
            "SK",
            "NT",
            "NU",
            "UM",
            "YT",
            "DC"
          ],
          "description": "US State or Canadian Province"
        },
        "number": {
          "type": "string"
        }
      }
    },
    "createdAt": {
      "title": "SourceCreatedAt",
      "type": "string",
      "format": "date-time",
      "description": "The date and time the record was created in the provider's system. This timestamp comes directly from the source system and represents when the data was originally created there. Note: not all providers expose this."
    },
    "updatedAt": {
      "title": "SourceUpdatedAt",
      "type": "string",
      "format": "date-time",
      "description": "The date and time the record was updated in the provider's system. This timestamp comes directly from the source system and represents when the data was last updated there. Note: not all providers expose this."
    },
    "metadata": {
      "title": "CoreEntityMetadata",
      "type": "object",
      "description": "Internal metadata about the record.",
      "required": ["addedAt", "modifiedAt"],
      "properties": {
        "addedAt": {
          "title": "AddedAt",
          "type": "string",
          "format": "date-time",
          "description": "The date and time the record was ingested into Terminal. Note: this is not the date and time the record was created in the provider's system."
        },
        "modifiedAt": {
          "title": "ModifiedAt",
          "type": "string",
          "format": "date-time",
          "description": "The date and time the record was last updated in Terminal. Note: this is not the date and time the record was updated in the provider's system."
        },
        "deletedAt": {
          "title": "DeletedAt",
          "type": "string",
          "format": "date-time",
          "description": "The date and time the record was deleted from Terminal. Note: this is not the date and time the record was deleted in the provider's system."
        },
        "visibility": {
          "type": "string",
          "enum": [
            "visible",
            "hidden_by_exclude_list",
            "hidden_by_include_list",
            "hidden_by_status",
            "deleted"
          ],
          "description": "Visibility status of a resource. Read more about hidden records [here](https://docs.withterminal.com/guides/vehicle-driver-filtering)."
        }
      }
    },
    "raw": {
      "title": "RawDataList",
      "type": "array",
      "items": {
        "title": "RawData",
        "type": "object",
        "properties": {
          "provider": {
            "type": "string"
          },
          "schema": {
            "type": "string"
          },
          "extractedAt": {
            "type": "string"
          },
          "data": {
            "type": "object"
          }
        },
        "required": ["provider", "schema", "extractedAt", "data"]
      }
    }
  },
  "required": [
    "connectionId",
    "id",
    "sourceId",
    "provider",
    "status",
    "metadata"
  ]
}
