{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/loadsmart/json-schema/loadsmart-asset-visit-schema.json",
  "title": "AssetVisit",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/loadsmart-asset-visit-api-openapi.yml#/components/schemas/AssetVisit",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique identifier of the record",
      "readOnly": true
    },
    "createDateTime": {
      "format": "date-time",
      "type": "string",
      "description": "The date and time when the record was created",
      "readOnly": true
    },
    "createdBy": {
      "type": "object",
      "description": "The ID of the user who created the record",
      "readOnly": true
    },
    "lastChangedDateTime": {
      "format": "date-time",
      "type": "string",
      "description": "The date and time when the record was last changed",
      "readOnly": true
    },
    "orgId": {
      "type": "string",
      "format": "uuid"
    },
    "warehouseId": {
      "type": "string",
      "format": "uuid",
      "description": "The id of the warehouse"
    },
    "appointmentId": {
      "type": "string",
      "format": "uuid",
      "description": "The id of the appointment"
    },
    "secondaryAppointmentId": {
      "type": "string",
      "format": "uuid",
      "description": "The id of the secondary appointment"
    },
    "companyId": {
      "type": "string",
      "format": "uuid",
      "description": "The id of the company"
    },
    "phone": {
      "type": "string",
      "description": "The phone number of the driver"
    },
    "isPlanned": {
      "type": "boolean",
      "description": "Indicates if the visit has an appointment or not"
    },
    "companyHint": {
      "type": "string",
      "description": "A free-text to indicate the company name when there is no appointment"
    },
    "driverNotes": {
      "type": "string",
      "description": "Notes typed by the driver when checking in"
    },
    "driverAppointmentIdentifier": {
      "type": "string",
      "description": "Appointment identification typed by the driver when checking in"
    },
    "visitType": {
      "$ref": "#/$defs/AssetVisitType"
    },
    "checkInAcknowledged": {
      "type": "boolean",
      "description": "Whether the check-in was acknowledged by the warehouse or not"
    },
    "rejectReason": {
      "type": "object",
      "description": "The reason the asset visit was rejected"
    }
  },
  "required": [
    "id",
    "createDateTime",
    "createdBy",
    "lastChangedDateTime",
    "orgId",
    "warehouseId",
    "phone",
    "isPlanned"
  ],
  "$defs": {
    "AssetVisitType": {
      "type": "string",
      "description": "The type of the asset visit",
      "enum": [
        "LiveUnload",
        "LiveLoad",
        "Live",
        "Drop",
        "PickUp",
        "DropHook",
        "Unknown"
      ]
    }
  }
}