{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "TripEnd",
    "type": "object",
    "additionalProperties": false,
    "description": "Trip End Event Schema",
    "properties": {
        "log_context": {
            "$ref": "/resources/schema/analytics/client/v4/LogContext.json",
            "description": "Required Log Context Reference"
        },
        "event_name": {
            "type": "string",
            "enum": [
                "TRIP_END"
            ]
        },
        "schema_definition": {
            "type": "string",
            "enum": [
                "TripEnd"
            ]
        },
        "trip_end_mode": {
            "type": "string",
            "enum": [
                "AUTO",
                "MANUAL"
            ],
            "description": "The SDK detection mode in which trip is generated"
        },
        "trip_end_state": {
            "type": "string",
            "enum": [
                "COMPLETED",
                "INVALID"
            ],
            "description": "This indicates whether the current trip is valid or invalid"
        },
        "trip_end_reason": {
            "type": "string",
            "enum": [
                "MOTION",
                "NO_SPEED",
                "LOW_SPEED",
                "MANUAL_STOP",
                "LOW_BATTERY",
                "FORCE_SHUTDOWN",
                "FORCE_QUIT",
                "NON_DRIVE_TRIP",
                "PERIPHERAL_STATUS"
            ],
            "description": "This indicates the reason for the trip end. For example, SDK might detect the trip type as airplane/bicycle/walk and mark it as NON_DRIVE_TRIP."
        },
        "trip_model_version": {
            "type": "string",
            "description": "The version of trip scoring algorithm"
        },
        "odometer": {
            "type":  "number",
            "description": "Vehicle odometer in miles"
        },
        "reason_summary": {
            "type": "string",
            "description": "explanation that complements the high-level reason"
        }
    },
    "required": [
        "log_context",
        "event_name",
        "schema_definition"
    ]
}