{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "TripAssignmentItem",
    "type": "object",
    "description": "Assignment-result object for a single trip produced during a batch re-matching run.",
    "additionalProperties": false,
    "properties": {
        "trip_id": {
            "type": "string",
            "description": "Unique identifier of the trip (equivalent to log_context.trip_id)."
        },
        "reason": {
            "type": "string",
            "description": "Reason why the trip was (re)matched",
            "$ref": "/resources/schema/analytics/client/v4/type/TripAssignmentReasonType.json"
        },
        "channel_client_id": {
            "type": "string",
            "description": "Identifier of the vehicle/channel this trip ultimately matched to (same as PERIPHERAL_CONNECTION_STATUS.channel_client_id)."
        },
        "matched_peripheral": {
            "$ref": "/resources/schema/analytics/client/v4/item/PeripheralDetailItem.json",
            "description": "Peripheral device information that led to the match."
        },
        "previous_reason": {
            "type": "string",
            "description": "Reason recorded for the trip’s prior match attempt.",
            "$ref": "/resources/schema/analytics/client/v4/type/TripAssignmentReasonType.json"
        },
        "previous_channel_client_id": {
            "type": "string",
            "description": "Previously recorded channel_client_id, if any."
        }
    },
    "required": [
        "trip_id",
        "reason"
    ]
}