{
  "openapi": "3.1.1",
  "info": {
    "title": "摩师足浴智能手表标准厂商接入 API",
    "version": "1.2.0-candidate-onboarding",
    "description": "摩师软件商接入协议。原系统负责业务与账务；摩师负责手表交互、命令与回执。独立测试环境已部署，测试凭证单独发放；正式门店须另行开通并完成真实软件商及实表验收。SOS 仅可查询与确认知晓，解除仅限店长手表。支持任务/SOS游标分页、厂商专用结果投影及历史执行凭据。公开文档：https://www.mosizb.cn/developers/partner-v1/ 2026-11-01兼容说明：技师工作状态尚无厂商API双向同步契约；手表长轮询不属于厂商API。详见在线手册。"
  },
  "servers": [
    {
      "url": "https://partner-test.mosizb.cn",
      "description": "已部署的隔离测试环境，仅使用测试凭证"
    },
    {
      "url": "http://127.0.0.1:18080",
      "description": "本机教学沙箱"
    }
  ],
  "paths": {
    "/api/partner/v1/info": {
      "get": {
        "summary": "读取门店接入配置",
        "description": "密钥只访问其绑定门店和接入授权。读取是否启用以及可操作能力。 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerInfo"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "operationId": "get_api_partner_v1_info",
        "tags": [
          "软件商接口"
        ]
      }
    },
    "/api/partner/v1/catalog": {
      "post": {
        "summary": "增量同步基础资料",
        "description": "逐资源使用递增 source_version；同 ID、同版本但不同内容拒绝。同 request_id 相同内容重放返回原结果。缺省数组和未出现记录保持原样。 关闭时仅暂存；启用后才应用到手表。 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "413": {
            "description": "超过 262144 字节",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "415": {
            "description": "必须使用 application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogInput"
              },
              "example": {
                "request_id": "catalog-20261005-001",
                "rooms": [
                  {
                    "external_id": "room:306",
                    "source_version": 1,
                    "number": "306",
                    "status": "pending",
                    "clean": true
                  }
                ],
                "people": [
                  {
                    "external_id": "employee:28",
                    "source_version": 1,
                    "employee_no": "28",
                    "name": "28号技师",
                    "role": "technician",
                    "active": true,
                    "phone": "19900000028",
                    "phone_processing_authorized": true
                  }
                ],
                "projects": [
                  {
                    "external_id": "project:footbath",
                    "source_version": 1,
                    "name": "经典足浴",
                    "price_minor": 12800,
                    "minutes": 60,
                    "active": true,
                    "extension": false
                  }
                ]
              }
            }
          }
        },
        "operationId": "post_api_partner_v1_catalog",
        "tags": [
          "软件商接口"
        ]
      }
    },
    "/api/partner/v1/state": {
      "post": {
        "summary": "增量同步原系统派单及服务状态",
        "description": "不会按摩师排钟规则重新派单。必需先同步所有引用基础资料。原系统执行业务后上传真实状态。 关闭时仅暂存，启用时一次性应用。 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "413": {
            "description": "超过 262144 字节",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "415": {
            "description": "必须使用 application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StateInput"
              },
              "example": {
                "request_id": "state-20261005-001",
                "assignments": [
                  {
                    "external_id": "dispatch:0001",
                    "source_version": 1,
                    "room_external_id": "room:306",
                    "person_external_id": "employee:28",
                    "project_external_id": "project:footbath",
                    "visit_external_id": "visit:306:0001",
                    "status": "pending",
                    "dispatch_mode": "requested"
                  }
                ]
              }
            }
          }
        },
        "operationId": "post_api_partner_v1_state",
        "tags": [
          "软件商接口"
        ]
      }
    },
    "/api/partner/v1/notifications": {
      "post": {
        "summary": "向指定员工发送通知",
        "description": "通知不创建服务任务。发送成功及送达/播报回执均不代表业务执行。 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "413": {
            "description": "超过 262144 字节",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "415": {
            "description": "必须使用 application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationInput"
              }
            }
          }
        },
        "operationId": "post_api_partner_v1_notifications",
        "tags": [
          "软件商接口"
        ]
      }
    },
    "/api/partner/v1/commands": {
      "get": {
        "summary": "拉取待处理及待核对命令",
        "description": "拉取 queued 命令。已领取和 unknown 命令通过本地执行台账中的 command_id 查询；读取本身不会重复执行业务。 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "operationId": "get_api_partner_v1_commands",
        "tags": [
          "软件商接口"
        ]
      }
    },
    "/api/partner/v1/commands/{command_id}": {
      "get": {
        "summary": "查询命令最终状态",
        "description": " 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "command_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "operationId": "get_api_partner_v1_commands_command_id",
        "tags": [
          "软件商接口"
        ]
      }
    },
    "/api/partner/v1/commands/{command_id}/claim": {
      "post": {
        "summary": "领取命令执行租约",
        "description": "先持久化 command_id、worker_id 和随机 lease_token 再领取；成功后才执行原系统事务。同 worker_id/token 重复领取活动租约返回相同领取结果且不延长租约。不同 worker/token 返回 PARTNER_LEASE_BUSY。过期领取变为 unknown，绝不重新入队。 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "413": {
            "description": "超过 262144 字节",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "415": {
            "description": "必须使用 application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "command_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "operationId": "post_api_partner_v1_commands_command_id_claim",
        "tags": [
          "软件商接口"
        ]
      }
    },
    "/api/partner/v1/commands/{command_id}/result": {
      "post": {
        "summary": "回传真实业务结果",
        "description": "succeeded 必须附原系统实际房态与权威动作状态并满足后置条件，failed 表示确定未执行，不能确定时 unknown。相同 result_id 及请求内容重放返回原结果。领取过期后使用原 lease_token 和 reconciliation:true 回报核对结果；不得盲目再次执行。 failed/unknown 不允许附 state，改用 /state 独立同步。晚到核对可报告当前 ended 状态，但必须证明此次起钟/加钟曾实际发生。 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "413": {
            "description": "超过 262144 字节",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "415": {
            "description": "必须使用 application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResultInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "command_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "operationId": "post_api_partner_v1_commands_command_id_result",
        "tags": [
          "软件商接口"
        ]
      }
    },
    "/api/partner/v1/events": {
      "get": {
        "summary": "拉取门店接入事件",
        "description": "按递增 seq 拉取，持久化最后已处理游标。回执阶段不代表业务成功。 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 300,
              "default": 100
            }
          }
        ],
        "operationId": "get_api_partner_v1_events",
        "tags": [
          "软件商接口"
        ]
      }
    },
    "/api/integrations": {
      "get": {
        "summary": "商家列出本店接入",
        "description": "",
        "security": [
          {
            "MerchantSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_api_integrations",
        "tags": [
          "商家配置与配对"
        ]
      },
      "post": {
        "summary": "商家创建接入并取得一次性密钥",
        "description": "默认关闭。密钥仅在创建响应显示一次，应传递给获授权厂商并妥善保存。",
        "security": [
          {
            "MerchantSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationCreate"
              }
            }
          }
        },
        "operationId": "post_api_integrations",
        "tags": [
          "商家配置与配对"
        ]
      }
    },
    "/api/integrations/{integration_id}/configure": {
      "post": {
        "summary": "商家启用/关闭及授权能力",
        "description": "完成资料与状态同步且没有摩师原生未结束业务后才能启用。关闭时存在待执行/结果不明命令将拒绝，需先核对。",
        "security": [
          {
            "MerchantSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationConfigure"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "integration_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "operationId": "post_api_integrations_integration_id_configure",
        "tags": [
          "商家配置与配对"
        ]
      }
    },
    "/api/integrations/{integration_id}/keys": {
      "post": {
        "summary": "商家增加轮换密钥",
        "description": "先新增并验证新密钥，再撤销旧密钥；不自动撤销旧密钥。",
        "security": [
          {
            "MerchantSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "integration_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "operationId": "post_api_integrations_integration_id_keys",
        "tags": [
          "商家配置与配对"
        ]
      }
    },
    "/api/integrations/{integration_id}/keys/{key_id}/revoke": {
      "post": {
        "summary": "商家撤销接入密钥",
        "description": "",
        "security": [
          {
            "MerchantSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "请求返回成功；业务执行状态必须读取 command.status。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyRevokeResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "integration_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "operationId": "post_api_integrations_integration_id_keys_key_id_revoke",
        "tags": [
          "商家配置与配对"
        ]
      }
    },
    "/api/pair/status": {
      "post": {
        "tags": [
          "商家配置与配对"
        ],
        "summary": "手表绑定查询",
        "description": "设备使用自己的绑定会话查询。需手机号人员仅获得脱敏号码及用途说明，不能获得原号。不是厂商密钥接口。",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairStatusInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "绑定状态或完成结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairStatusResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_api_pair_status"
      }
    },
    "/api/pair/confirm": {
      "post": {
        "tags": [
          "商家配置与配对"
        ],
        "summary": "手表绑定确认",
        "description": "设备确认已核对说明及脱敏号码；资料或说明版本已变化时拒绝旧确认。未做SMS验码，不保证号码属于本人。不是厂商密钥接口。",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairConfirmInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "绑定状态或完成结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairConfirmResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_api_pair_confirm"
      }
    },
    "/api/partner/v1/sos": {
      "get": {
        "summary": "查询本店 SOS",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功接收请求；读取 status/alert 判断业务状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SosList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "operationId": "get_api_partner_v1_sos",
        "tags": [
          "软件商接口"
        ],
        "description": " 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。 默认50条、上限100。读取到has_more=false为止；不是历史快照，权限和记录内容每页重新检查，新插入记录由下一次遍历或events读取。",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "每页数量；必须使用十进制整数。"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            },
            "description": "上页next_cursor原样传回；绑定接入、列表与员工，不能修改或跨查询复用。"
          }
        ]
      }
    },
    "/api/partner/v1/sos/{alert_id}/acknowledge": {
      "post": {
        "summary": "确认软件商已知晓 SOS，不解除预警",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功接收请求；读取 status/alert 判断业务状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SosResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "413": {
            "description": "超过 262144 字节",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "415": {
            "description": "必须使用 application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SosActionInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "alert_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "operationId": "post_api_partner_v1_sos_alert_id_acknowledge",
        "tags": [
          "软件商接口"
        ],
        "description": " 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。"
      }
    },
    "/api/partner/v1/tasks": {
      "get": {
        "summary": "查询指定员工可见任务",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功接收请求；读取 status/alert 判断业务状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operator_external_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "每页数量；必须使用十进制整数。"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            },
            "description": "上页next_cursor原样传回；绑定接入、列表与员工，不能修改或跨查询复用。"
          }
        ],
        "operationId": "get_api_partner_v1_tasks",
        "tags": [
          "软件商接口"
        ],
        "description": " 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。 默认50条、上限100。读取到has_more=false为止；不是历史快照，权限和记录内容每页重新检查，新插入记录由下一次遍历或events读取。"
      }
    },
    "/api/partner/v1/tasks/actions": {
      "post": {
        "summary": "执行员工任务操作，打扫完成等待原系统回执",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功接收请求；读取 status/alert 判断业务状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskActionResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "400": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "401": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "403": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "404": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "409": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "429": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "至少等待的秒数。"
              }
            }
          },
          "500": {
            "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "405": {
            "description": "方法不支持，查看 Allow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "413": {
            "description": "超过 262144 字节",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          },
          "415": {
            "description": "必须使用 application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "本次 HTTP 请求追踪编号，与业务幂等 request_id 不同。"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskActionInput"
              }
            }
          }
        },
        "operationId": "post_api_partner_v1_tasks_actions",
        "tags": [
          "软件商接口"
        ],
        "description": " 通用约定见 STANDARD.md；HTTP 成功不等于业务已完成，按响应 status 判断。"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "PartnerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "商家授权的厂商接入密钥，每把密钥仅绑定一项接入和一个门店。"
      },
      "MerchantSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "商家本店管理会话；厂商不得获取或使用该凭据。"
      }
    },
    "schemas": {
      "ExternalId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
        "description": "ExternalId 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "Room": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "原系统生成的稳定业务编号；在本接入、本资源类型内唯一。保留大小写与空格，不用员工显示名称代替。"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "原系统针对该资源递增的整数版本；业务 ID 为不透明字符串。"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 24,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "number 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "status": {
            "type": "string",
            "enum": [
              "idle",
              "pending",
              "serving",
              "awaiting_stop",
              "unpaid",
              "dirty"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "clean": {
            "type": "boolean",
            "description": "原系统房间是否已打扫；打扫完成命令须同时回传 clean=true 和 status=idle。"
          }
        },
        "required": [
          "external_id",
          "source_version",
          "number",
          "status",
          "clean"
        ],
        "additionalProperties": false,
        "description": "包厢及权威房态；与服务状态一并同步。"
      },
      "Person": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "原系统生成的稳定业务编号；在本接入、本资源类型内唯一。保留大小写与空格，不用员工显示名称代替。"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "原系统针对该资源递增的整数版本；业务 ID 为不透明字符串。"
          },
          "employee_no": {
            "type": "string",
            "minLength": 1,
            "maxLength": 24,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "门店员工工号，用于显示与映射检查；不同于 external_id。"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "name 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "role": {
            "type": "string",
            "enum": [
              "technician",
              "waiter",
              "manager"
            ],
            "description": "role 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "active": {
            "type": "boolean",
            "description": "原系统是否启用此员工或项目；false 表示停用，省略不能代替停用。"
          },
          "phone": {
            "type": "string",
            "writeOnly": true,
            "pattern": "^\\s*(?:(?:\\+?86)?1[3-9][0-9]{9})?\\s*$",
            "description": "仅用于工作身份核对与设备服务联系。大陆11位手机号，可带+86/86前缀，首尾空白被移除。省略保留已有号码；空字符串仅在绑定规则允许时清空；null无效。绑定中的有效技师/店长须有号码。普通设备、语音AI、厂商响应不返回完整号码。"
          },
          "phone_processing_authorized": {
            "type": "boolean",
            "writeOnly": true,
            "description": "本员工项非空phone必传true，记录供应方声明已履行相关用途告知及适用授权。声明不是本人同意证明或SMS验证结果；未真实完成流程不得仅为通过校验填true。"
          }
        },
        "required": [
          "external_id",
          "source_version",
          "employee_no",
          "name",
          "role",
          "active"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "required": [
                "phone"
              ],
              "properties": {
                "phone": {
                  "type": "string",
                  "pattern": "\\S"
                }
              }
            },
            "then": {
              "required": [
                "phone_processing_authorized"
              ],
              "properties": {
                "phone_processing_authorized": {
                  "const": true
                }
              }
            }
          }
        ],
        "description": "厂商员工资料。本次新增手机号可选输入。未参与手表绑定的员工不强制收集；active technician/manager绑定前须有有效号码，已绑定对应人员不得清空。服务员保留原规则。供应方授权声明写入处理记录，不能作为本人已同意或短信验证的证据。 启用检查覆盖整店所有已绑定active技师/店长，包括未映射本地人员；未绑表员工及服务员不强制收集。",
        "examples": [
          {
            "external_id": "demo:employee:28",
            "source_version": 1,
            "employee_no": "28",
            "name": "演示技师",
            "role": "technician",
            "active": true,
            "phone": "+8619900000028",
            "phone_processing_authorized": true
          },
          {
            "external_id": "demo:employee:58",
            "source_version": 1,
            "employee_no": "58",
            "name": "未绑表示例技师",
            "role": "technician",
            "active": true
          }
        ]
      },
      "Project": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "原系统生成的稳定业务编号；在本接入、本资源类型内唯一。保留大小写与空格，不用员工显示名称代替。"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "原系统针对该资源递增的整数版本；业务 ID 为不透明字符串。"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "name 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "price_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "原系统项目标价，人民币分。本平台不依据该字段结算。",
            "maximum": 100000000
          },
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440,
            "description": "服务或项目时长，单位分钟；服务总时长须等于 items 中 minutes × quantity 之和。"
          },
          "active": {
            "type": "boolean",
            "description": "原系统是否启用此员工或项目；false 表示停用，省略不能代替停用。"
          },
          "extension": {
            "type": "boolean",
            "description": "是否加钟项目；加钟选择必须符合项目类型。"
          }
        },
        "required": [
          "external_id",
          "source_version",
          "name",
          "price_minor",
          "minutes",
          "active",
          "extension"
        ],
        "additionalProperties": false,
        "description": "Project 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "CatalogInput": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Room"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Person"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Project"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          }
        },
        "required": [
          "request_id"
        ],
        "additionalProperties": false,
        "description": "关闭接入时仅暂存；启用时一次性应用，不影响独立模式手表身份、房态或派单。 可选手机号数据遵循employee-phone-v1；未传保留最新本地资料，非空号码须本员工供应方授权声明，响应不返回号码。"
      },
      "Assignment": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "原系统生成的稳定业务编号；在本接入、本资源类型内唯一。保留大小写与空格，不用员工显示名称代替。"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "原系统针对该资源递增的整数版本；业务 ID 为不透明字符串。"
          },
          "room_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 room 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "person_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 person 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "project_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 project 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "visit_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 visit 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "started",
              "rejected",
              "cancelled",
              "replaced"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "dispatch_mode": {
            "type": "string",
            "enum": [
              "rotation",
              "requested"
            ],
            "description": "rotation=排钟；requested=点钟。原系统执行前重新验证人员可用性与队列。"
          }
        },
        "required": [
          "external_id",
          "source_version",
          "room_external_id",
          "person_external_id",
          "project_external_id",
          "visit_external_id",
          "status",
          "dispatch_mode"
        ],
        "additionalProperties": false,
        "description": "派单；身份引用不可改写，换人须新建派单。"
      },
      "ServiceItem": {
        "type": "object",
        "properties": {
          "project_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 project 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440,
            "description": "服务或项目时长，单位分钟；服务总时长须等于 items 中 minutes × quantity 之和。"
          },
          "price_minor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000,
            "description": "人民币分，非元；整数 12800 表示 128.00 元。仅同步原系统价格，摩师不二次计费。"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 99,
            "description": "该服务项目数量；与单项分钟数相乘计入总时长。"
          }
        },
        "required": [
          "project_external_id",
          "minutes",
          "price_minor",
          "quantity"
        ],
        "additionalProperties": false,
        "description": "ServiceItem 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "Service": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "原系统生成的稳定业务编号；在本接入、本资源类型内唯一。保留大小写与空格，不用员工显示名称代替。"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "原系统针对该资源递增的整数版本；业务 ID 为不透明字符串。"
          },
          "assignment_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 assignment 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "room_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 room 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "person_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 person 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "project_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 project 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "visit_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 visit 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "ended"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "started_at": {
            "type": "integer",
            "minimum": 1,
            "description": "Unix 毫秒",
            "maximum": 9007199254740991
          },
          "ended_at": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "结束时间 Unix 毫秒；进行中传 null"
          },
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440,
            "description": "服务或项目时长，单位分钟；服务总时长须等于 items 中 minutes × quantity 之和。"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceItem"
            },
            "maxItems": 50,
            "minItems": 1,
            "description": "items 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "external_id",
          "source_version",
          "assignment_external_id",
          "room_external_id",
          "person_external_id",
          "project_external_id",
          "visit_external_id",
          "status",
          "started_at",
          "ended_at",
          "minutes"
        ],
        "additionalProperties": false,
        "description": "items 时长乘以数量的合计必须等于 minutes。服务的员工、包厢、客人与派单一致。起钟核对选定另一基础项目时，服务的 project_external_id 可以不同于原派单，但必须符合起钟命令，原派单项目不变。已有服务身份及起钟时间不可改变；已下钟服务不能恢复进行中。"
      },
      "StateInput": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "assignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Assignment"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Service"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Room"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "visits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Visit"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "replacements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Replacement"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "technician_queue": {
            "$ref": "#/components/schemas/TechnicianQueue",
            "description": "technician_queue 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "request_id"
        ],
        "additionalProperties": false,
        "description": "增量同步原系统真实状态；排钟队列是完整有序名单。换人申请成功可只回传 replacements；派单、审批、打扫以及钟务成功必须回传更新后的包厢状态。详见 WORKFLOWS.md。"
      },
      "ResultState": {
        "type": "object",
        "properties": {
          "assignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Assignment"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Service"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Room"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "visits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Visit"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "replacements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Replacement"
            },
            "maxItems": 200,
            "description": "增量资源列表：省略或 [] 表示本批不更新该类型；不能传 null，未列出的记录不删除。"
          },
          "technician_queue": {
            "$ref": "#/components/schemas/TechnicianQueue",
            "description": "technician_queue 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [],
        "additionalProperties": false,
        "description": "增量同步原系统真实状态；排钟队列是完整有序名单。换人申请成功可只回传 replacements；派单、审批、打扫以及钟务成功必须回传更新后的包厢状态。详见 WORKFLOWS.md。"
      },
      "NotificationInput": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "person_external_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "description": "人员外部编号列表；TechnicianQueue 中为完整有序技师名单，空数组清空队列。"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "text 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "request_id",
          "person_external_ids",
          "text"
        ],
        "additionalProperties": false,
        "description": "NotificationInput 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "ResourceMapping": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "room",
              "person",
              "project",
              "assignment",
              "service",
              "visit",
              "replacement"
            ],
            "description": "type 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "原系统生成的稳定业务编号；在本接入、本资源类型内唯一。保留大小写与空格，不用员工显示名称代替。"
          },
          "native_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "native_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "原系统针对该资源递增的整数版本；业务 ID 为不透明字符串。"
          }
        },
        "required": [
          "type",
          "external_id",
          "native_id",
          "source_version"
        ],
        "additionalProperties": false,
        "description": "ResourceMapping 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "SyncResult": {
        "type": "object",
        "properties": {
          "status": {
            "const": "succeeded",
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceMapping"
            },
            "description": "resources 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "status",
          "request_id",
          "resources"
        ],
        "additionalProperties": true,
        "description": "SyncResult 的协议结构；必填、类型及取值范围以此定义为准。",
        "examples": [
          {
            "status": "succeeded",
            "request_id": "catalog-1",
            "resources": [
              {
                "type": "room",
                "external_id": "r-301",
                "native_id": "room-301",
                "source_version": 1
              },
              {
                "type": "person",
                "external_id": "p-58",
                "native_id": "tech-58",
                "source_version": 1
              },
              {
                "type": "person",
                "external_id": "p-08",
                "native_id": "waiter-08",
                "source_version": 1
              },
              {
                "type": "project",
                "external_id": "pr-foot",
                "native_id": "partner-1ed88c4df0dc9485276df7740597341f",
                "source_version": 1
              },
              {
                "type": "project",
                "external_id": "pr-extra",
                "native_id": "partner-faafaf7015961d8938b809b4e67abfe3",
                "source_version": 1
              }
            ],
            "server_time": 1800000000000
          }
        ]
      },
      "Target": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "assignment",
              "service",
              "visit",
              "replacement",
              "room"
            ],
            "description": "type 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "原系统生成的稳定业务编号；在本接入、本资源类型内唯一。保留大小写与空格，不用员工显示名称代替。"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "原系统针对该资源递增的整数版本；业务 ID 为不透明字符串。"
          }
        },
        "required": [
          "type",
          "external_id",
          "source_version"
        ],
        "additionalProperties": false,
        "description": "Target 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "Command": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "action": {
            "type": "string",
            "enum": [
              "service.start",
              "service.stop",
              "service.extend",
              "assignment.reject",
              "assignment.create",
              "replacement.request",
              "replacement.approve",
              "room.clean"
            ],
            "description": "action 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "target": {
            "$ref": "#/components/schemas/Target",
            "description": "target 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "params": {
            "type": "object",
            "properties": {
              "project_external_id": {
                "$ref": "#/components/schemas/ExternalId",
                "description": "原系统 project 编号。"
              },
              "project_source_version": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "description": "对应资源版本。"
              },
              "technician_external_id": {
                "$ref": "#/components/schemas/ExternalId",
                "description": "原系统 technician 编号。"
              },
              "technician_source_version": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "description": "对应资源版本。"
              },
              "visit_external_id": {
                "$ref": "#/components/schemas/ExternalId",
                "description": "原系统 visit 编号。"
              },
              "visit_source_version": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "description": "对应资源版本。"
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "换人原因。"
              },
              "dispatch_mode": {
                "type": "string",
                "enum": [
                  "rotation",
                  "requested"
                ],
                "description": "rotation=排钟；requested=点钟。原系统执行前重新验证人员可用性与队列。"
              }
            },
            "required": [],
            "additionalProperties": false,
            "description": "钟务项目、排钟/点钟、换人及打扫参数见 WORKFLOWS.md。所有 *_id 关联转为 *_external_id 和 *_source_version。换人审批原服务引用与版本在 baseline.source；队列和人员可用性必须在原系统事务内再次核对。"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "claimed",
              "unknown",
              "succeeded",
              "failed"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "created_at": {
            "type": "integer",
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。",
            "maximum": 9007199254740991
          },
          "lease_expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。"
          },
          "command_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "摩师生成的命令编号；原系统事务台账的去重键，禁止用员工或包厢编号替代。"
          },
          "expires_at": {
            "type": "integer",
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。",
            "maximum": 9007199254740991
          },
          "operator": {
            "type": "object",
            "properties": {
              "person_external_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
              },
              "employee_no": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 24
              }
            },
            "required": [
              "person_external_id",
              "employee_no"
            ],
            "additionalProperties": false,
            "description": "手表发起操作的员工引用；原系统执行时须再次核对权限。"
          },
          "protocol_version": {
            "const": 1,
            "description": "业务协议版本，目前固定为 1；与 OpenAPI 文档版本无关。"
          },
          "baseline": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32,
                "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
              },
              "minutes": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "item_count": {
                "type": "integer",
                "maximum": 9007199254740991
              },
              "room": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Target"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "原包厢引用；相关成功结果须提供更高版本房态。"
              },
              "source": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Target"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "换人审批的原派单或服务引用。"
              },
              "project_minutes": {
                "type": "integer",
                "minimum": 0,
                "description": "发起时所选项目分钟数。"
              }
            },
            "required": [],
            "additionalProperties": true,
            "description": "发起命令时的原系统状态和引用快照；用于原系统执行前检查并发变化。"
          }
        },
        "required": [
          "command_id",
          "request_id",
          "action",
          "target",
          "params",
          "operator",
          "protocol_version",
          "status",
          "created_at",
          "expires_at"
        ],
        "additionalProperties": true,
        "description": "Command 的协议结构；必填、类型及取值范围以此定义为准。",
        "allOf": [
          {
            "if": {
              "properties": {
                "action": {
                  "const": "service.start"
                }
              }
            },
            "then": {
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "project_external_id": {
                      "$ref": "#/components/schemas/ExternalId",
                      "description": "原系统 project 编号。"
                    },
                    "project_source_version": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991,
                      "description": "对应资源版本。"
                    }
                  },
                  "required": [],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "service.extend"
                }
              }
            },
            "then": {
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "project_external_id": {
                      "$ref": "#/components/schemas/ExternalId",
                      "description": "原系统 project 编号。"
                    },
                    "project_source_version": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991,
                      "description": "对应资源版本。"
                    }
                  },
                  "required": [
                    "project_external_id",
                    "project_source_version"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "service.stop"
                }
              }
            },
            "then": {
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "assignment.reject"
                }
              }
            },
            "then": {
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "assignment.create"
                }
              }
            },
            "then": {
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "visit_external_id": {
                      "$ref": "#/components/schemas/ExternalId",
                      "description": "原系统 visit 编号。"
                    },
                    "visit_source_version": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991,
                      "description": "对应资源版本。"
                    },
                    "technician_external_id": {
                      "$ref": "#/components/schemas/ExternalId",
                      "description": "原系统 technician 编号。"
                    },
                    "technician_source_version": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991,
                      "description": "对应资源版本。"
                    },
                    "project_external_id": {
                      "$ref": "#/components/schemas/ExternalId",
                      "description": "原系统 project 编号。"
                    },
                    "project_source_version": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991,
                      "description": "对应资源版本。"
                    },
                    "dispatch_mode": {
                      "type": "string",
                      "enum": [
                        "rotation",
                        "requested"
                      ],
                      "description": "rotation=排钟；requested=点钟。原系统执行前重新验证人员可用性与队列。"
                    }
                  },
                  "required": [
                    "visit_external_id",
                    "visit_source_version",
                    "technician_external_id",
                    "technician_source_version",
                    "project_external_id",
                    "project_source_version",
                    "dispatch_mode"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "replacement.request"
                }
              }
            },
            "then": {
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "reason": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "description": "换人原因。"
                    }
                  },
                  "required": [
                    "reason"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "replacement.approve"
                }
              }
            },
            "then": {
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "technician_external_id": {
                      "$ref": "#/components/schemas/ExternalId",
                      "description": "原系统 technician 编号。"
                    },
                    "technician_source_version": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991,
                      "description": "对应资源版本。"
                    },
                    "dispatch_mode": {
                      "type": "string",
                      "enum": [
                        "rotation",
                        "requested"
                      ],
                      "description": "rotation=排钟；requested=点钟。原系统执行前重新验证人员可用性与队列。"
                    }
                  },
                  "required": [
                    "technician_external_id",
                    "technician_source_version",
                    "dispatch_mode"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "room.clean"
                }
              }
            },
            "then": {
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              }
            }
          }
        ],
        "examples": [
          {
            "command_id": "6776201e-f640-4b7e-ac40-3b5cd2b4c74c",
            "request_id": "e42acc89-0412-4a53-bbde-4a1e219cbfef",
            "action": "assignment.create",
            "target": {
              "type": "visit",
              "external_id": "v-new",
              "source_version": 1
            },
            "params": {
              "dispatch_mode": "rotation",
              "visit_external_id": "v-new",
              "visit_source_version": 1,
              "technician_external_id": "p-58",
              "technician_source_version": 1,
              "project_external_id": "pr-foot",
              "project_source_version": 1
            },
            "baseline": {
              "status": "open",
              "minutes": 0,
              "item_count": 0,
              "room": {
                "type": "room",
                "external_id": "r-301",
                "source_version": 1
              },
              "source": null,
              "project_minutes": 60
            },
            "operator": {
              "person_external_id": "p-manager",
              "employee_no": null
            },
            "protocol_version": 1,
            "status": "queued",
            "created_at": 1800000000000,
            "expires_at": 1800000300000
          },
          {
            "command_id": "ac457925-5322-4437-ad0f-e3a62f368a09",
            "request_id": "bbd6dbae-9008-4c6e-b565-0a3e8e76bd2b",
            "action": "replacement.request",
            "target": {
              "type": "assignment",
              "external_id": "a-1",
              "source_version": 1
            },
            "params": {
              "reason": "客人要求更换"
            },
            "baseline": {
              "status": "pending",
              "minutes": 0,
              "item_count": 0,
              "room": {
                "type": "room",
                "external_id": "r-301",
                "source_version": 1
              },
              "source": null,
              "project_minutes": 0
            },
            "operator": {
              "person_external_id": "p-58",
              "employee_no": "58"
            },
            "protocol_version": 1,
            "status": "claimed",
            "created_at": 1800000000000,
            "expires_at": 1800000300000,
            "worker_id": "frontdesk-1",
            "lease_expires_at": 1800000060000
          },
          {
            "command_id": "98760e0a-fd4e-4745-88ba-b08892b7140b",
            "request_id": "ab0302a1-431f-4d5d-bbe1-9058e3d0354f",
            "action": "replacement.approve",
            "target": {
              "type": "replacement",
              "external_id": "replace-1",
              "source_version": 1
            },
            "params": {
              "dispatch_mode": "requested",
              "technician_external_id": "p-66",
              "technician_source_version": 1
            },
            "baseline": {
              "status": "pending",
              "minutes": 0,
              "item_count": 0,
              "room": {
                "type": "room",
                "external_id": "r-301",
                "source_version": 1
              },
              "source": {
                "type": "assignment",
                "external_id": "a-1",
                "source_version": 1
              },
              "project_minutes": 0
            },
            "operator": {
              "person_external_id": "p-manager",
              "employee_no": null
            },
            "protocol_version": 1,
            "status": "claimed",
            "created_at": 1800000000000,
            "expires_at": 1800000300000,
            "worker_id": "frontdesk-1",
            "lease_expires_at": 1800000060000
          },
          {
            "command_id": "6ac6870f-8316-4f3d-bc48-5ed95d5a84d6",
            "request_id": "24fa71c3-a2e7-4327-b778-cd59843f3e2f",
            "action": "room.clean",
            "target": {
              "type": "room",
              "external_id": "r-301",
              "source_version": 2
            },
            "params": {},
            "baseline": {
              "minutes": 0,
              "item_count": 0,
              "room": {
                "type": "room",
                "external_id": "r-301",
                "source_version": 2
              },
              "source": null,
              "project_minutes": 0
            },
            "operator": {
              "person_external_id": "p-manager",
              "employee_no": null
            },
            "protocol_version": 1,
            "status": "claimed",
            "created_at": 1800000000000,
            "expires_at": 1800000300000,
            "worker_id": "frontdesk-1",
            "lease_expires_at": 1800000060000
          }
        ]
      },
      "CommandResult": {
        "type": "object",
        "properties": {
          "command": {
            "$ref": "#/components/schemas/Command",
            "description": "command 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VendorResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "result 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "server_time": {
            "type": "integer",
            "description": "摩师服务端当前 Unix 时间戳，单位毫秒。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "command",
          "result",
          "server_time"
        ],
        "additionalProperties": true,
        "description": "CommandResult 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "CommandList": {
        "type": "object",
        "properties": {
          "commands": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Command"
            },
            "description": "commands 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "commands"
        ],
        "additionalProperties": true,
        "description": "CommandList 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "ClaimInput": {
        "type": "object",
        "properties": {
          "worker_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "软件商工作进程稳定编号；领取重试时与原 lease_token 一起复用。"
          },
          "lease_token": {
            "type": "string",
            "minLength": 32,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_-]+$",
            "description": "调用方在领取前持久化的不可预测随机令牌；推荐 32 随机字节的 base64url。"
          }
        },
        "required": [
          "worker_id",
          "lease_token"
        ],
        "additionalProperties": false,
        "description": "ClaimInput 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "ClaimResult": {
        "type": "object",
        "properties": {
          "command": {
            "$ref": "#/components/schemas/Command",
            "description": "command 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "lease_token": {
            "type": "string",
            "minLength": 32,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_-]+$",
            "description": "调用方在领取前持久化的不可预测随机令牌；推荐 32 随机字节的 base64url。"
          },
          "lease_expires_at": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "command",
          "lease_token",
          "lease_expires_at"
        ],
        "additionalProperties": true,
        "description": "ClaimResult 的协议结构；必填、类型及取值范围以此定义为准。",
        "examples": [
          {
            "command": {
              "command_id": "6776201e-f640-4b7e-ac40-3b5cd2b4c74c",
              "request_id": "e42acc89-0412-4a53-bbde-4a1e219cbfef",
              "action": "assignment.create",
              "target": {
                "type": "visit",
                "external_id": "v-new",
                "source_version": 1
              },
              "params": {
                "dispatch_mode": "rotation",
                "visit_external_id": "v-new",
                "visit_source_version": 1,
                "technician_external_id": "p-58",
                "technician_source_version": 1,
                "project_external_id": "pr-foot",
                "project_source_version": 1
              },
              "baseline": {
                "status": "open",
                "minutes": 0,
                "item_count": 0,
                "room": {
                  "type": "room",
                  "external_id": "r-301",
                  "source_version": 1
                },
                "source": null,
                "project_minutes": 60
              },
              "operator": {
                "person_external_id": "p-manager",
                "employee_no": null
              },
              "protocol_version": 1,
              "status": "claimed",
              "created_at": 1800000000000,
              "expires_at": 1800000300000,
              "worker_id": "frontdesk-1",
              "lease_expires_at": 1800000060000
            },
            "lease_token": "ytGts3xtmrfVLyDEE4ji8vYwCuNgq8udUS7skDGugLo",
            "lease_expires_at": 1800000060000,
            "server_time": 1800000000000
          }
        ]
      },
      "ErrorDetail": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "code 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "message 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false,
        "description": "ErrorDetail 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "ResultInput": {
        "type": "object",
        "properties": {
          "lease_token": {
            "type": "string",
            "minLength": 32,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_-]+$",
            "description": "软件商生成并先持久保存的随机领取凭据（32–128 位 base64url）；推荐 SDK createLeaseToken()。日志应脱敏。"
          },
          "result_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "软件商持久保存的结果编号；同命令重传相同结果时保持不变。"
          },
          "status": {
            "type": "string",
            "enum": [
              "succeeded",
              "failed",
              "unknown"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorDetail",
            "description": "error 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "state": {
            "$ref": "#/components/schemas/ResultState",
            "description": "普通成功：提交动作所需的权威状态；历史补报：只放最新状态，若已通过/state同步则传{}。严禁把历史effects当state重放。"
          },
          "reconciliation": {
            "type": "boolean",
            "default": false,
            "description": "默认 false。命令 unknown 或租约过期后，核对原系统事务台账并取得确定结果，才可设置 true。禁止据此重新执行业务。"
          },
          "execution_receipt": {
            "$ref": "#/components/schemas/ExecutionReceipt"
          }
        },
        "required": [
          "lease_token",
          "result_id",
          "status"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "succeeded"
                }
              }
            },
            "then": {
              "required": [
                "state"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "failed"
                }
              }
            },
            "then": {
              "required": [
                "error"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "enum": [
                    "failed",
                    "unknown"
                  ]
                }
              }
            },
            "then": {
              "not": {
                "required": [
                  "state"
                ]
              }
            }
          },
          {
            "if": {
              "required": [
                "execution_receipt"
              ]
            },
            "then": {
              "required": [
                "reconciliation",
                "state"
              ],
              "properties": {
                "status": {
                  "const": "succeeded"
                },
                "reconciliation": {
                  "const": true
                }
              }
            }
          }
        ],
        "description": "ResultInput 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "PartnerInfo": {
        "type": "object",
        "properties": {
          "integration": {
            "$ref": "#/components/schemas/Integration",
            "description": "integration 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "server_time": {
            "type": "integer",
            "description": "摩师服务端当前 Unix 时间戳，单位毫秒。",
            "maximum": 9007199254740991
          },
          "limits": {
            "type": "object",
            "properties": {
              "batch_items": {
                "const": 200
              },
              "notification_recipients": {
                "const": 100
              },
              "claim_lease_ms": {
                "const": 60000
              },
              "command_expiry_ms": {
                "const": 300000
              },
              "task_page_items": {
                "const": 100
              },
              "sos_page_items": {
                "const": 100
              }
            },
            "required": [
              "batch_items",
              "notification_recipients",
              "claim_lease_ms",
              "command_expiry_ms",
              "task_page_items",
              "sos_page_items"
            ],
            "additionalProperties": false,
            "description": "limits 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "business_authority": {
            "const": "partner",
            "description": "business_authority 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "protocol_version": {
            "const": 1,
            "description": "业务协议版本，目前固定为 1；与 OpenAPI 文档版本无关。"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "能力探测标记；本候选包含 task_cursor_pagination, sos_cursor_pagination, public_command_results, execution_receipts。旧服务缺少标记时不可发送新凭据字段。"
          }
        },
        "required": [
          "integration",
          "server_time",
          "limits",
          "business_authority",
          "protocol_version",
          "features"
        ],
        "additionalProperties": false,
        "description": "PartnerInfo 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "Event": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "type 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "payload": {
            "type": "object",
            "properties": {},
            "required": [],
            "additionalProperties": true,
            "description": "payload 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "created_at": {
            "type": "integer",
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。",
            "maximum": 9007199254740991
          },
          "event_id": {
            "type": "integer",
            "minimum": 1,
            "description": "单调事件编号；用作消费去重键，序号可跳号，不保证连续。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "event_id",
          "type",
          "payload",
          "created_at"
        ],
        "additionalProperties": true,
        "description": "Event 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "EventList": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "description": "events 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "cursor": {
            "type": "integer",
            "minimum": 0,
            "description": "本页末尾游标；持久处理本页后用于下次 after。空页保留原游标。",
            "maximum": 9007199254740991
          },
          "server_time": {
            "type": "integer",
            "description": "摩师服务端当前 Unix 时间戳，单位毫秒。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "events",
          "cursor",
          "server_time"
        ],
        "additionalProperties": true,
        "description": "EventList 的协议结构；必填、类型及取值范围以此定义为准。",
        "examples": [
          {
            "events": [
              {
                "event_id": 1,
                "type": "catalog.updated",
                "payload": {
                  "request_id": "catalog-1",
                  "resources": [
                    {
                      "type": "room",
                      "external_id": "r-301",
                      "native_id": "room-301",
                      "source_version": 1
                    },
                    {
                      "type": "person",
                      "external_id": "p-58",
                      "native_id": "tech-58",
                      "source_version": 1
                    },
                    {
                      "type": "person",
                      "external_id": "p-08",
                      "native_id": "waiter-08",
                      "source_version": 1
                    },
                    {
                      "type": "project",
                      "external_id": "pr-foot",
                      "native_id": "partner-3d1238879730256ec1cd4ae7cb454260",
                      "source_version": 1
                    },
                    {
                      "type": "project",
                      "external_id": "pr-extra",
                      "native_id": "partner-5bbdd4a23091ef3b2c4e8b9584a0eb2a",
                      "source_version": 1
                    }
                  ]
                },
                "created_at": 1800000000000
              },
              {
                "event_id": 2,
                "type": "catalog.updated",
                "payload": {
                  "request_id": "271f31cf-0aae-45eb-b000-1e87308cffc1",
                  "resources": [
                    {
                      "type": "person",
                      "external_id": "p-66",
                      "native_id": "tech-66",
                      "source_version": 1
                    },
                    {
                      "type": "person",
                      "external_id": "p-manager",
                      "native_id": "manager-01",
                      "source_version": 1
                    }
                  ]
                },
                "created_at": 1800000000000
              },
              {
                "event_id": 3,
                "type": "state.updated",
                "payload": {
                  "resources": [
                    {
                      "type": "visit",
                      "external_id": "v-new",
                      "native_id": "partner-cd5783e8ad22a24d323762b94e03396a",
                      "source_version": 1
                    }
                  ]
                },
                "created_at": 1800000000000
              },
              {
                "event_id": 4,
                "type": "sos.active",
                "payload": {
                  "alert_id": "4c42627f-8d89-4a04-a183-38fb1351e5d6",
                  "version": 1,
                  "status": "active",
                  "created_at": 1800000000000,
                  "resolved_at": null,
                  "initiator_external_id": "p-manager"
                },
                "created_at": 1800000000000
              }
            ],
            "cursor": 4,
            "server_time": 1800000000000
          }
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "status": {
            "const": "failed",
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "code 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "message 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "status",
          "code",
          "message"
        ],
        "additionalProperties": false,
        "description": "Error 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "IntegrationCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "name 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "service.start",
                "service.stop",
                "service.extend",
                "assignment.reject",
                "assignment.create",
                "replacement.request",
                "replacement.approve",
                "room.clean"
              ]
            },
            "uniqueItems": true,
            "description": "capabilities 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "description": "IntegrationCreate 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "IntegrationConfigure": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "enabled 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "service.start",
                "service.stop",
                "service.extend",
                "assignment.reject",
                "assignment.create",
                "replacement.request",
                "replacement.approve",
                "room.clean"
              ]
            },
            "uniqueItems": true,
            "description": "capabilities 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [],
        "additionalProperties": false,
        "description": "IntegrationConfigure 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "KeyCreate": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false,
        "description": "KeyCreate 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "Integration": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "name 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "enabled": {
            "type": "boolean",
            "description": "enabled 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "store_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "store_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "capabilities 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "created_at": {
            "type": "integer",
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。",
            "maximum": 9007199254740991
          },
          "protocol_version": {
            "const": 1,
            "description": "业务协议版本，目前固定为 1；与 OpenAPI 文档版本无关。"
          }
        },
        "required": [],
        "additionalProperties": true,
        "description": "Integration 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "KeyResult": {
        "type": "object",
        "properties": {
          "key_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "key_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "api_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "description": "api_key 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "integration": {
            "$ref": "#/components/schemas/Integration",
            "description": "integration 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "key_id",
          "api_key"
        ],
        "additionalProperties": true,
        "description": "KeyResult 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "NotificationResult": {
        "type": "object",
        "properties": {
          "status": {
            "const": "accepted",
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "notifications": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "notification_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
                },
                "event_seq": {
                  "type": "integer",
                  "maximum": 9007199254740991
                },
                "person_external_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
                }
              },
              "required": [
                "notification_id",
                "event_seq",
                "person_external_id"
              ],
              "additionalProperties": false
            },
            "description": "notifications 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "server_time": {
            "type": "integer",
            "description": "摩师服务端当前 Unix 时间戳，单位毫秒。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "status",
          "request_id",
          "notifications",
          "server_time"
        ],
        "additionalProperties": false,
        "description": "NotificationResult 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "IntegrationList": {
        "type": "object",
        "properties": {
          "integrations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integration"
            },
            "description": "integrations 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "integrations"
        ],
        "additionalProperties": false,
        "description": "IntegrationList 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "IntegrationResult": {
        "type": "object",
        "properties": {
          "integration": {
            "$ref": "#/components/schemas/Integration",
            "description": "integration 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "integration"
        ],
        "additionalProperties": false,
        "description": "IntegrationResult 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "KeyRevokeResult": {
        "type": "object",
        "properties": {
          "status": {
            "const": "revoked",
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "key_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "key_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "status",
          "key_id"
        ],
        "additionalProperties": false,
        "description": "KeyRevokeResult 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "PairStatusInput": {
        "type": "object",
        "properties": {
          "pair_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "pair_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "pair_secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "writeOnly": true,
            "description": "设备自己持有的绑定会话凭据，不能交给厂商。"
          }
        },
        "required": [
          "pair_id",
          "pair_secret"
        ],
        "additionalProperties": false,
        "description": "PairStatusInput 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "PairConfirmInput": {
        "type": "object",
        "properties": {
          "pair_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "pair_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "pair_secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "writeOnly": true,
            "description": "设备自己持有的绑定会话凭据，不能交给厂商。"
          },
          "notice_acknowledged": {
            "const": true,
            "description": "需手机号的人员表示已阅读用途提示及核对脱敏号码，不是本人同意或短信验证。"
          },
          "phone_notice_version": {
            "const": "employee-phone-v1",
            "description": "phone_notice_version 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "person_version": {
            "type": "integer",
            "minimum": 1,
            "description": "取绑定查询顶层原始值；人员资料变化必须重新查询。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "pair_id",
          "pair_secret"
        ],
        "additionalProperties": false,
        "description": "仅设备绑定确认。查询返回phone_required:true时，三个新增确认字段均必需；独立模式原请求保持兼容。"
      },
      "PairStatusResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "waiting",
              "needs_confirmation"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "person": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "role": {
                "type": "string",
                "enum": [
                  "technician",
                  "waiter",
                  "manager"
                ]
              },
              "employee_no": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "role",
              "employee_no"
            ],
            "additionalProperties": false,
            "description": "person 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "store_name": {
            "type": "string",
            "description": "store_name 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "phone_required": {
            "const": true,
            "description": "phone_required 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "phone_masked": {
            "type": "string",
            "example": "199****0028",
            "description": "phone_masked 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "phone_notice": {
            "type": "string",
            "description": "phone_notice 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "phone_notice_version": {
            "const": "employee-phone-v1",
            "description": "phone_notice_version 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "person_version": {
            "type": "integer",
            "minimum": 1,
            "description": "person_version 字段；类型、必填性和限制见本结构，省略与 null 不等价。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "status"
        ],
        "additionalProperties": false,
        "description": "PairStatusResult 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "PairConfirmResult": {
        "type": "object",
        "properties": {
          "status": {
            "const": "bound",
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "token": {
            "type": "string",
            "description": "仅设备本人保存的新会话令牌，禁止提供给厂商。"
          },
          "device_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "device_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "expires_at": {
            "type": "integer",
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "status",
          "token",
          "device_id",
          "expires_at"
        ],
        "additionalProperties": false,
        "description": "PairConfirmResult 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "Visit": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "原系统生成的稳定业务编号；在本接入、本资源类型内唯一。保留大小写与空格，不用员工显示名称代替。"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "description": "原系统维护的资源版本，正整数。每次内容变化递增；同版本仅接受相同内容；旧版本拒绝。与摩师 version 不可混用。",
            "maximum": 9007199254740991
          },
          "room_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 room 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          }
        },
        "required": [
          "external_id",
          "source_version",
          "room_external_id",
          "status"
        ],
        "additionalProperties": false,
        "description": "单次在店客人/开房记录；open → closed，不得跨房或重开。"
      },
      "Replacement": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "原系统生成的稳定业务编号；在本接入、本资源类型内唯一。保留大小写与空格，不用员工显示名称代替。"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "description": "原系统维护的资源版本，正整数。每次内容变化递增；同版本仅接受相同内容；旧版本拒绝。与摩师 version 不可混用。",
            "maximum": 9007199254740991
          },
          "source_type": {
            "type": "string",
            "enum": [
              "assignment",
              "service"
            ],
            "description": "source_type 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "source_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 source 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "reason 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "cancelled"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "assignment_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "关联原系统 assignment 的 external_id；须先同步或在允许的同批次内建立引用。"
          }
        },
        "required": [
          "external_id",
          "source_version",
          "source_type",
          "source_external_id",
          "reason",
          "status"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "approved"
                }
              }
            },
            "then": {
              "required": [
                "assignment_external_id"
              ]
            }
          }
        ],
        "description": "换人申请；pending → approved/rejected/cancelled，终态不可改写。"
      },
      "TechnicianQueue": {
        "type": "object",
        "properties": {
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "description": "原系统维护的资源版本，正整数。每次内容变化递增；同版本仅接受相同内容；旧版本拒绝。与摩师 version 不可混用。",
            "maximum": 9007199254740991
          },
          "person_external_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "maxItems": 200,
            "uniqueItems": true,
            "description": "人员外部编号列表；TechnicianQueue 中为完整有序技师名单，空数组清空队列。"
          },
          "unavailable_person_external_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "maxItems": 200,
            "uniqueItems": true,
            "description": "当前不可排钟的技师编号，必须为队列子集；省略默认空数组。"
          }
        },
        "required": [
          "source_version",
          "person_external_ids"
        ],
        "additionalProperties": false,
        "description": "完整有序队列；省略整个对象表示保留，提供对象表示替换名单。"
      },
      "SosAlert": {
        "type": "object",
        "properties": {
          "alert_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "摩师生成的预警编号；用于查询与确认知晓，软件商无解除权限。"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "摩师资源当前版本；执行任务或确认知晓时原样填写 expected_version。",
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "resolved"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "created_at": {
            "type": "integer",
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。",
            "maximum": 9007199254740991
          },
          "resolved_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。"
          },
          "initiator_external_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "发起预警员工的外部编号；无法映射时为 null。"
          }
        },
        "required": [
          "alert_id",
          "version",
          "status",
          "created_at",
          "resolved_at",
          "initiator_external_id"
        ],
        "additionalProperties": false,
        "description": "SosAlert 的协议结构；必填、类型及取值范围以此定义为准。",
        "examples": [
          {
            "alert_id": "4c42627f-8d89-4a04-a183-38fb1351e5d6",
            "version": 1,
            "status": "active",
            "created_at": 1800000000000,
            "resolved_at": null,
            "initiator_external_id": "p-manager"
          }
        ]
      },
      "SosActionInput": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "expected_version": {
            "type": "integer",
            "minimum": 1,
            "description": "摩师查询响应中的当前 version，用于并发检查；不使用 source_version。",
            "maximum": 9007199254740991
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "description": "软件商确认知晓的备注；不改变 SOS 状态，不代表任何手表员工已阅。"
          }
        },
        "required": [
          "request_id",
          "expected_version"
        ],
        "additionalProperties": false,
        "description": "SosActionInput 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "SosResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "succeeded"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "alert": {
            "$ref": "#/components/schemas/SosAlert",
            "description": "alert 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "server_time": {
            "type": "integer",
            "description": "摩师服务端当前 Unix 时间戳，单位毫秒。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "status",
          "alert",
          "server_time"
        ],
        "additionalProperties": false,
        "description": "SosResult 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "SosList": {
        "type": "object",
        "properties": {
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SosAlert"
            },
            "description": "alerts 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "server_time": {
            "type": "integer",
            "description": "摩师服务端当前 Unix 时间戳，单位毫秒。",
            "maximum": 9007199254740991
          },
          "has_more": {
            "type": "boolean",
            "description": "是否还有可见记录。"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "下一页游标；末页为null。"
          }
        },
        "required": [
          "alerts",
          "server_time",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false,
        "description": "SosList 的协议结构；必填、类型及取值范围以此定义为准。",
        "examples": [
          {
            "alerts": [
              {
                "alert_id": "4c42627f-8d89-4a04-a183-38fb1351e5d6",
                "version": 1,
                "status": "active",
                "created_at": 1800000000000,
                "resolved_at": null,
                "initiator_external_id": "p-manager"
              }
            ],
            "server_time": 1800000000000,
            "has_more": false,
            "next_cursor": null
          }
        ]
      },
      "Task": {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "task_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "摩师资源当前版本；执行任务或确认知晓时原样填写 expected_version。",
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "waiting",
              "completed",
              "cancelled"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "task_type": {
            "type": "string",
            "description": "task_type 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "description": {
            "type": "string",
            "description": "description 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "room_external_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "关联原系统 room 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "creator_external_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "关联原系统 creator 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "assignee_external_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "关联原系统 assignee 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "created_at": {
            "type": "integer",
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。",
            "maximum": 9007199254740991
          },
          "completed_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix 时间戳，单位毫秒；允许 null 时表示尚未发生。"
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "at": {
                  "type": "integer",
                  "maximum": 9007199254740991
                },
                "text": {
                  "type": "string"
                },
                "person_external_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "at",
                "text",
                "person_external_id"
              ],
              "additionalProperties": false
            },
            "description": "messages 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          }
        },
        "required": [
          "task_id",
          "version",
          "status",
          "room_external_id",
          "assignee_external_id",
          "messages"
        ],
        "additionalProperties": false,
        "description": "Task 的协议结构；必填、类型及取值范围以此定义为准。",
        "examples": [
          {
            "task_id": "061bbb16-b07a-4b6a-85e5-8ea439276c10",
            "version": 3,
            "status": "processing",
            "task_type": "service",
            "description": "送两条毛巾",
            "room_external_id": "r-301",
            "creator_external_id": "p-58",
            "assignee_external_id": "p-08",
            "created_at": 1800000000000,
            "completed_at": null,
            "messages": [
              {
                "at": 1800000000000,
                "text": "任务已指派，请确认接手",
                "person_external_id": "p-manager"
              },
              {
                "at": 1800000000000,
                "text": "08号服务员已接手任务",
                "person_external_id": "p-08"
              }
            ]
          }
        ]
      },
      "TaskList": {
        "type": "object",
        "properties": {
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Task"
            },
            "description": "tasks 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "server_time": {
            "type": "integer",
            "description": "摩师服务端当前 Unix 时间戳，单位毫秒。",
            "maximum": 9007199254740991
          },
          "has_more": {
            "type": "boolean",
            "description": "是否还有可见记录。"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "下一页游标；末页为null。"
          }
        },
        "required": [
          "tasks",
          "server_time",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false,
        "description": "TaskList 的协议结构；必填、类型及取值范围以此定义为准。",
        "examples": [
          {
            "tasks": [
              {
                "task_id": "061bbb16-b07a-4b6a-85e5-8ea439276c10",
                "version": 3,
                "status": "processing",
                "task_type": "service",
                "description": "送两条毛巾",
                "room_external_id": "r-301",
                "creator_external_id": "p-58",
                "assignee_external_id": "p-08",
                "created_at": 1800000000000,
                "completed_at": null,
                "messages": [
                  {
                    "at": 1800000000000,
                    "text": "任务已指派，请确认接手",
                    "person_external_id": "p-manager"
                  },
                  {
                    "at": 1800000000000,
                    "text": "08号服务员已接手任务",
                    "person_external_id": "p-08"
                  }
                ]
              }
            ],
            "server_time": 1800000000000,
            "has_more": false,
            "next_cursor": null
          }
        ]
      },
      "TaskActionInput": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "operator_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "实际操作员工的原系统编号；必须映射且有效。软件商负责确认操作者身份，不得冒用店长。"
          },
          "action": {
            "type": "string",
            "enum": [
              "task.create",
              "task.claim",
              "task.takeover",
              "task.assign",
              "task.feedback",
              "task.reply",
              "task.complete",
              "task.cancel"
            ],
            "description": "action 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "task_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "expected_version": {
            "type": "integer",
            "minimum": 1,
            "description": "摩师查询响应中的当前 version，用于并发检查；不使用 source_version。",
            "maximum": 9007199254740991
          },
          "params": {
            "type": "object",
            "properties": {
              "room_external_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "person_external_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "description": {
                "type": "string",
                "maxLength": 240
              },
              "text": {
                "type": "string",
                "maxLength": 240
              },
              "reason": {
                "type": "string",
                "maxLength": 240
              }
            },
            "required": [],
            "additionalProperties": false,
            "description": "按 action 选择参数；只允许该动作支持的字段。"
          }
        },
        "required": [
          "request_id",
          "operator_external_id",
          "action"
        ],
        "additionalProperties": false,
        "description": "按 action 限制 params。create: room_external_id,description；assign: person_external_id；feedback/reply: text；cancel: reason；其余为空。非 create 必须 task_id,expected_version。员工角色和任务所有权仍被验证。",
        "allOf": [
          {
            "if": {
              "properties": {
                "action": {
                  "const": "task.create"
                }
              }
            },
            "then": {
              "required": [
                "params"
              ],
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "room_external_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 240
                    }
                  },
                  "required": [
                    "room_external_id",
                    "description"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "task.assign"
                }
              }
            },
            "then": {
              "required": [
                "params",
                "task_id",
                "expected_version"
              ],
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "person_external_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    }
                  },
                  "required": [
                    "person_external_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "task.feedback"
                }
              }
            },
            "then": {
              "required": [
                "params",
                "task_id",
                "expected_version"
              ],
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "maxLength": 240
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "task.reply"
                }
              }
            },
            "then": {
              "required": [
                "params",
                "task_id",
                "expected_version"
              ],
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "maxLength": 240
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "task.cancel"
                }
              }
            },
            "then": {
              "required": [
                "params",
                "task_id",
                "expected_version"
              ],
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {
                    "reason": {
                      "type": "string",
                      "maxLength": 240
                    }
                  },
                  "required": [
                    "reason"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "task.claim"
                }
              }
            },
            "then": {
              "required": [
                "task_id",
                "expected_version"
              ],
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "task.takeover"
                }
              }
            },
            "then": {
              "required": [
                "task_id",
                "expected_version"
              ],
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "action": {
                  "const": "task.complete"
                }
              }
            },
            "then": {
              "required": [
                "task_id",
                "expected_version"
              ],
              "properties": {
                "params": {
                  "type": "object",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              }
            }
          }
        ]
      },
      "TaskActionResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "succeeded",
              "pending",
              "unknown"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "entity": {
            "$ref": "#/components/schemas/TaskActionReceipt",
            "description": "稳定的任务操作回执，仅含TaskActionReceipt定义字段。"
          },
          "command_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "摩师生成的命令编号；原系统事务台账的去重键，禁止用员工或包厢编号替代。"
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "server_time": {
            "type": "integer",
            "description": "摩师服务端当前 Unix 时间戳，单位毫秒。",
            "maximum": 9007199254740991
          }
        },
        "required": [
          "status",
          "request_id",
          "server_time"
        ],
        "additionalProperties": false,
        "description": "TaskActionResult 的协议结构；必填、类型及取值范围以此定义为准。",
        "examples": [
          {
            "status": "succeeded",
            "request_id": "92ce95e9-17d3-4984-8656-6e177328ff65",
            "entity": {
              "task_id": "061bbb16-b07a-4b6a-85e5-8ea439276c10",
              "version": 1,
              "status": "pending",
              "room_external_id": "r-301",
              "assignee_external_id": null
            },
            "server_time": 1800000000000
          }
        ]
      },
      "TaskActionReceipt": {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "task_id 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "摩师资源当前版本；执行任务或确认知晓时原样填写 expected_version。",
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "waiting",
              "completed",
              "cancelled"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "room_external_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "关联原系统 room 的 external_id；须先同步或在允许的同批次内建立引用。"
          },
          "assignee_external_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "关联原系统 assignee 的 external_id；须先同步或在允许的同批次内建立引用。"
          }
        },
        "required": [
          "task_id",
          "version",
          "status",
          "room_external_id",
          "assignee_external_id"
        ],
        "additionalProperties": false,
        "description": "TaskActionReceipt 的协议结构；必填、类型及取值范围以此定义为准。"
      },
      "VendorEntityRef": {
        "type": "object",
        "properties": {
          "type": {
            "enum": [
              "room",
              "visit",
              "assignment",
              "service",
              "replacement"
            ]
          },
          "external_id": {
            "$ref": "#/components/schemas/ExternalId"
          },
          "source_version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "该结果入库时的原系统版本；不是当前最新版本。"
          }
        },
        "required": [
          "type",
          "external_id",
          "source_version"
        ],
        "additionalProperties": false,
        "description": "厂商结果资源引用，不包含本地实体ID、费用、手机号或手表内部结构。"
      },
      "ExecutionReceiptSummary": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "已确认的原系统事务编号。"
          },
          "executed_at": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "该事务提交完成时间，Unix毫秒。"
          }
        },
        "required": [
          "transaction_id",
          "executed_at"
        ],
        "additionalProperties": false,
        "description": ""
      },
      "VendorResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "succeeded",
              "failed",
              "unknown"
            ],
            "description": "当前状态；只允许列出的枚举值。业务流转与成功证据见 WORKFLOWS.md。"
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "调用方生成并持久保存的幂等编号；同接入、同接口重试必须复用编号和完全相同请求体。新业务使用新编号。"
          },
          "command_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "摩师生成的命令编号；原系统事务台账的去重键，禁止用员工或包厢编号替代。"
          },
          "entity": {
            "$ref": "#/components/schemas/VendorEntityRef"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorDetail",
            "description": "error 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
          },
          "server_time": {
            "type": "integer",
            "description": "摩师服务端当前 Unix 时间戳，单位毫秒。",
            "maximum": 9007199254740991
          },
          "reconciled": {
            "const": true,
            "description": "已按持久化执行凭据确认历史执行结果。不会据此回滚当前业务状态。"
          },
          "execution_receipt": {
            "$ref": "#/components/schemas/ExecutionReceiptSummary"
          }
        },
        "required": [
          "status",
          "request_id",
          "command_id",
          "server_time"
        ],
        "additionalProperties": false,
        "description": "厂商专用命令结果。手表接口仍使用内部投影；厂商不得依赖 operation_id 或内部entity字段。历史补报可以没有entity，按command_id查询原系统台账。"
      },
      "ExecutionEffect": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "room"
              },
              "external_id": {
                "$ref": "#/components/schemas/ExternalId"
              },
              "source_version": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "description": "执行事务提交时的原系统版本；必须不高于已同步的最新版本。"
              },
              "status": {
                "enum": [
                  "idle",
                  "pending",
                  "serving",
                  "awaiting_stop",
                  "unpaid",
                  "dirty"
                ]
              },
              "clean": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "external_id",
              "source_version",
              "status",
              "clean"
            ],
            "additionalProperties": false,
            "description": ""
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "assignment"
              },
              "external_id": {
                "$ref": "#/components/schemas/ExternalId"
              },
              "source_version": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "description": "执行事务提交时的原系统版本；必须不高于已同步的最新版本。"
              },
              "status": {
                "enum": [
                  "pending",
                  "started",
                  "rejected",
                  "cancelled",
                  "replaced"
                ]
              }
            },
            "required": [
              "type",
              "external_id",
              "source_version",
              "status"
            ],
            "additionalProperties": false,
            "description": ""
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "service"
              },
              "external_id": {
                "$ref": "#/components/schemas/ExternalId"
              },
              "source_version": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "description": "执行事务提交时的原系统版本；必须不高于已同步的最新版本。"
              },
              "status": {
                "enum": [
                  "running",
                  "ended"
                ]
              },
              "minutes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1440,
                "description": "执行当时总时长。"
              },
              "item_count": {
                "type": "integer",
                "minimum": 1,
                "maximum": 50,
                "description": "执行当时项目条目数。"
              },
              "added_project_external_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
                "description": "本次加钟项目编号。"
              },
              "added_minutes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1440,
                "description": "本次新增该项目时长（单项时长乘数量合计）。"
              }
            },
            "required": [
              "type",
              "external_id",
              "source_version",
              "status"
            ],
            "additionalProperties": false,
            "description": ""
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "replacement"
              },
              "external_id": {
                "$ref": "#/components/schemas/ExternalId"
              },
              "source_version": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "description": "执行事务提交时的原系统版本；必须不高于已同步的最新版本。"
              },
              "status": {
                "enum": [
                  "pending",
                  "approved",
                  "rejected",
                  "cancelled"
                ]
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
                "description": "执行当时的换人原因；申请换人时必须与指令一致。"
              }
            },
            "required": [
              "type",
              "external_id",
              "source_version",
              "status"
            ],
            "additionalProperties": false,
            "description": ""
          }
        ],
        "description": "原系统事务台账记录的提交效果，不是当前状态同步。只允许该类型字段；每种类型/编号唯一。动作要求详见RECONCILIATION.md。"
      },
      "ExecutionReceipt": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "接入内唯一的原系统事务/执行台账编号；禁止复用于其他command_id。"
          },
          "started_at": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "事务开始时间，Unix毫秒；须在本次领取租约内。"
          },
          "executed_at": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "事务提交完成时间，Unix毫秒；不早于started_at，不晚于摩师当前时间。"
          },
          "command": {
            "type": "object",
            "properties": {
              "command_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
                "description": "原命令编号。"
              },
              "action": {
                "type": "string",
                "enum": [
                  "service.start",
                  "service.stop",
                  "service.extend",
                  "assignment.reject",
                  "assignment.create",
                  "replacement.request",
                  "replacement.approve",
                  "room.clean"
                ],
                "description": "action 字段；类型、必填性和限制见本结构，省略与 null 不等价。"
              },
              "target": {
                "$ref": "#/components/schemas/Target"
              },
              "params": {
                "type": "object",
                "description": "逐字段复制原指令params，包括所有source_version，不得自行省略或重写。"
              }
            },
            "required": [
              "command_id",
              "action",
              "target",
              "params"
            ],
            "additionalProperties": false,
            "description": ""
          },
          "effects": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/ExecutionEffect"
            }
          }
        },
        "required": [
          "transaction_id",
          "started_at",
          "executed_at",
          "command",
          "effects"
        ],
        "additionalProperties": false,
        "description": "经厂商凭证认证的原系统台账声明，并非独立的密码学执行证明。必须与实际业务事务原子持久化；摩师校验租约、指令、作用对象、版本及动作证据，信任软件商对原系统事实负责。"
      }
    },
    "responses": {
      "Error": {
        "description": "拒绝或异常；按 code 核对，勿因超时盲目重复业务执行。",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "x-moshi-phone-policy": {
    "version": "employee-phone-v1",
    "purpose": [
      "工作身份核对",
      "设备服务联系"
    ],
    "supplier_declaration_is_employee_consent_proof": false,
    "sms_verification_implemented": false,
    "not_required_for_unbound_employees": true,
    "required_binding_roles": [
      "technician",
      "manager"
    ],
    "default_management_display": "masked",
    "reveal_and_export_audited": true
  },
  "tags": [
    {
      "name": "WatchBinding",
      "description": "摩师设备原生绑定协议扩展，厂商不应获取pair_secret、绑定会话或设备token。"
    }
  ]
}
