{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://local.lwltapi/schemas/agent_operation.schema.json", "title": "LTJT Agent Parsed Operation", "description": "User-intent operation emitted by the Agent. It contains only user-visible business facts and normalized values; execution references and runtime evidence belong to the downstream execution contract. Update actions preserve every recognized user-stated business field, even when the plugin will later require manual review.", "type": "object", "additionalProperties": false, "required": ["action", "order_nature", "submit_mode", "data"], "properties": { "action": { "enum": [ "team_order_create", "team_order_batch_create", "shared_plan_create", "shared_child_order_create", "passenger_list_import", "arrangement_guide", "arrangement_vehicle", "arrangement_hotel", "arrangement_transport", "arrangement_other", "order_update_independent", "order_update_shared_plan", "order_update_shared_child", "order_cancel", "order_restore", "confirmation_export" ] }, "order_nature": { "const": "formal" }, "submit_mode": { "const": "dry_run" }, "data": { "$ref": "#/$defs/data" } }, "allOf": [ { "if": { "properties": { "action": { "const": "team_order_create" } }, "required": ["action"] }, "then": { "properties": { "data": { "required": ["customer", "product", "departure_dates", "passenger_counts", "room_counts"], "properties": { "departure_dates": { "minItems": 1, "maxItems": 1 } } } } } }, { "if": { "properties": { "action": { "const": "team_order_batch_create" } }, "required": ["action"] }, "then": { "properties": { "data": { "required": ["customer", "product", "departure_dates", "recurrence", "passenger_counts", "room_counts"], "properties": { "departure_dates": { "minItems": 2 } } } } } }, { "if": { "properties": { "action": { "const": "shared_plan_create" } }, "required": ["action"] }, "then": { "properties": { "data": { "required": ["product", "planned_capacity", "room_counts"], "anyOf": [ { "required": ["departure_dates"], "properties": { "departure_dates": { "minItems": 1 } } }, { "required": ["recurrence"] } ] } } } }, { "if": { "properties": { "action": { "const": "shared_child_order_create" } }, "required": ["action"] }, "then": { "properties": { "data": { "required": ["customer", "passenger_counts"], "anyOf": [ { "required": ["existing_refs"], "properties": { "existing_refs": { "required": ["identifier"] } } }, { "required": ["departure_dates"], "properties": { "departure_dates": { "minItems": 1, "maxItems": 1 } } } ], "properties": { "existing_refs": { "required": ["kind"], "properties": { "kind": { "const": "shared_plan" } } }, "departure_dates": { "maxItems": 1 } } } } } }, { "if": { "properties": { "action": { "const": "passenger_list_import" } }, "required": ["action"] }, "then": { "properties": { "data": { "required": ["existing_refs", "passenger_list"], "anyOf": [ { "properties": { "existing_refs": { "required": ["identifier"] } } }, { "required": ["customer", "departure_dates"], "properties": { "departure_dates": { "minItems": 1, "maxItems": 1 } } } ], "properties": { "existing_refs": { "required": ["kind"], "properties": { "kind": { "enum": ["independent_order", "shared_child_order"] } } } } } } } }, { "if": { "properties": { "action": { "const": "arrangement_guide" } }, "required": ["action"] }, "then": { "properties": { "data": { "required": ["existing_refs", "arrangement"], "properties": { "existing_refs": { "required": ["identifier"] }, "arrangement": { "required": ["mode", "resource"], "properties": { "mode": { "const": "create" } } } } } } } }, { "if": { "properties": { "action": { "const": "arrangement_vehicle" } }, "required": ["action"] }, "then": { "properties": { "data": { "required": ["existing_refs", "arrangement"], "properties": { "existing_refs": { "required": ["identifier"] }, "arrangement": { "required": ["mode", "supplier", "start_date", "end_date", "quantity"], "properties": { "mode": { "const": "create" } }, "not": { "anyOf": [{ "required": ["item"] }, { "required": ["date"] }] } } } } } } }, { "if": { "properties": { "action": { "const": "arrangement_transport" } }, "required": ["action"] }, "then": { "properties": { "data": { "required": ["existing_refs", "arrangement"], "properties": { "existing_refs": { "required": ["identifier"] }, "arrangement": { "required": ["mode", "supplier", "quantity"], "properties": { "mode": { "const": "create" } } } } } } } }, { "if": { "properties": { "action": { "const": "arrangement_other" } }, "required": ["action"] }, "then": { "properties": { "data": { "required": ["existing_refs", "arrangement"], "properties": { "existing_refs": { "required": ["identifier"] }, "arrangement": { "required": ["mode", "supplier", "date"], "properties": { "mode": { "const": "create" } } } } } } } }, { "if": { "properties": { "action": { "const": "arrangement_hotel" }, "data": { "properties": { "arrangement": { "properties": { "mode": { "const": "create" } }, "required": ["mode"] } }, "required": ["arrangement"] } }, "required": ["action", "data"] }, "then": { "properties": { "data": { "required": ["existing_refs", "arrangement"], "properties": { "existing_refs": { "required": ["identifier"] }, "arrangement": { "required": ["resource", "start_date", "end_date", "room_count"] } } } } } }, { "if": { "properties": { "action": { "const": "arrangement_hotel" }, "data": { "properties": { "arrangement": { "properties": { "mode": { "const": "update" } }, "required": ["mode"] } }, "required": ["arrangement"] } }, "required": ["action", "data"] }, "then": { "properties": { "data": { "required": ["existing_refs", "arrangement"], "properties": { "existing_refs": { "required": ["identifier"] }, "arrangement": { "required": ["changes"] } } } } } }, { "if": { "properties": { "action": { "const": "order_update_independent" } }, "required": ["action"] }, "then": { "$ref": "#/$defs/independentUpdate" } }, { "if": { "properties": { "action": { "const": "order_update_shared_plan" } }, "required": ["action"] }, "then": { "$ref": "#/$defs/sharedPlanUpdate" } }, { "if": { "properties": { "action": { "const": "order_update_shared_child" } }, "required": ["action"] }, "then": { "$ref": "#/$defs/sharedChildUpdate" } }, { "if": { "properties": { "action": { "enum": ["order_cancel", "order_restore"] } }, "required": ["action"] }, "then": { "properties": { "data": { "anyOf": [ { "required": ["existing_refs"], "properties": { "existing_refs": { "required": ["identifier"] } } }, { "required": ["customer", "departure_dates"], "properties": { "departure_dates": { "minItems": 1, "maxItems": 1 } } } ] } } } }, { "if": { "properties": { "action": { "const": "confirmation_export" } }, "required": ["action"] }, "then": { "properties": { "data": { "anyOf": [ { "required": ["existing_refs"], "properties": { "existing_refs": { "required": ["identifier"] } } }, { "required": ["customer", "departure_dates"], "properties": { "departure_dates": { "minItems": 1, "maxItems": 1 } } } ], "oneOf": [ { "required": ["confirmation"], "not": { "required": ["export_types"] } }, { "required": ["export_types"], "not": { "required": ["confirmation"] } } ] } } } }, { "if": { "properties": { "action": { "const": "confirmation_export" }, "data": { "properties": { "existing_refs": { "properties": { "kind": { "const": "shared_plan" } }, "required": ["kind"] } }, "required": ["existing_refs"] } }, "required": ["action", "data"] }, "then": { "properties": { "data": { "required": ["confirmation"], "not": { "required": ["export_types"] }, "properties": { "confirmation": { "required": ["type"], "properties": { "type": { "const": "visitor-list" } } } } } } } } ], "$defs": { "data": { "type": "object", "additionalProperties": false, "properties": { "customer": { "$ref": "#/$defs/namedRef" }, "product": { "$ref": "#/$defs/namedRef" }, "leader": { "$ref": "#/$defs/namedRef" }, "departure_dates": { "$ref": "#/$defs/dateList" }, "recurrence": { "$ref": "#/$defs/recurrence" }, "planned_capacity": { "type": "integer", "minimum": 1 }, "passenger_counts": { "$ref": "#/$defs/passengerCounts" }, "split_order": { "$ref": "#/$defs/splitOrder" }, "room_counts": { "$ref": "#/$defs/roomCounts" }, "special_requests": { "type": "string", "minLength": 1 }, "existing_refs": { "$ref": "#/$defs/existingRefs" }, "passenger_list": { "$ref": "#/$defs/passengerList" }, "updates": { "$ref": "#/$defs/updates" }, "arrangement": { "$ref": "#/$defs/arrangement" }, "transition": { "$ref": "#/$defs/transition" }, "visitor_name": { "type": "string", "minLength": 1 }, "export_types": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/exportType" } }, "confirmation": { "type": "object", "additionalProperties": false, "required": ["type"], "properties": { "type": { "$ref": "#/$defs/exportType" } } } } }, "namedRef": { "type": "object", "additionalProperties": false, "required": ["name", "keyword"], "properties": { "name": { "type": "string", "minLength": 1 }, "keyword": { "type": "string", "minLength": 1 }, "source_region": { "type": "string", "minLength": 1 } } }, "existingRefs": { "type": "object", "additionalProperties": false, "properties": { "kind": { "enum": ["independent_order", "shared_plan", "shared_child_order"] }, "identifier": { "type": "string", "minLength": 1 }, "parent_group_no": { "type": "string", "minLength": 1 } } }, "dateList": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "format": "date" } }, "recurrence": { "type": "object", "additionalProperties": false, "required": ["start_date", "end_date"], "properties": { "start_date": { "type": "string", "format": "date" }, "end_date": { "type": "string", "format": "date" }, "pattern": { "enum": ["daily", "weekly", "odd_days", "even_days", "specified_dates"] }, "weekday": { "type": "array", "uniqueItems": true, "items": { "type": "integer", "minimum": 1, "maximum": 7 } } } }, "passengerCounts": { "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "adult": { "type": "integer", "minimum": 0 }, "child_bed": { "type": "integer", "minimum": 0 }, "child_no_bed": { "type": "integer", "minimum": 0 }, "infant": { "type": "integer", "minimum": 0 }, "leader": { "type": "integer", "minimum": 0 }, "expected_total": { "type": "integer", "minimum": 1 } }, "anyOf": [ { "required": ["adult"] }, { "required": ["child_bed"] }, { "required": ["child_no_bed"] }, { "required": ["infant"] }, { "required": ["leader"] } ] }, "splitOrder": { "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "customer": { "$ref": "#/$defs/namedRef" }, "passenger_counts": { "$ref": "#/$defs/passengerCounts" } } }, "roomCounts": { "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "SGL": { "type": "integer", "minimum": 1 }, "TWN": { "type": "integer", "minimum": 1 }, "TRP": { "type": "integer", "minimum": 1 }, "DBL": { "type": "integer", "minimum": 1 } } }, "passengerLeaderContact": { "type": "object", "additionalProperties": false, "required": ["sequence", "name", "phone"], "properties": { "sequence": { "type": "integer", "minimum": 1, "maximum": 5000 }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "phone": { "type": "string", "minLength": 1, "maxLength": 200 } } }, "passengerList": { "type": "object", "additionalProperties": false, "required": ["operation", "row_count", "text"], "properties": { "operation": { "enum": ["import", "full_replace"] }, "confirmed": { "type": "boolean" }, "row_count": { "type": "integer", "minimum": 1, "description": "用户本次提供的游客行数,不代表订单总人数。" }, "text": { "type": "string", "minLength": 1, "description": "一个或多个完整 13 列游客行;序号用于定位对应游客位。" }, "leader_contact": { "$ref": "#/$defs/passengerLeaderContact" } }, "allOf": [ { "if": { "properties": { "operation": { "const": "full_replace" } }, "required": ["operation"] }, "then": { "required": ["confirmed"], "properties": { "confirmed": { "const": true } } } } ] }, "updateAction": { "type": "object", "additionalProperties": false, "required": ["target", "operation"], "properties": { "target": { "$ref": "#/$defs/updateTarget" }, "operation": { "enum": ["set", "append", "delta", "clear"] }, "value": {} } }, "updateTarget": { "type": "string", "pattern": "^(twin_room_count|planned_capacity|lodging_note|departure_date|trip_days|customer|product|leader|route|status|remark|xiadanbeizhu|booking_note|pax\\.(adult|child_bed|child_no_bed|infant|leader|expected_total)|rooms\\.(SGL|TWN|TRP|DBL|HNM|TL)|prices\\.(adult|child_bed|child_no_bed|infant|leader))$" }, "updates": { "type": "object", "additionalProperties": false, "required": ["actions"], "properties": { "actions": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "$ref": "#/$defs/updateAction" } } } }, "arrangement": { "type": "object", "additionalProperties": false, "required": ["mode"], "properties": { "mode": { "enum": ["create", "update"] }, "changes": { "$ref": "#/$defs/arrangementChanges" }, "resource": { "$ref": "#/$defs/namedRef" }, "supplier": { "$ref": "#/$defs/namedRef" }, "item": { "type": "string", "minLength": 1 }, "room_type": { "type": "string", "minLength": 1 }, "date": { "type": "string", "format": "date" }, "start_date": { "type": "string", "format": "date" }, "end_date": { "type": "string", "format": "date" }, "quantity": { "type": "integer", "minimum": 1 }, "room_count": { "type": "integer", "minimum": 1 }, "remark": { "type": "string", "minLength": 1 }, "filing": { "$ref": "#/$defs/filing" } } }, "arrangementChanges": { "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "end_date": { "type": "string", "format": "date" }, "room_count": { "type": "integer", "minimum": 1 } } }, "filing": { "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "number": { "type": "string", "minLength": 1 }, "date": { "type": "string", "format": "date" }, "entry_port": { "type": "string", "minLength": 1 }, "exit_port": { "type": "string", "minLength": 1 } } }, "transition": { "type": "object", "additionalProperties": false, "required": ["to_status"], "properties": { "to_status": { "enum": ["预订", "已确认", "收客中"] } } }, "exportType": { "enum": [ "xingyou-confirm", "liantai-confirm", "job-order", "visitor-list", "guide-confirm", "hotel-preorder", "transport-preorder", "filing-current", "filing-history", "pickup-sign" ] }, "independentUpdate": { "properties": { "data": { "required": ["existing_refs", "updates"], "anyOf": [ { "properties": { "existing_refs": { "required": ["identifier"] } } }, { "required": ["customer", "departure_dates"], "properties": { "departure_dates": { "minItems": 1, "maxItems": 1 } } } ], "properties": { "existing_refs": { "properties": { "kind": { "const": "independent_order" } }, "required": ["kind"] }, "updates": { "properties": { "actions": { "items": { "properties": {} } } } } } } } }, "sharedPlanUpdate": { "properties": { "data": { "required": ["existing_refs", "updates"], "anyOf": [ { "properties": { "existing_refs": { "required": ["identifier"] } } }, { "required": ["departure_dates"], "properties": { "departure_dates": { "minItems": 1, "maxItems": 1 } } } ], "properties": { "existing_refs": { "properties": { "kind": { "const": "shared_plan" } }, "required": ["kind"] }, "updates": { "properties": { "actions": { "items": { "properties": {} } } } } } } } }, "sharedChildUpdate": { "properties": { "data": { "required": ["existing_refs", "updates"], "anyOf": [ { "properties": { "existing_refs": { "required": ["identifier"] } } }, { "required": ["customer", "departure_dates"], "properties": { "departure_dates": { "minItems": 1, "maxItems": 1 } } } ], "properties": { "existing_refs": { "properties": { "kind": { "const": "shared_child_order" } }, "required": ["kind"] }, "updates": { "properties": { "actions": { "items": { "properties": {} } } } } } } } } } }