ticket.ts 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094
  1. /**
  2. * 册 5《工单与开停交付》接口面:**逐字对齐** 31 条路由(`src/modules/ops/src/router.rs`)
  3. * 与后端 `json!` 出参(`src/modules/ops/src/handlers/*.rs`)。
  4. *
  5. * ⚠️ 出参标量的形态由服务端 SQL 决定:除列表/队列行的 `overdue_7d` 与详情页 head 的
  6. * `overdue` 是**真布尔**外,其余由 `::text` 投影出来的列一律是**字符串**(含数字、日期、
  7. * `true`/`false`),页面判布尔用本文件的 [`isYes`],⛔ `if (row.closed_flag)`(字符串 "false" 是 truthy)。
  8. *
  9. * ⚠️ 列表族出参统一是 `{total,page,page_size,rows[]}`(键名 `rows`);分页 **1 基**
  10. * (`dbx::page_norm`:`page.unwrap_or(1)`,offset=`(page-1)*size`),UI 页码直接透传。
  11. *
  12. * ⛔ 在本文件做 camelCase 转换:网关按 openapi 声明的 operation_id 放行,字段名照抄 spec。
  13. */
  14. import { get, list, post } from "./http.ts";
  15. /* ══════════════ 枚举(domain.rs 常量,⛔ 自造第八种类型) ══════════════ */
  16. export const TICKET_TYPES = [
  17. "open",
  18. "service_open",
  19. "expiry_stop",
  20. "service_stop",
  21. // 2026-11-17 第七类主线类型:契约内逐条替换的升降配(系统专属,⛔ 手工建单)。
  22. "updown",
  23. "fault",
  24. "after_sale",
  25. // 第八类(2026-11-17):合同到期续签的商务跟踪单,不走开停与竣工回执。
  26. "renewal",
  27. ] as const;
  28. export type TicketType = (typeof TICKET_TYPES)[number] | string;
  29. /**
  30. * 运维团队/成员可承接的类型=八类去掉第八类 `renewal`(与后端 `domain::MAINTENANCE_TYPES` 同源)。
  31. *
  32. * 业主 2026-11-17:「续签工单就是由运营账号受理的」→「运维不可接续签工单」。
  33. * 团队可分配类型、成员工单类型的勾选项一律用本常量;⛔ 用 `TICKET_TYPES`——
  34. * 后端 `ops_team/*` 会以「续签只由运营账号受理」拒掉整次保存。
  35. */
  36. export const MAINTENANCE_TICKET_TYPES: readonly string[] = TICKET_TYPES.filter((code) => code !== "renewal");
  37. /**
  38. * 运营账号可承接类型里**不可取消**的一枚:`renewal`(与后端 `domain::T_RENEWAL` 同源)。
  39. *
  40. * 业主 2026-11-17:「默认仅续签且不可清空,运维不可接续签工单」——续签单只由运营账号受理,
  41. * 故运营账号清单恒含本枚;`ent_team/member_update@v1` 对不含它的清单直接拒。
  42. */
  43. export const OPS_ACCOUNT_REQUIRED_TYPE = "renewal";
  44. export const TICKET_STATUSES = [
  45. "unassigned",
  46. "pending",
  47. "processing",
  48. "completed",
  49. "rejected",
  50. "settled",
  51. "terminated",
  52. ] as const;
  53. export type TicketStatus = (typeof TICKET_STATUSES)[number] | string;
  54. /** 中文名与后端 `domain::type_name` 同源(列表页由服务端下发 `ticket_type_name`,详情页只有码)。 */
  55. export const TICKET_TYPE_NAMES: Record<string, string> = {
  56. open: "开户",
  57. service_open: "服务开通",
  58. expiry_stop: "到期停机",
  59. service_stop: "服务停用",
  60. // 第七类:契约内逐条替换的升降配(系统专属)。
  61. updown: "升降配",
  62. fault: "故障报修",
  63. after_sale: "售后服务",
  64. renewal: "续签",
  65. };
  66. export const TICKET_STATUS_NAMES: Record<string, string> = {
  67. unassigned: "待分派",
  68. pending: "待处理",
  69. processing: "处理中",
  70. completed: "已完成",
  71. rejected: "竣工驳回",
  72. settled: "已闭环",
  73. terminated: "已作废",
  74. };
  75. export const typeLabel = (v?: string | null) => (v ? TICKET_TYPE_NAMES[v] ?? v : "-");
  76. export const statusLabel = (v?: string | null) => (v ? TICKET_STATUS_NAMES[v] ?? v : "-");
  77. /** 详情页 11 动作位(`finish()` 的 `actions`,工单§3.7.3)。 */
  78. export type TicketActionKey =
  79. | "assign"
  80. | "backfill"
  81. | "check_done"
  82. | "mark_done"
  83. | "delegate"
  84. | "close"
  85. | "defer_open_stop"
  86. | "defer_ticket"
  87. | "withdraw"
  88. | "generate_completion"
  89. | "reject_completion"
  90. | "confirm_receipt";
  91. /* ══════════════ 读侧出参 ══════════════ */
  92. /**
  93. * 「卡在别人手里」的对家与催办读数(`waiting.rs::to_json`,列表 `rows[].waiting` 与详情 `waiting` 同形)。
  94. *
  95. * * `kind`:`receipt`=等运营商回执(v1.62 起对家=**该客户所属运营商的账号**);
  96. * `customer`=等客户确认(对家=提交方账号)。
  97. * * `counterparty_user_id` 为 `null` =主体档案在但**没有可用账号**(运营商账号未创建/已停用):
  98. * 行内仍写「等{运营商}回执」,但前端⛔ 给催办入口(发给没人读的信箱=假成功)。
  99. * * `org_name`:所属主体名(运营商取所在省份、客户取客户名),行内括号用它。
  100. * * `urge.eligible` 是**纯时长+对家**口径(⛔ 角色权限位):`true` 只说明「现在可以催」,
  101. * 服务端写口还会按角色与对象再判一次。
  102. * * `urge.reason` 取值:`no_counterparty`/`self`/`no_completed_at`/`waiting_lt_min`/
  103. * `already_sent_today`(`already_sent_today` 是**幂等成功**,不是错误)。
  104. */
  105. export type TicketWaiting = {
  106. kind: "receipt" | "customer" | string;
  107. /** 服务端中文主文案(「等运营商回执」/「等客户确认」),⛔ 前端再拼一份。 */
  108. label: string;
  109. counterparty_user_id: string | null;
  110. counterparty_name: string | null;
  111. counterparty_role: string | null;
  112. /** 所属主体名(运营商所在地/客户名);无值时不加括号。 */
  113. org_name: string | null;
  114. since: string | null;
  115. hours: number | null;
  116. urge: {
  117. eligible: boolean;
  118. reason: string | null;
  119. sent_today: boolean;
  120. last_sent_at: string | null;
  121. min_hours: number;
  122. };
  123. };
  124. /** `POST /ticket/list@v1` 行(`list_inner` 的 `json!`,键名逐字对齐)。 */
  125. export type TicketListItem = {
  126. /** 全局序号(按当页偏移现算) */
  127. seq_no?: number;
  128. ticket_id: string;
  129. ticket_no: string | null;
  130. ticket_type: TicketType;
  131. title: string | null;
  132. customer_id: string | null;
  133. customer_name: string | null;
  134. assign_team_id: string | null;
  135. team_name?: string | null;
  136. assignee_user_id: string | null;
  137. assignee_name?: string | null;
  138. status: TicketStatus;
  139. /** 回填来源(manual/unicom_feedback/mixed;NULL=未回填) */
  140. backfill_source: string | null;
  141. expected_done_date: string | null;
  142. /**
  143. * 延期后的**生效期限**(`YYYY-MM-DD`;无延期=`null`/`undefined`)。
  144. *
  145. * 服务端 `handlers/read.rs` 已按 `os.deferred_until` → `t.deferred_until` 折算后下发
  146. * (与 `overdue_7d` 同一优先级)。行内日期、分组与「还剩 N 天」都用它,⛔ 再用
  147. * `expected_done_date`——那会让延期单显示「已超 N 天」而页顶「已超期」不数它。
  148. */
  149. deferred_until?: string | null;
  150. /** 7 日内到期/已超期(真布尔;仅队列口下发) */
  151. overdue_7d?: boolean;
  152. /**
  153. * 执行锁(2026-11-17,服务端业务日现算):开通类三类
  154. * (`open`/`service_open`/`updown`)的计划执行日=订阅**服务开始日**,未到该日
  155. * ⇒ `true`:工单可见可分派,但回填/核对一律被 `KLT-G20403` 拒。
  156. *
  157. * ⚠️ ⛔ 前端按 `expected_done_date - 今天` 自行推断:业务日锚在 `Asia/Shanghai`,
  158. * 浏览器时钟与它不同源(跨零点会打架)。
  159. */
  160. execution_locked?: boolean;
  161. /** 计划执行日(=服务开始日;非开通类恒 `null`),可作日期输入的 `min`。 */
  162. execution_not_before?: string | null;
  163. created_at: string | null;
  164. completed_at?: string | null;
  165. /**
  166. * 「卡在别人手里」的对家与催办读数(2026-11-18,服务端 `waiting.rs`)。
  167. *
  168. * 只在**能看台账的五档**(admin/运主/运子/团队主/`ops`)下发;客户侧与续签单、非
  169. * `completed` 行恒 `null`/`undefined`。对家姓名由服务端解析,⛔ 前端按类型猜
  170. * (主线=承接团队的团队主账号,故障/售后=提交方账号,续签没有对家)。
  171. */
  172. waiting?: TicketWaiting | null;
  173. /**
  174. * 提交方(`customer`=客户自报/`ops`=运营代建/`system`/`unicom`)。
  175. *
  176. * ⚠️ 声明成可选是事实而非猜测:`handlers/read.rs` 的 `LIST_COLS` 投影里**没有**这一列,
  177. * `list_inner` 的 `json!` 也不下发 ⇒ 列表行拿到这里通常是 `undefined`。
  178. * 客户侧「我的工单」据此判闸门(`customerLiveTicketActions`):`undefined`=还没取过详情,
  179. * ⛔ 凭空当作 `customer` 给「确认完成,关闭工单」按钮(运维代建的单点了必被 `KLT-G20401` 拒)。
  180. * 后端哪天补上这列,前端无需改动即可直接在同一行给出按钮。
  181. */
  182. submitter_type?: string | null;
  183. };
  184. export type TicketListResult = {
  185. rows: TicketListItem[];
  186. total: number;
  187. page: number;
  188. page_size: number;
  189. };
  190. /** 可分派候选人(`pending_queue` 行内 `candidates[]`,⛔ 前端再拼一份人名单)。 */
  191. export type AssignCandidate = {
  192. user_id: string;
  193. username: string | null;
  194. display_name: string | null;
  195. /** 该候选人手头未完成单量(自动分派按此最少先挑) */
  196. pending_count: number;
  197. /**
  198. * 候选来源(2026-11-17):`ops_account`=运营主/子账号(不是运维团队成员,
  199. * 按「客户在其负责范围内」入池),缺省=运维团队成员。承接后的可用动作不同
  200. * (运营账号没有成员档案),故页面必须标出来。
  201. */
  202. source?: "member" | "ops_account";
  203. };
  204. export type PendingQueueItem = TicketListItem & {
  205. candidates: AssignCandidate[];
  206. };
  207. export type PendingQueueResult = {
  208. rows: PendingQueueItem[];
  209. total: number;
  210. page: number;
  211. page_size: number;
  212. };
  213. /** `GET /ticket/todo_counts@v1`:四件套计数(口径写死在 SQL,`note` 是人读口径说明)。 */
  214. export type TodoCounts = {
  215. /** 件1:开户/到期停机/服务停用/升降配 ∧ 尚未回填出开停事实 ∧ 已超期(开通类=**超过**服务开始日才计入;停机类=建单日+7 当天计入;批准延期后按新期限) */
  216. item_1_pending_exec_overdue: number;
  217. /** 件2:服务开通工单(待分派/待处理/处理中)同口径筛超期,与件1 单集互斥 */
  218. item_2_service_open_incomplete: number;
  219. /** 件4:待处置报文(未归集+待确认),⛔ 与未回填合算 */
  220. item_4_message_pending: number;
  221. note: string;
  222. };
  223. /* ── 追溯 ── */
  224. /**
  225. * `GET /ticket/trace@v1`(§3.7.3):**单票**四段一次拉齐;查无/越权同回 `11104`(⛔ 拆穿存在性)。
  226. * 入参四键至少给一键:`ticket_no`/`unicom_order_no`/`completion_no`/`ticket_id`。
  227. */
  228. export type TraceIn = { ticket_no?: string; unicom_order_no?: string; completion_no?: string; ticket_id?: string };
  229. export type TraceResult = {
  230. ticket: {
  231. ticket_id: string;
  232. ticket_no: string | null;
  233. ticket_type: TicketType;
  234. status: TicketStatus;
  235. customer_id: string | null;
  236. unicom_order_no: string | null;
  237. title: string | null;
  238. };
  239. /** 开停载体行(`::text` 字符串布尔判 `isYes`) */
  240. open_stop: Record<string, string | null>[];
  241. /** 回填头(至多一行) */
  242. backfill: Record<string, string | null>[];
  243. /** 竣工件行 */
  244. completion: Record<string, string | null>[];
  245. messages: TicketMessage[];
  246. };
  247. /* ── 报文 ── */
  248. /** 报文出参(`message_json`:已脱敏,⛔ 期望拿到原文)。 */
  249. export type TicketMessage = {
  250. message_id: string;
  251. unicom_order_no: string | null;
  252. reported_ticket_no: string | null;
  253. action: string | null;
  254. status: string | null;
  255. external_date: string | null;
  256. received_at: string | null;
  257. effective_at: string | null;
  258. void_reason: string | null;
  259. conflict_note: string | null;
  260. customer_name: string | null;
  261. identity_no: string | null;
  262. contact_name: string | null;
  263. contact_phone: string | null;
  264. network_account_name: string | null;
  265. };
  266. export type MessagePendingResult = {
  267. rows: TicketMessage[];
  268. total: number;
  269. page: number;
  270. page_size: number;
  271. };
  272. /* ── 详情 ── */
  273. export type TicketHead = {
  274. ticket_id: string;
  275. ticket_no: string;
  276. ticket_type: TicketType;
  277. status: TicketStatus;
  278. title: string;
  279. detail: string | null;
  280. customer_id: string | null;
  281. subscription_id: string | null;
  282. reporter_account_id: string | null;
  283. unicom_order_no: string | null;
  284. submitter_type: string | null;
  285. submitter_user_id: string | null;
  286. assign_team_id: string | null;
  287. assignee_user_id: string | null;
  288. assignee_snapshot_name: string | null;
  289. /** 服务端把 *_user_id 解析成的姓名回填进这三键(无匹配 ⇒ 键缺席,保留 ID 值) */
  290. assign_team_name?: string | null;
  291. creator_name?: string | null;
  292. delegate_from_name?: string | null;
  293. assignee_name?: string | null;
  294. delegate_from_user_id: string | null;
  295. delegated_at: string | null;
  296. expected_done_date: string | null;
  297. /** 执行锁(2026-11-17):开通类未到服务开始日 ⇒ `true`(写侧同口径拒绝)。 */
  298. execution_locked?: boolean;
  299. /** 计划执行日=服务开始日(非开通类恒 `null`)。 */
  300. execution_not_before?: string | null;
  301. deferred_until: string | null;
  302. confirm_deadline: string | null;
  303. source_message_id: string | null;
  304. close_reason: string | null;
  305. completed_at: string | null;
  306. closed_at: string | null;
  307. settled_at: string | null;
  308. creator_user_id: string | null;
  309. created_at: string | null;
  310. updated_at: string | null;
  311. row_version: string;
  312. overdue: boolean;
  313. };
  314. export type OpenStopAccount = {
  315. id: string;
  316. sub_account_id: string | null;
  317. before_status: string | null;
  318. after_status: string | null;
  319. effective_date: string | null;
  320. source: string | null;
  321. display_name: string | null;
  322. net_account: string | null;
  323. };
  324. export type OpenStop = {
  325. open_stop_id: string;
  326. customer_id: string | null;
  327. subscription_id: string | null;
  328. action: string | null;
  329. exec_status: string | null;
  330. exec_date: string | null;
  331. effective_account_count: string | null;
  332. backfill_id: string | null;
  333. deferred_until: string | null;
  334. note: string | null;
  335. closed_flag: string | null;
  336. row_version: string;
  337. accounts: OpenStopAccount[];
  338. overdue: boolean;
  339. };
  340. export type RouteRow = {
  341. id: string;
  342. sub_account_id: string | null;
  343. network_account_name: string | null;
  344. intranet_ip: string | null;
  345. subnet_mask: string | null;
  346. gateway: string | null;
  347. vlan: string | null;
  348. vni: string | null;
  349. src_endpoint: string | null;
  350. dst_endpoint: string | null;
  351. egress_pop: string | null;
  352. down_mbps: string | null;
  353. up_mbps: string | null;
  354. };
  355. /** PIN/CPID 库里只有密文 ⇒ 只出"有没有登记"(`"true"`/`"false"` 字符串)。 */
  356. export type IpRow = {
  357. id: string;
  358. row_no: string;
  359. egress: string | null;
  360. overseas_ip: string | null;
  361. ip_type: string | null;
  362. bandwidth_mbps: string | null;
  363. pin_registered: string | null;
  364. cpid_registered: string | null;
  365. };
  366. export type Backfill = {
  367. backfill_id: string;
  368. exec_conclusion: string | null;
  369. conclusion_note: string | null;
  370. actual_opened_date: string | null;
  371. stop_done_date: string | null;
  372. builder_user_id: string | null;
  373. evidence_text: string | null;
  374. source: string | null;
  375. ip_rule_version: string | null;
  376. attempt_count: string | null;
  377. detail_empty_flag: string | null;
  378. row_version: string;
  379. created_at: string | null;
  380. routes: RouteRow[];
  381. ips: IpRow[];
  382. };
  383. export type Completion = {
  384. completion_id: string;
  385. completion_no: string | null;
  386. action: string | null;
  387. exec_conclusion: string | null;
  388. mode: string | null;
  389. pushed_at: string | null;
  390. pushed_by: string | null;
  391. receipt_at: string | null;
  392. /** 回执**仍有效**(`"1"`/`"0"`)=`receipt_at` 非空且晚于最近一次受控回退;回退后回执失效但 `receipt_at` 仍是历史值。 */
  393. receipt_valid: string | null;
  394. receipt_user_id: string | null;
  395. receipt_remark: string | null;
  396. ip_rule_version: string | null;
  397. pdf_ready: string | null;
  398. row_version: string;
  399. created_at: string | null;
  400. };
  401. /** 处理记录=append-only 纯文本留痕(数据模型§2.9):⛔ `related_id` 之类的关联列。 */
  402. export type ProcessLog = {
  403. log_id: string;
  404. action: string | null;
  405. /**
  406. * 操作人平台主体号。⚠️ 服务端按角色下发:台账读侧五档给原值(要拿它对齐审计流水),
  407. * 客户侧/合作方侧置 `null`;`"0"`=系统/定时作业主体(署名应落「系统」)。
  408. */
  409. actor_user_id: string | null;
  410. /** 操作人姓名/展示名(服务端按 `bos_account_ext.display_name` 优先、未自填回落登录名现查;查无或系统主体为 `null`)。 */
  411. actor_name?: string | null;
  412. actor_role: string | null;
  413. note: string | null;
  414. at: string | null;
  415. };
  416. /** ⛔ 期望 `oss_key`:下载走 `material_grant`,服务端不外泄对象键。 */
  417. export type TicketMaterial = {
  418. material_id: string;
  419. kind: string | null;
  420. file_name: string | null;
  421. size_bytes: string | null;
  422. uploaded_by: string | null;
  423. uploaded_at: string | null;
  424. };
  425. export type ServiceItem = {
  426. item_id: string;
  427. seq_no: string;
  428. item_name: string | null;
  429. spec_text: string | null;
  430. /**
  431. * 升降配(`updown`)的参数对照(2026-11-17 补列):`spec_before`=原档位参数摘要、
  432. * `spec_after`=新档位参数摘要(回收行写「停用(截止新订阅生效前一日)」);其余类型两列为 null。
  433. */
  434. spec_before: string | null;
  435. spec_after: string | null;
  436. expect_qty: string | null;
  437. check_result: string | null;
  438. checked_at: string | null;
  439. checked_by: string | null;
  440. note: string | null;
  441. };
  442. /**
  443. * 竣工驳回记录(`ticket_completion_reject`,工单§5.5.3,U-115)。
  444. *
  445. * ⚠️ 出参里**没有** `external_reject_no`:设计方案§5.1 把它列为门户/合伙人⛔ 回显字段,
  446. * 服务端直接把它排除在 SELECT 之外,前端⛔ 指望"拿到再隐藏"。
  447. */
  448. export type CompletionReject = {
  449. reject_seq: string;
  450. channel: string;
  451. completion_no: string;
  452. primary_code: string;
  453. reason_codes: string;
  454. reason_text: string;
  455. pushed_at: string | null;
  456. rejected_at: string | null;
  457. };
  458. /** `reject@v1` 应答:`data` 平铺(工单§5.5.3)。 */
  459. export type CompletionRejectResult = {
  460. data: {
  461. ticket_id: string;
  462. ticket_no?: string;
  463. ticket_status: string;
  464. reject_seq: string;
  465. completion_no: string;
  466. primary_code: string;
  467. reason_codes: string[];
  468. completion_channel?: string;
  469. external_wait_seconds?: number | null;
  470. row_version?: number | null;
  471. pathway?: string;
  472. idempotent_replay?: boolean;
  473. message: string;
  474. };
  475. };
  476. export type TicketDetail = {
  477. ticket: TicketHead;
  478. customer: {
  479. customer_id: string;
  480. customer_name: string | null;
  481. customer_code: string | null;
  482. contact_name: string | null;
  483. contact_mobile: string | null;
  484. address: string | null;
  485. } | null;
  486. order: {
  487. subscription_id: string;
  488. customer_id: string | null;
  489. plan_name: string | null;
  490. plan_kind: string | null;
  491. use_category: string | null;
  492. sub_mode: string | null;
  493. line_exits: string | null;
  494. order_no: string | null;
  495. term: string | null;
  496. start_date: string | null;
  497. status: string | null;
  498. actual_opened_at: string | null;
  499. } | null;
  500. service_items: ServiceItem[];
  501. open_stop: OpenStop | null;
  502. backfill: Backfill | null;
  503. completion: Completion | null;
  504. /** 驳回流水(旧→新)。门户/合伙人拿到的行集与运维侧同形,只是少了对外编号列。 */
  505. completion_rejects?: CompletionReject[];
  506. /** 「外部等待中」判据(工单§4.6 第六条):由服务端判,⛔ 前端用 `length > 0` 推导。 */
  507. reject_pending?: boolean;
  508. process_logs: ProcessLog[];
  509. materials: TicketMaterial[];
  510. messages: TicketMessage[];
  511. /** 缺口分组名(与 `required_groups` 同词典);空集=可出竣工 */
  512. gaps: string[];
  513. required_groups: string[];
  514. actions: Record<TicketActionKey, boolean>;
  515. read_advanced: boolean;
  516. /** 「卡在别人手里」的对家与催办读数(非 `completed`/客户侧恒 `null`)。 */
  517. waiting?: TicketWaiting | null;
  518. };
  519. /* ══════════════ 写侧入参/出参 ══════════════ */
  520. /** 建单携带的材料:只有 `oss_key`(已直传、未登记),服务端补 file_name/size。 */
  521. export type CreateMaterialIn = { oss_key: string };
  522. export type TicketCreateResult = {
  523. ticket_id: string;
  524. ticket_no: string;
  525. status: TicketStatus;
  526. assign_team_id: string | null;
  527. /** 抑制分支才有:命中§3.3.1 同类未完成抑制时回「已并入既有工单」+既有单信息 */
  528. suppressed?: boolean;
  529. message?: string;
  530. existing_ticket_no?: string;
  531. existing_id?: string;
  532. };
  533. export type AssignResult = {
  534. ticket_id: string;
  535. assignee_user_id: string;
  536. assignee_snapshot_name: string;
  537. status: TicketStatus;
  538. };
  539. /** 自动分派回执(create.rs dispatch_auto_inner):dispatched/skipped 是明细数组,不是计数。 */
  540. export type DispatchedTicket = {
  541. ticket_id: string;
  542. ticket_no: string | null;
  543. assignee_user_id: string;
  544. assignee_snapshot_name: string | null;
  545. };
  546. export type DispatchSkipped = {
  547. ticket_id: string;
  548. ticket_no?: string | null;
  549. /** no_candidate=无合适成员;already_taken=并发下已被他人分派 */
  550. reason: string;
  551. message?: string;
  552. };
  553. export type DispatchResult = {
  554. team_id: string;
  555. scanned: number;
  556. dispatched: DispatchedTicket[];
  557. skipped: DispatchSkipped[];
  558. };
  559. export type DelegateResult = {
  560. ticket_id: string;
  561. assignee_user_id: string;
  562. assignee_snapshot_name: string;
  563. delegate_from_user_id: string;
  564. delegated_at: string;
  565. status: TicketStatus;
  566. };
  567. export type StartResult = {
  568. ticket_id: string;
  569. advanced: boolean;
  570. status: TicketStatus;
  571. /** `advanced:false` 时后端回的原因:非责任人/已被推进/并发。 */
  572. reason?: "not_assignee" | "already_advanced" | "concurrent";
  573. advanced_at?: string;
  574. audit_written?: boolean;
  575. };
  576. export type BackfillInRoute = {
  577. sub_account_id?: string | null;
  578. network_account_name?: string | null;
  579. intranet_ip?: string | null;
  580. subnet_mask?: string | null;
  581. gateway?: string | null;
  582. vlan?: string | null;
  583. vni?: string | null;
  584. src_endpoint?: string | null;
  585. dst_endpoint?: string | null;
  586. egress_pop?: string | null;
  587. down_mbps?: number | null;
  588. up_mbps?: number | null;
  589. open_this_time: boolean;
  590. };
  591. export type BackfillInIp = {
  592. egress?: string | null;
  593. overseas_ip?: string | null;
  594. ip_type?: string | null;
  595. bandwidth_mbps?: number | null;
  596. pin?: string | null;
  597. cpid?: string | null;
  598. };
  599. export type BackfillResult = {
  600. ticket_id: string;
  601. backfill_id: string;
  602. exec_conclusion: string;
  603. route_rows: number;
  604. ip_rows: number;
  605. ip_rule_version: string;
  606. open_stop_id: string | null;
  607. effective_account_count: number;
  608. apply_facts: unknown;
  609. status: TicketStatus;
  610. status_advanced: boolean;
  611. /** 仍缺的分组名:非空 ⇒ 已保存但未达闭环口径(页面点名,⛔ 报"保存失败") */
  612. missing_groups: string[];
  613. audit_written: boolean;
  614. };
  615. export type CheckDoneResult = {
  616. ticket_id: string;
  617. all_done: boolean;
  618. pending_rows: number;
  619. missing_item_ids: string[];
  620. audit_written: boolean;
  621. };
  622. export type MarkDoneResult = {
  623. ticket_id: string;
  624. status: TicketStatus;
  625. completed_at: string;
  626. biz_date: string;
  627. audit_written: boolean;
  628. };
  629. export type FinalizeResult = {
  630. ticket_id: string;
  631. status: TicketStatus;
  632. closed_at?: string;
  633. open_stop_closed?: boolean;
  634. settled_at?: string;
  635. defer_scope?: string;
  636. deferred_until?: string;
  637. reverted_from?: string;
  638. untouched?: string[];
  639. audit_written: boolean;
  640. };
  641. export type CompletionGenerateResult = {
  642. ticket_id: string;
  643. ticket_status: TicketStatus;
  644. completion_id: string;
  645. completion_no: string;
  646. action: string;
  647. exec_conclusion: string;
  648. mode: string;
  649. pushed_at: string;
  650. pushed_by: string;
  651. pushed_by_name: string | null;
  652. ip_rule_version: string;
  653. pdf_oss_key: string | null;
  654. reissued: boolean;
  655. receipt_valid: boolean;
  656. audit_written: boolean;
  657. next_step: string;
  658. };
  659. export type CompletionReceiptResult = {
  660. ticket_id: string;
  661. ticket_status: TicketStatus;
  662. completion_no: string | null;
  663. receipt_at: string;
  664. receipt_user_id: string;
  665. receipt_user_name: string | null;
  666. settled_at: string;
  667. completed_at: string;
  668. audit_written: boolean;
  669. next_step: string;
  670. };
  671. export type MessageActionResult = {
  672. message_id: string;
  673. status: string;
  674. ticket_id: string;
  675. audit_written: boolean;
  676. next_step: string;
  677. };
  678. /** 上传分支:服务端派生的对象键与前缀(直传完成后必须原样交给 `material_attach`)。 */
  679. export type MaterialGrantUpload = {
  680. purpose: "upload";
  681. kind: string;
  682. ticket_id: string;
  683. ticket_status: TicketStatus;
  684. file_name: string;
  685. oss_key: string;
  686. prefix: string;
  687. presign_endpoint: string;
  688. bucket: string;
  689. size_limit_bytes: number;
  690. next_step: string;
  691. };
  692. /** 下载分支:⚠️ 对象键⛔ 下发,只给一条平台现签的短时效地址。 */
  693. export type MaterialGrantDownload = {
  694. purpose: "download";
  695. material_id: string;
  696. kind: string;
  697. ticket_id: string;
  698. ticket_status: TicketStatus;
  699. file_name: string;
  700. download_url: string;
  701. expires_at: string | null;
  702. };
  703. export type MaterialGrantResult = MaterialGrantUpload | MaterialGrantDownload;
  704. export type MaterialAttachResult = {
  705. ticket_id: string;
  706. material_id: string;
  707. kind: string;
  708. file_name: string;
  709. size_bytes: string | null;
  710. audit_written: boolean;
  711. next_step: string;
  712. };
  713. export type ClosureConfig = {
  714. closure_mode: string;
  715. closure_mode_name: string;
  716. row_version: string;
  717. updated_at: string | null;
  718. updated_by: string | null;
  719. };
  720. export type ClosureConfigUpdateResult = {
  721. closure_mode: string;
  722. changed: boolean;
  723. /** 同档提交(changed=false)时服务端不回此键 */
  724. from?: string;
  725. row_version: number;
  726. updated_by: string;
  727. audit_written: boolean;
  728. next_step: string;
  729. };
  730. /* ══════════════ 工具 ══════════════ */
  731. /** 后端 `::text` 投影出来的布尔列(`"true"`/`"false"`/`"t"`/`"f"`)。列表页的真布尔走原值。 */
  732. export function isYes(v: unknown): boolean {
  733. if (typeof v === "boolean") return v;
  734. const s = `${v ?? ""}`.trim().toLowerCase();
  735. return s === "true" || s === "t" || s === "1" || s === "yes";
  736. }
  737. /** 乐观并发两种拼写并存:`handle`/`finalize` 族=`expected_version`,`completion`/`message`/`config` 族=`expect_version`。 */
  738. const q = (o: Record<string, string | number | undefined | null>) =>
  739. Object.entries(o)
  740. .filter(([, v]) => v !== undefined && v !== null && `${v}` !== "")
  741. .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
  742. .join("&");
  743. /* ══════════════ §6.1 读侧(7) ══════════════ */
  744. /** 工单列表 [实]。分页 **1 基**(`page_norm`),UI 页码直接透传。 */
  745. export const ticketList = (d: {
  746. ticket_types?: string[];
  747. statuses?: string[];
  748. /** 回填来源三值:manual/unicom_feedback/mixed */
  749. sources?: string[];
  750. date_from?: string;
  751. date_to?: string;
  752. keyword?: string;
  753. /** 订阅(订阅)过滤:订阅详情「关联工单」按本条订阅现查(P3-D6)。 */
  754. subscription_id?: string;
  755. /** 合同过滤:合同详情「关联工单」按合同下订阅集合现查(P3-D7)。 */
  756. contract_id?: string;
  757. /** 客户过滤:客户维度的工单台账。 */
  758. customer_id?: string;
  759. /**
  760. * 责任人过滤:**只有 `me` 一个取值**(服务端按会话解析,⛔ 收任意 user_id)。
  761. * 「我的待办」靠它把可见行集收窄到本人名下——运维成员的可见性本来就是本人,
  762. * 运营账号/团队主/总运营则是「先按可见范围取并集再筛本人」。
  763. */
  764. assignee?: string;
  765. page?: number;
  766. page_size?: number;
  767. }) => list<TicketListResult>("/ticket/list@v1", d, d);
  768. /** 工单详情定位入参 [实] —— 二选一(都给以 `ticket_id` 为准)。
  769. *
  770. * 客户门户⛔ 在 URL 里出现内部主键,故列表只回 `ticket_no`、详情按业务工单号定位;
  771. * 运营侧仍走 `ticket_id`(台账/队列/待办页手上有主键)。 */
  772. export type TicketDetailIn = { ticket_id?: string; ticket_no?: string; read_event?: boolean };
  773. /** 工单详情 [实] —— GET;`read_event=true` 才推进 pending→processing(终态返 KLT-G20401)。 */
  774. export const ticketDetail = (d: TicketDetailIn) =>
  775. get<TicketDetail>(
  776. `/ticket/detail@v1?${q({
  777. ticket_id: d.ticket_id,
  778. ticket_no: d.ticket_no,
  779. read_event: d.read_event ? "true" : undefined,
  780. })}`,
  781. );
  782. /** 待分派队列 [实] —— 逐行带 `candidates[]`(可分派候选人+手头量)。 */
  783. export const ticketPendingQueue = (d?: {
  784. ticket_types?: string[];
  785. assign_team_id?: string;
  786. keyword?: string;
  787. page?: number;
  788. page_size?: number;
  789. }) => list<PendingQueueResult>("/ticket/pending_queue@v1", d, d);
  790. /** 六档待办计数 [实] —— 红点/徽标唯一来源。 */
  791. export const ticketTodoCounts = () => get<TodoCounts>("/ticket/todo_counts@v1");
  792. /** 全链路追溯 [实] —— GET,四键至少一键(工单号/订单号/竣工单号/ticket_id)。 */
  793. export const ticketTrace = (d: TraceIn) => get<TraceResult>(`/ticket/trace@v1?${q({ ...d })}`);
  794. /** 报文待处置清单 [实] —— 仅 `unmatched`/`conflict`。 */
  795. export const messagePending = (d?: { page?: number; page_size?: number; status?: string }) =>
  796. list<MessagePendingResult>("/message/pending@v1", d, d);
  797. /* ══════════════ §6.2 建单与分派(4) ══════════════ */
  798. /**
  799. * 建单 [实] —— 客户侧/运营侧同一口,`submitter_type` 由服务端按身份定。
  800. * `ticket_type` 收 `fault`/`after_sale`/`service_stop`(create.rs `CREATE_TYPES`,
  801. * 2026-11-14 起「运营人工发起服务停用」也挂本口=工单§3.2.1);`title` 必填(≤128 字)。
  802. * `service_stop` 必带 `subscription_id` + `confirm:true`(二次确认),服务端同批登记
  803. * `ticket_open_stop`(`action=stop`、`exec_status=pending`),实际停机由回填执行。
  804. * 客户侧 ⛔ 带 `customer_id`(由会话派生);总运营必带;材料键须先落在
  805. * `提交材料/{customer_id}/` 前缀下——该前缀 ⛔ 在建单前取到(`material_grant` 要 `ticket_id`),
  806. * 所以门户建单 ⛔ 挂 attachments 假上传,材料在建单后走 `material_grant`+`material_attach`。
  807. */
  808. export const ticketCreate = (d: {
  809. ticket_type: string;
  810. customer_id?: string;
  811. title: string;
  812. detail?: string;
  813. subscription_id?: string;
  814. /** 仅 `service_stop` 用:人工发起停用的二次确认位,⛔ 由服务端默认放行。 */
  815. confirm?: boolean;
  816. materials?: CreateMaterialIn[];
  817. }) => post<TicketCreateResult>("/ticket/create@v1", d);
  818. /** 人工分派 [实] —— 候选人来自 `pending_queue` 行内 `candidates[]`。 */
  819. export const ticketAssign = (d: { ticket_id: string; assignee_user_id: string }) =>
  820. post<AssignResult>("/ticket/assign@v1", d);
  821. /** 自动分派 [实] —— 按团队批量。 */
  822. export const ticketDispatchAuto = (d: { team_id: string }) =>
  823. post<DispatchResult>("/ticket/dispatch_auto@v1", d);
  824. /** 转交代管 [实] —— 责任人本人把单交给同事代管。 */
  825. export const ticketDelegate = (d: { ticket_id: string; trustee_user_id: string }) =>
  826. post<DelegateResult>("/ticket/delegate@v1", d);
  827. /* ══════════════ §6.3 处理推进与回填(5) ══════════════ */
  828. /** 阅读推进 [实]——由详情口 `read_event=true` 内部调用,**无人工按钮**(工单§4.1.4,2026-11-04 定案)。 */
  829. export const ticketStart = (d: { ticket_id: string }) => post<StartResult>("/ticket/start@v1", d);
  830. /** 施工回填 [实] —— 停机类只录组四五项(契约 14.2),`route_rows`/`ip_rows` 传空数组。 */
  831. export const ticketBackfill = (d: {
  832. ticket_id: string;
  833. exec_conclusion?: string;
  834. conclusion_note?: string;
  835. actual_opened_date?: string;
  836. stop_done_date?: string;
  837. builder_user_id?: string;
  838. evidence_text?: string;
  839. route_rows?: BackfillInRoute[];
  840. ip_rows?: BackfillInIp[];
  841. expected_version?: number;
  842. }) => post<BackfillResult>("/ticket/backfill@v1", d);
  843. /** 服务开通条目核对 [实]。 */
  844. export const ticketCheckDone = (d: {
  845. ticket_id: string;
  846. item_ids?: string[];
  847. note?: string;
  848. /** 实际开通日(服务开通单三件套之一;服务开通单没有回填弹窗,这一列随核对登记)。 */
  849. actual_opened_date?: string;
  850. expected_version?: number;
  851. }) => post<CheckDoneResult>("/ticket/check_done@v1", d);
  852. /** 非主线单标记完成 [实]。 */
  853. export const ticketMarkDone = (d: { ticket_id: string; note?: string; expected_version?: number }) =>
  854. post<MarkDoneResult>("/ticket/mark_done@v1", d);
  855. /* ══════════════ §6.4 终态收口与受控回退(5) ══════════════ */
  856. /** 关闭/作废 [实]。 */
  857. export const ticketClose = (d: { ticket_id: string; reason?: string; expected_version?: number }) =>
  858. post<FinalizeResult>("/ticket/close@v1", d);
  859. /** 客户侧撤回并关闭 [实]。 */
  860. export const ticketWithdraw = (d: { ticket_id: string; reason?: string }) =>
  861. post<FinalizeResult>("/ticket/withdraw@v1", d);
  862. /** 非主线单客户侧闭环确认 [实]。 */
  863. export const ticketConfirmClose = (d: { ticket_id: string; expected_version?: number }) =>
  864. post<FinalizeResult>("/ticket/confirm_close@v1", d);
  865. /** 延期提醒 [实] —— 载体两档:`open_stop`(开停记录)/`ticket`(工单本身);期限由服务端按超期天数推进。 */
  866. export const ticketDefer = (d: { ticket_id: string; defer_scope?: "open_stop" | "ticket" }) =>
  867. post<FinalizeResult>("/ticket/defer@v1", d);
  868. /** 受控回退(仅总运营) [实]。 */
  869. export const ticketRevert = (d: { ticket_id: string; reason?: string; expected_version?: number }) =>
  870. post<FinalizeResult>("/ticket/revert@v1", d);
  871. /**
  872. * 站内催办 [实](2026-11-18,需求§7.5.2)——向「卡在别人手里」的对家投递一封催办信。
  873. *
  874. * 收件人/信体/业务日一律服务端取(⛔ 传 `to_user_id`:那等于开了任意发信通路)。
  875. * **一单一天一封**:同一业务日重复调用回 `created=false`/`reason=already_sent_today`
  876. * ——那是**幂等成功**,UI 按「今日已催」呈现,⛔ 报错。
  877. * 前置不满足(非 `completed`/未满 24 小时/对家=本人)回 `KLT-G20424`,`detail.reason`
  878. * 与 `waiting.urge.reason` 同词典。
  879. */
  880. export type TicketUrgeResult = {
  881. ticket_id: string;
  882. /** `true`=本轮真的投递了一封;`false`=当日已发过(幂等去重)或并发已投。 */
  883. created: boolean;
  884. reason: string | null;
  885. message_id?: string | null;
  886. business_date: string;
  887. counterparty?: { user_id: string; name: string; role: string; org_name: string | null };
  888. waiting: TicketWaiting;
  889. audit_written?: boolean;
  890. next_step: string;
  891. };
  892. export const ticketUrge = (d: { ticket_id: string }) =>
  893. post<TicketUrgeResult>("/ticket/urge@v1", d);
  894. /* ══════════════ §6.5 竣工回传与回执(2) ══════════════ */
  895. /** 生成并回传竣工 [实] —— 缺口未清 ⇒ 服务端硬拦。 */
  896. export const completionGenerate = (d: { ticket_id: string }) =>
  897. post<CompletionGenerateResult>("/completion/generate@v1", d);
  898. /** 回执确认闭环 [实] —— 仅 admin/该团队主账号。 */
  899. export const completionReceipt = (d: {
  900. ticket_id: string;
  901. completion_no?: string;
  902. external_order_no?: string;
  903. receipt_remark?: string;
  904. expect_version?: number;
  905. /** 驳回态冲突纠正(设计方案§3.3):**仅 admin** 生效,非驳回态传了也⛔ 改变任何行为。 */
  906. override_state_conflict?: boolean;
  907. }) => post<CompletionReceiptResult>("/completion/receipt@v1", d);
  908. /**
  909. * 竣工驳回理由七枚(工单§5.5.3 批复④),**顺序=后端 `domain::REJECT_REASONS` 定义序**。
  910. *
  911. * ⚠️ 顺序有语义:服务端按本表下标归一化后落库,**主原因=归一化首位**(下标最小的那枚),
  912. * ⛔ 把"用户先点的那枚"当主原因——同一次勾选无论怎么点主原因都相同,报表「主原因分布」
  913. * 才不会被排列组合劈成几条(驳回抽屉的预览按这条口径回显)。
  914. */
  915. export const REJECT_REASONS: { code: string; name: string }[] = [
  916. { code: "doc_mismatch", name: "资料不符" },
  917. { code: "resource_unavailable", name: "端口或IP资源不可用" },
  918. { code: "duplicate", name: "重复申报" },
  919. { code: "out_of_scope", name: "超出受理范围" },
  920. { code: "doc_missing", name: "竣工资料缺失" },
  921. { code: "site_not_ready", name: "现场不具备条件" },
  922. { code: "other", name: "其他" },
  923. ];
  924. /** 一次驳回的枚数上限(`1 ≤ n ≤ 3`,超限/空选 ⇒ `KLT-G20422`)。 */
  925. export const REJECT_REASON_MAX = 3;
  926. /** 归一化主原因(本表下标最小者);未勾选回空串。 */
  927. export const rejectPrimaryReason = (codes: string[]) =>
  928. REJECT_REASONS.find((r) => codes.includes(r.code))?.name ?? "";
  929. /** 登记竣工驳回 [实](工单§5.5.3,U-115)——重复提交命中幂等回 `KLT-G20421`+既有 seq。 */
  930. export const completionReject = (d: {
  931. ticket_id: string;
  932. reason_codes: string[];
  933. reason_text: string;
  934. external_reject_no?: string;
  935. }) => post<CompletionRejectResult>("/completion/reject@v1", d);
  936. /* ══════════════ §6.6 报文人工处置(4) ══════════════ */
  937. /** 报文关联到工单 [实]。 */
  938. export const messageAttach = (d: { message_id: string; ticket_id: string; expect_version?: number }) =>
  939. post<MessageActionResult>("/message/attach@v1", d);
  940. /** 报文作废 [实] —— `void_reason` 服务端必填(缺失 ⇒ KLT-G20412),⛔ 空串提交。 */
  941. export const messageVoid = (d: { message_id: string; void_reason?: string; expect_version?: number }) =>
  942. post<MessageActionResult>("/message/void@v1", d);
  943. /** 冲突确认 [实] —— `as_is`=以现状为准归档(默认)/`apply_external`=按报文外部值生效。 */
  944. export const messageConfirmConflict = (d: {
  945. message_id: string;
  946. disposition?: "as_is" | "apply_external";
  947. note?: string;
  948. expect_version?: number;
  949. }) => post<MessageActionResult>("/message/confirm_conflict@v1", d);
  950. /** 报文改绑到另一单 [实]。 */
  951. export const messageRematch = (d: { message_id: string; ticket_id: string; expect_version?: number }) =>
  952. post<MessageActionResult>("/message/rematch@v1", d);
  953. /* ══════════════ §6.7 材料直传(2) ══════════════ */
  954. /** 申请直传凭证 [实] —— 拿 `oss_key` 后到 `presign_endpoint` 换签名直传,再 `material_attach` 登记。 */
  955. export const ticketMaterialGrant = (d: {
  956. ticket_id: string;
  957. kind: string;
  958. file_name?: string;
  959. purpose?: "upload" | "download";
  960. material_id?: string;
  961. oss_key?: string;
  962. }) => post<MaterialGrantResult>("/ticket/material_grant@v1", d);
  963. /**
  964. * 换一条材料下载地址 [实]。
  965. *
  966. * `detail@v1` 刻意不下发对象键 ⇒ 页面只能按 `material_id` 现签;签名由服务端向平台取,
  967. * ⛔ 不经浏览器拼路径、⛔ 缓存地址(短时效)。
  968. */
  969. export const ticketMaterialDownload = (d: { ticket_id: string; kind: string; material_id: string }) =>
  970. post<MaterialGrantDownload>("/ticket/material_grant@v1", {
  971. ticket_id: d.ticket_id,
  972. kind: d.kind,
  973. material_id: d.material_id,
  974. purpose: "download",
  975. });
  976. /** 登记已直传材料 [实]。 */
  977. export const ticketMaterialAttach = (d: {
  978. ticket_id: string;
  979. kind: string;
  980. oss_key: string;
  981. file_name?: string;
  982. size_bytes?: number;
  983. }) => post<MaterialAttachResult>("/ticket/material_attach@v1", d);
  984. /* ══════════════ §6.8 闭环方式配置(2) ══════════════ */
  985. /** 读闭环方式 [实] —— 仅运营侧三类;交付侧 11104。 */
  986. export const ticketConfigGet = () => get<ClosureConfig>("/ticket/config_get@v1");
  987. /** 改闭环方式 [实] —— 仅总运营;`reason` 必填进审计。 */
  988. export const ticketConfigUpdate = (d: { closure_mode: string; expect_version?: number; reason?: string }) =>
  989. post<ClosureConfigUpdateResult>("/ticket/config_update@v1", d);