Просмотр исходного кода

feat(klt-bos): 在 src/ 落地 Rust 扩展微服务一期骨架与账户域 API

按 SEOH SDK 规范接入注册/鉴权,交付 M0–M6/M2 支撑链与第 1 期账户域 OpenAPI 路由;同步忽略 target/temp,锁定 Cargo.lock。

Co-authored-by: Cursor <cursoragent@cursor.com>
cg 2 недель назад
Родитель
Сommit
5e4108110a
90 измененных файлов с 15245 добавлено и 0 удалено
  1. 5 0
      .gitignore
  2. 3981 0
      src/Cargo.lock
  3. 65 0
      src/Cargo.toml
  4. 17 0
      src/Dockerfile
  5. 20 0
      src/README.md
  6. 43 0
      src/bin/klt-bos/Cargo.toml
  7. 3777 0
      src/bin/klt-bos/openapi.yaml
  8. 89 0
      src/bin/klt-bos/src/config.rs
  9. 218 0
      src/bin/klt-bos/src/main.rs
  10. 21 0
      src/config/default.toml
  11. 19 0
      src/crates/bos-activation/Cargo.toml
  12. 61 0
      src/crates/bos-activation/src/export.rs
  13. 31 0
      src/crates/bos-activation/src/issue.rs
  14. 9 0
      src/crates/bos-activation/src/lib.rs
  15. 16 0
      src/crates/bos-activation/src/verify.rs
  16. 18 0
      src/crates/bos-api/Cargo.toml
  17. 61 0
      src/crates/bos-api/src/auth.rs
  18. 147 0
      src/crates/bos-api/src/extract.rs
  19. 10 0
      src/crates/bos-api/src/lib.rs
  20. 1 0
      src/crates/bos-api/src/middleware.rs
  21. 13 0
      src/crates/bos-api/src/state.rs
  22. 14 0
      src/crates/bos-core/Cargo.toml
  23. 191 0
      src/crates/bos-core/src/error.rs
  24. 15 0
      src/crates/bos-core/src/lib.rs
  25. 34 0
      src/crates/bos-core/src/money.rs
  26. 41 0
      src/crates/bos-core/src/page.rs
  27. 54 0
      src/crates/bos-core/src/response.rs
  28. 61 0
      src/crates/bos-core/src/roles.rs
  29. 10 0
      src/crates/bos-core/src/time.rs
  30. 9 0
      src/crates/bos-invariant/Cargo.toml
  31. 103 0
      src/crates/bos-invariant/src/lib.rs
  32. 13 0
      src/crates/bos-invariant/tests/rbac_overreach.rs
  33. 16 0
      src/crates/bos-io/Cargo.toml
  34. 36 0
      src/crates/bos-io/src/export.rs
  35. 30 0
      src/crates/bos-io/src/import.rs
  36. 7 0
      src/crates/bos-io/src/lib.rs
  37. 16 0
      src/crates/bos-jobs/Cargo.toml
  38. 31 0
      src/crates/bos-jobs/src/handlers.rs
  39. 8 0
      src/crates/bos-jobs/src/lib.rs
  40. 90 0
      src/crates/bos-jobs/src/registry.rs
  41. 10 0
      src/crates/bos-jobs/src/report.rs
  42. 10 0
      src/crates/bos-notify/Cargo.toml
  43. 15 0
      src/crates/bos-notify/src/lib.rs
  44. 17 0
      src/crates/bos-platform/Cargo.toml
  45. 16 0
      src/crates/bos-platform/src/audit.rs
  46. 15 0
      src/crates/bos-platform/src/clients/activation.rs
  47. 15 0
      src/crates/bos-platform/src/clients/iam.rs
  48. 12 0
      src/crates/bos-platform/src/clients/impexp.rs
  49. 58 0
      src/crates/bos-platform/src/clients/mod.rs
  50. 21 0
      src/crates/bos-platform/src/clients/resource_metadata.rs
  51. 21 0
      src/crates/bos-platform/src/clients/scheduler.rs
  52. 15 0
      src/crates/bos-platform/src/config.rs
  53. 8 0
      src/crates/bos-platform/src/lib.rs
  54. 15 0
      src/crates/bos-scope/Cargo.toml
  55. 40 0
      src/crates/bos-scope/src/grant.rs
  56. 11 0
      src/crates/bos-scope/src/lib.rs
  57. 31 0
      src/crates/bos-scope/src/mount.rs
  58. 23 0
      src/crates/bos-scope/src/roles_policy.rs
  59. 141 0
      src/crates/bos-scope/src/scoped_select.rs
  60. 13 0
      src/docs/路由在册核对表模板.md
  61. 505 0
      src/migrations/dev/20261104000001_bos_core_tables.sql
  62. 22 0
      src/modules/account/Cargo.toml
  63. 161 0
      src/modules/account/src/handlers/account.rs
  64. 21 0
      src/modules/account/src/handlers/activation.rs
  65. 15 0
      src/modules/account/src/handlers/auth_ctx.rs
  66. 16 0
      src/modules/account/src/handlers/catalog.rs
  67. 16 0
      src/modules/account/src/handlers/contract.rs
  68. 19 0
      src/modules/account/src/handlers/cost.rs
  69. 75 0
      src/modules/account/src/handlers/customer.rs
  70. 22 0
      src/modules/account/src/handlers/ent_team.rs
  71. 30 0
      src/modules/account/src/handlers/import_batch.rs
  72. 56 0
      src/modules/account/src/handlers/jobs.rs
  73. 19 0
      src/modules/account/src/handlers/mod.rs
  74. 40 0
      src/modules/account/src/handlers/operator.rs
  75. 40 0
      src/modules/account/src/handlers/ops_team.rs
  76. 13 0
      src/modules/account/src/handlers/opsview.rs
  77. 22 0
      src/modules/account/src/handlers/partner.rs
  78. 16 0
      src/modules/account/src/handlers/ping.rs
  79. 123 0
      src/modules/account/src/handlers/region.rs
  80. 19 0
      src/modules/account/src/handlers/share_rule.rs
  81. 11 0
      src/modules/account/src/handlers/sub_account.rs
  82. 17 0
      src/modules/account/src/handlers/subscription.rs
  83. 6 0
      src/modules/account/src/lib.rs
  84. 148 0
      src/modules/account/src/router.rs
  85. 14 0
      src/modules/billing/Cargo.toml
  86. 62 0
      src/modules/billing/src/lib.rs
  87. 8 0
      src/modules/ops/Cargo.toml
  88. 4 0
      src/modules/ops/src/lib.rs
  89. 3777 0
      src/openapi.yaml
  90. 40 0
      src/scripts/assert_structure.sh

+ 5 - 0
.gitignore

@@ -1,5 +1,10 @@
 .DS_Store
 
+# Rust
+src/target/
+src/temp/
+**/*.rs.bk
+
 # 用例说明分册拼装用的分片中间产物,不入库
 .tc_parts/
 .screenshots/

+ 3981 - 0
src/Cargo.lock

@@ -0,0 +1,3981 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "account"
+version = "0.1.0"
+dependencies = [
+ "async-trait",
+ "axum",
+ "bos-activation",
+ "bos-api",
+ "bos-core",
+ "bos-invariant",
+ "bos-io",
+ "bos-jobs",
+ "bos-platform",
+ "bos-scope",
+ "chrono",
+ "serde",
+ "serde_json",
+ "sqlx",
+ "thiserror 1.0.69",
+ "tracing",
+]
+
+[[package]]
+name = "ahash"
+version = "0.8.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
+dependencies = [
+ "cfg-if",
+ "once_cell",
+ "version_check",
+ "zerocopy",
+]
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "allocator-api2"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
+
+[[package]]
+name = "android_system_properties"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "anyhow"
+version = "1.0.104"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
+
+[[package]]
+name = "ar_archive_writer"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73cd58deff2140a0a8eae87e417bd01db68a33e148aa93d1e8cd837e55e312b6"
+dependencies = [
+ "object",
+]
+
+[[package]]
+name = "arc-swap"
+version = "1.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "380962b3d93b99642e50b9febf72c071e97e8b32d86eae9cf4ef582bb960ae6e"
+dependencies = [
+ "rustversion",
+]
+
+[[package]]
+name = "arraydeque"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236"
+
+[[package]]
+name = "async-trait"
+version = "0.1.92"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "atoi"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "atomic-waker"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
+
+[[package]]
+name = "autocfg"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
+
+[[package]]
+name = "aws-lc-rs"
+version = "1.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "048006790404103c488e6c5616b3e7e702a71292aadda08e8f7698a9e0d2eb53"
+dependencies = [
+ "aws-lc-sys",
+ "zeroize",
+]
+
+[[package]]
+name = "aws-lc-sys"
+version = "0.47.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8bfbe32ac36b3c428696ce315464181bc4029d689fd58e3f2a4e58c252242f52"
+dependencies = [
+ "cc",
+ "cmake",
+ "dunce",
+ "fs_extra",
+ "pkg-config",
+]
+
+[[package]]
+name = "axum"
+version = "0.7.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f"
+dependencies = [
+ "async-trait",
+ "axum-core",
+ "bytes",
+ "futures-util",
+ "http 1.5.0",
+ "http-body 1.1.0",
+ "http-body-util",
+ "hyper 1.12.0",
+ "hyper-util",
+ "itoa",
+ "matchit",
+ "memchr",
+ "mime",
+ "percent-encoding",
+ "pin-project-lite",
+ "rustversion",
+ "serde",
+ "serde_json",
+ "serde_path_to_error",
+ "serde_urlencoded",
+ "sync_wrapper 1.0.2",
+ "tokio",
+ "tower 0.5.3",
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "axum-core"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199"
+dependencies = [
+ "async-trait",
+ "bytes",
+ "futures-util",
+ "http 1.5.0",
+ "http-body 1.1.0",
+ "http-body-util",
+ "mime",
+ "pin-project-lite",
+ "rustversion",
+ "sync_wrapper 1.0.2",
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "axum-server"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1ab4a3ec9ea8a657c72d99a03a824af695bd0fb5ec639ccbd9cd3543b41a5f9"
+dependencies = [
+ "arc-swap",
+ "bytes",
+ "fs-err",
+ "http 1.5.0",
+ "http-body 1.1.0",
+ "hyper 1.12.0",
+ "hyper-util",
+ "pin-project-lite",
+ "rustls 0.23.46",
+ "rustls-pemfile 2.2.0",
+ "rustls-pki-types",
+ "tokio",
+ "tokio-rustls 0.26.6",
+ "tower-service",
+]
+
+[[package]]
+name = "base62"
+version = "2.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a3a647dce9631f152a99ec16cfc09267ae55fe280d5dc288964027d458076323"
+
+[[package]]
+name = "base64"
+version = "0.21.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
+
+[[package]]
+name = "base64"
+version = "0.22.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
+
+[[package]]
+name = "base64"
+version = "0.23.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
+
+[[package]]
+name = "base64ct"
+version = "1.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
+
+[[package]]
+name = "billing"
+version = "0.1.0"
+dependencies = [
+ "async-trait",
+ "bos-core",
+ "chrono",
+ "serde",
+ "serde_json",
+ "sqlx",
+ "thiserror 1.0.69",
+ "tracing",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bitflags"
+version = "2.13.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
+dependencies = [
+ "serde_core",
+]
+
+[[package]]
+name = "block-buffer"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "bos-activation"
+version = "0.1.0"
+dependencies = [
+ "async-trait",
+ "bos-core",
+ "bos-platform",
+ "chrono",
+ "hex",
+ "hmac",
+ "rand 0.8.8",
+ "serde",
+ "serde_json",
+ "sha2",
+ "sqlx",
+ "thiserror 1.0.69",
+ "tracing",
+]
+
+[[package]]
+name = "bos-api"
+version = "0.1.0"
+dependencies = [
+ "async-trait",
+ "axum",
+ "base64 0.22.1",
+ "bos-core",
+ "bos-platform",
+ "bos-scope",
+ "chrono",
+ "serde",
+ "serde_json",
+ "sqlx",
+ "tower 0.4.13",
+ "tracing",
+]
+
+[[package]]
+name = "bos-core"
+version = "0.1.0"
+dependencies = [
+ "chrono",
+ "chrono-tz",
+ "serde",
+ "serde_json",
+ "sqlx",
+ "thiserror 1.0.69",
+ "tracing",
+ "uuid",
+]
+
+[[package]]
+name = "bos-invariant"
+version = "0.1.0"
+dependencies = [
+ "bos-core",
+ "serde",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "bos-io"
+version = "0.1.0"
+dependencies = [
+ "async-trait",
+ "bos-core",
+ "bos-platform",
+ "bos-scope",
+ "chrono",
+ "serde",
+ "serde_json",
+ "sqlx",
+ "thiserror 1.0.69",
+ "tracing",
+]
+
+[[package]]
+name = "bos-jobs"
+version = "0.1.0"
+dependencies = [
+ "async-trait",
+ "axum",
+ "bos-core",
+ "bos-platform",
+ "chrono",
+ "serde",
+ "serde_json",
+ "sqlx",
+ "thiserror 1.0.69",
+ "tracing",
+]
+
+[[package]]
+name = "bos-notify"
+version = "0.1.0"
+dependencies = [
+ "bos-core",
+ "serde",
+ "thiserror 1.0.69",
+ "tracing",
+]
+
+[[package]]
+name = "bos-platform"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+ "async-trait",
+ "bos-core",
+ "chrono",
+ "reqwest 0.12.28",
+ "seoh-service-sdk",
+ "serde",
+ "serde_json",
+ "thiserror 1.0.69",
+ "tokio",
+ "tracing",
+]
+
+[[package]]
+name = "bos-scope"
+version = "0.1.0"
+dependencies = [
+ "async-trait",
+ "bos-core",
+ "bos-platform",
+ "chrono",
+ "serde",
+ "serde_json",
+ "sqlx",
+ "thiserror 1.0.69",
+ "tracing",
+]
+
+[[package]]
+name = "bumpalo"
+version = "3.20.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
+
+[[package]]
+name = "byteorder"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+
+[[package]]
+name = "bytes"
+version = "1.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
+
+[[package]]
+name = "cc"
+version = "1.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "375989decec1a0fa424442bed520fa12ede43a48475ce8c7417d2c69b32b5f6b"
+dependencies = [
+ "find-msvc-tools",
+ "jobserver",
+ "libc",
+ "shlex",
+]
+
+[[package]]
+name = "cfg-if"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
+
+[[package]]
+name = "cfg_aliases"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"
+
+[[package]]
+name = "chacha20"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06"
+dependencies = [
+ "cfg-if",
+ "cpufeatures 0.3.1",
+ "rand_core 0.10.1",
+]
+
+[[package]]
+name = "chrono"
+version = "0.4.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327"
+dependencies = [
+ "iana-time-zone",
+ "js-sys",
+ "num-traits",
+ "serde",
+ "wasm-bindgen",
+ "windows-link",
+]
+
+[[package]]
+name = "chrono-tz"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a6139a8597ed92cf816dfb33f5dd6cf0bb93a6adc938f11039f371bc5bcd26c3"
+dependencies = [
+ "chrono",
+ "phf",
+]
+
+[[package]]
+name = "cmake"
+version = "0.1.58"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "config"
+version = "0.14.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68578f196d2a33ff61b27fae256c3164f65e36382648e30666dde05b8cc9dfdf"
+dependencies = [
+ "async-trait",
+ "convert_case",
+ "json5",
+ "nom",
+ "pathdiff",
+ "ron",
+ "rust-ini",
+ "serde",
+ "serde_json",
+ "toml",
+ "yaml-rust2",
+]
+
+[[package]]
+name = "const-oid"
+version = "0.9.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
+
+[[package]]
+name = "const-random"
+version = "0.1.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359"
+dependencies = [
+ "const-random-macro",
+]
+
+[[package]]
+name = "const-random-macro"
+version = "0.1.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e"
+dependencies = [
+ "getrandom 0.2.17",
+ "once_cell",
+ "tiny-keccak",
+]
+
+[[package]]
+name = "convert_case"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca"
+dependencies = [
+ "unicode-segmentation",
+]
+
+[[package]]
+name = "core-foundation"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "core-foundation-sys"
+version = "0.8.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
+
+[[package]]
+name = "core_detect"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48"
+
+[[package]]
+name = "cpufeatures"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "cpufeatures"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "crc"
+version = "3.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d"
+dependencies = [
+ "crc-catalog",
+]
+
+[[package]]
+name = "crc-catalog"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853"
+
+[[package]]
+name = "crossbeam-queue"
+version = "0.3.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03e8bd762f7479489c70ed6c768ddca99d7296857de437a68dcb2a94365b3fae"
+dependencies = [
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
+
+[[package]]
+name = "crunchy"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
+
+[[package]]
+name = "crypto-common"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
+dependencies = [
+ "generic-array",
+ "typenum",
+]
+
+[[package]]
+name = "der"
+version = "0.7.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
+dependencies = [
+ "const-oid",
+ "pem-rfc7468",
+ "zeroize",
+]
+
+[[package]]
+name = "deranged"
+version = "0.5.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e"
+
+[[package]]
+name = "digest"
+version = "0.10.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
+dependencies = [
+ "block-buffer",
+ "const-oid",
+ "crypto-common",
+ "subtle",
+]
+
+[[package]]
+name = "displaydoc"
+version = "0.2.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "dlv-list"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f"
+dependencies = [
+ "const-random",
+]
+
+[[package]]
+name = "dotenvy"
+version = "0.15.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
+
+[[package]]
+name = "dunce"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
+
+[[package]]
+name = "either"
+version = "1.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "encoding_rs"
+version = "0.8.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5"
+dependencies = [
+ "cfg-if",
+ "core_detect",
+ "multiversion_no_op",
+ "rustversion",
+ "scopeguard",
+ "simdutf8",
+]
+
+[[package]]
+name = "equivalent"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
+
+[[package]]
+name = "errno"
+version = "0.3.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
+dependencies = [
+ "libc",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "etcetera"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943"
+dependencies = [
+ "cfg-if",
+ "home",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
+name = "event-listener"
+version = "5.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"
+dependencies = [
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "find-msvc-tools"
+version = "0.1.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48"
+
+[[package]]
+name = "flume"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+ "spin",
+]
+
+[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
+name = "foldhash"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
+
+[[package]]
+name = "form_urlencoded"
+version = "1.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
+dependencies = [
+ "percent-encoding",
+]
+
+[[package]]
+name = "fs-err"
+version = "3.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5c95b673b8f6f7235229ae11c5642d81b04c2e64c1e2fb417bc0cf73ca45f29"
+dependencies = [
+ "autocfg",
+ "tokio",
+]
+
+[[package]]
+name = "fs_extra"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
+
+[[package]]
+name = "futures-channel"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
+[[package]]
+name = "futures-core"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
+
+[[package]]
+name = "futures-executor"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"
+dependencies = [
+ "futures-core",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-intrusive"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f"
+dependencies = [
+ "futures-core",
+ "lock_api",
+ "parking_lot",
+]
+
+[[package]]
+name = "futures-io"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
+
+[[package]]
+name = "futures-sink"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
+
+[[package]]
+name = "futures-task"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
+
+[[package]]
+name = "futures-util"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
+dependencies = [
+ "futures-core",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "memchr",
+ "pin-project-lite",
+ "slab",
+]
+
+[[package]]
+name = "generic-array"
+version = "0.14.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
+dependencies = [
+ "typenum",
+ "version_check",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "libc",
+ "wasi",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "libc",
+ "r-efi",
+ "rand_core 0.10.1",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "h2"
+version = "0.3.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d"
+dependencies = [
+ "bytes",
+ "fnv",
+ "futures-core",
+ "futures-sink",
+ "futures-util",
+ "http 0.2.12",
+ "indexmap",
+ "slab",
+ "tokio",
+ "tokio-util",
+ "tracing",
+]
+
+[[package]]
+name = "h2"
+version = "0.4.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d29020232d6aa3fb1daca64c1127cf662cf97f254ae16c18c05b8ab635fc118"
+dependencies = [
+ "atomic-waker",
+ "bytes",
+ "fnv",
+ "futures-core",
+ "futures-sink",
+ "http 1.5.0",
+ "indexmap",
+ "slab",
+ "tokio",
+ "tokio-util",
+ "tracing",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.14.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
+dependencies = [
+ "ahash",
+ "allocator-api2",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.15.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
+dependencies = [
+ "allocator-api2",
+ "equivalent",
+ "foldhash",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.17.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
+
+[[package]]
+name = "hashlink"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7"
+dependencies = [
+ "hashbrown 0.14.5",
+]
+
+[[package]]
+name = "hashlink"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
+dependencies = [
+ "hashbrown 0.15.5",
+]
+
+[[package]]
+name = "heck"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
+
+[[package]]
+name = "hex"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
+
+[[package]]
+name = "hkdf"
+version = "0.12.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
+dependencies = [
+ "hmac",
+]
+
+[[package]]
+name = "hmac"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
+dependencies = [
+ "digest",
+]
+
+[[package]]
+name = "home"
+version = "0.5.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d"
+dependencies = [
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "http"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
+dependencies = [
+ "bytes",
+ "fnv",
+ "itoa",
+]
+
+[[package]]
+name = "http"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"
+dependencies = [
+ "bytes",
+ "itoa",
+]
+
+[[package]]
+name = "http-body"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
+dependencies = [
+ "bytes",
+ "http 0.2.12",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "http-body"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c"
+dependencies = [
+ "bytes",
+ "http 1.5.0",
+]
+
+[[package]]
+name = "http-body-util"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "http 1.5.0",
+ "http-body 1.1.0",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "httparse"
+version = "1.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
+
+[[package]]
+name = "httpdate"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
+
+[[package]]
+name = "hyper"
+version = "0.14.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7"
+dependencies = [
+ "bytes",
+ "futures-channel",
+ "futures-core",
+ "futures-util",
+ "h2 0.3.27",
+ "http 0.2.12",
+ "http-body 0.4.6",
+ "httparse",
+ "httpdate",
+ "itoa",
+ "pin-project-lite",
+ "socket2 0.5.10",
+ "tokio",
+ "tower-service",
+ "tracing",
+ "want",
+]
+
+[[package]]
+name = "hyper"
+version = "1.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c"
+dependencies = [
+ "atomic-waker",
+ "bytes",
+ "futures-channel",
+ "futures-core",
+ "h2 0.4.20",
+ "http 1.5.0",
+ "http-body 1.1.0",
+ "httparse",
+ "httpdate",
+ "itoa",
+ "pin-project-lite",
+ "smallvec",
+ "tokio",
+ "want",
+]
+
+[[package]]
+name = "hyper-rustls"
+version = "0.24.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
+dependencies = [
+ "futures-util",
+ "http 0.2.12",
+ "hyper 0.14.32",
+ "rustls 0.21.12",
+ "tokio",
+ "tokio-rustls 0.24.1",
+]
+
+[[package]]
+name = "hyper-rustls"
+version = "0.27.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53"
+dependencies = [
+ "http 1.5.0",
+ "hyper 1.12.0",
+ "hyper-util",
+ "rustls 0.23.46",
+ "tokio",
+ "tokio-rustls 0.26.6",
+ "tower-service",
+ "webpki-roots 1.0.11",
+]
+
+[[package]]
+name = "hyper-util"
+version = "0.1.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff"
+dependencies = [
+ "base64 0.23.1",
+ "bytes",
+ "futures-channel",
+ "futures-util",
+ "http 1.5.0",
+ "http-body 1.1.0",
+ "httparse",
+ "hyper 1.12.0",
+ "ipnet",
+ "libc",
+ "percent-encoding",
+ "pin-project-lite",
+ "socket2 0.6.5",
+ "tokio",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "iana-time-zone"
+version = "0.1.65"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"
+dependencies = [
+ "android_system_properties",
+ "core-foundation-sys",
+ "iana-time-zone-haiku",
+ "js-sys",
+ "log",
+ "wasm-bindgen",
+ "windows-core",
+]
+
+[[package]]
+name = "iana-time-zone-haiku"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "icu_collections"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd"
+dependencies = [
+ "displaydoc",
+ "potential_utf",
+ "utf8_iter",
+ "yoke",
+ "zerofrom",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locale_core"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0"
+dependencies = [
+ "displaydoc",
+ "litemap",
+ "tinystr",
+ "writeable",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_normalizer"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599"
+dependencies = [
+ "icu_collections",
+ "icu_normalizer_data",
+ "icu_properties",
+ "icu_provider",
+ "smallvec",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_normalizer_data"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"
+
+[[package]]
+name = "icu_properties"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f"
+dependencies = [
+ "displaydoc",
+ "icu_collections",
+ "icu_locale_core",
+ "icu_properties_data",
+ "icu_provider",
+ "zerotrie",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_properties_data"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"
+
+[[package]]
+name = "icu_provider"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514"
+dependencies = [
+ "displaydoc",
+ "icu_locale_core",
+ "writeable",
+ "yoke",
+ "zerofrom",
+ "zerotrie",
+ "zerovec",
+]
+
+[[package]]
+name = "idna"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
+dependencies = [
+ "idna_adapter",
+ "smallvec",
+ "utf8_iter",
+]
+
+[[package]]
+name = "idna_adapter"
+version = "1.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
+dependencies = [
+ "icu_normalizer",
+ "icu_properties",
+]
+
+[[package]]
+name = "indexmap"
+version = "2.14.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
+dependencies = [
+ "equivalent",
+ "hashbrown 0.17.1",
+ "serde",
+ "serde_core",
+]
+
+[[package]]
+name = "ipnet"
+version = "2.12.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0"
+
+[[package]]
+name = "itoa"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
+
+[[package]]
+name = "jobserver"
+version = "0.1.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"
+dependencies = [
+ "getrandom 0.4.3",
+ "libc",
+]
+
+[[package]]
+name = "js-sys"
+version = "0.3.107"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a"
+dependencies = [
+ "cfg-if",
+ "futures-util",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "json5"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1"
+dependencies = [
+ "pest",
+ "pest_derive",
+ "serde",
+]
+
+[[package]]
+name = "jsonwebtoken"
+version = "9.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde"
+dependencies = [
+ "base64 0.22.1",
+ "js-sys",
+ "pem",
+ "ring",
+ "serde",
+ "serde_json",
+ "simple_asn1",
+]
+
+[[package]]
+name = "klt-bos"
+version = "0.1.0"
+dependencies = [
+ "account",
+ "anyhow",
+ "async-trait",
+ "axum",
+ "axum-server",
+ "billing",
+ "bos-activation",
+ "bos-api",
+ "bos-core",
+ "bos-invariant",
+ "bos-io",
+ "bos-jobs",
+ "bos-notify",
+ "bos-platform",
+ "bos-scope",
+ "chrono",
+ "config",
+ "ops",
+ "seoh-service-sdk",
+ "serde",
+ "serde_json",
+ "serde_yaml",
+ "sqlx",
+ "tokio",
+ "toml",
+ "tower 0.4.13",
+ "tower-http 0.5.2",
+ "tracing",
+ "tracing-subscriber",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"
+dependencies = [
+ "spin",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.191"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
+
+[[package]]
+name = "libm"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
+
+[[package]]
+name = "libredox"
+version = "0.1.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d"
+dependencies = [
+ "bitflags 2.13.2",
+ "libc",
+ "plain",
+ "redox_syscall 0.9.5",
+]
+
+[[package]]
+name = "libsqlite3-sys"
+version = "0.30.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
+dependencies = [
+ "pkg-config",
+ "vcpkg",
+]
+
+[[package]]
+name = "litemap"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
+
+[[package]]
+name = "lock_api"
+version = "0.4.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
+dependencies = [
+ "scopeguard",
+]
+
+[[package]]
+name = "log"
+version = "0.4.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c"
+
+[[package]]
+name = "lru-slab"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f"
+
+[[package]]
+name = "matchers"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
+dependencies = [
+ "regex-automata",
+]
+
+[[package]]
+name = "matchit"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
+
+[[package]]
+name = "md-5"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
+dependencies = [
+ "cfg-if",
+ "digest",
+]
+
+[[package]]
+name = "memchr"
+version = "2.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
+
+[[package]]
+name = "mime"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+
+[[package]]
+name = "mime_guess"
+version = "2.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"
+dependencies = [
+ "mime",
+ "unicase",
+]
+
+[[package]]
+name = "minimal-lexical"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
+
+[[package]]
+name = "mio"
+version = "1.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee"
+dependencies = [
+ "libc",
+ "wasi",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "multiversion_no_op"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d"
+
+[[package]]
+name = "nom"
+version = "7.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
+dependencies = [
+ "memchr",
+ "minimal-lexical",
+]
+
+[[package]]
+name = "nu-ansi-term"
+version = "0.50.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
+dependencies = [
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "num-bigint"
+version = "0.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367"
+dependencies = [
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-bigint-dig"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7"
+dependencies = [
+ "lazy_static",
+ "libm",
+ "num-integer",
+ "num-iter",
+ "num-traits",
+ "rand 0.8.8",
+ "smallvec",
+ "zeroize",
+]
+
+[[package]]
+name = "num-conv"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"
+
+[[package]]
+name = "num-integer"
+version = "0.1.47"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "num-iter"
+version = "0.1.46"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b"
+dependencies = [
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
+dependencies = [
+ "autocfg",
+ "libm",
+]
+
+[[package]]
+name = "object"
+version = "0.39.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.21.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
+
+[[package]]
+name = "ops"
+version = "0.1.0"
+dependencies = [
+ "bos-core",
+ "serde",
+]
+
+[[package]]
+name = "ordered-multimap"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79"
+dependencies = [
+ "dlv-list",
+ "hashbrown 0.14.5",
+]
+
+[[package]]
+name = "parking"
+version = "2.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
+
+[[package]]
+name = "parking_lot"
+version = "0.12.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall 0.5.18",
+ "smallvec",
+ "windows-link",
+]
+
+[[package]]
+name = "pathdiff"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"
+
+[[package]]
+name = "pem"
+version = "3.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be"
+dependencies = [
+ "base64 0.22.1",
+ "serde_core",
+]
+
+[[package]]
+name = "pem-rfc7468"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
+dependencies = [
+ "base64ct",
+]
+
+[[package]]
+name = "percent-encoding"
+version = "2.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
+
+[[package]]
+name = "pest"
+version = "2.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8db75153506001cb36ed924f08cadc862eb3f8c4d0d534139f29074769d7660"
+dependencies = [
+ "memchr",
+ "pest_stack_guard",
+ "ucd-trie",
+]
+
+[[package]]
+name = "pest_derive"
+version = "2.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20aa17e11fb35664b67d5214a0afac57a360d231b6ec53d6eba0700b27d933b4"
+dependencies = [
+ "pest",
+ "pest_generator",
+]
+
+[[package]]
+name = "pest_generator"
+version = "2.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "626ec5afccf44ccbfeb2b232316510bb55b4bf34d891afcb0fb07d2b17d7fe9d"
+dependencies = [
+ "pest",
+ "pest_meta",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "pest_meta"
+version = "2.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b3f45b6caa65c1b08186832745159c2529994146340a7bf44168095469720f5d"
+dependencies = [
+ "pest",
+]
+
+[[package]]
+name = "pest_stack_guard"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ac6154fd4418b8f0b82532c59c26f303f9ca59a64c883e8ce3971fd82733439"
+dependencies = [
+ "psm",
+ "stacker",
+]
+
+[[package]]
+name = "phf"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7"
+dependencies = [
+ "phf_shared",
+]
+
+[[package]]
+name = "phf_shared"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981"
+dependencies = [
+ "siphasher",
+]
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
+
+[[package]]
+name = "pkcs1"
+version = "0.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f"
+dependencies = [
+ "der",
+ "pkcs8",
+ "spki",
+]
+
+[[package]]
+name = "pkcs8"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
+dependencies = [
+ "der",
+ "spki",
+]
+
+[[package]]
+name = "pkg-config"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
+
+[[package]]
+name = "plain"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
+
+[[package]]
+name = "potential_utf"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"
+dependencies = [
+ "zerovec",
+]
+
+[[package]]
+name = "powerfmt"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
+dependencies = [
+ "zerocopy",
+]
+
+[[package]]
+name = "proc-macro-error"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
+dependencies = [
+ "proc-macro-error-attr",
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro-error-attr"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.107"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "psm"
+version = "0.1.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4dcd034599e63b970727f70d79e02d62390a4a84f7c6b827c27c46d5ac3fa622"
+dependencies = [
+ "ar_archive_writer",
+ "cc",
+]
+
+[[package]]
+name = "quinn"
+version = "0.11.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11"
+dependencies = [
+ "bytes",
+ "cfg_aliases",
+ "pin-project-lite",
+ "quinn-proto",
+ "quinn-udp",
+ "rustc-hash",
+ "rustls 0.23.46",
+ "socket2 0.6.5",
+ "thiserror 2.0.21",
+ "tokio",
+ "tracing",
+ "web-time",
+]
+
+[[package]]
+name = "quinn-proto"
+version = "0.11.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0e750cca55fe4f0439a15d0bb529da9651e79993e8e72c61a899a36d462befbe"
+dependencies = [
+ "bytes",
+ "getrandom 0.4.3",
+ "lru-slab",
+ "rand 0.10.3",
+ "rand_pcg",
+ "ring",
+ "rustc-hash",
+ "rustls 0.23.46",
+ "rustls-pki-types",
+ "slab",
+ "thiserror 2.0.21",
+ "tinyvec",
+ "tracing",
+ "web-time",
+]
+
+[[package]]
+name = "quinn-udp"
+version = "0.5.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016"
+dependencies = [
+ "cfg_aliases",
+ "libc",
+ "once_cell",
+ "socket2 0.6.5",
+ "tracing",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.47"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "r-efi"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
+
+[[package]]
+name = "rand"
+version = "0.8.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core 0.6.4",
+]
+
+[[package]]
+name = "rand"
+version = "0.10.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af"
+dependencies = [
+ "chacha20",
+ "getrandom 0.4.3",
+ "rand_core 0.10.1",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+dependencies = [
+ "ppv-lite86",
+ "rand_core 0.6.4",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+dependencies = [
+ "getrandom 0.2.17",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
+
+[[package]]
+name = "rand_pcg"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a"
+dependencies = [
+ "rand_core 0.10.1",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.5.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
+dependencies = [
+ "bitflags 2.13.2",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "580c875845b41ecb1564ad1ae4703044cef774145e3d7a94dc2b3fa7c97868fd"
+dependencies = [
+ "bitflags 2.13.2",
+]
+
+[[package]]
+name = "regex"
+version = "1.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
+
+[[package]]
+name = "reqwest"
+version = "0.11.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62"
+dependencies = [
+ "base64 0.21.7",
+ "bytes",
+ "encoding_rs",
+ "futures-core",
+ "futures-util",
+ "h2 0.3.27",
+ "http 0.2.12",
+ "http-body 0.4.6",
+ "hyper 0.14.32",
+ "hyper-rustls 0.24.2",
+ "ipnet",
+ "js-sys",
+ "log",
+ "mime",
+ "mime_guess",
+ "once_cell",
+ "percent-encoding",
+ "pin-project-lite",
+ "rustls 0.21.12",
+ "rustls-pemfile 1.0.4",
+ "serde",
+ "serde_json",
+ "serde_urlencoded",
+ "sync_wrapper 0.1.2",
+ "system-configuration",
+ "tokio",
+ "tokio-rustls 0.24.1",
+ "tower-service",
+ "url",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+ "webpki-roots 0.25.4",
+ "winreg",
+]
+
+[[package]]
+name = "reqwest"
+version = "0.12.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
+dependencies = [
+ "base64 0.22.1",
+ "bytes",
+ "futures-core",
+ "http 1.5.0",
+ "http-body 1.1.0",
+ "http-body-util",
+ "hyper 1.12.0",
+ "hyper-rustls 0.27.10",
+ "hyper-util",
+ "js-sys",
+ "log",
+ "percent-encoding",
+ "pin-project-lite",
+ "quinn",
+ "rustls 0.23.46",
+ "rustls-pki-types",
+ "serde",
+ "serde_json",
+ "serde_urlencoded",
+ "sync_wrapper 1.0.2",
+ "tokio",
+ "tokio-rustls 0.26.6",
+ "tower 0.5.3",
+ "tower-http 0.6.11",
+ "tower-service",
+ "url",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+ "webpki-roots 1.0.11",
+]
+
+[[package]]
+name = "ring"
+version = "0.17.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
+dependencies = [
+ "cc",
+ "cfg-if",
+ "getrandom 0.2.17",
+ "libc",
+ "untrusted",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "ron"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94"
+dependencies = [
+ "base64 0.21.7",
+ "bitflags 2.13.2",
+ "serde",
+ "serde_derive",
+]
+
+[[package]]
+name = "rsa"
+version = "0.9.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d"
+dependencies = [
+ "const-oid",
+ "digest",
+ "num-bigint-dig",
+ "num-integer",
+ "num-traits",
+ "pkcs1",
+ "pkcs8",
+ "rand_core 0.6.4",
+ "signature",
+ "spki",
+ "subtle",
+ "zeroize",
+]
+
+[[package]]
+name = "rust-ini"
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3e0698206bcb8882bf2a9ecb4c1e7785db57ff052297085a6efd4fe42302068a"
+dependencies = [
+ "cfg-if",
+ "ordered-multimap",
+]
+
+[[package]]
+name = "rustc-hash"
+version = "2.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
+
+[[package]]
+name = "rustls"
+version = "0.21.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e"
+dependencies = [
+ "log",
+ "ring",
+ "rustls-webpki 0.101.7",
+ "sct",
+]
+
+[[package]]
+name = "rustls"
+version = "0.23.46"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
+dependencies = [
+ "aws-lc-rs",
+ "once_cell",
+ "ring",
+ "rustls-pki-types",
+ "rustls-webpki 0.103.16",
+ "subtle",
+ "zeroize",
+]
+
+[[package]]
+name = "rustls-pemfile"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
+dependencies = [
+ "base64 0.21.7",
+]
+
+[[package]]
+name = "rustls-pemfile"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"
+dependencies = [
+ "rustls-pki-types",
+]
+
+[[package]]
+name = "rustls-pki-types"
+version = "1.15.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
+dependencies = [
+ "web-time",
+ "zeroize",
+]
+
+[[package]]
+name = "rustls-webpki"
+version = "0.101.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765"
+dependencies = [
+ "ring",
+ "untrusted",
+]
+
+[[package]]
+name = "rustls-webpki"
+version = "0.103.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281"
+dependencies = [
+ "aws-lc-rs",
+ "ring",
+ "rustls-pki-types",
+ "untrusted",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
+
+[[package]]
+name = "ryu"
+version = "1.0.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
+
+[[package]]
+name = "ryu-js"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6518fc26bced4d53678a22d6e423e9d8716377def84545fe328236e3af070e7f"
+
+[[package]]
+name = "same-file"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "scopeguard"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+
+[[package]]
+name = "sct"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414"
+dependencies = [
+ "ring",
+ "untrusted",
+]
+
+[[package]]
+name = "seoh-service-sdk"
+version = "1.2.0"
+dependencies = [
+ "async-trait",
+ "axum",
+ "base62",
+ "base64 0.21.7",
+ "chrono",
+ "config",
+ "hmac",
+ "http 1.5.0",
+ "jsonwebtoken",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "reqwest 0.11.27",
+ "rustls 0.23.46",
+ "seoh-service-sdk-macros",
+ "seoh-ume-common",
+ "serde",
+ "serde_jcs",
+ "serde_json",
+ "serde_yaml",
+ "sha2",
+ "syn 2.0.119",
+ "thiserror 1.0.69",
+ "tokio",
+ "toml",
+ "tracing",
+ "tracing-subscriber",
+ "urlencoding",
+ "utoipa",
+ "uuid",
+ "walkdir",
+]
+
+[[package]]
+name = "seoh-service-sdk-macros"
+version = "1.1.0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "seoh-ume-common"
+version = "0.1.0"
+
+[[package]]
+name = "serde"
+version = "1.0.229"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
+dependencies = [
+ "serde_core",
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_core"
+version = "1.0.229"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.229"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "serde_jcs"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cacecf649bc1a7c5f0e299cc813977c6a78116abda2b93b1ee01735b71ead9a8"
+dependencies = [
+ "ryu-js",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.154"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
+dependencies = [
+ "itoa",
+ "memchr",
+ "serde",
+ "serde_core",
+ "zmij",
+]
+
+[[package]]
+name = "serde_path_to_error"
+version = "0.1.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457"
+dependencies = [
+ "itoa",
+ "serde",
+ "serde_core",
+]
+
+[[package]]
+name = "serde_spanned"
+version = "0.6.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "serde_urlencoded"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
+dependencies = [
+ "form_urlencoded",
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "serde_yaml"
+version = "0.9.34+deprecated"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
+dependencies = [
+ "indexmap",
+ "itoa",
+ "ryu",
+ "serde",
+ "unsafe-libyaml",
+]
+
+[[package]]
+name = "sha1"
+version = "0.10.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
+dependencies = [
+ "cfg-if",
+ "cpufeatures 0.2.17",
+ "digest",
+]
+
+[[package]]
+name = "sha2"
+version = "0.10.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
+dependencies = [
+ "cfg-if",
+ "cpufeatures 0.2.17",
+ "digest",
+]
+
+[[package]]
+name = "sharded-slab"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
+dependencies = [
+ "lazy_static",
+]
+
+[[package]]
+name = "shlex"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
+
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
+dependencies = [
+ "errno",
+ "libc",
+]
+
+[[package]]
+name = "signature"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
+dependencies = [
+ "digest",
+ "rand_core 0.6.4",
+]
+
+[[package]]
+name = "simdutf8"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
+
+[[package]]
+name = "simple_asn1"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d585997b0ac10be3c5ee635f1bab02d512760d14b7c468801ac8a01d9ae5f1d"
+dependencies = [
+ "num-bigint",
+ "num-traits",
+ "thiserror 2.0.21",
+ "time",
+]
+
+[[package]]
+name = "siphasher"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"
+
+[[package]]
+name = "slab"
+version = "0.4.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
+
+[[package]]
+name = "smallvec"
+version = "1.16.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "socket2"
+version = "0.5.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "socket2"
+version = "0.6.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
+dependencies = [
+ "libc",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "spin"
+version = "0.9.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e"
+dependencies = [
+ "lock_api",
+]
+
+[[package]]
+name = "spki"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
+dependencies = [
+ "base64ct",
+ "der",
+]
+
+[[package]]
+name = "sqlx"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc"
+dependencies = [
+ "sqlx-core",
+ "sqlx-macros",
+ "sqlx-mysql",
+ "sqlx-postgres",
+ "sqlx-sqlite",
+]
+
+[[package]]
+name = "sqlx-core"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6"
+dependencies = [
+ "base64 0.22.1",
+ "bytes",
+ "chrono",
+ "crc",
+ "crossbeam-queue",
+ "either",
+ "event-listener",
+ "futures-core",
+ "futures-intrusive",
+ "futures-io",
+ "futures-util",
+ "hashbrown 0.15.5",
+ "hashlink 0.10.0",
+ "indexmap",
+ "log",
+ "memchr",
+ "once_cell",
+ "percent-encoding",
+ "serde",
+ "serde_json",
+ "sha2",
+ "smallvec",
+ "thiserror 2.0.21",
+ "tokio",
+ "tokio-stream",
+ "tracing",
+ "url",
+ "uuid",
+]
+
+[[package]]
+name = "sqlx-macros"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "sqlx-core",
+ "sqlx-macros-core",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "sqlx-macros-core"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b"
+dependencies = [
+ "dotenvy",
+ "either",
+ "heck",
+ "hex",
+ "once_cell",
+ "proc-macro2",
+ "quote",
+ "serde",
+ "serde_json",
+ "sha2",
+ "sqlx-core",
+ "sqlx-mysql",
+ "sqlx-postgres",
+ "sqlx-sqlite",
+ "syn 2.0.119",
+ "tokio",
+ "url",
+]
+
+[[package]]
+name = "sqlx-mysql"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526"
+dependencies = [
+ "atoi",
+ "base64 0.22.1",
+ "bitflags 2.13.2",
+ "byteorder",
+ "bytes",
+ "chrono",
+ "crc",
+ "digest",
+ "dotenvy",
+ "either",
+ "futures-channel",
+ "futures-core",
+ "futures-io",
+ "futures-util",
+ "generic-array",
+ "hex",
+ "hkdf",
+ "hmac",
+ "itoa",
+ "log",
+ "md-5",
+ "memchr",
+ "once_cell",
+ "percent-encoding",
+ "rand 0.8.8",
+ "rsa",
+ "serde",
+ "sha1",
+ "sha2",
+ "smallvec",
+ "sqlx-core",
+ "stringprep",
+ "thiserror 2.0.21",
+ "tracing",
+ "uuid",
+ "whoami",
+]
+
+[[package]]
+name = "sqlx-postgres"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46"
+dependencies = [
+ "atoi",
+ "base64 0.22.1",
+ "bitflags 2.13.2",
+ "byteorder",
+ "chrono",
+ "crc",
+ "dotenvy",
+ "etcetera",
+ "futures-channel",
+ "futures-core",
+ "futures-util",
+ "hex",
+ "hkdf",
+ "hmac",
+ "home",
+ "itoa",
+ "log",
+ "md-5",
+ "memchr",
+ "once_cell",
+ "rand 0.8.8",
+ "serde",
+ "serde_json",
+ "sha2",
+ "smallvec",
+ "sqlx-core",
+ "stringprep",
+ "thiserror 2.0.21",
+ "tracing",
+ "uuid",
+ "whoami",
+]
+
+[[package]]
+name = "sqlx-sqlite"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea"
+dependencies = [
+ "atoi",
+ "chrono",
+ "flume",
+ "futures-channel",
+ "futures-core",
+ "futures-executor",
+ "futures-intrusive",
+ "futures-util",
+ "libsqlite3-sys",
+ "log",
+ "percent-encoding",
+ "serde",
+ "serde_urlencoded",
+ "sqlx-core",
+ "thiserror 2.0.21",
+ "tracing",
+ "url",
+ "uuid",
+]
+
+[[package]]
+name = "stable_deref_trait"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
+
+[[package]]
+name = "stacker"
+version = "0.1.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "707f49d46706bacf8a2b00d51dace3f9de527c13eec3778f570c411f89e69967"
+dependencies = [
+ "cc",
+ "cfg-if",
+ "libc",
+ "psm",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "stringprep"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1"
+dependencies = [
+ "unicode-bidi",
+ "unicode-normalization",
+ "unicode-properties",
+]
+
+[[package]]
+name = "subtle"
+version = "2.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
+
+[[package]]
+name = "syn"
+version = "1.0.109"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+dependencies = [
+ "proc-macro2",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.119"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "3.0.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "sync_wrapper"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
+
+[[package]]
+name = "sync_wrapper"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
+dependencies = [
+ "futures-core",
+]
+
+[[package]]
+name = "synstructure"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "system-configuration"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7"
+dependencies = [
+ "bitflags 1.3.2",
+ "core-foundation",
+ "system-configuration-sys",
+]
+
+[[package]]
+name = "system-configuration-sys"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "thiserror"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
+dependencies = [
+ "thiserror-impl 1.0.69",
+]
+
+[[package]]
+name = "thiserror"
+version = "2.0.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
+dependencies = [
+ "thiserror-impl 2.0.21",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "2.0.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "thread_local"
+version = "1.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "time"
+version = "0.3.55"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"
+dependencies = [
+ "deranged",
+ "num-conv",
+ "powerfmt",
+ "serde_core",
+ "time-core",
+ "time-macros",
+]
+
+[[package]]
+name = "time-core"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
+
+[[package]]
+name = "time-macros"
+version = "0.2.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85"
+dependencies = [
+ "num-conv",
+ "time-core",
+]
+
+[[package]]
+name = "tiny-keccak"
+version = "2.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237"
+dependencies = [
+ "crunchy",
+]
+
+[[package]]
+name = "tinystr"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"
+dependencies = [
+ "displaydoc",
+ "zerovec",
+]
+
+[[package]]
+name = "tinyvec"
+version = "1.13.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"
+
+[[package]]
+name = "tokio"
+version = "1.54.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"
+dependencies = [
+ "bytes",
+ "libc",
+ "mio",
+ "parking_lot",
+ "pin-project-lite",
+ "signal-hook-registry",
+ "socket2 0.6.5",
+ "tokio-macros",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "tokio-macros"
+version = "2.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "tokio-rustls"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
+dependencies = [
+ "rustls 0.21.12",
+ "tokio",
+]
+
+[[package]]
+name = "tokio-rustls"
+version = "0.26.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db"
+dependencies = [
+ "rustls 0.23.46",
+ "tokio",
+]
+
+[[package]]
+name = "tokio-stream"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a3d06f0b082ba57c26b79407372e57cf2a1e28124f78e9479fe80322cf53420b"
+dependencies = [
+ "futures-core",
+ "pin-project-lite",
+ "tokio",
+]
+
+[[package]]
+name = "tokio-util"
+version = "0.7.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "futures-sink",
+ "libc",
+ "pin-project-lite",
+ "tokio",
+]
+
+[[package]]
+name = "toml"
+version = "0.8.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
+dependencies = [
+ "serde",
+ "serde_spanned",
+ "toml_datetime",
+ "toml_edit",
+]
+
+[[package]]
+name = "toml_datetime"
+version = "0.6.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "toml_edit"
+version = "0.22.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
+dependencies = [
+ "indexmap",
+ "serde",
+ "serde_spanned",
+ "toml_datetime",
+ "toml_write",
+ "winnow",
+]
+
+[[package]]
+name = "toml_write"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
+
+[[package]]
+name = "tower"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
+dependencies = [
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "tower"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
+dependencies = [
+ "futures-core",
+ "futures-util",
+ "pin-project-lite",
+ "sync_wrapper 1.0.2",
+ "tokio",
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "tower-http"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5"
+dependencies = [
+ "bitflags 2.13.2",
+ "bytes",
+ "http 1.5.0",
+ "http-body 1.1.0",
+ "http-body-util",
+ "pin-project-lite",
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "tower-http"
+version = "0.6.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840"
+dependencies = [
+ "bitflags 2.13.2",
+ "bytes",
+ "futures-util",
+ "http 1.5.0",
+ "http-body 1.1.0",
+ "pin-project-lite",
+ "tower 0.5.3",
+ "tower-layer",
+ "tower-service",
+ "url",
+]
+
+[[package]]
+name = "tower-layer"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
+
+[[package]]
+name = "tower-service"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
+
+[[package]]
+name = "tracing"
+version = "0.1.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
+dependencies = [
+ "log",
+ "pin-project-lite",
+ "tracing-attributes",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-attributes"
+version = "0.1.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.36"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
+dependencies = [
+ "once_cell",
+ "valuable",
+]
+
+[[package]]
+name = "tracing-log"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
+dependencies = [
+ "log",
+ "once_cell",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-subscriber"
+version = "0.3.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319"
+dependencies = [
+ "matchers",
+ "nu-ansi-term",
+ "once_cell",
+ "regex-automata",
+ "sharded-slab",
+ "smallvec",
+ "thread_local",
+ "tracing",
+ "tracing-core",
+ "tracing-log",
+]
+
+[[package]]
+name = "try-lock"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+
+[[package]]
+name = "typenum"
+version = "1.20.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
+
+[[package]]
+name = "ucd-trie"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
+
+[[package]]
+name = "unicase"
+version = "2.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f"
+
+[[package]]
+name = "unicode-bidi"
+version = "0.3.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
+
+[[package]]
+name = "unicode-normalization"
+version = "0.1.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75cd3fb03d5288b3ba9a1ee103ac7e9cbb59f0b03d64f8ddfcc04dd42758a85d"
+dependencies = [
+ "tinyvec",
+]
+
+[[package]]
+name = "unicode-properties"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833"
+
+[[package]]
+name = "unicode-segmentation"
+version = "1.13.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
+
+[[package]]
+name = "unsafe-libyaml"
+version = "0.2.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
+
+[[package]]
+name = "untrusted"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
+
+[[package]]
+name = "url"
+version = "2.5.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
+dependencies = [
+ "form_urlencoded",
+ "idna",
+ "percent-encoding",
+ "serde",
+]
+
+[[package]]
+name = "urlencoding"
+version = "2.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
+
+[[package]]
+name = "utf8_iter"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0"
+dependencies = [
+ "utf_types",
+]
+
+[[package]]
+name = "utf_types"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6"
+
+[[package]]
+name = "utoipa"
+version = "4.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c5afb1a60e207dca502682537fefcfd9921e71d0b83e9576060f09abc6efab23"
+dependencies = [
+ "indexmap",
+ "serde",
+ "serde_json",
+ "serde_yaml",
+ "utoipa-gen",
+]
+
+[[package]]
+name = "utoipa-gen"
+version = "4.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20c24e8ab68ff9ee746aad22d39b5535601e6416d1b0feeabf78be986a5c4392"
+dependencies = [
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "uuid"
+version = "1.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514"
+dependencies = [
+ "getrandom 0.4.3",
+ "js-sys",
+ "serde_core",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "valuable"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
+
+[[package]]
+name = "vcpkg"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+
+[[package]]
+name = "version_check"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
+
+[[package]]
+name = "walkdir"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
+dependencies = [
+ "same-file",
+ "winapi-util",
+]
+
+[[package]]
+name = "want"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b"
+dependencies = [
+ "try-lock",
+]
+
+[[package]]
+name = "wasi"
+version = "0.11.1+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
+
+[[package]]
+name = "wasite"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.130"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c"
+dependencies = [
+ "cfg-if",
+ "rustversion",
+ "wasm-bindgen-macro",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-futures"
+version = "0.4.80"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5e14e0327cb5368ad60ccb22d04a9827a693c95a926d8d125e9fa39e0baec501"
+dependencies = [
+ "js-sys",
+ "tokio",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.130"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.130"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a"
+dependencies = [
+ "bumpalo",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.130"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "web-sys"
+version = "0.3.107"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d7d179596ff5ec0f6de4db64d54011bde6289cc49603d3a6e4ce3f329207ab88"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "web-time"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "webpki-roots"
+version = "0.25.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1"
+
+[[package]]
+name = "webpki-roots"
+version = "1.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f5f280bbb2b287bc8e7de7e3852945a0ff50d1bbcb5ed42b6c7a568c546df171"
+dependencies = [
+ "rustls-pki-types",
+]
+
+[[package]]
+name = "whoami"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d"
+dependencies = [
+ "libredox",
+ "wasite",
+]
+
+[[package]]
+name = "winapi-util"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
+dependencies = [
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "windows-core"
+version = "0.62.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
+dependencies = [
+ "windows-implement",
+ "windows-interface",
+ "windows-link",
+ "windows-result",
+ "windows-strings",
+]
+
+[[package]]
+name = "windows-implement"
+version = "0.60.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "windows-interface"
+version = "0.59.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "windows-link"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
+
+[[package]]
+name = "windows-result"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows-strings"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
+dependencies = [
+ "windows-targets 0.48.5",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.61.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
+dependencies = [
+ "windows_aarch64_gnullvm 0.48.5",
+ "windows_aarch64_msvc 0.48.5",
+ "windows_i686_gnu 0.48.5",
+ "windows_i686_msvc 0.48.5",
+ "windows_x86_64_gnu 0.48.5",
+ "windows_x86_64_gnullvm 0.48.5",
+ "windows_x86_64_msvc 0.48.5",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
+dependencies = [
+ "windows_aarch64_gnullvm 0.52.6",
+ "windows_aarch64_msvc 0.52.6",
+ "windows_i686_gnu 0.52.6",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc 0.52.6",
+ "windows_x86_64_gnu 0.52.6",
+ "windows_x86_64_gnullvm 0.52.6",
+ "windows_x86_64_msvc 0.52.6",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
+
+[[package]]
+name = "winnow"
+version = "0.7.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "winreg"
+version = "0.50.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
+dependencies = [
+ "cfg-if",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
+name = "writeable"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
+
+[[package]]
+name = "yaml-rust2"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8902160c4e6f2fb145dbe9d6760a75e3c9522d8bf796ed7047c85919ac7115f8"
+dependencies = [
+ "arraydeque",
+ "encoding_rs",
+ "hashlink 0.8.4",
+]
+
+[[package]]
+name = "yoke"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3"
+dependencies = [
+ "stable_deref_trait",
+ "yoke-derive",
+ "zerofrom",
+]
+
+[[package]]
+name = "yoke-derive"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+ "synstructure",
+]
+
+[[package]]
+name = "zerocopy"
+version = "0.8.63"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8"
+dependencies = [
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.8.63"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "zerofrom"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
+dependencies = [
+ "zerofrom-derive",
+]
+
+[[package]]
+name = "zerofrom-derive"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+ "synstructure",
+]
+
+[[package]]
+name = "zeroize"
+version = "1.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879"
+
+[[package]]
+name = "zerotrie"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
+dependencies = [
+ "displaydoc",
+ "yoke",
+ "zerofrom",
+]
+
+[[package]]
+name = "zerovec"
+version = "0.11.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"
+dependencies = [
+ "yoke",
+ "zerofrom",
+ "zerovec-derive",
+]
+
+[[package]]
+name = "zerovec-derive"
+version = "0.11.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "zmij"
+version = "1.0.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"

+ 65 - 0
src/Cargo.toml

@@ -0,0 +1,65 @@
+[workspace]
+resolver = "2"
+members = [
+  "crates/bos-core",
+  "crates/bos-platform",
+  "crates/bos-api",
+  "crates/bos-scope",
+  "crates/bos-invariant",
+  "crates/bos-activation",
+  "crates/bos-io",
+  "crates/bos-jobs",
+  "crates/bos-notify",
+  "modules/account",
+  "modules/ops",
+  "modules/billing",
+  "bin/klt-bos",
+]
+default-members = ["bin/klt-bos"]
+
+[workspace.package]
+version = "0.1.0"
+edition = "2021"
+authors = ["恪澜通 · 运营支撑"]
+license = "UNLICENSED"
+
+[workspace.dependencies]
+axum = "0.7"
+tower = "0.4"
+tower-http = { version = "0.5", features = ["trace", "cors"] }
+axum-server = { version = "0.7", features = ["tls-rustls"] }
+seoh-service-sdk = { path = "../../../../产品/seoh/seoh-service-sdk/rust", features = ["auth", "internal-token-verify"] }
+serde = { version = "1.0", features = ["derive"] }
+serde_json = "1.0"
+serde_yaml = "0.9"
+config = "0.14"
+toml = "0.8"
+tracing = "0.1"
+tracing-subscriber = { version = "0.3", features = ["env-filter"] }
+tokio = { version = "1", features = ["full"] }
+sqlx = { version = "0.8", features = ["runtime-tokio", "postgres", "chrono", "migrate", "uuid"] }
+chrono = { version = "0.4", features = ["serde"] }
+chrono-tz = "0.10"
+uuid = { version = "1.0", features = ["v4", "serde"] }
+thiserror = "1.0"
+anyhow = "1.0"
+async-trait = "0.1"
+bytes = "1"
+hmac = "0.12"
+sha2 = "0.10"
+hex = "0.4"
+base64 = "0.22"
+rand = "0.8"
+reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
+bos-core = { path = "crates/bos-core" }
+bos-platform = { path = "crates/bos-platform" }
+bos-api = { path = "crates/bos-api" }
+bos-scope = { path = "crates/bos-scope" }
+bos-invariant = { path = "crates/bos-invariant" }
+bos-activation = { path = "crates/bos-activation" }
+bos-io = { path = "crates/bos-io" }
+bos-jobs = { path = "crates/bos-jobs" }
+bos-notify = { path = "crates/bos-notify" }
+account = { path = "modules/account" }
+ops = { path = "modules/ops" }
+billing = { path = "modules/billing" }

+ 17 - 0
src/Dockerfile

@@ -0,0 +1,17 @@
+# klt-bos 扩展微服务(与 SEOH 栈同一 compose bridge 网络)
+FROM rust:1.83-bookworm AS builder
+WORKDIR /build
+COPY . /build/klt-bos
+# 构建期需能解析 path 依赖 seoh-service-sdk;部署流水线应把 SDK 挂到相对路径或改用 git/vendor
+WORKDIR /build/klt-bos
+RUN cargo build --release -p klt-bos
+
+FROM debian:bookworm-slim
+RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
+COPY --from=builder /build/klt-bos/target/release/klt-bos /usr/local/bin/klt-bos
+WORKDIR /app
+COPY config /app/config
+COPY openapi.yaml /app/openapi.yaml
+ENV RUST_LOG=info
+EXPOSE 8088
+CMD ["klt-bos"]

+ 20 - 0
src/README.md

@@ -0,0 +1,20 @@
+# klt-bos 服务源码
+
+SEOH 扩展微服务(Rust / Axum / seoh-service-sdk)。文档与原型仍在仓库根目录 `docs/`、`prototype/`。
+
+## 构建
+
+```bash
+cd src
+export KLT_BOS_DATABASE_URL='postgres://...'
+cargo run -p klt-bos
+```
+
+经网关对外前缀:`/api/klt/bos/{resource}/{action}@v1`(服务内路径无 namespace 前缀)。
+
+## 结构断言
+
+```bash
+bash scripts/assert_structure.sh
+cargo test -p bos-invariant -p bos-activation
+```

+ 43 - 0
src/bin/klt-bos/Cargo.toml

@@ -0,0 +1,43 @@
+[package]
+name = "klt-bos"
+version = { workspace = true }
+edition = { workspace = true }
+
+[[bin]]
+name = "klt-bos"
+path = "src/main.rs"
+
+[dependencies]
+bos-core = { workspace = true }
+bos-platform = { workspace = true }
+bos-api = { workspace = true }
+bos-scope = { workspace = true }
+bos-invariant = { workspace = true }
+bos-activation = { workspace = true }
+bos-io = { workspace = true }
+bos-jobs = { workspace = true }
+bos-notify = { workspace = true }
+account = { workspace = true }
+ops = { workspace = true }
+billing = { workspace = true }
+seoh-service-sdk = { workspace = true }
+axum = { workspace = true }
+tower = { workspace = true }
+tower-http = { workspace = true }
+axum-server = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+serde_yaml = { workspace = true }
+config = { workspace = true }
+toml = { workspace = true }
+tracing = { workspace = true }
+tracing-subscriber = { workspace = true }
+tokio = { workspace = true }
+sqlx = { workspace = true }
+chrono = { workspace = true }
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+
+[features]
+default = ["tls"]
+tls = []

+ 3777 - 0
src/bin/klt-bos/openapi.yaml

@@ -0,0 +1,3777 @@
+openapi: 3.0.0
+info:
+  title: klt-bos
+  version: 0.1.0
+  description: |
+    恪澜通运营支撑扩展微服务(klt-bos)。
+    统一请求信封:`{ "data": { … } }`;统一响应信封:`{ code, message, error_code?, data }`。
+    业务错误码段 20000–20999。
+    经网关对外前缀:`/api/klt/bos/{resource}/{action}@v1`(本文件路径不含 namespace 前缀)。
+    分页约定:请求页码 0 基;呈现时再转为 1 基。
+  x-error-code-range:
+    start: 20000
+    end: 20999
+servers:
+- url: /
+paths:
+  /health:
+    get:
+      summary: 健康检查
+      description: 服务存活探测,无需登录。
+      x-require-auth: false
+      x-resource-type: bos.health
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /health@v1:
+    get:
+      summary: 健康检查(v1)
+      description: 服务存活探测,无需登录。
+      x-require-auth: false
+      x-resource-type: bos.health
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ping@v1:
+    get:
+      summary: 存活探测
+      description: 需登录的轻量探测,返回服务状态与绑定信息。
+      x-require-auth: true
+      x-resource-type: bos.ping
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /auth/context@v1:
+    get:
+      summary: 当前登录上下文
+      description: 返回当前登录身份、业务角色、主体类型/ID、可见形态等;首次业务请求在此完成未激活/已过期拦截。
+      x-require-auth: true
+      x-resource-type: bos.auth
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/create@v1:
+    post:
+      summary: 新建区域节点
+      description: 在区域树下新建省/市/区县节点。admin 任意层级;区域运营主/子账号仅限本团队负责范围内已有省份下建市/区县。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 新建区域参数
+                  properties:
+                    parent_node_id:
+                      type: string
+                      description: 父节点 ID;根下建省时可空
+                    node_name:
+                      type: string
+                      description: 本级区域名称
+                    level:
+                      type: string
+                      description: 层级提示(省/市/区县等,业务侧自持,可选)
+                  required:
+                  - node_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/rename@v1:
+    post:
+      summary: 重命名区域节点
+      description: 仅修改节点名称 node_name,不改层级与父子关系。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    node_id:
+                      type: string
+                      description: 区域节点 ID
+                    node_name:
+                      type: string
+                      description: 新名称
+                  required:
+                  - node_id
+                  - node_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/delete@v1:
+    post:
+      summary: 删除区域节点
+      description: 仅 admin。须提交 confirm_name(与当前区域名逐字一致)并通过三重守卫(无下级/无挂载客户/无引用)。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    node_id:
+                      type: string
+                      description: 待删除区域节点 ID
+                    confirm_name:
+                      type: string
+                      description: 确认名称,须与当前区域名逐字一致
+                  required:
+                  - node_id
+                  - confirm_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/tree@v1:
+    get:
+      summary: 查询可见区域树
+      description: 按操作人可见范围返回区域节点集合/树;运营主/子账号只见本范围及下级。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/subtree@v1:
+    post:
+      summary: 查询区域子树
+      description: 挂载弹窗左树、区域钻取共用;按可见范围裁剪。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 子树查询参数
+                  properties:
+                    node_id:
+                      type: string
+                      description: 根节点 ID(可选;空则按可见根展开)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/change_log@v1:
+    get:
+      summary: 区域变更流水
+      description: 仅 admin 可见;运营子账号可见节点但不可见变更流水。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/orphans@v1:
+    get:
+      summary: 悬空区域节点
+      description: 查询悬空/孤儿节点;按节点所在区域分派可见性,admin 全量。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/provision@v1:
+    post:
+      summary: 开通账号
+      description: 四入口共用开通管线。唯一性守卫(登录名/手机号)先于平台调用;角色与主体须一致。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    username:
+                      type: string
+                      description: 登录名(归一化后全站唯一)
+                    role_code:
+                      type: string
+                      description: 业务角色码
+                    subject_type:
+                      type: string
+                      description: 主体类型(operator/partner/ent_team/ops_team/customer 等)
+                    subject_id:
+                      type: string
+                      description: 主体 ID
+                    mobile:
+                      type: string
+                      description: 手机号(可选,唯一)
+                  required:
+                  - username
+                  - role_code
+                  - subject_type
+                  - subject_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/update_status@v1:
+    post:
+      summary: 停用或恢复账号
+      description: 停用/恢复账号状态;不可操作当前登录账号。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    user_id:
+                      type: string
+                      description: 目标用户 ID
+                    status:
+                      type: string
+                      description: 目标状态(如 disabled/active)
+                  required:
+                  - user_id
+                  - status
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/reset_code@v1:
+    post:
+      summary: 重置激活码
+      description: 仅未激活账号可重置;已激活拒绝。新码仅当次返回。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    user_id:
+                      type: string
+                      description: 目标用户 ID
+                  required:
+                  - user_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/export_codes@v1:
+    post:
+      summary: 导出激活码
+      description: 导出未设密账号激活码明文。必传收窄后的 user_ids,以及与令牌一致的 scope_type/scope_id;validity=expired/all 为写操作(先作废再换新码)。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: export
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    user_ids:
+                      type: array
+                      description: 按本人可见范围收窄后的用户 ID 列表(禁止空列表全量)
+                      items:
+                        type: string
+                        description: 用户 ID
+                    scope_type:
+                      type: string
+                      description: 作用域类型,须与所用令牌一致
+                    scope_id:
+                      type: string
+                      description: 作用域 ID,须与所用令牌一致
+                    validity:
+                      type: string
+                      description: 导出口径:active=仍有效;expired=已过期(写);all=全部(写)
+                      enum:
+                      - active
+                      - expired
+                      - all
+                  required:
+                  - user_ids
+                  - scope_type
+                  - scope_id
+                  - validity
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/change_password@v1:
+    post:
+      summary: 自助修改密码
+      description: 已登录用户修改本人密码;新旧相同不保存。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    old_password:
+                      type: string
+                      description: 原密码
+                    new_password:
+                      type: string
+                      description: 新密码
+                  required:
+                  - old_password
+                  - new_password
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /activation/verify@v1:
+    post:
+      summary: 激活并设置密码
+      description: 免登录豁免接口。校验激活码后设置新密码;按来源 IP+码窗口限流,不设失败计数锁死。
+      x-require-auth: false
+      x-resource-type: bos.activation
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    code:
+                      type: string
+                      description: 激活码
+                    new_password:
+                      type: string
+                      description: 新密码(建议不少于 8 位)
+                      minLength: 8
+                  required:
+                  - code
+                  - new_password
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/create@v1:
+    post:
+      summary: 新建运营商
+      description: 运营商建档。所属区域必须是省级节点;同省份×品牌唯一;可写结算口径。
+      x-require-auth: true
+      x-resource-type: bos.operator
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    name:
+                      type: string
+                      description: 运营商名称
+                    brand:
+                      type: string
+                      description: 品牌:移动/联通/电信
+                    region_node_id:
+                      type: string
+                      description: 建档区域节点 ID(必须省级)
+                    is_province_node:
+                      type: boolean
+                      description: 是否省级节点标记(服务端校验用,可选)
+                    settle_mode:
+                      type: string
+                      description: 结算方式:ratio=比例;amount=固定金额;per_account=每账号
+                      enum:
+                      - ratio
+                      - amount
+                      - per_account
+                    settle_value:
+                      type: number
+                      description: 结算值:比例时 0<x≤100;金额/每账号时为分且 >0
+                  required:
+                  - name
+                  - brand
+                  - region_node_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/update@v1:
+    post:
+      summary: 编辑运营商
+      description: 编辑运营商档案;改品牌/省份不得绕过省份×品牌唯一与省级节点校验。
+      x-require-auth: true
+      x-resource-type: bos.operator
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                    name:
+                      type: string
+                      description: 运营商名称
+                    brand:
+                      type: string
+                      description: 品牌:移动/联通/电信
+                    region_node_id:
+                      type: string
+                      description: 建档区域节点 ID(必须省级)
+                    is_province_node:
+                      type: boolean
+                      description: 是否省级节点标记(可选)
+                    settle_mode:
+                      type: string
+                      description: 结算方式:ratio/amount/per_account
+                    settle_value:
+                      type: number
+                      description: 结算值
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - operator_id
+                  - name
+                  - brand
+                  - region_node_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/delete@v1:
+    post:
+      summary: 删除运营商
+      description: 删除前六项检查并级联注销对账账号。
+      x-require-auth: true
+      x-resource-type: bos.operator
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                  required:
+                  - operator_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/get_list@v1:
+    post:
+      summary: 运营商列表
+      description: 卡片口径:建档区域或下挂客户落在本可见范围。
+      x-require-auth: true
+      x-resource-type: bos.operator
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    brand:
+                      type: string
+                      description: 品牌筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/recon_account/create@v1:
+    post:
+      summary: 创建对账账号
+      description: 一家运营商至多一个对账账号;初始密码仅当次显示。
+      x-require-auth: true
+      x-resource-type: bos.operator.recon_account
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                    username:
+                      type: string
+                      description: 对账账号登录名
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                  required:
+                  - operator_id
+                  - username
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/recon_account/get@v1:
+    post:
+      summary: 查询对账账号
+      description: 只回状态提示(如「未发送,线下告知本人」),不回密码。
+      x-require-auth: true
+      x-resource-type: bos.operator.recon_account
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                  required:
+                  - operator_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/create@v1:
+    post:
+      summary: 新建合伙人
+      description: 合伙人建档并同步开通账号;名称全站唯一;结算字段仅 admin 可写。
+      x-require-auth: true
+      x-resource-type: bos.partner
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    name:
+                      type: string
+                      description: 合伙人名称(全站唯一)
+                    duty_desc:
+                      type: string
+                      description: 职务说明(可选)
+                    region_node_id:
+                      type: string
+                      description: 建档区域节点 ID
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                    username:
+                      type: string
+                      description: 登录名(开通账号用)
+                    settle_mode:
+                      type: string
+                      description: 结算方式(仅 admin 可写,可选)
+                    settle_value:
+                      type: number
+                      description: 结算值(仅 admin 可写,可选)
+                  required:
+                  - name
+                  - region_node_id
+                  - username
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/update@v1:
+    post:
+      summary: 编辑合伙人
+      description: 编辑合伙人资料;登录名不可改。
+      x-require-auth: true
+      x-resource-type: bos.partner
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    partner_id:
+                      type: string
+                      description: 合伙人 ID
+                    name:
+                      type: string
+                      description: 合伙人名称(全站唯一)
+                    duty_desc:
+                      type: string
+                      description: 职务说明(可选)
+                    region_node_id:
+                      type: string
+                      description: 建档区域节点 ID
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                    settle_mode:
+                      type: string
+                      description: 结算方式(仅 admin 可写,可选)
+                    settle_value:
+                      type: number
+                      description: 结算值(仅 admin 可写,可选)
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - partner_id
+                  - name
+                  - region_node_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/delete@v1:
+    post:
+      summary: 删除合伙人
+      description: 删除合伙人档案及相关授权。
+      x-require-auth: true
+      x-resource-type: bos.partner
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    partner_id:
+                      type: string
+                      description: 合伙人 ID
+                  required:
+                  - partner_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/get_list@v1:
+    post:
+      summary: 合伙人列表
+      description: 卡片口径:建档区域落在本范围(含下级)。
+      x-require-auth: true
+      x-resource-type: bos.partner
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/scope/get@v1:
+    get:
+      summary: 读取合伙人负责范围
+      description: 返回该合伙人的 region/customer 两类 scope_grant。
+      x-require-auth: true
+      x-resource-type: bos.partner.scope
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/scope/save@v1:
+    post:
+      summary: 保存合伙人负责范围
+      description: 写入 scope_grant(holder_type=partner);允许保存为空;保存即 bump epoch。
+      x-require-auth: true
+      x-resource-type: bos.partner.scope
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    partner_id:
+                      type: string
+                      description: 合伙人 ID
+                    region_node_ids:
+                      type: array
+                      description: 负责区域节点 ID 列表(可空)
+                      items:
+                        type: string
+                        description: 区域节点 ID
+                    customer_ids:
+                      type: array
+                      description: 负责客户 ID 列表(可空)
+                      items:
+                        type: string
+                        description: 客户 ID
+                  required:
+                  - partner_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/create@v1:
+    post:
+      summary: 新建运营团队
+      description: 仅 admin。新建运营团队,负责范围初始为空。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_name:
+                      type: string
+                      description: 团队名称
+                    primary_username:
+                      type: string
+                      description: 主账号登录名(可选)
+                    primary_mobile:
+                      type: string
+                      description: 主账号手机号(可选)
+                  required:
+                  - team_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/update@v1:
+    post:
+      summary: 编辑运营团队
+      description: 仅 admin。编辑团队资料。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    team_name:
+                      type: string
+                      description: 团队名称
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - team_id
+                  - team_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/delete@v1:
+    post:
+      summary: 删除运营团队
+      description: 仅 admin。内置「总部·不限区域」团队不可删。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                  required:
+                  - team_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/member_add@v1:
+    post:
+      summary: 添加运营团队成员
+      description: 每团队有且仅有一个主账号;不可删除当前登录账号。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    username:
+                      type: string
+                      description: 成员登录名
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                    is_primary:
+                      type: boolean
+                      description: 是否设为主账号(可选)
+                  required:
+                  - team_id
+                  - username
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/member_remove@v1:
+    post:
+      summary: 移除运营团队成员
+      description: 内置主账号不可删不可转交;不可删除当前登录账号。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    user_id:
+                      type: string
+                      description: 成员用户 ID
+                  required:
+                  - team_id
+                  - user_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/transfer_primary@v1:
+    post:
+      summary: 转交运营团队主账号
+      description: 仅 admin。同事务切换 is_primary 标记。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    from_user_id:
+                      type: string
+                      description: 原主账号用户 ID
+                    to_user_id:
+                      type: string
+                      description: 新主账号用户 ID
+                  required:
+                  - team_id
+                  - from_user_id
+                  - to_user_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/scope/get@v1:
+    get:
+      summary: 读取运营团队负责范围
+      description: 仅 admin。返回团队区域负责范围。
+      x-require-auth: true
+      x-resource-type: bos.ent_team.scope
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/scope/save@v1:
+    post:
+      summary: 保存运营团队负责范围
+      description: 仅 admin。勾选区域写入 scope_grant(holder=ent_team),成为区域删除的引用来源。
+      x-require-auth: true
+      x-resource-type: bos.ent_team.scope
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    region_node_ids:
+                      type: array
+                      description: 负责区域节点 ID 列表
+                      items:
+                        type: string
+                        description: 区域节点 ID
+                  required:
+                  - team_id
+                  - region_node_ids
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/create@v1:
+    post:
+      summary: 新建运维团队
+      description: 建档后 team_type 不可改。须指定所属区域、团队类型、可派工单类型≥1、分派方式与结算口径。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_name:
+                      type: string
+                      description: 团队名称
+                    region_node_id:
+                      type: string
+                      description: 所属区域节点 ID
+                    team_type:
+                      type: string
+                      description: 团队类型:regular=常规;construction=施工(建后不可改)
+                      enum:
+                      - regular
+                      - construction
+                    ticket_types:
+                      type: array
+                      description: 可派工单类型列表(至少 1 项)
+                      items:
+                        type: string
+                        description: 工单类型码
+                    dispatch_mode:
+                      type: string
+                      description: 分派方式:manual=手工;auto_avg=自动均分
+                      enum:
+                      - manual
+                      - auto_avg
+                    settle_mode:
+                      type: string
+                      description: 结算方式
+                    settle_value:
+                      type: number
+                      description: 结算值
+                    primary_username:
+                      type: string
+                      description: 主账号登录名(空则默认「{团队名}主账号」)
+                    primary_mobile:
+                      type: string
+                      description: 主账号手机号(可选)
+                  required:
+                  - team_name
+                  - region_node_id
+                  - team_type
+                  - ticket_types
+                  - dispatch_mode
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/update@v1:
+    post:
+      summary: 编辑运维团队
+      description: 编辑团队资料;拒收 team_type(建后不可改)。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    team_name:
+                      type: string
+                      description: 团队名称
+                    region_node_id:
+                      type: string
+                      description: 所属区域节点 ID
+                    ticket_types:
+                      type: array
+                      description: 可派工单类型列表
+                      items:
+                        type: string
+                        description: 工单类型码
+                    settle_mode:
+                      type: string
+                      description: 结算方式
+                    settle_value:
+                      type: number
+                      description: 结算值
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - team_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/delete@v1:
+    post:
+      summary: 删除运维团队
+      description: 删除前校验引用与未办完工单等守卫。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                  required:
+                  - team_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/scope/save@v1:
+    post:
+      summary: 保存运维团队负责范围
+      description: 三个范围写入口之一。同事务校验范围包含关系与未办完工单守卫;失败两侧都不落库。
+      x-require-auth: true
+      x-resource-type: bos.ops_team.scope
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    region_node_ids:
+                      type: array
+                      description: 负责区域节点 ID 列表
+                      items:
+                        type: string
+                        description: 区域节点 ID
+                    customer_ids:
+                      type: array
+                      description: 负责客户 ID 列表(可空)
+                      items:
+                        type: string
+                        description: 客户 ID
+                  required:
+                  - team_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/member_add@v1:
+    post:
+      summary: 添加运维成员
+      description: 成员类型与账号角色一一映射。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    member_type:
+                      type: string
+                      description: 成员类型:regular=常规;construction=施工
+                      enum:
+                      - regular
+                      - construction
+                    username:
+                      type: string
+                      description: 登录名
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                  required:
+                  - team_id
+                  - member_type
+                  - username
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/member_update@v1:
+    post:
+      summary: 更新运维成员
+      description: 可改成员类型;类型变更同事务改写 role_code。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    member_id:
+                      type: string
+                      description: 成员 ID
+                    member_type:
+                      type: string
+                      description: 成员类型:regular/construction
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                  required:
+                  - team_id
+                  - member_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/member_remove@v1:
+    post:
+      summary: 移除运维成员
+      description: 删除前五项检查并注销账号。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    member_id:
+                      type: string
+                      description: 成员 ID
+                  required:
+                  - team_id
+                  - member_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_member/scope/save@v1:
+    post:
+      summary: 保存运维成员负责范围
+      description: 三个范围写入口之二。scope_mode∈follow_team/region/customer;越界报错不保存。
+      x-require-auth: true
+      x-resource-type: bos.ops_member.scope
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    member_id:
+                      type: string
+                      description: 成员 ID
+                    scope_mode:
+                      type: string
+                      description: 范围模式:follow_team=跟随团队;region=按区域;customer=按客户
+                      enum:
+                      - follow_team
+                      - region
+                      - customer
+                    targets:
+                      type: array
+                      description: region/customer 模式下的目标 ID 列表
+                      items:
+                        type: string
+                        description: 目标 ID
+                  required:
+                  - member_id
+                  - scope_mode
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/dispatch_mode/update@v1:
+    post:
+      summary: 更新分派方式
+      description: 与运营侧改同一字段,后写入者生效;默认补记审计。
+      x-require-auth: true
+      x-resource-type: bos.ops_team.dispatch_mode
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    dispatch_mode:
+                      type: string
+                      description: 分派方式:manual=手工;auto_avg=自动均分
+                      enum:
+                      - manual
+                      - auto_avg
+                  required:
+                  - team_id
+                  - dispatch_mode
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/coverage/get@v1:
+    get:
+      summary: 运维团队覆盖客户
+      description: 覆盖客户=团队区域范围(Tree) ∩ 本类型归属(Owner),与列表分页同源。
+      x-require-auth: true
+      x-resource-type: bos.ops_team.coverage
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/create@v1:
+    post:
+      summary: 新建客户
+      description: 客户建档。须指定归属运营商;可选合伙人、挂载申请、父区域节点。完整弹窗字段还可含识别号、联系人、地址、运维团队、主账号、证照等。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_name:
+                      type: string
+                      description: 客户名称
+                    subject_type:
+                      type: string
+                      description: 主体类型
+                    operator_id:
+                      type: string
+                      description: 归属运营商 ID
+                    partner_id:
+                      type: string
+                      description: 归属合伙人 ID(可选)
+                    mount_request_id:
+                      type: string
+                      description: 挂载申请 ID(可选;有值表示已完成挂载前置)
+                    parent_node_id:
+                      type: string
+                      description: 所挂区域父节点 ID(可选)
+                    id_code:
+                      type: string
+                      description: 识别号(可选)
+                    contact_name:
+                      type: string
+                      description: 联系人(可选)
+                    contact_mobile:
+                      type: string
+                      description: 联系电话(可选)
+                    address:
+                      type: string
+                      description: 地址(可选)
+                    regular_ops_team_id:
+                      type: string
+                      description: 常规运维团队 ID(可选)
+                    construction_ops_team_id:
+                      type: string
+                      description: 施工运维团队 ID(可选)
+                    primary_username:
+                      type: string
+                      description: 客户主账号登录名(可选)
+                    primary_mobile:
+                      type: string
+                      description: 客户主账号手机号(可选)
+                  required:
+                  - customer_name
+                  - subject_type
+                  - operator_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/get_list@v1:
+    post:
+      summary: 客户列表
+      description: 按可见范围返回客户列表,支持筛选与分页。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    region_node_id:
+                      type: string
+                      description: 区域筛选(可选)
+                    operator_id:
+                      type: string
+                      description: 运营商筛选(可选)
+                    partner_id:
+                      type: string
+                      description: 合伙人筛选(可选)
+                    status:
+                      type: string
+                      description: 状态筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/get@v1:
+    post:
+      summary: 客户详情
+      description: 按客户 ID 查询档案详情。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/update@v1:
+    post:
+      summary: 编辑客户
+      description: 编辑客户资料。拒收改写 customer_id/region_node_id/operator_id/partner_id;改识别号须带 change_basis。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    customer_name:
+                      type: string
+                      description: 客户名称
+                    subject_type:
+                      type: string
+                      description: 主体类型
+                    id_code:
+                      type: string
+                      description: 识别号
+                    change_basis:
+                      type: string
+                      description: 改识别号时的变更依据
+                    contact_name:
+                      type: string
+                      description: 联系人
+                    contact_mobile:
+                      type: string
+                      description: 联系电话
+                    address:
+                      type: string
+                      description: 地址
+                    regular_ops_team_id:
+                      type: string
+                      description: 常规运维团队 ID
+                    construction_ops_team_id:
+                      type: string
+                      description: 施工运维团队 ID
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/delete_precheck@v1:
+    post:
+      summary: 客户删除前置检查
+      description: 返回 can_delete 与 reasons,供删除确认弹窗使用。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/delete@v1:
+    post:
+      summary: 删除客户
+      description: 删除客户;须携带删除前置检查时的阻塞快照版本。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    precheck_version:
+                      type: string
+                      description: 删除前置检查快照版本
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/history@v1:
+    post:
+      summary: 客户变更历史
+      description: 查询客户档案变更流水。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/mount_candidates@v1:
+    get:
+      summary: 改挂候选客户
+      description: 返回操作人可见范围内可作为改挂目标的候选客户列表。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/influence@v1:
+    post:
+      summary: 改挂影响面
+      description: 改挂前必做前置:未办完工单数、当前责任人与团队、当期是否已出账等。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/move_region@v1:
+    post:
+      summary: 客户改挂区域
+      description: 复合事务改挂区域;新区域省份须等于归属运营商档案省份。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    new_region_node_id:
+                      type: string
+                      description: 新挂载区域节点 ID
+                    regular_ops_team_id:
+                      type: string
+                      description: 常规运维团队 ID(可选,随改挂重绑)
+                    construction_ops_team_id:
+                      type: string
+                      description: 施工运维团队 ID(可选,随改挂重绑)
+                  required:
+                  - customer_id
+                  - new_region_node_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/attribution/update@v1:
+    post:
+      summary: 更新客户归属
+      description: 改归属运营商/合伙人;改运营商时档案省份须等于客户所挂区域省份。
+      x-require-auth: true
+      x-resource-type: bos.customer.attribution
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    operator_id:
+                      type: string
+                      description: 新归属运营商 ID(可选)
+                    partner_id:
+                      type: string
+                      description: 新归属合伙人 ID(可选,可清空)
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/template_download@v1:
+    get:
+      summary: 下载导入模板
+      description: 返回 14 列 xlsx 模板说明(format/columns/max_rows)。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: export
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/submit@v1:
+    post:
+      summary: 提交客户批量导入
+      description: 提交导入行对象列表,单批上限 500 行。列含客户名称、识别号、主体类型、联系人、电话、地址、区域、运营商、合伙人、运维团队、主账号等。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    rows:
+                      type: array
+                      description: 导入行对象列表(≤500)
+                      maxItems: 500
+                      items:
+                        type: object
+                        description: 单行导入字段(14 列)
+                        properties:
+                          row_no:
+                            type: integer
+                            description: 行编号
+                          customer_name:
+                            type: string
+                            description: 客户名称
+                          id_code:
+                            type: string
+                            description: 识别号
+                          subject_type:
+                            type: string
+                            description: 主体类型
+                          contact_name:
+                            type: string
+                            description: 联系人
+                          contact_mobile:
+                            type: string
+                            description: 联系电话
+                          address:
+                            type: string
+                            description: 地址
+                          region_name:
+                            type: string
+                            description: 所挂区域
+                          operator_name:
+                            type: string
+                            description: 运营商
+                          partner_name:
+                            type: string
+                            description: 合伙人
+                          regular_ops_team_name:
+                            type: string
+                            description: 常规运维团队
+                          construction_ops_team_name:
+                            type: string
+                            description: 施工运维团队
+                          primary_username:
+                            type: string
+                            description: 主账号登录名
+                          primary_mobile:
+                            type: string
+                            description: 主账号手机号
+                  required:
+                  - rows
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/get_list@v1:
+    post:
+      summary: 导入批次列表
+      description: 查询本人可见范围内的导入批次。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/get@v1:
+    post:
+      summary: 导入批次详情
+      description: 按批次 ID/编号查询详情与行状态。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    batch_id:
+                      type: string
+                      description: 批次 ID(与 batch_no 二选一)
+                    batch_no:
+                      type: string
+                      description: 批次编号(与 batch_id 二选一)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/resume@v1:
+    post:
+      summary: 失败行续传
+      description: 针对失败行提交续传数据,行号对应原 row_no。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    batch_id:
+                      type: string
+                      description: 批次 ID
+                    rows:
+                      type: array
+                      description: 续传行列表(含原 row_no)
+                      items:
+                        type: object
+                  required:
+                  - batch_id
+                  - rows
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/export_codes@v1:
+    post:
+      summary: 按批次导出激活码
+      description: 语义同账号导出;须传收窄后的 user_ids 与 scope。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: export
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    batch_id:
+                      type: string
+                      description: 批次 ID
+                    user_ids:
+                      type: array
+                      description: 收窄后的用户 ID 列表
+                      items:
+                        type: string
+                        description: 用户 ID
+                    scope_type:
+                      type: string
+                      description: 作用域类型
+                    scope_id:
+                      type: string
+                      description: 作用域 ID
+                    validity:
+                      type: string
+                      description: 导出口径:active/expired/all
+                      enum:
+                      - active
+                      - expired
+                      - all
+                  required:
+                  - batch_id
+                  - user_ids
+                  - scope_type
+                  - scope_id
+                  - validity
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/export_customers@v1:
+    post:
+      summary: 按批次导出客户
+      description: 按导入批次导出客户 15 列结果。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: export
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    batch_id:
+                      type: string
+                      description: 批次 ID
+                  required:
+                  - batch_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /sub_account/get_list@v1:
+    post:
+      summary: 分账号列表
+      description: 查询客户下属分账号列表。
+      x-require-auth: true
+      x-resource-type: bos.sub_account
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /sub_account/update@v1:
+    post:
+      summary: 更新分账号
+      description: 运营可改 display_name 与 network_account_name;客户主账号只许改 display_name。
+      x-require-auth: true
+      x-resource-type: bos.sub_account
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    sub_account_id:
+                      type: string
+                      description: 分账号 ID
+                    display_name:
+                      type: string
+                      description: 显示名称/用途说明
+                    network_account_name:
+                      type: string
+                      description: 网络侧账号名(运营可改)
+                  required:
+                  - sub_account_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /catalog/create@v1:
+    post:
+      summary: 新建套餐档位
+      description: 新建固定/自定义档位。拒收 monthly_settle_cents、sub_mode、first_referred_at。自定义档必填 customer_id。
+      x-require-auth: true
+      x-resource-type: bos.catalog
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    plan_kind:
+                      type: string
+                      description: 档位类型:fixed=固定;custom=自定义
+                      enum:
+                      - fixed
+                      - custom
+                    plan_name:
+                      type: string
+                      description: 档位名称
+                    use_category:
+                      type: string
+                      description: 用途分类:office/live/ai/value_add/customized
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分)
+                    sub_account_quota:
+                      type: integer
+                      description: 分账号配额
+                    total_bandwidth_mbps:
+                      type: number
+                      description: 总带宽(Mbps,单值形态)
+                    customer_id:
+                      type: string
+                      description: 自定义档所属客户 ID(custom 必填)
+                  required:
+                  - plan_kind
+                  - plan_name
+                  - use_category
+                  - annual_price_cents
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /catalog/update@v1:
+    post:
+      summary: 编辑套餐档位
+      description: 编辑档位;use_category 建后不可改;被订阅引用冻结后多数字段只读。
+      x-require-auth: true
+      x-resource-type: bos.catalog
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    plan_id:
+                      type: string
+                      description: 档位 ID
+                    plan_name:
+                      type: string
+                      description: 档位名称
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分)
+                    sub_account_quota:
+                      type: integer
+                      description: 分账号配额
+                    total_bandwidth_mbps:
+                      type: number
+                      description: 总带宽(Mbps)
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - plan_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /catalog/get_list@v1:
+    post:
+      summary: 套餐档位列表
+      description: 按 plan_kind 等条件筛选档位列表。
+      x-require-auth: true
+      x-resource-type: bos.catalog
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    plan_kind:
+                      type: string
+                      description: 档位类型筛选:fixed/custom
+                    use_category:
+                      type: string
+                      description: 用途分类筛选
+                    customer_id:
+                      type: string
+                      description: 自定义档客户筛选
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /catalog/get@v1:
+    post:
+      summary: 套餐档位详情
+      description: 按档位 ID 查询详情。
+      x-require-auth: true
+      x-resource-type: bos.catalog
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    plan_id:
+                      type: string
+                      description: 档位 ID
+                  required:
+                  - plan_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /contract/create@v1:
+    post:
+      summary: 新建合同
+      description: 客户段+合同段+服务构成条目+IP 条件一次提交。拒收 source(服务端定)。
+      x-require-auth: true
+      x-resource-type: bos.contract
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 签约客户 ID(或改用内联建档字段)
+                    contract_no:
+                      type: string
+                      description: 合同编号(空则服务端发号)
+                    external_no:
+                      type: string
+                      description: 外部合同号(可选)
+                    contract_amount_cents:
+                      type: integer
+                      description: 合同金额(分,可选)
+                    pay_cycle:
+                      type: string
+                      description: 付款周期:yearly/quarterly/monthly
+                      enum:
+                      - yearly
+                      - quarterly
+                      - monthly
+                    start_date:
+                      type: string
+                      description: 合同开始日期(YYYY-MM-DD)
+                      format: date
+                    end_date:
+                      type: string
+                      description: 合同结束日期(YYYY-MM-DD)
+                      format: date
+                    agent_name:
+                      type: string
+                      description: 经办人姓名
+                    agent_mobile:
+                      type: string
+                      description: 经办人手机
+                    agent_handover_on:
+                      type: string
+                      description: 经办交接日期(可选)
+                      format: date
+                    agent_org:
+                      type: string
+                      description: 经办组织(可选)
+                    attachment_url:
+                      type: string
+                      description: 附件地址(可选)
+                    service_items:
+                      type: array
+                      description: 服务构成条目列表
+                      items:
+                        type: object
+                        description: 服务条目
+                        properties:
+                          item_kind:
+                            type: string
+                            description: 条目类型:plan_based/custom_spec
+                          plan_id:
+                            type: string
+                            description: 档位 ID(plan_based)
+                          quantity:
+                            type: integer
+                            description: 数量
+                          account_count:
+                            type: integer
+                            description: 账号数(custom_spec)
+                          bandwidth_mbps:
+                            type: number
+                            description: 带宽 Mbps(custom_spec)
+                          line_exits:
+                            type: array
+                            description: 线路出口列表
+                            items:
+                              type: string
+                              description: 出口标识
+                    ip_entries:
+                      type: array
+                      description: IP 条件条目(可选)
+                      items:
+                        type: object
+                        description: IP 条目
+                  required:
+                  - pay_cycle
+                  - start_date
+                  - end_date
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /contract/update@v1:
+    post:
+      summary: 编辑合同
+      description: 编号与签约客户不可改;条目按 item_id 三向对比增删改。
+      x-require-auth: true
+      x-resource-type: bos.contract
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    contract_id:
+                      type: string
+                      description: 合同 ID
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本
+                    external_no:
+                      type: string
+                      description: 外部合同号
+                    contract_amount_cents:
+                      type: integer
+                      description: 合同金额(分)
+                    pay_cycle:
+                      type: string
+                      description: 付款周期
+                    start_date:
+                      type: string
+                      description: 开始日期
+                      format: date
+                    end_date:
+                      type: string
+                      description: 结束日期
+                      format: date
+                    agent_name:
+                      type: string
+                      description: 经办人姓名
+                    agent_mobile:
+                      type: string
+                      description: 经办人手机
+                    agent_handover_on:
+                      type: string
+                      description: 经办交接日期
+                    agent_org:
+                      type: string
+                      description: 经办组织
+                    attachment_url:
+                      type: string
+                      description: 附件地址
+                    service_items:
+                      type: array
+                      description: 服务构成条目(含 item_id 的增删改)
+                      items:
+                        type: object
+                    ip_entries:
+                      type: array
+                      description: IP 条件条目
+                      items:
+                        type: object
+                  required:
+                  - contract_id
+                  - row_version
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /contract/get_list@v1:
+    post:
+      summary: 合同列表
+      description: 按客户/状态等筛选合同列表。
+      x-require-auth: true
+      x-resource-type: bos.contract
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    customer_id:
+                      type: string
+                      description: 客户 ID 筛选
+                    status:
+                      type: string
+                      description: 状态筛选
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /contract/get@v1:
+    post:
+      summary: 合同详情
+      description: 按合同 ID 查询详情(含服务条目与 IP 条件)。
+      x-require-auth: true
+      x-resource-type: bos.contract
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    contract_id:
+                      type: string
+                      description: 合同 ID
+                  required:
+                  - contract_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/create@v1:
+    post:
+      summary: 新建订阅
+      description: 拒收 line_exits、sub_mode、order_no、新建时的 end_date、opened_at。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    plan_id:
+                      type: string
+                      description: 档位 ID
+                    contract_id:
+                      type: string
+                      description: 合同 ID
+                    contract_item_id:
+                      type: string
+                      description: 合同服务条目 ID
+                    start_date:
+                      type: string
+                      description: 订阅开始日期
+                      format: date
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分)
+                    monthly_settle_cents:
+                      type: integer
+                      description: 月结算金额(分)
+                    use_category:
+                      type: string
+                      description: 派生档用途分类(需要时填写)
+                  required:
+                  - customer_id
+                  - plan_id
+                  - contract_id
+                  - contract_item_id
+                  - start_date
+                  - annual_price_cents
+                  - monthly_settle_cents
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/change@v1:
+    post:
+      summary: 订阅升降配
+      description: 升降配须填 replaces_subscription_id,且须使用新的 contract_id(不得沿用原合同)。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    replaces_subscription_id:
+                      type: string
+                      description: 被替换的原订阅 ID
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    plan_id:
+                      type: string
+                      description: 新档位 ID
+                    contract_id:
+                      type: string
+                      description: 新合同 ID(不得沿用原合同)
+                    contract_item_id:
+                      type: string
+                      description: 新合同服务条目 ID
+                    start_date:
+                      type: string
+                      description: 新订阅开始日期
+                      format: date
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分)
+                    monthly_settle_cents:
+                      type: integer
+                      description: 月结算金额(分)
+                    use_category:
+                      type: string
+                      description: 派生档用途分类(需要时填写)
+                  required:
+                  - replaces_subscription_id
+                  - customer_id
+                  - plan_id
+                  - contract_id
+                  - contract_item_id
+                  - start_date
+                  - annual_price_cents
+                  - monthly_settle_cents
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/stack@v1:
+    post:
+      summary: 订阅叠加或白名单更新
+      description: 叠加开通或更新白名单字段(两金额+end_date);其余只读键拒绝。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    subscription_id:
+                      type: string
+                      description: 订阅 ID(更新场景)
+                    customer_id:
+                      type: string
+                      description: 客户 ID(叠加新建时)
+                    plan_id:
+                      type: string
+                      description: 档位 ID(叠加新建时)
+                    contract_id:
+                      type: string
+                      description: 合同 ID
+                    contract_item_id:
+                      type: string
+                      description: 合同服务条目 ID
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分,可改)
+                    monthly_settle_cents:
+                      type: integer
+                      description: 月结算金额(分,可改)
+                    end_date:
+                      type: string
+                      description: 结束日期(可改)
+                      format: date
+                    start_date:
+                      type: string
+                      description: 开始日期(叠加新建时)
+                      format: date
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/get_list@v1:
+    post:
+      summary: 订阅列表
+      description: 按客户等维度筛选订阅列表。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID(常必填)
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    status:
+                      type: string
+                      description: 状态筛选
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/get@v1:
+    post:
+      summary: 订阅详情
+      description: 按订阅 ID 查询详情。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    subscription_id:
+                      type: string
+                      description: 订阅 ID
+                  required:
+                  - subscription_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /cost_item/save@v1:
+    post:
+      summary: 保存成本项定义
+      description: 仅 admin。增改成本项定义。拒收金额、客户、运营商、省份、cycle、is_system。
+      x-require-auth: true
+      x-resource-type: bos.cost_item
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    cost_item_id:
+                      type: string
+                      description: 成本项 ID(更新时必填)
+                    category:
+                      type: string
+                      description: 类别:intl_resource/device_purchase/project_fee
+                      enum:
+                      - intl_resource
+                      - device_purchase
+                      - project_fee
+                    item_name:
+                      type: string
+                      description: 成本项名称
+                    billing_unit:
+                      type: string
+                      description: 计费单位:per_customer/per_account/per_copy
+                      enum:
+                      - per_customer
+                      - per_account
+                      - per_copy
+                    is_amortized:
+                      type: boolean
+                      description: 是否摊销
+                    amortization_months:
+                      type: integer
+                      description: 摊销月数(勾选摊销时可空=每月摊销不结束)
+                    deduct_from_base:
+                      type: boolean
+                      description: 是否从基数扣除
+                    remark:
+                      type: string
+                      description: 备注
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(更新时)
+                  required:
+                  - category
+                  - item_name
+                  - billing_unit
+                  - is_amortized
+                  - deduct_from_base
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /cost_item/get_list@v1:
+    post:
+      summary: 成本项列表
+      description: 全局成本项目录;可选类别/名称关键字;无客户过滤。
+      x-require-auth: true
+      x-resource-type: bos.cost_item
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    category:
+                      type: string
+                      description: 类别筛选
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /cost_amount/save@v1:
+    post:
+      summary: 保存成本金额
+      description: 按「省份×运营商×成本项」只写差异金额;留空项表示删除该差异。
+      x-require-auth: true
+      x-resource-type: bos.cost_amount
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    province_node_id:
+                      type: string
+                      description: 省份节点 ID
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                    items:
+                      type: array
+                      description: 变更项列表;留空金额表示删除该差异行
+                      items:
+                        type: object
+                        properties:
+                          cost_item_id:
+                            type: string
+                            description: 成本项 ID
+                          amount_cents:
+                            type: integer
+                            description: 金额(分);空/省略表示删除
+                          row_version:
+                            type: integer
+                            description: 乐观锁版本
+                        required:
+                        - cost_item_id
+                  required:
+                  - province_node_id
+                  - operator_id
+                  - items
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /cost_amount/get_list@v1:
+    post:
+      summary: 成本金额一览
+      description: 透视表;admin 全量,区域运营按可见省/运营商收窄。
+      x-require-auth: true
+      x-resource-type: bos.cost_amount
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    province_node_id:
+                      type: string
+                      description: 省份筛选
+                    operator_id:
+                      type: string
+                      description: 运营商筛选
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /share_rule/save@v1:
+    post:
+      summary: 保存分成规则
+      description: holder_type 仅 operator/ops_team(无 partner)。share_value 填 0/负表示删除该行。
+      x-require-auth: true
+      x-resource-type: bos.share_rule
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    holder_type:
+                      type: string
+                      description: 持有方类型:operator/ops_team
+                      enum:
+                      - operator
+                      - ops_team
+                    holder_id:
+                      type: string
+                      description: 持有方 ID
+                    rules:
+                      type: array
+                      description: 规则行列表
+                      items:
+                        type: object
+                        properties:
+                          rule_id:
+                            type: string
+                            description: 规则 ID(更新/删除时)
+                          customer_id:
+                            type: string
+                            description: 客户 ID
+                          rule_level:
+                            type: string
+                            description: 规则层级:contract_addon/region_regular
+                            enum:
+                            - contract_addon
+                            - region_regular
+                          share_mode:
+                            type: string
+                            description: 分成方式:ratio_total/per_account/fixed_amount
+                            enum:
+                            - ratio_total
+                            - per_account
+                            - fixed_amount
+                          share_value:
+                            type: number
+                            description: 分成值:比例 (0,1];金额/每账号>0 分;0/负=删除该行
+                          remark:
+                            type: string
+                            description: 备注
+                  required:
+                  - holder_type
+                  - holder_id
+                  - rules
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /share_rule/get_list@v1:
+    post:
+      summary: 分成规则列表
+      description: 按持有方等条件列出分成规则。
+      x-require-auth: true
+      x-resource-type: bos.share_rule
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    holder_type:
+                      type: string
+                      description: 持有方类型
+                    holder_id:
+                      type: string
+                      description: 持有方 ID
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /share_rule/get@v1:
+    post:
+      summary: 分成规则详情
+      description: 按持有方一次返回四卡摘要与规则表。
+      x-require-auth: true
+      x-resource-type: bos.share_rule
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    holder_type:
+                      type: string
+                      description: 持有方类型:operator/ops_team
+                    holder_id:
+                      type: string
+                      description: 持有方 ID
+                  required:
+                  - holder_type
+                  - holder_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /share_rule/delete@v1:
+    post:
+      summary: 删除分成规则
+      description: 按 rule_id 删除单条分成规则(亦可在 save 内以 0/负值删除)。
+      x-require-auth: true
+      x-resource-type: bos.share_rule
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    rule_id:
+                      type: string
+                      description: 规则 ID
+                  required:
+                  - rule_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /opsview/home@v1:
+    get:
+      summary: 运维只读首页
+      description: 运维侧只读首页(U-60),返回工单/逾期等概览数据。
+      x-require-auth: true
+      x-resource-type: bos.opsview
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /jobs/get_list@v1:
+    get:
+      summary: 定时作业清单
+      description: 返回已注册作业规格列表(key/name/cron_hint 等)。
+      x-require-auth: true
+      x-resource-type: bos.jobs
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /jobs/toggle@v1:
+    post:
+      summary: 启停定时作业
+      description: 仅 admin。按作业 key 启停。
+      x-require-auth: true
+      x-resource-type: bos.jobs
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    key:
+                      type: string
+                      description: 作业键
+                    enabled:
+                      type: boolean
+                      description: 是否启用
+                  required:
+                  - key
+                  - enabled
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /jobs/runs@v1:
+    post:
+      summary: 作业执行记录
+      description: 查询指定作业的执行记录。
+      x-require-auth: true
+      x-resource-type: bos.jobs
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    key:
+                      type: string
+                      description: 作业键
+                  required:
+                  - key
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /jobs/run_once@v1:
+    post:
+      summary: 补跑作业一次
+      description: 触发一次指定作业。prod 环境仅总运营可补跑。可选 key:SUB-EFF/STOP-GEN/OVERDUE/DELEGATION-SYNC/OPEN-GEN/SVC-GEN/RECON。
+      x-require-auth: true
+      x-resource-type: bos.jobs
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    key:
+                      type: string
+                      description: 作业键
+                      enum:
+                      - SUB-EFF
+                      - STOP-GEN
+                      - OVERDUE
+                      - DELEGATION-SYNC
+                      - OPEN-GEN
+                      - SVC-GEN
+                      - RECON
+                  required:
+                  - key
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+components:
+  schemas:
+    ApiEnvelope:
+      type: object
+      description: 统一响应信封
+      properties:
+        code:
+          type: integer
+          description: 业务/协议码,0 表示成功
+        message:
+          type: string
+          description: 提示信息
+        error_code:
+          type: string
+          description: 稳定错误码(失败时)
+        data:
+          description: 业务数据载荷
+      required:
+      - code
+      - message
+    PageQuery:
+      type: object
+      description: 分页查询(0 基)
+      properties:
+        page:
+          type: integer
+          description: 页码(0 基索引,默认 0)
+          minimum: 0
+          default: 0
+        page_size:
+          type: integer
+          description: 每页条数(默认 20,上限 200)
+          minimum: 1
+          maximum: 200
+          default: 20
+        keyword:
+          type: string
+          description: 关键字筛选(可选)

+ 89 - 0
src/bin/klt-bos/src/config.rs

@@ -0,0 +1,89 @@
+use serde::Deserialize;
+
+#[derive(Debug, Clone, Deserialize)]
+pub struct AppConfig {
+    pub server: ServerConfig,
+    pub database: DatabaseConfig,
+    pub gateway: GatewayConfig,
+    pub registry: RegistryConfig,
+    #[serde(default = "default_bos_env")]
+    pub bos_env: String,
+}
+
+fn default_bos_env() -> String {
+    std::env::var("BOS_ENV").unwrap_or_else(|_| "dev".into())
+}
+
+#[derive(Debug, Clone, Deserialize)]
+pub struct ServerConfig {
+    #[serde(default = "default_host")]
+    pub host: String,
+    #[serde(default = "default_port")]
+    pub port: u16,
+    #[serde(default)]
+    pub tls_enabled: bool,
+}
+
+fn default_host() -> String {
+    "0.0.0.0".into()
+}
+fn default_port() -> u16 {
+    8088
+}
+
+#[derive(Debug, Clone, Deserialize)]
+pub struct DatabaseConfig {
+    pub url: String,
+}
+
+#[derive(Debug, Clone, Deserialize)]
+pub struct GatewayConfig {
+    #[serde(default)]
+    pub enabled: bool,
+    #[serde(default)]
+    pub url: String,
+    #[serde(default = "default_svc")]
+    pub service_name: String,
+    #[serde(default = "default_ver")]
+    pub service_version: String,
+}
+
+#[derive(Debug, Clone, Deserialize)]
+pub struct RegistryConfig {
+    #[serde(default)]
+    pub enabled: bool,
+    #[serde(default)]
+    pub url: String,
+    #[serde(default = "default_svc")]
+    pub service_name: String,
+    #[serde(default = "default_ver")]
+    pub service_version: String,
+    pub signature_secret: Option<String>,
+}
+
+fn default_svc() -> String {
+    "klt-bos".into()
+}
+fn default_ver() -> String {
+    "0.1.0".into()
+}
+
+pub async fn load() -> Result<AppConfig, Box<dyn std::error::Error>> {
+    let mut builder = config::Config::builder()
+        .add_source(config::File::with_name("config/default").required(false))
+        .add_source(config::File::with_name("config/development").required(false))
+        .add_source(config::Environment::default().separator("__"));
+
+    if let Ok(url) = std::env::var("KLT_BOS_DATABASE_URL") {
+        builder = builder.set_override("database.url", url)?;
+    }
+    if let Ok(port) = std::env::var("KLT_BOS_PORT") {
+        builder = builder.set_override("server.port", port)?;
+    }
+    if let Ok(env) = std::env::var("BOS_ENV") {
+        builder = builder.set_override("bos_env", env)?;
+    }
+
+    let cfg: AppConfig = builder.build()?.try_deserialize()?;
+    Ok(cfg)
+}

+ 218 - 0
src/bin/klt-bos/src/main.rs

@@ -0,0 +1,218 @@
+//! klt-bos 扩展微服务入口。
+
+use std::net::SocketAddr;
+use std::sync::Arc;
+
+use account::account_router;
+use axum::Router;
+use bos_api::AppState;
+use bos_platform::clients::PlatformClient;
+use bos_scope::DbScopedSelect;
+use seoh_service_sdk::{
+    build_openapi_ac_route_table, unified_ac_middleware, RuntimeTokenManager,
+    UnifiedAcMiddlewareConfig,
+};
+use tower_http::cors::{Any, CorsLayer};
+use tracing::info;
+
+mod config;
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+    seoh_service_sdk::install_rustls_crypto_default();
+    tracing_subscriber::fmt()
+        .with_env_filter(
+            std::env::var("RUST_LOG").unwrap_or_else(|_| "info,klt_bos=debug".into()),
+        )
+        .init();
+
+    let internal_token = match std::env::var("KLT_BOS_SERVICE_TOKEN")
+        .ok()
+        .filter(|t| !t.trim().is_empty())
+    {
+        Some(t) => t.trim().to_string(),
+        None => match seoh_service_sdk::obtain_runtime_token_from_env().await {
+            Ok(rt) => {
+                info!("已用 Bootstrap Token 换取运行期 JWT");
+                rt
+            }
+            Err(e) => {
+                tracing::warn!(
+                    "未配置服务 Token 且 Bootstrap 换取失败: {};将以空 Token 继续(本地/降级)",
+                    e
+                );
+                String::new()
+            }
+        },
+    };
+    std::env::set_var("CONFIG_CENTER_TOKEN", &internal_token);
+    let runtime_token_manager =
+        Arc::new(RuntimeTokenManager::new(internal_token.clone(), 300));
+    let _refresh = runtime_token_manager.start_auto_refresh_task(60);
+
+    let cfg = config::load().await?;
+    info!(
+        "klt-bos 配置加载完成 port={} env={}",
+        cfg.server.port, cfg.bos_env
+    );
+
+    if cfg.database.url.trim().is_empty() {
+        return Err("必须配置 database.url(配置中心或 KLT_BOS_DATABASE_URL)".into());
+    }
+    let pool = sqlx::postgres::PgPoolOptions::new()
+        .max_connections(10)
+        .connect(&cfg.database.url)
+        .await?;
+    sqlx::migrate!("../../migrations/dev").run(&pool).await?;
+    info!("数据库连接与迁移完成");
+
+    let token_for_platform = runtime_token_manager.clone();
+    let platform = Arc::new(PlatformClient::new(
+        cfg.gateway.url.clone(),
+        Arc::new(move || token_for_platform.current_token()),
+    ));
+    let scope = Arc::new(DbScopedSelect {
+        pool: pool.clone(),
+    });
+
+    let state = AppState {
+        pool,
+        platform,
+        scope,
+        bos_env: cfg.bos_env.clone(),
+        service_name: cfg.registry.service_name.clone(),
+    };
+
+    let registry_url_for_ac = if !cfg.registry.url.trim().is_empty() {
+        cfg.registry.url.trim().to_string()
+    } else {
+        std::env::var("SERVICE_REGISTRY_URL").unwrap_or_default()
+    };
+    let ac_cfg = Arc::new(UnifiedAcMiddlewareConfig {
+        registry_url: registry_url_for_ac,
+        route_table: build_openapi_ac_route_table(include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/openapi.yaml")))
+        .map_err(|e| format!("构建 OpenAPI AC 路由表失败: {e}"))?,
+        internal_token_provider: {
+            let rtm = runtime_token_manager.clone();
+            Arc::new(move || Some(rtm.current_token()))
+        },
+        runtime_token_manager: Some(runtime_token_manager.clone()),
+        ..Default::default()
+    });
+
+    let app = Router::new()
+        .merge(account_router())
+        .layer(axum::middleware::from_fn_with_state(
+            ac_cfg,
+            unified_ac_middleware,
+        ))
+        .layer(
+            CorsLayer::new()
+                .allow_origin(Any)
+                .allow_methods([axum::http::Method::GET, axum::http::Method::POST])
+                .allow_headers(Any),
+        )
+        .with_state(state);
+
+    let addr: SocketAddr = format!("{}:{}", cfg.server.host, cfg.server.port).parse()?;
+
+    if cfg.gateway.enabled {
+        use seoh_service_sdk::{
+            register_service_with_delayed_registration, GatewayConfig as SdkGatewayConfig,
+            ServerConfig as SdkServerConfig, ServiceRegistrationConfig,
+        };
+        let health_host = if cfg.server.host == "0.0.0.0" {
+            "localhost".to_string()
+        } else {
+            cfg.server.host.clone()
+        };
+        let reg_config = ServiceRegistrationConfig {
+            gateway: SdkGatewayConfig {
+                enabled: cfg.gateway.enabled,
+                url: cfg.gateway.url.clone(),
+                service_name: cfg.gateway.service_name.clone(),
+                service_version: cfg.gateway.service_version.clone(),
+                api_key: None,
+                danger_accept_invalid_certs: Some(false),
+                ca_cert_path: None,
+                client_cert_path: None,
+                client_key_path: None,
+            },
+            server: SdkServerConfig {
+                host: health_host,
+                port: cfg.server.port,
+                protocol: if cfg.server.tls_enabled {
+                    "https".to_string()
+                } else {
+                    "http".to_string()
+                },
+            },
+            openapi: None,
+            auto_start_monitoring: Some(false),
+            monitoring_interval: Some(60),
+            instance_id_persistence: None,
+        };
+        let (_client, _handle) = register_service_with_delayed_registration(
+            reg_config,
+            serde_json::Value::Object(serde_json::Map::new()),
+            Some(30),
+        );
+        info!("已启动延迟网关注册(后台重试)");
+    }
+
+    if cfg.registry.enabled && !cfg.registry.url.is_empty() {
+        use seoh_service_sdk::register_to_registry_in_background;
+        let runtime_token_for_registry = if internal_token.is_empty() {
+            None
+        } else {
+            Some(internal_token)
+        };
+        let reg_config = seoh_service_sdk::build_registry_registration_config_from_env(
+            &cfg.registry.url,
+            &cfg.registry.service_name,
+            &cfg.registry.service_version,
+            "klt-bos",
+            &cfg.server.host,
+            cfg.server.port,
+            cfg.server.tls_enabled,
+            cfg.registry.signature_secret.as_deref(),
+            "/var/lib/seoh/klt-bos-instance-id.json",
+            runtime_token_for_registry,
+        );
+        let openapi_spec = openapi_spec(&cfg.registry.service_version);
+        let _handle = register_to_registry_in_background(reg_config, openapi_spec, Some(30));
+        info!("已启动延迟服务注册中心注册(后台重试)");
+    } else {
+        info!("注册中心未启用或未配置 URL,跳过延迟注册");
+    }
+
+    // 第 1 期作业注册位(SJC);失败仅告警不阻断启动
+    if let Err(e) = register_phase1_jobs().await {
+        tracing::warn!("phase1 jobs register skipped: {e}");
+    }
+
+    info!("klt-bos listening on {addr}");
+    let listener = tokio::net::TcpListener::bind(addr).await?;
+    axum::serve(listener, app).await?;
+    Ok(())
+}
+
+fn openapi_spec(version: &str) -> serde_json::Value {
+    let mut v: serde_json::Value =
+        serde_yaml::from_str(include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/openapi.yaml")))
+        .unwrap_or_else(|_| {
+            serde_json::json!({
+                "openapi": "3.0.0",
+                "info": { "title": "klt-bos", "version": version }
+            })
+        });
+    if let Some(info) = v.get_mut("info") {
+        info["version"] = serde_json::Value::String(version.to_string());
+    }
+    v
+}
+
+async fn register_phase1_jobs() -> Result<(), String> {
+    let _ = bos_jobs::phase1_job_specs();
+    Ok(())
+}

+ 21 - 0
src/config/default.toml

@@ -0,0 +1,21 @@
+bos_env = "dev"
+
+[server]
+host = "0.0.0.0"
+port = 8088
+tls_enabled = false
+
+[database]
+url = ""
+
+[gateway]
+enabled = true
+url = "https://api-gateway:8443"
+service_name = "klt-bos"
+service_version = "0.1.0"
+
+[registry]
+enabled = true
+url = "https://service-registry:8443"
+service_name = "klt-bos"
+service_version = "0.1.0"

+ 19 - 0
src/crates/bos-activation/Cargo.toml

@@ -0,0 +1,19 @@
+[package]
+name = "bos-activation"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+bos-platform = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+sqlx = { workspace = true }
+async-trait = { workspace = true }
+thiserror = { workspace = true }
+tracing = { workspace = true }
+chrono = { workspace = true }
+hmac = { workspace = true }
+sha2 = { workspace = true }
+hex = { workspace = true }
+rand = { workspace = true }

+ 61 - 0
src/crates/bos-activation/src/export.rs

@@ -0,0 +1,61 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub struct ExportCodesRequest {
+    pub user_ids: Vec<String>,
+    pub scope_type: String,
+    pub scope_id: String,
+    pub validity: String, // active | expired | all
+}
+
+/// 组织§4.3 / A66 / A67:缺作用域或与令牌不一致必拒。
+pub fn assert_export_scope(
+    req: &ExportCodesRequest,
+    token_scope_type: &str,
+    token_scope_id: &str,
+) -> Result<(), bos_core::BosError> {
+    if req.scope_type.trim().is_empty() || req.scope_id.trim().is_empty() {
+        return Err(bos_core::BosError::bad_params(
+            "导出激活码必须传 scope_type 与 scope_id",
+        ));
+    }
+    if req.user_ids.is_empty() {
+        return Err(bos_core::BosError::bad_params(
+            "导出激活码必须传收窄后的 user_ids,禁止空列表全量导出",
+        ));
+    }
+    if req.scope_type != token_scope_type || req.scope_id != token_scope_id {
+        return Err(bos_core::BosError::biz(
+            bos_core::ErrorCode::Forbidden,
+            "scope 与令牌作用域不一致",
+        ));
+    }
+    Ok(())
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn rejects_missing_scope() {
+        let r = ExportCodesRequest {
+            user_ids: vec!["1".into()],
+            scope_type: "".into(),
+            scope_id: "x".into(),
+            validity: "active".into(),
+        };
+        assert!(assert_export_scope(&r, "end_user", "x").is_err());
+    }
+
+    #[test]
+    fn rejects_scope_mismatch() {
+        let r = ExportCodesRequest {
+            user_ids: vec!["1".into()],
+            scope_type: "end_user".into(),
+            scope_id: "a".into(),
+            validity: "active".into(),
+        };
+        assert!(assert_export_scope(&r, "end_user", "b").is_err());
+    }
+}

+ 31 - 0
src/crates/bos-activation/src/issue.rs

@@ -0,0 +1,31 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ActivationStatus {
+    None,
+    Issued,
+    Issuing,
+    Activated,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct IssueCodeResult {
+    pub user_id: String,
+    pub status: ActivationStatus,
+    /// 仅当次显示;库内只存 cipher/hmac
+    pub plaintext_once: Option<String>,
+    pub expire_date: Option<String>,
+}
+
+/// CU-06:已激活账号禁止重置激活码。
+pub fn assert_reset_allowed(status: ActivationStatus) -> Result<(), bos_core::BosError> {
+    if status == ActivationStatus::Activated {
+        Err(bos_core::BosError::klt(
+            bos_core::KltCode::A003,
+            "已激活账号不可重置激活码",
+        ))
+    } else {
+        Ok(())
+    }
+}

+ 9 - 0
src/crates/bos-activation/src/lib.rs

@@ -0,0 +1,9 @@
+//! M6:激活码生命周期(明文唯一来自平台 bootstrap_credential)。
+
+pub mod export;
+pub mod issue;
+pub mod verify;
+
+pub use export::{assert_export_scope, ExportCodesRequest};
+pub use issue::{assert_reset_allowed, ActivationStatus, IssueCodeResult};
+pub use verify::{assert_rate_limit, VerifyActivationRequest};

+ 16 - 0
src/crates/bos-activation/src/verify.rs

@@ -0,0 +1,16 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub struct VerifyActivationRequest {
+    pub code: String,
+    pub new_password: String,
+}
+
+/// 免登录激活口:按来源 IP + 码固定窗口限流(调用方注入计数)。
+pub fn assert_rate_limit(hits_in_window: u32, limit: u32) -> Result<(), bos_core::BosError> {
+    if hits_in_window >= limit {
+        Err(bos_core::BosError::bad_params("激活尝试过于频繁,请稍后再试"))
+    } else {
+        Ok(())
+    }
+}

+ 18 - 0
src/crates/bos-api/Cargo.toml

@@ -0,0 +1,18 @@
+[package]
+name = "bos-api"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+bos-platform = { workspace = true }
+bos-scope = { workspace = true }
+axum = { workspace = true }
+tower = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+sqlx = { workspace = true }
+tracing = { workspace = true }
+async-trait = { workspace = true }
+chrono = { workspace = true }
+base64 = { workspace = true }

+ 61 - 0
src/crates/bos-api/src/auth.rs

@@ -0,0 +1,61 @@
+use bos_core::{BosError, RoleCode};
+use bos_scope::{AuthContext, ScopeMode, SubjectRef};
+use sqlx::PgPool;
+use std::collections::HashSet;
+
+#[derive(Debug, sqlx::FromRow)]
+struct BindingRow {
+    user_id: i64,
+    role_code: String,
+    subject_type: String,
+    subject_id: String,
+    entry_only: bool,
+    username: Option<String>,
+}
+
+pub async fn load_binding(pool: &PgPool, user_id: &str) -> Result<AuthContext, BosError> {
+    let uid: i64 = user_id
+        .parse()
+        .map_err(|_| BosError::bad_params("invalid user_id"))?;
+    let row = sqlx::query_as::<_, BindingRow>(
+        r#"
+        SELECT user_id, role_code, subject_type, subject_id, entry_only, username
+        FROM bos_user_binding WHERE user_id = $1
+        "#,
+    )
+    .bind(uid)
+    .fetch_optional(pool)
+    .await
+    .map_err(|e| BosError::internal(e.to_string()))?
+    .ok_or_else(|| BosError::biz(bos_core::ErrorCode::Forbidden, "账号未绑定业务角色"))?;
+
+    let role = RoleCode::parse(&row.role_code).ok_or_else(|| {
+        BosError::internal(format!("unknown role_code {}", row.role_code))
+    })?;
+
+    let scope_mode = if matches!(role, RoleCode::Ops | RoleCode::Worker) {
+        let mode: Option<(String,)> = sqlx::query_as(
+            "SELECT scope_mode FROM ops_member WHERE user_id = $1 LIMIT 1",
+        )
+        .bind(uid)
+        .fetch_optional(pool)
+        .await
+        .map_err(|e| BosError::internal(e.to_string()))?;
+        mode.and_then(|(m,)| ScopeMode::parse(&m))
+    } else {
+        None
+    };
+
+    Ok(AuthContext {
+        user_id: row.user_id.to_string(),
+        role,
+        subject: SubjectRef {
+            subject_type: row.subject_type,
+            subject_id: row.subject_id,
+        },
+        entry_only: row.entry_only,
+        scope_mode,
+        granted_resource_instances: HashSet::new(),
+        username: row.username,
+    })
+}

+ 147 - 0
src/crates/bos-api/src/extract.rs

@@ -0,0 +1,147 @@
+use axum::{
+    async_trait,
+    extract::FromRequestParts,
+    http::request::Parts,
+    Json,
+};
+use bos_core::{ApiResponse, BosError};
+use bos_scope::AuthContext;
+use serde::de::DeserializeOwned;
+
+use crate::state::AppState;
+
+pub struct RequireAuth(pub AuthContext);
+pub struct OptionalAuth(pub Option<AuthContext>);
+
+#[async_trait]
+impl FromRequestParts<AppState> for RequireAuth {
+    type Rejection = axum::response::Response;
+
+    async fn from_request_parts(
+        parts: &mut Parts,
+        state: &AppState,
+    ) -> Result<Self, Self::Rejection> {
+        if let Some(auth) = parts.extensions.get::<AuthContext>() {
+            return Ok(RequireAuth(auth.clone()));
+        }
+        // 尝试从 Authorization 头解析(本地/网关后)
+        let auth_header = parts
+            .headers
+            .get(axum::http::header::AUTHORIZATION)
+            .and_then(|v| v.to_str().ok())
+            .unwrap_or("");
+        let user_id = parts
+            .headers
+            .get("X-Seoh-User-Id")
+            .and_then(|v| v.to_str().ok())
+            .map(|s| s.to_string())
+            .or_else(|| extract_sub_from_bearer(auth_header));
+
+        let Some(user_id) = user_id else {
+            return Err(json_err(BosError::biz(
+                bos_core::ErrorCode::Unauthorized,
+                "未登录",
+            )));
+        };
+
+        // 注入的 granted 实例
+        let mut auth = crate::load_binding(&state.pool, &user_id)
+            .await
+            .map_err(json_err)?;
+        if let Some(raw) = parts
+            .headers
+            .get("X-Granted-Resource-Instances")
+            .and_then(|v| v.to_str().ok())
+        {
+            if let Ok(ids) = serde_json::from_str::<Vec<String>>(raw) {
+                auth.granted_resource_instances.extend(ids);
+            }
+        }
+        // 环境一致性
+        if let Some(env) = parts.headers.get("X-Seoh-Env").and_then(|v| v.to_str().ok()) {
+            if env != state.bos_env {
+                return Err(json_err(BosError::bad_params(format!(
+                    "X-Seoh-Env={env} 与实例 BOS_ENV={} 不一致",
+                    state.bos_env
+                ))));
+            }
+        }
+        parts.extensions.insert(auth.clone());
+        Ok(RequireAuth(auth))
+    }
+}
+
+#[async_trait]
+impl FromRequestParts<AppState> for OptionalAuth {
+    type Rejection = axum::response::Response;
+
+    async fn from_request_parts(
+        parts: &mut Parts,
+        state: &AppState,
+    ) -> Result<Self, Self::Rejection> {
+        match RequireAuth::from_request_parts(parts, state).await {
+            Ok(RequireAuth(a)) => Ok(OptionalAuth(Some(a))),
+            Err(_) => Ok(OptionalAuth(None)),
+        }
+    }
+}
+
+fn extract_sub_from_bearer(header: &str) -> Option<String> {
+    let token = header.strip_prefix("Bearer ")?.trim();
+    // 非验证解析 JWT payload 仅用于本地 stub;生产由 SDK middleware 注入 user id。
+    let parts: Vec<&str> = token.split('.').collect();
+    if parts.len() < 2 {
+        return None;
+    }
+    let payload = parts[1];
+    let padded = match payload.len() % 4 {
+        2 => format!("{payload}=="),
+        3 => format!("{payload}="),
+        _ => payload.to_string(),
+    };
+    use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine};
+    let bytes = URL_SAFE_NO_PAD
+        .decode(padded.trim_end_matches('='))
+        .or_else(|_| base64::engine::general_purpose::URL_SAFE.decode(&padded))
+        .ok()?;
+    let v: serde_json::Value = serde_json::from_slice(&bytes).ok()?;
+    v.get("sub")
+        .or_else(|| v.get("user_id"))
+        .and_then(|x| x.as_str())
+        .map(|s| s.to_string())
+}
+
+pub struct DataBody<T>(pub T);
+
+#[async_trait]
+impl<S, T> axum::extract::FromRequest<S> for DataBody<T>
+where
+    S: Send + Sync,
+    T: DeserializeOwned,
+{
+    type Rejection = axum::response::Response;
+
+    async fn from_request(req: axum::extract::Request, state: &S) -> Result<Self, Self::Rejection> {
+        let Json(wrapper): Json<serde_json::Value> = Json::from_request(req, state)
+            .await
+            .map_err(|e| json_err(BosError::bad_params(e.to_string())))?;
+        let data = wrapper
+            .get("data")
+            .cloned()
+            .ok_or_else(|| json_err(BosError::bad_params("缺少 data")))?;
+        let typed: T = serde_json::from_value(data)
+            .map_err(|e| json_err(BosError::bad_params(e.to_string())))?;
+        Ok(DataBody(typed))
+    }
+}
+
+pub fn json_err(err: BosError) -> axum::response::Response {
+    use axum::response::IntoResponse;
+    let body = ApiResponse::<()>::from_error(&err);
+    (axum::http::StatusCode::OK, axum::Json(body)).into_response()
+}
+
+pub fn json_ok<T: serde::Serialize>(data: T) -> axum::response::Response {
+    use axum::response::IntoResponse;
+    (axum::http::StatusCode::OK, axum::Json(ApiResponse::ok(data))).into_response()
+}

+ 10 - 0
src/crates/bos-api/src/lib.rs

@@ -0,0 +1,10 @@
+//! bos-api:axum 路由辅助、鉴权中间件、请求级 AuthContext。
+
+pub mod auth;
+pub mod extract;
+pub mod middleware;
+pub mod state;
+
+pub use auth::load_binding;
+pub use extract::{DataBody, OptionalAuth, RequireAuth};
+pub use state::AppState;

+ 1 - 0
src/crates/bos-api/src/middleware.rs

@@ -0,0 +1 @@
+//! 额外中间件占位:审计钩子可在此扩展。

+ 13 - 0
src/crates/bos-api/src/state.rs

@@ -0,0 +1,13 @@
+use bos_platform::clients::PlatformClient;
+use bos_scope::DbScopedSelect;
+use sqlx::PgPool;
+use std::sync::Arc;
+
+#[derive(Clone)]
+pub struct AppState {
+    pub pool: PgPool,
+    pub platform: Arc<PlatformClient>,
+    pub scope: Arc<DbScopedSelect>,
+    pub bos_env: String,
+    pub service_name: String,
+}

+ 14 - 0
src/crates/bos-core/Cargo.toml

@@ -0,0 +1,14 @@
+[package]
+name = "bos-core"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+serde = { workspace = true }
+serde_json = { workspace = true }
+thiserror = { workspace = true }
+chrono = { workspace = true }
+chrono-tz = { workspace = true }
+uuid = { workspace = true }
+sqlx = { workspace = true }
+tracing = { workspace = true }

+ 191 - 0
src/crates/bos-core/src/error.rs

@@ -0,0 +1,191 @@
+use serde::Serialize;
+use thiserror::Error;
+
+/// 平台通用成功码。
+pub const CODE_OK: i64 = 10000;
+
+/// BOS 业务数字码段 20000–20999;对外稳定契约仍用 `KLT-*`。
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum ErrorCode {
+    Ok,
+    /// 通用冲突(条件更新零行 / 唯一索引)
+    ConflictS407,
+    Unauthorized,
+    Forbidden,
+    ForbiddenRole,
+    BadParams,
+    NotFound,
+    Downstream,
+    Internal,
+    /// 业务码(按册块预留;具体文案由 KltCode)
+    Business(i64),
+}
+
+impl ErrorCode {
+    pub fn as_i64(self) -> i64 {
+        match self {
+            Self::Ok => CODE_OK,
+            Self::ConflictS407 => 20001,
+            Self::Unauthorized => 11000,
+            Self::Forbidden => 11001,
+            Self::ForbiddenRole => 20010, // KLT-P301
+            Self::BadParams => 11103,
+            Self::NotFound => 11104,
+            Self::Downstream => 10110,
+            Self::Internal => 11100,
+            Self::Business(n) => n,
+        }
+    }
+}
+
+/// 对外稳定错误码字符串。
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
+#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
+pub enum KltCode {
+    #[serde(rename = "KLT-S407")]
+    S407,
+    #[serde(rename = "KLT-P301")]
+    P301,
+    #[serde(rename = "KLT-B001")]
+    B001,
+    #[serde(rename = "KLT-B002")]
+    B002,
+    #[serde(rename = "KLT-B003")]
+    B003,
+    #[serde(rename = "KLT-A003")]
+    A003,
+    #[serde(rename = "KLT-R101")]
+    R101,
+    #[serde(rename = "KLT-R102")]
+    R102,
+    #[serde(rename = "KLT-R103")]
+    R103,
+    #[serde(rename = "KLT-R104")]
+    R104,
+    #[serde(rename = "KLT-R105")]
+    R105,
+    #[serde(rename = "KLT-T201")]
+    T201,
+    #[serde(rename = "KLT-T224")]
+    T224,
+    #[serde(rename = "KLT-T225")]
+    T225,
+    #[serde(rename = "KLT-C001")]
+    C001,
+    #[serde(rename = "KLT-C008")]
+    C008,
+    #[serde(rename = "KLT-I101")]
+    I101,
+    #[serde(rename = "KLT-I102")]
+    I102,
+    #[serde(rename = "KLT-S401")]
+    S401,
+    #[serde(rename = "KLT-S402")]
+    S402,
+    #[serde(rename = "KLT-S403")]
+    S403,
+    #[serde(rename = "KLT-S404")]
+    S404,
+}
+
+impl KltCode {
+    pub fn numeric(self) -> i64 {
+        match self {
+            Self::S407 => 20001,
+            Self::P301 => 20010,
+            Self::B001 => 20020,
+            Self::B002 => 20021,
+            Self::B003 => 20022,
+            Self::A003 => 20030,
+            Self::R101 => 20040,
+            Self::R102 => 20041,
+            Self::R103 => 20042,
+            Self::R104 => 20043,
+            Self::R105 => 20044,
+            Self::T201 => 20050,
+            Self::T224 => 20051,
+            Self::T225 => 20052,
+            Self::C001 => 20060,
+            Self::C008 => 20061,
+            Self::I101 => 20070,
+            Self::I102 => 20071,
+            Self::S401 => 20101,
+            Self::S402 => 20102,
+            Self::S403 => 20103,
+            Self::S404 => 20104,
+        }
+    }
+
+    pub fn as_str(self) -> &'static str {
+        match self {
+            Self::S407 => "KLT-S407",
+            Self::P301 => "KLT-P301",
+            Self::B001 => "KLT-B001",
+            Self::B002 => "KLT-B002",
+            Self::B003 => "KLT-B003",
+            Self::A003 => "KLT-A003",
+            Self::R101 => "KLT-R101",
+            Self::R102 => "KLT-R102",
+            Self::R103 => "KLT-R103",
+            Self::R104 => "KLT-R104",
+            Self::R105 => "KLT-R105",
+            Self::T201 => "KLT-T201",
+            Self::T224 => "KLT-T224",
+            Self::T225 => "KLT-T225",
+            Self::C001 => "KLT-C001",
+            Self::C008 => "KLT-C008",
+            Self::I101 => "KLT-I101",
+            Self::I102 => "KLT-I102",
+            Self::S401 => "KLT-S401",
+            Self::S402 => "KLT-S402",
+            Self::S403 => "KLT-S403",
+            Self::S404 => "KLT-S404",
+        }
+    }
+}
+
+#[derive(Debug, Error)]
+pub enum BosError {
+    #[error("{message}")]
+    Biz {
+        code: i64,
+        error_code: Option<&'static str>,
+        message: String,
+    },
+    #[error(transparent)]
+    Other(#[from] Box<dyn std::error::Error + Send + Sync>),
+}
+
+impl BosError {
+    pub fn biz(code: ErrorCode, message: impl Into<String>) -> Self {
+        Self::Biz {
+            code: code.as_i64(),
+            error_code: None,
+            message: message.into(),
+        }
+    }
+
+    pub fn klt(klt: KltCode, message: impl Into<String>) -> Self {
+        Self::Biz {
+            code: klt.numeric(),
+            error_code: Some(klt.as_str()),
+            message: message.into(),
+        }
+    }
+
+    pub fn bad_params(message: impl Into<String>) -> Self {
+        Self::biz(ErrorCode::BadParams, message)
+    }
+
+    pub fn forbidden_role(message: impl Into<String>) -> Self {
+        Self::klt(KltCode::P301, message)
+    }
+
+    pub fn not_found(message: impl Into<String>) -> Self {
+        Self::biz(ErrorCode::NotFound, message)
+    }
+
+    pub fn internal(message: impl Into<String>) -> Self {
+        Self::biz(ErrorCode::Internal, message)
+    }
+}

+ 15 - 0
src/crates/bos-core/src/lib.rs

@@ -0,0 +1,15 @@
+//! bos-core:DB 辅助、雪花/金额/时区、KLT 错误码、分页(内部 0 基)。
+
+pub mod error;
+pub mod money;
+pub mod page;
+pub mod response;
+pub mod roles;
+pub mod time;
+
+pub use error::{BosError, ErrorCode, KltCode};
+pub use money::Cents;
+pub use page::{PageQuery, PageResult};
+pub use response::ApiResponse;
+pub use roles::{RoleCode, HIGH_RISK_ROLES};
+pub use time::{biz_today, shanghai_now};

+ 34 - 0
src/crates/bos-core/src/money.rs

@@ -0,0 +1,34 @@
+use serde::{Deserialize, Serialize};
+
+/// 金额:整数分。
+#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
+#[serde(transparent)]
+pub struct Cents(pub i64);
+
+impl Cents {
+    pub fn from_yuan_str(s: &str) -> Option<Self> {
+        let s = s.trim();
+        if s.is_empty() {
+            return None;
+        }
+        let neg = s.starts_with('-');
+        let s = s.trim_start_matches('-');
+        let parts: Vec<&str> = s.split('.').collect();
+        if parts.len() > 2 {
+            return None;
+        }
+        let yuan: i64 = parts[0].parse().ok()?;
+        let cents = if parts.len() == 2 {
+            let frac = parts[1];
+            if frac.len() > 2 || !frac.chars().all(|c| c.is_ascii_digit()) {
+                return None;
+            }
+            let padded = format!("{:0<2}", frac);
+            padded.parse::<i64>().ok()?
+        } else {
+            0
+        };
+        let v = yuan.checked_mul(100)?.checked_add(cents)?;
+        Some(Self(if neg { -v } else { v }))
+    }
+}

+ 41 - 0
src/crates/bos-core/src/page.rs

@@ -0,0 +1,41 @@
+use serde::{Deserialize, Serialize};
+
+/// 内部 0 基分页;对外呈现时再 +1。
+#[derive(Debug, Clone, Deserialize)]
+pub struct PageQuery {
+    /// 0 基页码
+    #[serde(default)]
+    pub page: i64,
+    #[serde(default = "default_page_size")]
+    pub page_size: i64,
+}
+
+fn default_page_size() -> i64 {
+    20
+}
+
+impl PageQuery {
+    pub fn offset(&self) -> i64 {
+        let page = if self.page < 0 { 0 } else { self.page };
+        let size = self.page_size.clamp(1, 200);
+        page * size
+    }
+
+    pub fn limit(&self) -> i64 {
+        self.page_size.clamp(1, 200)
+    }
+
+    /// 对外 1 基页码
+    pub fn display_page(&self) -> i64 {
+        self.page.max(0) + 1
+    }
+}
+
+#[derive(Debug, Clone, Serialize)]
+pub struct PageResult<T: Serialize> {
+    pub items: Vec<T>,
+    pub total: i64,
+    /// 对外 1 基
+    pub page: i64,
+    pub page_size: i64,
+}

+ 54 - 0
src/crates/bos-core/src/response.rs

@@ -0,0 +1,54 @@
+use serde::Serialize;
+
+use crate::error::{BosError, CODE_OK};
+
+#[derive(Debug, Serialize)]
+pub struct ApiResponse<T: Serialize> {
+    pub code: i64,
+    pub message: String,
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub error_code: Option<&'static str>,
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub data: Option<T>,
+}
+
+impl<T: Serialize> ApiResponse<T> {
+    pub fn ok(data: T) -> Self {
+        Self {
+            code: CODE_OK,
+            message: "ok".into(),
+            error_code: None,
+            data: Some(data),
+        }
+    }
+
+    pub fn ok_msg(data: T, message: impl Into<String>) -> Self {
+        Self {
+            code: CODE_OK,
+            message: message.into(),
+            error_code: None,
+            data: Some(data),
+        }
+    }
+
+    pub fn from_error(err: &BosError) -> ApiResponse<()> {
+        match err {
+            BosError::Biz {
+                code,
+                error_code,
+                message,
+            } => ApiResponse {
+                code: *code,
+                message: message.clone(),
+                error_code: *error_code,
+                data: None,
+            },
+            BosError::Other(e) => ApiResponse {
+                code: 11100,
+                message: e.to_string(),
+                error_code: None,
+                data: None,
+            },
+        }
+    }
+}

+ 61 - 0
src/crates/bos-core/src/roles.rs

@@ -0,0 +1,61 @@
+use serde::{Deserialize, Serialize};
+
+/// 10 类业务角色(需求矩阵)。
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub enum RoleCode {
+    Admin,
+    RegAdmin,
+    RegSubAdmin,
+    TeamLead,
+    Ops,
+    Worker,
+    Enterprise,
+    Sub,
+    Partner,
+    Operator,
+}
+
+impl RoleCode {
+    pub fn as_str(self) -> &'static str {
+        match self {
+            Self::Admin => "admin",
+            Self::RegAdmin => "regAdmin",
+            Self::RegSubAdmin => "regSubAdmin",
+            Self::TeamLead => "teamLead",
+            Self::Ops => "ops",
+            Self::Worker => "worker",
+            Self::Enterprise => "enterprise",
+            Self::Sub => "sub",
+            Self::Partner => "partner",
+            Self::Operator => "operator",
+        }
+    }
+
+    pub fn parse(s: &str) -> Option<Self> {
+        match s {
+            "admin" => Some(Self::Admin),
+            "regAdmin" => Some(Self::RegAdmin),
+            "regSubAdmin" => Some(Self::RegSubAdmin),
+            "teamLead" => Some(Self::TeamLead),
+            "ops" => Some(Self::Ops),
+            "worker" => Some(Self::Worker),
+            "enterprise" => Some(Self::Enterprise),
+            "sub" => Some(Self::Sub),
+            "partner" => Some(Self::Partner),
+            "operator" => Some(Self::Operator),
+            _ => None,
+        }
+    }
+
+    pub fn is_high_risk(self) -> bool {
+        HIGH_RISK_ROLES.contains(&self)
+    }
+}
+
+/// 高危窄面角色:不得绑用户组,只直授个人(业务侧唯一判据)。
+pub const HIGH_RISK_ROLES: &[RoleCode] = &[RoleCode::Admin];
+
+pub fn is_high_risk_role_name(name: &str) -> bool {
+    RoleCode::parse(name).map(|r| r.is_high_risk()).unwrap_or(false)
+}

+ 10 - 0
src/crates/bos-core/src/time.rs

@@ -0,0 +1,10 @@
+use chrono::{DateTime, NaiveDate, Utc};
+use chrono_tz::Asia::Shanghai;
+
+pub fn shanghai_now() -> DateTime<chrono_tz::Tz> {
+    Utc::now().with_timezone(&Shanghai)
+}
+
+pub fn biz_today() -> NaiveDate {
+    shanghai_now().date_naive()
+}

+ 9 - 0
src/crates/bos-invariant/Cargo.toml

@@ -0,0 +1,9 @@
+[package]
+name = "bos-invariant"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+serde = { workspace = true }
+thiserror = { workspace = true }

+ 103 - 0
src/crates/bos-invariant/src/lib.rs

@@ -0,0 +1,103 @@
+//! M5:业务不变量纯函数(一期 I1–I6)。
+
+use bos_core::{BosError, KltCode, RoleCode};
+
+/// I1:客户运营商归属等值合法。
+pub fn i1_operator_belongs(customer_operator_id: Option<&str>, new_operator_id: &str) -> Result<(), BosError> {
+    if new_operator_id.is_empty() {
+        return Err(BosError::klt(KltCode::I101, "运营商归属不能为空"));
+    }
+    let _ = customer_operator_id;
+    Ok(())
+}
+
+/// I2:合伙人归属等值合法。
+pub fn i2_partner_belongs(new_partner_id: Option<&str>) -> Result<(), BosError> {
+    if let Some(p) = new_partner_id {
+        if p.is_empty() {
+            return Err(BosError::klt(KltCode::I102, "合伙人 ID 非法"));
+        }
+    }
+    Ok(())
+}
+
+/// I3:每客户每类型运维团队当前归属恰一条(常规)/至多一条(施工)。
+pub fn i3_team_belong_counts(regular: usize, construction: usize) -> Result<(), BosError> {
+    if regular != 1 {
+        return Err(BosError::bad_params(format!(
+            "常规运维团队归属必须恰有 1 条,当前 {regular}"
+        )));
+    }
+    if construction > 1 {
+        return Err(BosError::bad_params(format!(
+            "施工运维团队归属至多 1 条,当前 {construction}"
+        )));
+    }
+    Ok(())
+}
+
+/// I4:自定义范围 ⊆ 团队范围(调用方传入展开集)。
+pub fn i4_scope_subset(overflow_count: usize) -> Result<(), BosError> {
+    if overflow_count == 0 {
+        Ok(())
+    } else {
+        Err(BosError::bad_params(format!(
+            "成员范围越界 {overflow_count} 家客户"
+        )))
+    }
+}
+
+/// I5:成员类型与账号角色一一映射。
+pub fn i5_member_type_role(member_type: &str, role: RoleCode) -> Result<(), BosError> {
+    let ok = match member_type {
+        "regular" => matches!(role, RoleCode::Ops | RoleCode::TeamLead),
+        "construction" => matches!(role, RoleCode::Worker),
+        _ => false,
+    };
+    if ok {
+        Ok(())
+    } else {
+        Err(BosError::bad_params(format!(
+            "成员类型 {member_type} 与角色 {} 不一致",
+            role.as_str()
+        )))
+    }
+}
+
+/// I6:省份 × 品牌唯一 / 运营商必须挂省级(结构侧另有唯一索引)。
+pub fn i6_operator_province_brand(is_province_node: bool) -> Result<(), BosError> {
+    if is_province_node {
+        Ok(())
+    } else {
+        Err(BosError::klt(KltCode::T225, "运营商档案只能建在省级区域节点"))
+    }
+}
+
+/// 高危角色不得绑组:调用 user_group_role/bind 前拦截。
+pub fn reject_high_risk_group_bind(role_name: &str) -> Result<(), BosError> {
+    if bos_core::roles::is_high_risk_role_name(role_name) {
+        Err(BosError::forbidden_role(format!(
+            "高危角色 {role_name} 不得绑定用户组,只允许个人直授"
+        )))
+    } else {
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn high_risk_admin_blocked() {
+        assert!(reject_high_risk_group_bind("admin").is_err());
+        assert!(reject_high_risk_group_bind("ops").is_ok());
+    }
+
+    #[test]
+    fn i3_regular_must_one() {
+        assert!(i3_team_belong_counts(1, 0).is_ok());
+        assert!(i3_team_belong_counts(0, 0).is_err());
+        assert!(i3_team_belong_counts(1, 2).is_err());
+    }
+}

+ 13 - 0
src/crates/bos-invariant/tests/rbac_overreach.rs

@@ -0,0 +1,13 @@
+//! 越权回归:高危角色绑组必须被业务侧拦下(请求不出门)。
+
+use bos_invariant::reject_high_risk_group_bind;
+
+#[test]
+fn admin_group_bind_rejected() {
+    assert!(reject_high_risk_group_bind("admin").is_err());
+}
+
+#[test]
+fn ops_group_bind_allowed_at_biz_gate() {
+    assert!(reject_high_risk_group_bind("ops").is_ok());
+}

+ 16 - 0
src/crates/bos-io/Cargo.toml

@@ -0,0 +1,16 @@
+[package]
+name = "bos-io"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+bos-platform = { workspace = true }
+bos-scope = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+sqlx = { workspace = true }
+async-trait = { workspace = true }
+thiserror = { workspace = true }
+tracing = { workspace = true }
+chrono = { workspace = true }

+ 36 - 0
src/crates/bos-io/src/export.rs

@@ -0,0 +1,36 @@
+use bos_scope::AuthContext;
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ExportDataSource {
+    ActivationCodes,
+    ImportBatchCodes,
+    ImportBatchCustomers,
+    CustomerList,
+    ReconBatchDetail,
+}
+
+#[derive(Debug, Clone)]
+pub struct ExportRequest {
+    pub source: ExportDataSource,
+    pub auth: AuthContext,
+    pub filters: serde_json::Value,
+}
+
+pub const SYNC_EXPORT_ROW_THRESHOLD: i64 = 20_000;
+
+pub fn should_use_async(row_estimate: i64) -> bool {
+    row_estimate > SYNC_EXPORT_ROW_THRESHOLD
+}
+
+/// 只读身份不提供列表级导出。
+pub fn assert_list_export_role(role: bos_core::RoleCode) -> Result<(), bos_core::BosError> {
+    use bos_core::RoleCode::*;
+    match role {
+        Partner | Operator => Err(bos_core::BosError::forbidden_role(
+            "合伙人或运营商不提供列表级导出,仅批次详情单批导出可用",
+        )),
+        _ => Ok(()),
+    }
+}

+ 30 - 0
src/crates/bos-io/src/import.rs

@@ -0,0 +1,30 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ImportBatchStatus {
+    Running,
+    Completed,
+    HasFailures,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum ImportPipelineStage {
+    Parse,
+    StructureCheck,
+    RowValidate,
+    Provision,
+    BatchSettle,
+}
+
+pub const IMPORT_MAX_ROWS: usize = 500;
+
+pub fn assert_row_limit(rows: usize) -> Result<(), bos_core::BosError> {
+    if rows > IMPORT_MAX_ROWS {
+        Err(bos_core::BosError::bad_params(format!(
+            "导入行数 {rows} 超过上限 {IMPORT_MAX_ROWS}"
+        )))
+    } else {
+        Ok(())
+    }
+}

+ 7 - 0
src/crates/bos-io/src/lib.rs

@@ -0,0 +1,7 @@
+//! M2:导入流水线 + 谓词收窄导出。
+
+pub mod export;
+pub mod import;
+
+pub use export::{ExportDataSource, ExportRequest};
+pub use import::{assert_row_limit, ImportBatchStatus, ImportPipelineStage};

+ 16 - 0
src/crates/bos-jobs/Cargo.toml

@@ -0,0 +1,16 @@
+[package]
+name = "bos-jobs"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+bos-platform = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+sqlx = { workspace = true }
+async-trait = { workspace = true }
+thiserror = { workspace = true }
+tracing = { workspace = true }
+chrono = { workspace = true }
+axum = { workspace = true }

+ 31 - 0
src/crates/bos-jobs/src/handlers.rs

@@ -0,0 +1,31 @@
+use chrono::NaiveDate;
+
+use crate::registry::JobKey;
+use crate::report::RunReport;
+
+/// 作业函数签名:(biz_date, params) -> RunReport。租约在平台。
+pub async fn run_job(key: JobKey, biz_date: NaiveDate, _params: serde_json::Value) -> RunReport {
+    match key {
+        JobKey::SubEff => RunReport {
+            message: format!("SUB-EFF noop for {biz_date} (await subscriptions)"),
+            ..Default::default()
+        },
+        JobKey::StopGen => RunReport {
+            message: format!("STOP-GEN noop for {biz_date}"),
+            ..Default::default()
+        },
+        JobKey::Overdue => RunReport {
+            message: format!("OVERDUE scan-only for {biz_date}; notify deferred to M3"),
+            ..Default::default()
+        },
+        JobKey::DelegationSync => RunReport {
+            message: "DELEGATION-SYNC permanent obligation".into(),
+            ..Default::default()
+        },
+        other => RunReport {
+            message: format!("{} registered but not wired in phase1", other.as_str()),
+            skipped: 1,
+            ..Default::default()
+        },
+    }
+}

+ 8 - 0
src/crates/bos-jobs/src/lib.rs

@@ -0,0 +1,8 @@
+//! M1:作业函数与注册契约(调度在 SJC/ETS)。
+
+pub mod handlers;
+pub mod registry;
+pub mod report;
+
+pub use registry::{phase1_job_specs, JobKey, JobSpec, PHASE1_JOBS};
+pub use report::RunReport;

+ 90 - 0
src/crates/bos-jobs/src/registry.rs

@@ -0,0 +1,90 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
+pub enum JobKey {
+    #[serde(rename = "SUB-EFF")]
+    SubEff,
+    #[serde(rename = "STOP-GEN")]
+    StopGen,
+    #[serde(rename = "OVERDUE")]
+    Overdue,
+    #[serde(rename = "OPEN-GEN")]
+    OpenGen,
+    #[serde(rename = "SVC-GEN")]
+    SvcGen,
+    #[serde(rename = "RECON")]
+    Recon,
+    #[serde(rename = "DELEGATION-SYNC")]
+    DelegationSync,
+}
+
+impl JobKey {
+    pub fn as_str(self) -> &'static str {
+        match self {
+            Self::SubEff => "SUB-EFF",
+            Self::StopGen => "STOP-GEN",
+            Self::Overdue => "OVERDUE",
+            Self::OpenGen => "OPEN-GEN",
+            Self::SvcGen => "SVC-GEN",
+            Self::Recon => "RECON",
+            Self::DelegationSync => "DELEGATION-SYNC",
+        }
+    }
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct JobSpec {
+    pub key: JobKey,
+    pub name: String,
+    pub cron_hint: String,
+    pub wired_in_phase1: bool,
+}
+
+pub const PHASE1_JOBS: &[JobSpec] = &[];
+
+pub fn phase1_job_specs() -> Vec<JobSpec> {
+    vec![
+        JobSpec {
+            key: JobKey::SubEff,
+            name: "订阅生效翻转".into(),
+            cron_hint: "00:05".into(),
+            wired_in_phase1: true,
+        },
+        JobSpec {
+            key: JobKey::StopGen,
+            name: "到期停机生成".into(),
+            cron_hint: "00:15".into(),
+            wired_in_phase1: true,
+        },
+        JobSpec {
+            key: JobKey::Overdue,
+            name: "超期扫描(仅批次,不投递)".into(),
+            cron_hint: "08:00".into(),
+            wired_in_phase1: true,
+        },
+        JobSpec {
+            key: JobKey::DelegationSync,
+            name: "主/子账号委托同步".into(),
+            cron_hint: "event+daily".into(),
+            wired_in_phase1: true,
+        },
+        JobSpec {
+            key: JobKey::OpenGen,
+            name: "开户工单生成".into(),
+            cron_hint: "00:10".into(),
+            wired_in_phase1: false,
+        },
+        JobSpec {
+            key: JobKey::SvcGen,
+            name: "服务开通生成".into(),
+            cron_hint: "event".into(),
+            wired_in_phase1: false,
+        },
+        JobSpec {
+            key: JobKey::Recon,
+            name: "对账出账".into(),
+            cron_hint: "06:00".into(),
+            wired_in_phase1: false,
+        },
+    ]
+}

+ 10 - 0
src/crates/bos-jobs/src/report.rs

@@ -0,0 +1,10 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Default, Serialize, Deserialize)]
+pub struct RunReport {
+    pub processed: i64,
+    pub succeeded: i64,
+    pub skipped: i64,
+    pub failed: i64,
+    pub message: String,
+}

+ 10 - 0
src/crates/bos-notify/Cargo.toml

@@ -0,0 +1,10 @@
+[package]
+name = "bos-notify"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+serde = { workspace = true }
+thiserror = { workspace = true }
+tracing = { workspace = true }

+ 15 - 0
src/crates/bos-notify/src/lib.rs

@@ -0,0 +1,15 @@
+//! M3 占位:一期只做站内红点/标记,不接线 G1 投递。
+
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct InAppMarker {
+    pub user_id: String,
+    pub kind: String,
+    pub ref_id: String,
+    pub unread: bool,
+}
+
+pub fn delivery_enabled() -> bool {
+    false
+}

+ 17 - 0
src/crates/bos-platform/Cargo.toml

@@ -0,0 +1,17 @@
+[package]
+name = "bos-platform"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+seoh-service-sdk = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+thiserror = { workspace = true }
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+reqwest = { workspace = true }
+tracing = { workspace = true }
+tokio = { workspace = true }
+chrono = { workspace = true }

+ 16 - 0
src/crates/bos-platform/src/audit.rs

@@ -0,0 +1,16 @@
+use serde::{Deserialize, Serialize};
+use serde_json::Value;
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct AuditEvent {
+    pub actor_user_id: String,
+    pub action: String,
+    pub resource_type: String,
+    pub resource_id: String,
+    #[serde(default)]
+    pub before: Option<Value>,
+    #[serde(default)]
+    pub after: Option<Value>,
+    #[serde(default)]
+    pub detail: Option<Value>,
+}

+ 15 - 0
src/crates/bos-platform/src/clients/activation.rs

@@ -0,0 +1,15 @@
+use serde_json::{json, Value};
+use super::PlatformClient;
+use bos_core::BosError;
+
+impl PlatformClient {
+    pub async fn bootstrap_credential_create_batch(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/identity-provider/bootstrap_credential/create_batch@v1", json!({ "data": data })).await
+    }
+    pub async fn bootstrap_credential_export(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/identity-provider/bootstrap_credential/export@v1", json!({ "data": data })).await
+    }
+    pub async fn user_set_password(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/iam-user/user/set_password@v1", json!({ "data": data })).await
+    }
+}

+ 15 - 0
src/crates/bos-platform/src/clients/iam.rs

@@ -0,0 +1,15 @@
+use serde_json::{json, Value};
+use super::PlatformClient;
+use bos_core::BosError;
+
+impl PlatformClient {
+    pub async fn user_create(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/iam-user/user/create@v1", json!({ "data": data })).await
+    }
+    pub async fn user_get(&self, user_id: &str) -> Result<Value, BosError> {
+        self.post_json("/api/system/iam-user/user/get@v1", json!({ "data": { "user_id": user_id } })).await
+    }
+    pub async fn group_role_bind(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/iam-user-group/user_group_role/bind@v1", json!({ "data": data })).await
+    }
+}

+ 12 - 0
src/crates/bos-platform/src/clients/impexp.rs

@@ -0,0 +1,12 @@
+use serde_json::{json, Value};
+use super::PlatformClient;
+use bos_core::BosError;
+
+impl PlatformClient {
+    pub async fn import_export_submit(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/import-export/task/submit@v1", json!({ "data": data })).await
+    }
+    pub async fn import_export_get(&self, task_id: &str) -> Result<Value, BosError> {
+        self.post_json("/api/system/import-export/task/get@v1", json!({ "data": { "task_id": task_id } })).await
+    }
+}

+ 58 - 0
src/crates/bos-platform/src/clients/mod.rs

@@ -0,0 +1,58 @@
+pub mod activation;
+pub mod iam;
+pub mod impexp;
+pub mod resource_metadata;
+pub mod scheduler;
+
+use reqwest::Client;
+use std::sync::Arc;
+
+#[derive(Clone)]
+pub struct PlatformClient {
+    pub http: Client,
+    pub gateway_base: String,
+    pub token: Arc<dyn Fn() -> String + Send + Sync>,
+}
+
+impl PlatformClient {
+    pub fn new(gateway_base: impl Into<String>, token: Arc<dyn Fn() -> String + Send + Sync>) -> Self {
+        Self {
+            http: Client::builder()
+                .danger_accept_invalid_certs(false)
+                .build()
+                .expect("reqwest client"),
+            gateway_base: gateway_base.into().trim_end_matches('/').to_string(),
+            token,
+        }
+    }
+
+    pub async fn post_json(
+        &self,
+        path: &str,
+        body: serde_json::Value,
+    ) -> Result<serde_json::Value, bos_core::BosError> {
+        let url = format!("{}{}", self.gateway_base, path);
+        let token = (self.token)();
+        let mut req = self.http.post(&url).json(&body);
+        if !token.is_empty() {
+            req = req.header("Authorization", format!("Bearer {token}"));
+            req = req.header("X-Internal-Token", &token);
+        }
+        let resp = req
+            .send()
+            .await
+            .map_err(|e| bos_core::BosError::internal(format!("platform call failed: {e}")))?;
+        let status = resp.status();
+        let v: serde_json::Value = resp
+            .json()
+            .await
+            .map_err(|e| bos_core::BosError::internal(format!("platform decode: {e}")))?;
+        if !status.is_success() {
+            return Err(bos_core::BosError::biz(
+                bos_core::ErrorCode::Downstream,
+                format!("platform HTTP {status}: {v}"),
+            ));
+        }
+        Ok(v)
+    }
+}

+ 21 - 0
src/crates/bos-platform/src/clients/resource_metadata.rs

@@ -0,0 +1,21 @@
+use serde_json::{json, Value};
+use super::PlatformClient;
+use bos_core::BosError;
+
+impl PlatformClient {
+    pub async fn node_create(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/resource-metadata/node/create@v1", json!({ "data": data })).await
+    }
+    pub async fn node_rename(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/resource-metadata/node/update@v1", json!({ "data": data })).await
+    }
+    pub async fn node_delete(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/resource-metadata/node/delete@v1", json!({ "data": data })).await
+    }
+    pub async fn registered_resource_create(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/resource-metadata/registered_resource/create@v1", json!({ "data": data })).await
+    }
+    pub async fn registered_resource_move(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/resource-metadata/registered_resource/move@v1", json!({ "data": data })).await
+    }
+}

+ 21 - 0
src/crates/bos-platform/src/clients/scheduler.rs

@@ -0,0 +1,21 @@
+use serde_json::{json, Value};
+use super::PlatformClient;
+use bos_core::BosError;
+
+impl PlatformClient {
+    pub async fn sjc_job_register(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/scheduled-job-center/job/register@v1", json!({ "data": data })).await
+    }
+    pub async fn sjc_job_toggle(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/scheduled-job-center/job/toggle@v1", json!({ "data": data })).await
+    }
+    pub async fn sjc_job_list(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/scheduled-job-center/job/list@v1", json!({ "data": data })).await
+    }
+    pub async fn ets_subscribe(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/event-task-scheduler/subscription/create@v1", json!({ "data": data })).await
+    }
+    pub async fn ets_run_once(&self, data: Value) -> Result<Value, BosError> {
+        self.post_json("/api/system/event-task-scheduler/task/run_once@v1", json!({ "data": data })).await
+    }
+}

+ 15 - 0
src/crates/bos-platform/src/config.rs

@@ -0,0 +1,15 @@
+use serde::Deserialize;
+
+#[derive(Debug, Clone, Default, Deserialize)]
+pub struct PlatformUrls {
+    pub gateway_url: String,
+    pub registry_url: String,
+    pub iam_user_url: String,
+    pub iam_user_group_url: String,
+    pub iam_role_url: String,
+    pub resource_metadata_url: String,
+    pub identity_provider_url: String,
+    pub sjc_url: String,
+    pub ets_url: String,
+    pub import_export_url: String,
+}

+ 8 - 0
src/crates/bos-platform/src/lib.rs

@@ -0,0 +1,8 @@
+//! bos-platform:SDK 胶合与平台客户端(调用+映射,不落平台影子表)。
+
+pub mod audit;
+pub mod clients;
+pub mod config;
+
+pub use audit::AuditEvent;
+pub use config::PlatformUrls;

+ 15 - 0
src/crates/bos-scope/Cargo.toml

@@ -0,0 +1,15 @@
+[package]
+name = "bos-scope"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+bos-platform = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+sqlx = { workspace = true }
+async-trait = { workspace = true }
+thiserror = { workspace = true }
+tracing = { workspace = true }
+chrono = { workspace = true }

+ 40 - 0
src/crates/bos-scope/src/grant.rs

@@ -0,0 +1,40 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ScopeMode {
+    FollowTeam,
+    Region,
+    Customer,
+}
+
+impl ScopeMode {
+    pub fn as_str(self) -> &'static str {
+        match self {
+            Self::FollowTeam => "follow_team",
+            Self::Region => "region",
+            Self::Customer => "customer",
+        }
+    }
+
+    pub fn parse(s: &str) -> Option<Self> {
+        match s {
+            "follow_team" => Some(Self::FollowTeam),
+            "region" => Some(Self::Region),
+            "customer" => Some(Self::Customer),
+            _ => None,
+        }
+    }
+
+    pub fn default_for_new_member() -> Self {
+        Self::FollowTeam
+    }
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct ScopeGrant {
+    pub holder_type: String,
+    pub holder_id: String,
+    pub target_type: String,
+    pub target_id: String,
+}

+ 11 - 0
src/crates/bos-scope/src/lib.rs

@@ -0,0 +1,11 @@
+//! M4:行级可见范围解析。
+
+pub mod grant;
+pub mod mount;
+pub mod roles_policy;
+pub mod scoped_select;
+
+pub use grant::{ScopeGrant, ScopeMode};
+pub use mount::{assert_mount_before_create, CustomerMountRequest, MountTerminalState};
+pub use roles_policy::visible_customer_strategy;
+pub use scoped_select::{AuthContext, DbScopedSelect, ScopedSelect, SubjectRef};

+ 31 - 0
src/crates/bos-scope/src/mount.rs

@@ -0,0 +1,31 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum MountTerminalState {
+    Pending,
+    Mounted,
+    Failed,
+    Cleaned,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct CustomerMountRequest {
+    pub mount_request_id: String,
+    pub customer_id: Option<String>,
+    pub hierarchy_id: String,
+    pub parent_node_id: String,
+    pub terminal_state: MountTerminalState,
+}
+
+/// 口径 13:先挂树、成功再建档;删除相反。
+pub fn assert_mount_before_create(mounted: bool) -> Result<(), bos_core::BosError> {
+    if mounted {
+        Ok(())
+    } else {
+        Err(bos_core::BosError::klt(
+            bos_core::KltCode::S401,
+            "客户建档前必须先完成资源树挂载",
+        ))
+    }
+}

+ 23 - 0
src/crates/bos-scope/src/roles_policy.rs

@@ -0,0 +1,23 @@
+use bos_core::RoleCode;
+
+/// 总则§6.3 可见客户集合来源策略。
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum VisibilitySource {
+    /// Tree ∪ Picked(区域轴)
+    TreeUnionPicked,
+    /// 身份绑定等值
+    Bind,
+    /// 归属字段等值(partner_id / operator_id)
+    Owner,
+}
+
+pub fn visible_customer_strategy(role: RoleCode) -> VisibilitySource {
+    match role {
+        RoleCode::Admin | RoleCode::RegAdmin | RoleCode::RegSubAdmin | RoleCode::TeamLead => {
+            VisibilitySource::TreeUnionPicked
+        }
+        RoleCode::Ops | RoleCode::Worker => VisibilitySource::TreeUnionPicked,
+        RoleCode::Enterprise | RoleCode::Sub => VisibilitySource::Bind,
+        RoleCode::Partner | RoleCode::Operator => VisibilitySource::Owner,
+    }
+}

+ 141 - 0
src/crates/bos-scope/src/scoped_select.rs

@@ -0,0 +1,141 @@
+use bos_core::{BosError, RoleCode};
+use serde::{Deserialize, Serialize};
+use std::collections::HashSet;
+
+use crate::grant::ScopeMode;
+use crate::roles_policy::{visible_customer_strategy, VisibilitySource};
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct SubjectRef {
+    pub subject_type: String,
+    pub subject_id: String,
+}
+
+#[derive(Debug, Clone)]
+pub struct AuthContext {
+    pub user_id: String,
+    pub role: RoleCode,
+    pub subject: SubjectRef,
+    pub entry_only: bool,
+    pub scope_mode: Option<ScopeMode>,
+    /// 通道②:网关注入的已授权实例(真源 HTTP 列举)
+    pub granted_resource_instances: HashSet<String>,
+    pub username: Option<String>,
+}
+
+impl AuthContext {
+    pub fn require_roles(&self, allowed: &[RoleCode]) -> Result<(), BosError> {
+        if allowed.contains(&self.role) {
+            Ok(())
+        } else {
+            Err(BosError::forbidden_role(format!(
+                "角色 {} 无权执行此操作",
+                self.role.as_str()
+            )))
+        }
+    }
+}
+
+/// 导出器与列表只接收本 trait,拒绝裸 SQL。
+#[async_trait::async_trait]
+pub trait ScopedSelect: Send + Sync {
+    /// 按角色策略解析可见客户 ID 集合。
+    /// ⛔ 禁止「先取编号再 IN」作为联邦列表退路;U-80 未明时联邦页暂不提供。
+    async fn visible_customer_ids(&self, auth: &AuthContext) -> Result<Vec<String>, BosError>;
+
+    /// 区域节点可见性(子树裁剪);区域树未就绪时诚实降级为空。
+    async fn visible_region_node_ids(&self, auth: &AuthContext) -> Result<Vec<String>, BosError>;
+}
+
+/// 进程内默认实现:Owner/Bind 走业务库;Tree 依赖 dim_node_ancestor / 注入 granted。
+pub struct DbScopedSelect {
+    pub pool: sqlx::PgPool,
+}
+
+#[async_trait::async_trait]
+impl ScopedSelect for DbScopedSelect {
+    async fn visible_customer_ids(&self, auth: &AuthContext) -> Result<Vec<String>, BosError> {
+        match visible_customer_strategy(auth.role) {
+            VisibilitySource::Owner => {
+                let col = match auth.role {
+                    RoleCode::Partner => "partner_id",
+                    RoleCode::Operator => "operator_id",
+                    _ => unreachable!(),
+                };
+                let q = format!(
+                    "SELECT customer_id::text FROM customer WHERE {} = $1 AND deleted_at IS NULL",
+                    col
+                );
+                let rows: Vec<(String,)> = sqlx::query_as(&q)
+                    .bind(&auth.subject.subject_id)
+                    .fetch_all(&self.pool)
+                    .await
+                    .map_err(|e| BosError::internal(e.to_string()))?;
+                Ok(rows.into_iter().map(|r| r.0).collect())
+            }
+            VisibilitySource::Bind => {
+                Ok(vec![auth.subject.subject_id.clone()])
+            }
+            VisibilitySource::TreeUnionPicked => {
+                // 优先消费通道②注入;否则走 scope_grant 点选 / follow_team。
+                if !auth.granted_resource_instances.is_empty() {
+                    return Ok(auth.granted_resource_instances.iter().cloned().collect());
+                }
+                let rows: Vec<(String,)> = sqlx::query_as(
+                    r#"
+                    SELECT target_id FROM scope_grant
+                    WHERE holder_type = 'user' AND holder_id = $1 AND target_type = 'customer'
+                    "#,
+                )
+                .bind(&auth.user_id)
+                .fetch_all(&self.pool)
+                .await
+                .map_err(|e| BosError::internal(e.to_string()))?;
+                Ok(rows.into_iter().map(|r| r.0).collect())
+            }
+        }
+    }
+
+    async fn visible_region_node_ids(&self, auth: &AuthContext) -> Result<Vec<String>, BosError> {
+        if auth.role == RoleCode::Admin {
+            let rows: Vec<(String,)> = sqlx::query_as(
+                "SELECT node_id FROM dim_node_ancestor WHERE ancestor_id = node_id",
+            )
+            .fetch_all(&self.pool)
+            .await
+            .map_err(|e| BosError::internal(e.to_string()))?;
+            return Ok(rows.into_iter().map(|r| r.0).collect());
+        }
+        if !auth.granted_resource_instances.is_empty() {
+            return Ok(auth.granted_resource_instances.iter().cloned().collect());
+        }
+        let rows: Vec<(String,)> = sqlx::query_as(
+            r#"
+            SELECT target_id FROM scope_grant
+            WHERE holder_type IN ('user','ent_team','ops_team','partner')
+              AND holder_id = $1 AND target_type = 'region'
+            "#,
+        )
+        .bind(&auth.subject.subject_id)
+        .fetch_all(&self.pool)
+        .await
+        .map_err(|e| BosError::internal(e.to_string()))?;
+        Ok(rows.into_iter().map(|r| r.0).collect())
+    }
+}
+
+/// I4:自定义范围展开后 ⊆ 团队范围。
+pub fn check_scope_containment(
+    member_expanded: &HashSet<String>,
+    team_expanded: &HashSet<String>,
+) -> Result<(), BosError> {
+    let overflow: Vec<_> = member_expanded.difference(team_expanded).cloned().collect();
+    if overflow.is_empty() {
+        Ok(())
+    } else {
+        Err(BosError::bad_params(format!(
+            "成员负责范围超出团队范围: {}",
+            overflow.join(",")
+        )))
+    }
+}

+ 13 - 0
src/docs/路由在册核对表模板.md

@@ -0,0 +1,13 @@
+# 平台路由在册核对表(上线并列门禁)
+
+> 承接原 A64:随上线申请留档。扫描到的引用点数与去重路由条数必须相符。
+
+| 路由名 | 引用位置(crate/file) | OpenAPI 位置(文件:行) | 核验所用已提交 commit | 核验人 | 日期 |
+| --- | --- | --- | --- | --- | --- |
+| | | | | | |
+
+核对步骤:
+
+1. `rg -n 'post_json\\(\"/api/' src/crates/bos-platform` 列出平台调用。
+2. 在对应平台服务已提交 OpenAPI 中定位同名路由。
+3. 填表;缺 OpenAPI 行则不得接线上线。

+ 505 - 0
src/migrations/dev/20261104000001_bos_core_tables.sql

@@ -0,0 +1,505 @@
+-- klt-bos 一期账户域基表(索引同批交付)
+-- ⛔ 黑名单:区域归属不得落业务副本列;禁止自建区域主表、调度影子表、异步任务影子表、口令/会话列
+
+CREATE TABLE IF NOT EXISTS bos_user_binding (
+    user_id BIGINT PRIMARY KEY,
+    scope_type VARCHAR(16) NOT NULL DEFAULT 'end_user',
+    scope_id VARCHAR(64) NOT NULL DEFAULT '',
+    role_code VARCHAR(32) NOT NULL,
+    subject_type VARCHAR(16) NOT NULL,
+    subject_id VARCHAR(64) NOT NULL,
+    username VARCHAR(64) NOT NULL,
+    username_norm VARCHAR(64) NOT NULL,
+    mobile VARCHAR(20) NULL,
+    entry_only BOOLEAN NOT NULL DEFAULT FALSE,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+    updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_bos_user_binding_username_norm ON bos_user_binding (username_norm);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_bos_user_binding_mobile ON bos_user_binding (mobile) WHERE mobile IS NOT NULL;
+COMMENT ON TABLE bos_user_binding IS '业务账号绑定:平台用户与业务主体/角色的唯一真源';
+COMMENT ON COLUMN bos_user_binding.user_id IS '平台 iam-user 账号 ID';
+COMMENT ON COLUMN bos_user_binding.scope_type IS '平台作用域类型(一期默认 end_user)';
+COMMENT ON COLUMN bos_user_binding.scope_id IS '平台作用域 ID';
+COMMENT ON COLUMN bos_user_binding.role_code IS '业务角色码(admin/regAdmin/teamLead/ops/enterprise/sub/partner/operator 等)';
+COMMENT ON COLUMN bos_user_binding.subject_type IS '业务主体类型(hq/region/ops_team/ent_team/customer/sub_account/partner/operator)';
+COMMENT ON COLUMN bos_user_binding.subject_id IS '业务主体 ID(团队/客户/合伙人/运营商/区域节点等)';
+COMMENT ON COLUMN bos_user_binding.username IS '登录名原文';
+COMMENT ON COLUMN bos_user_binding.username_norm IS '登录名归一化(去空白后小写),全站唯一';
+COMMENT ON COLUMN bos_user_binding.mobile IS '手机号(11 位),全站唯一(可空)';
+COMMENT ON COLUMN bos_user_binding.entry_only IS '录入人员变体标记(常规运维子账号,工单查询恒空集)';
+COMMENT ON COLUMN bos_user_binding.created_at IS '创建时间';
+COMMENT ON COLUMN bos_user_binding.updated_at IS '更新时间';
+
+CREATE TABLE IF NOT EXISTS bos_account_ext (
+    user_id BIGINT PRIMARY KEY REFERENCES bos_user_binding(user_id),
+    code_cipher TEXT NULL,
+    code_hmac VARCHAR(128) NULL,
+    expire_date DATE NULL,
+    delivered_at TIMESTAMPTZ NULL,
+    activated_at TIMESTAMPTZ NULL,
+    pwd_set_at TIMESTAMPTZ NULL,
+    status VARCHAR(16) NOT NULL DEFAULT 'none',
+    key_version INT NOT NULL DEFAULT 1
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_bos_account_ext_code_hmac ON bos_account_ext (code_hmac) WHERE code_hmac IS NOT NULL;
+COMMENT ON TABLE bos_account_ext IS '账号业务扩展:激活码生命周期与设密状态';
+COMMENT ON COLUMN bos_account_ext.user_id IS '关联平台用户 ID(与 bos_user_binding 一对一)';
+COMMENT ON COLUMN bos_account_ext.code_cipher IS '激活码密文(AES-256-GCM,带 key_version 前缀)';
+COMMENT ON COLUMN bos_account_ext.code_hmac IS '激活码 HMAC 检索列(唯一,防同码双户)';
+COMMENT ON COLUMN bos_account_ext.expire_date IS '激活码有效截止日;空=无未消费凭证';
+COMMENT ON COLUMN bos_account_ext.delivered_at IS '激活码交付时间';
+COMMENT ON COLUMN bos_account_ext.activated_at IS '激活时间';
+COMMENT ON COLUMN bos_account_ext.pwd_set_at IS '设密时间';
+COMMENT ON COLUMN bos_account_ext.status IS '激活码状态:none/issued/issuing/activated';
+COMMENT ON COLUMN bos_account_ext.key_version IS '加密密钥版本号(支持轮换)';
+
+CREATE TABLE IF NOT EXISTS bos_seq_year (
+    year INT NOT NULL,
+    kind VARCHAR(32) NOT NULL,
+    last_value BIGINT NOT NULL DEFAULT 0,
+    PRIMARY KEY (year, kind)
+);
+COMMENT ON TABLE bos_seq_year IS '年度流水发号器(按年+种类行锁取号)';
+COMMENT ON COLUMN bos_seq_year.year IS '发号年份';
+COMMENT ON COLUMN bos_seq_year.kind IS '发号种类(如 customer、import_batch)';
+COMMENT ON COLUMN bos_seq_year.last_value IS '当年该种类已用最大流水值';
+
+CREATE TABLE IF NOT EXISTS scope_grant (
+    id BIGSERIAL PRIMARY KEY,
+    holder_type VARCHAR(32) NOT NULL,
+    holder_id VARCHAR(64) NOT NULL,
+    target_type VARCHAR(32) NOT NULL,
+    target_id VARCHAR(64) NOT NULL,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE INDEX IF NOT EXISTS idx_scope_grant_holder ON scope_grant (holder_type, holder_id);
+CREATE INDEX IF NOT EXISTS idx_scope_grant_target ON scope_grant (target_type, target_id);
+COMMENT ON TABLE scope_grant IS '负责范围授权:持有者对区域/客户等目标的授权行';
+COMMENT ON COLUMN scope_grant.id IS '主键';
+COMMENT ON COLUMN scope_grant.holder_type IS '持有者类型(如 user/ent_team/ops_team/partner)';
+COMMENT ON COLUMN scope_grant.holder_id IS '持有者 ID';
+COMMENT ON COLUMN scope_grant.target_type IS '目标类型(如 region/customer)';
+COMMENT ON COLUMN scope_grant.target_id IS '目标 ID';
+COMMENT ON COLUMN scope_grant.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS dim_node_ancestor (
+    node_id VARCHAR(64) NOT NULL,
+    ancestor_id VARCHAR(64) NOT NULL,
+    depth INT NOT NULL DEFAULT 0,
+    PRIMARY KEY (node_id, ancestor_id)
+);
+COMMENT ON TABLE dim_node_ancestor IS '区域节点祖先闭包(查询缓存,非归属真源)';
+COMMENT ON COLUMN dim_node_ancestor.node_id IS '节点 ID';
+COMMENT ON COLUMN dim_node_ancestor.ancestor_id IS '祖先节点 ID(含自身)';
+COMMENT ON COLUMN dim_node_ancestor.depth IS '相对深度(自身为 0)';
+
+CREATE TABLE IF NOT EXISTS operator (
+    operator_id VARCHAR(64) PRIMARY KEY,
+    brand VARCHAR(16) NOT NULL,
+    region_node_id VARCHAR(64) NOT NULL,
+    name VARCHAR(128) NOT NULL,
+    name_norm VARCHAR(128) NOT NULL,
+    recon_day INT NULL,
+    pay_cycle VARCHAR(32) NULL,
+    settle_mode VARCHAR(16) NULL,
+    settle_value NUMERIC(12,4) NULL,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_operator_region_name ON operator (region_node_id, name_norm);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_operator_region_brand ON operator (region_node_id, brand);
+COMMENT ON TABLE operator IS '运营商档案';
+COMMENT ON COLUMN operator.operator_id IS '运营商 ID';
+COMMENT ON COLUMN operator.brand IS '品牌:移动/联通/电信';
+COMMENT ON COLUMN operator.region_node_id IS '所属省级区域节点 ID(运营商只能建在省级)';
+COMMENT ON COLUMN operator.name IS '运营商名称';
+COMMENT ON COLUMN operator.name_norm IS '名称归一化(同省同名唯一)';
+COMMENT ON COLUMN operator.recon_day IS '对账日(1–28;空=跟随默认)';
+COMMENT ON COLUMN operator.pay_cycle IS '付款周期(只记录不扣款)';
+COMMENT ON COLUMN operator.settle_mode IS '分成方式:ratio/amount/per_account;空=未配置';
+COMMENT ON COLUMN operator.settle_value IS '分成取值(单位由 settle_mode 决定)';
+COMMENT ON COLUMN operator.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS partner (
+    partner_id VARCHAR(64) PRIMARY KEY,
+    name VARCHAR(128) NOT NULL,
+    name_norm VARCHAR(128) NOT NULL,
+    duty_desc TEXT NULL,
+    region_node_id VARCHAR(64) NOT NULL,
+    mobile VARCHAR(20) NULL,
+    status VARCHAR(16) NOT NULL DEFAULT 'active',
+    settle_mode VARCHAR(16) NULL,
+    settle_value NUMERIC(12,4) NULL,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_partner_name_norm ON partner (name_norm);
+COMMENT ON TABLE partner IS '合伙人档案(区域渠道,只有一层)';
+COMMENT ON COLUMN partner.partner_id IS '合伙人 ID';
+COMMENT ON COLUMN partner.name IS '合伙人名称';
+COMMENT ON COLUMN partner.name_norm IS '名称归一化(全站唯一)';
+COMMENT ON COLUMN partner.duty_desc IS '职责说明';
+COMMENT ON COLUMN partner.region_node_id IS '建档所属区域节点 ID';
+COMMENT ON COLUMN partner.mobile IS '联系手机号';
+COMMENT ON COLUMN partner.status IS '状态(如 active)';
+COMMENT ON COLUMN partner.settle_mode IS '分成方式:ratio/amount/per_account;空=未配置(对名下客户统一生效)';
+COMMENT ON COLUMN partner.settle_value IS '分成取值(单位由 settle_mode 决定)';
+COMMENT ON COLUMN partner.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS ent_team (
+    team_id VARCHAR(64) PRIMARY KEY,
+    team_name VARCHAR(128) NOT NULL,
+    team_name_norm VARCHAR(128) NOT NULL,
+    is_builtin BOOLEAN NOT NULL DEFAULT FALSE,
+    owner_user_id BIGINT NULL,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_ent_team_name ON ent_team (team_name_norm);
+COMMENT ON TABLE ent_team IS '运营团队档案';
+COMMENT ON COLUMN ent_team.team_id IS '运营团队 ID';
+COMMENT ON COLUMN ent_team.team_name IS '团队名称';
+COMMENT ON COLUMN ent_team.team_name_norm IS '团队名称归一化(唯一)';
+COMMENT ON COLUMN ent_team.is_builtin IS '是否内置团队(如「总部 · 不限区域」,不可删)';
+COMMENT ON COLUMN ent_team.owner_user_id IS '主账号用户 ID';
+COMMENT ON COLUMN ent_team.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS ent_team_member (
+    team_id VARCHAR(64) NOT NULL REFERENCES ent_team(team_id),
+    user_id BIGINT NOT NULL,
+    is_primary BOOLEAN NOT NULL DEFAULT FALSE,
+    PRIMARY KEY (team_id, user_id)
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_ent_team_primary ON ent_team_member (team_id) WHERE is_primary;
+COMMENT ON TABLE ent_team_member IS '运营团队成员';
+COMMENT ON COLUMN ent_team_member.team_id IS '运营团队 ID';
+COMMENT ON COLUMN ent_team_member.user_id IS '成员用户 ID';
+COMMENT ON COLUMN ent_team_member.is_primary IS '是否主账号(每团队有且仅有一个)';
+
+CREATE TABLE IF NOT EXISTS ops_team (
+    team_id VARCHAR(64) PRIMARY KEY,
+    team_type VARCHAR(32) NOT NULL,
+    team_name VARCHAR(128) NOT NULL,
+    team_name_norm VARCHAR(128) NOT NULL,
+    region_node_id VARCHAR(64) NOT NULL,
+    dispatch_mode VARCHAR(32) NOT NULL DEFAULT 'manual',
+    settle_mode VARCHAR(16) NULL,
+    settle_value NUMERIC(12,4) NULL,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_ops_team_type_name ON ops_team (team_type, team_name_norm);
+COMMENT ON TABLE ops_team IS '运维团队档案';
+COMMENT ON COLUMN ops_team.team_id IS '运维团队 ID';
+COMMENT ON COLUMN ops_team.team_type IS '团队类型:regular(常规)/construction(施工)';
+COMMENT ON COLUMN ops_team.team_name IS '团队名称';
+COMMENT ON COLUMN ops_team.team_name_norm IS '团队名称归一化(同类型唯一)';
+COMMENT ON COLUMN ops_team.region_node_id IS '所属区域节点 ID';
+COMMENT ON COLUMN ops_team.dispatch_mode IS '工单分派方式:manual/auto_avg';
+COMMENT ON COLUMN ops_team.settle_mode IS '分成方式:ratio/amount/per_account;空=未配置';
+COMMENT ON COLUMN ops_team.settle_value IS '分成取值(单位由 settle_mode 决定)';
+COMMENT ON COLUMN ops_team.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS ops_team_ticket_type (
+    team_id VARCHAR(64) NOT NULL REFERENCES ops_team(team_id),
+    ticket_type VARCHAR(32) NOT NULL,
+    PRIMARY KEY (team_id, ticket_type)
+);
+COMMENT ON TABLE ops_team_ticket_type IS '运维团队可承接的工单类型';
+COMMENT ON COLUMN ops_team_ticket_type.team_id IS '运维团队 ID';
+COMMENT ON COLUMN ops_team_ticket_type.ticket_type IS '工单类型码';
+
+CREATE TABLE IF NOT EXISTS ops_member (
+    member_id VARCHAR(64) PRIMARY KEY,
+    team_id VARCHAR(64) NOT NULL REFERENCES ops_team(team_id),
+    user_id BIGINT NOT NULL UNIQUE,
+    member_type VARCHAR(32) NOT NULL,
+    scope_mode VARCHAR(32) NOT NULL DEFAULT 'follow_team',
+    is_primary BOOLEAN NOT NULL DEFAULT FALSE,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_ops_member_primary ON ops_member (team_id) WHERE is_primary;
+COMMENT ON TABLE ops_member IS '运维团队成员';
+COMMENT ON COLUMN ops_member.member_id IS '成员档案 ID';
+COMMENT ON COLUMN ops_member.team_id IS '所属运维团队 ID';
+COMMENT ON COLUMN ops_member.user_id IS '绑定平台用户 ID(一人一档)';
+COMMENT ON COLUMN ops_member.member_type IS '成员类型:regular(常规)/construction(施工)';
+COMMENT ON COLUMN ops_member.scope_mode IS '负责范围形态:follow_team/region/customer';
+COMMENT ON COLUMN ops_member.is_primary IS '是否团队主账号(每团队有且仅有一个)';
+COMMENT ON COLUMN ops_member.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS customer (
+    customer_id VARCHAR(64) PRIMARY KEY,
+    customer_name VARCHAR(256) NOT NULL,
+    subject_type VARCHAR(32) NOT NULL,
+    identity_no_cipher TEXT NULL,
+    identity_no_hash VARCHAR(128) NULL,
+    operator_id VARCHAR(64) NULL,
+    partner_id VARCHAR(64) NULL,
+    acct_status VARCHAR(32) NOT NULL DEFAULT 'active',
+    quota_cents BIGINT NOT NULL DEFAULT 0,
+    resource_id VARCHAR(64) NULL,
+    deleted_at TIMESTAMPTZ NULL,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+    updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_customer_identity_hash ON customer (identity_no_hash) WHERE identity_no_hash IS NOT NULL;
+CREATE INDEX IF NOT EXISTS idx_customer_operator ON customer (operator_id);
+CREATE INDEX IF NOT EXISTS idx_customer_partner ON customer (partner_id);
+CREATE INDEX IF NOT EXISTS idx_customer_resource ON customer (resource_id);
+COMMENT ON TABLE customer IS '客户主档';
+COMMENT ON COLUMN customer.customer_id IS '客户主体号(如 KL-{年}-{流水})';
+COMMENT ON COLUMN customer.customer_name IS '客户名称(企业名称同字段,允许重名)';
+COMMENT ON COLUMN customer.subject_type IS '主体类型:enterprise/individual/sole_proprietor';
+COMMENT ON COLUMN customer.identity_no_cipher IS '识别号密文';
+COMMENT ON COLUMN customer.identity_no_hash IS '识别号归一化 HMAC(建档查重幂等键)';
+COMMENT ON COLUMN customer.operator_id IS '归属运营商 ID';
+COMMENT ON COLUMN customer.partner_id IS '归属合伙人 ID';
+COMMENT ON COLUMN customer.acct_status IS '服务开通状态';
+COMMENT ON COLUMN customer.quota_cents IS '额度(分)';
+COMMENT ON COLUMN customer.resource_id IS '资源树资源 ID(通常等于 customer_id)';
+COMMENT ON COLUMN customer.deleted_at IS '删除时间(空=未删除)';
+COMMENT ON COLUMN customer.created_at IS '创建时间';
+COMMENT ON COLUMN customer.updated_at IS '更新时间';
+
+CREATE TABLE IF NOT EXISTS customer_region_mount (
+    mount_request_id VARCHAR(64) PRIMARY KEY,
+    customer_id VARCHAR(64) NULL,
+    hierarchy_id VARCHAR(64) NOT NULL,
+    parent_node_id VARCHAR(64) NOT NULL,
+    terminal_state VARCHAR(32) NOT NULL DEFAULT 'pending',
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+    cleaned_at TIMESTAMPTZ NULL
+);
+COMMENT ON TABLE customer_region_mount IS '客户区域挂载请求与本地终态(悬空清理判定依据)';
+COMMENT ON COLUMN customer_region_mount.mount_request_id IS '挂载请求号(主键)';
+COMMENT ON COLUMN customer_region_mount.customer_id IS '客户主体号(挂载成功后回填)';
+COMMENT ON COLUMN customer_region_mount.hierarchy_id IS '资源树层级 ID';
+COMMENT ON COLUMN customer_region_mount.parent_node_id IS '挂载父区域节点 ID';
+COMMENT ON COLUMN customer_region_mount.terminal_state IS '终态:pending 等';
+COMMENT ON COLUMN customer_region_mount.created_at IS '创建时间';
+COMMENT ON COLUMN customer_region_mount.cleaned_at IS '悬空清理完成时间';
+
+CREATE TABLE IF NOT EXISTS customer_team_belong (
+    id BIGSERIAL PRIMARY KEY,
+    customer_id VARCHAR(64) NOT NULL REFERENCES customer(customer_id),
+    team_type VARCHAR(32) NOT NULL,
+    team_id VARCHAR(64) NOT NULL,
+    is_current BOOLEAN NOT NULL DEFAULT TRUE,
+    valid_from TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+    valid_to TIMESTAMPTZ NULL
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_customer_team_current ON customer_team_belong (customer_id, team_type) WHERE is_current;
+COMMENT ON TABLE customer_team_belong IS '客户对各类型运维团队的归属(当前值 + 历史)';
+COMMENT ON COLUMN customer_team_belong.id IS '主键';
+COMMENT ON COLUMN customer_team_belong.customer_id IS '客户主体号';
+COMMENT ON COLUMN customer_team_belong.team_type IS '团队类型:regular/construction(同类型当前至多一条)';
+COMMENT ON COLUMN customer_team_belong.team_id IS '运维团队 ID';
+COMMENT ON COLUMN customer_team_belong.is_current IS '是否当前归属';
+COMMENT ON COLUMN customer_team_belong.valid_from IS '生效起';
+COMMENT ON COLUMN customer_team_belong.valid_to IS '生效止(空=仍有效)';
+
+CREATE TABLE IF NOT EXISTS billing_snapshot_customer (
+    period VARCHAR(7) NOT NULL,
+    customer_id VARCHAR(64) NOT NULL,
+    region_node_id VARCHAR(64) NOT NULL,
+    region_path TEXT NOT NULL,
+    operator_id VARCHAR(64) NOT NULL,
+    partner_id VARCHAR(64) NULL,
+    team_regular_id VARCHAR(64) NULL,
+    team_construction_id VARCHAR(64) NULL,
+    snapshot_source VARCHAR(16) NOT NULL DEFAULT 'job',
+    frozen_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+    PRIMARY KEY (period, customer_id)
+);
+COMMENT ON TABLE billing_snapshot_customer IS '账期期初客户归属与区域快照(出账只读,禁 as-of)';
+COMMENT ON COLUMN billing_snapshot_customer.period IS '账期标识 YYYY-MM';
+COMMENT ON COLUMN billing_snapshot_customer.customer_id IS '客户主体号';
+COMMENT ON COLUMN billing_snapshot_customer.region_node_id IS '冻结的归属区域节点 ID';
+COMMENT ON COLUMN billing_snapshot_customer.region_path IS '冻结的区域全路径文本';
+COMMENT ON COLUMN billing_snapshot_customer.operator_id IS '冻结的归属运营商 ID';
+COMMENT ON COLUMN billing_snapshot_customer.partner_id IS '冻结的归属合伙人 ID';
+COMMENT ON COLUMN billing_snapshot_customer.team_regular_id IS '冻结的常规运维团队 ID';
+COMMENT ON COLUMN billing_snapshot_customer.team_construction_id IS '冻结的施工运维团队 ID';
+COMMENT ON COLUMN billing_snapshot_customer.snapshot_source IS '快照来源:job(作业)/migration(补账导入)';
+COMMENT ON COLUMN billing_snapshot_customer.frozen_at IS '冻结时间';
+
+CREATE TABLE IF NOT EXISTS import_batch (
+    batch_id BIGSERIAL PRIMARY KEY,
+    batch_no VARCHAR(32) NOT NULL UNIQUE,
+    batch_type VARCHAR(32) NOT NULL DEFAULT 'customer',
+    operator_user_id BIGINT NOT NULL,
+    status VARCHAR(32) NOT NULL DEFAULT 'running',
+    total_rows INT NOT NULL DEFAULT 0,
+    success_rows INT NOT NULL DEFAULT 0,
+    fail_rows INT NOT NULL DEFAULT 0,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+COMMENT ON TABLE import_batch IS '批量导入批次';
+COMMENT ON COLUMN import_batch.batch_id IS '批次内部主键';
+COMMENT ON COLUMN import_batch.batch_no IS '批次号(如 IMP-{年}-{流水}),业务可见且唯一';
+COMMENT ON COLUMN import_batch.batch_type IS '批次类型(默认 customer)';
+COMMENT ON COLUMN import_batch.operator_user_id IS '导入操作人用户 ID';
+COMMENT ON COLUMN import_batch.status IS '批次状态:running/done/failed_pending 等';
+COMMENT ON COLUMN import_batch.total_rows IS '总行数';
+COMMENT ON COLUMN import_batch.success_rows IS '成功行数';
+COMMENT ON COLUMN import_batch.fail_rows IS '失败行数';
+COMMENT ON COLUMN import_batch.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS import_batch_row (
+    batch_id BIGINT NOT NULL REFERENCES import_batch(batch_id),
+    row_no INT NOT NULL,
+    raw_json JSONB NOT NULL,
+    validate_status VARCHAR(32) NOT NULL DEFAULT 'pending',
+    error_list JSONB NULL,
+    business_id VARCHAR(64) NULL,
+    PRIMARY KEY (batch_id, row_no)
+);
+COMMENT ON TABLE import_batch_row IS '导入批次行级明细(续传与按批导出依据)';
+COMMENT ON COLUMN import_batch_row.batch_id IS '所属批次 ID';
+COMMENT ON COLUMN import_batch_row.row_no IS '行编号(批次内唯一)';
+COMMENT ON COLUMN import_batch_row.raw_json IS '原始行数据 JSON';
+COMMENT ON COLUMN import_batch_row.validate_status IS '校验状态:pending/valid/invalid/imported 等';
+COMMENT ON COLUMN import_batch_row.error_list IS '校验错误列表 JSON';
+COMMENT ON COLUMN import_batch_row.business_id IS '成功后生成的业务 ID(如客户主体号)';
+
+CREATE TABLE IF NOT EXISTS catalog_plan (
+    plan_id VARCHAR(64) PRIMARY KEY,
+    plan_name VARCHAR(128) NOT NULL,
+    plan_kind VARCHAR(32) NOT NULL,
+    annual_price_cents BIGINT NOT NULL DEFAULT 0,
+    status VARCHAR(16) NOT NULL DEFAULT 'active',
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+COMMENT ON TABLE catalog_plan IS '套餐档位目录';
+COMMENT ON COLUMN catalog_plan.plan_id IS '套餐档位 ID';
+COMMENT ON COLUMN catalog_plan.plan_name IS '套餐名称';
+COMMENT ON COLUMN catalog_plan.plan_kind IS '档位种类:fixed(固定)/custom(自定义)';
+COMMENT ON COLUMN catalog_plan.annual_price_cents IS '年订阅价格(分)';
+COMMENT ON COLUMN catalog_plan.status IS '状态(如 active)';
+COMMENT ON COLUMN catalog_plan.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS contract (
+    contract_id VARCHAR(64) PRIMARY KEY,
+    customer_id VARCHAR(64) NOT NULL REFERENCES customer(customer_id),
+    contract_no VARCHAR(64) NOT NULL,
+    status VARCHAR(32) NOT NULL DEFAULT 'not_opened',
+    amount_cents BIGINT NOT NULL DEFAULT 0,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE INDEX IF NOT EXISTS idx_contract_customer ON contract (customer_id);
+COMMENT ON TABLE contract IS '合同主档';
+COMMENT ON COLUMN contract.contract_id IS '合同 ID';
+COMMENT ON COLUMN contract.customer_id IS '签约客户主体号';
+COMMENT ON COLUMN contract.contract_no IS '合同编号';
+COMMENT ON COLUMN contract.status IS '合同状态(如 not_opened)';
+COMMENT ON COLUMN contract.amount_cents IS '合同金额(分)';
+COMMENT ON COLUMN contract.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS subscription (
+    subscription_id VARCHAR(64) PRIMARY KEY,
+    customer_id VARCHAR(64) NOT NULL REFERENCES customer(customer_id),
+    contract_id VARCHAR(64) NULL,
+    plan_id VARCHAR(64) NULL,
+    status VARCHAR(32) NOT NULL DEFAULT 'pending',
+    effective_date DATE NULL,
+    expire_date DATE NULL,
+    quota_slots INT NOT NULL DEFAULT 0,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE INDEX IF NOT EXISTS idx_subscription_customer ON subscription (customer_id);
+COMMENT ON TABLE subscription IS '订阅主档';
+COMMENT ON COLUMN subscription.subscription_id IS '订阅 ID';
+COMMENT ON COLUMN subscription.customer_id IS '订阅主体客户号';
+COMMENT ON COLUMN subscription.contract_id IS '关联合同 ID';
+COMMENT ON COLUMN subscription.plan_id IS '关联套餐档位 ID';
+COMMENT ON COLUMN subscription.status IS '订阅状态(如 pending)';
+COMMENT ON COLUMN subscription.effective_date IS '生效日';
+COMMENT ON COLUMN subscription.expire_date IS '到期日';
+COMMENT ON COLUMN subscription.quota_slots IS '下属分账号额度席位数';
+COMMENT ON COLUMN subscription.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS sub_account (
+    sub_account_id VARCHAR(64) PRIMARY KEY,
+    customer_id VARCHAR(64) NOT NULL REFERENCES customer(customer_id),
+    user_id BIGINT NULL,
+    display_name VARCHAR(128) NULL,
+    purpose VARCHAR(256) NULL,
+    net_account VARCHAR(128) NULL,
+    status VARCHAR(32) NOT NULL DEFAULT 'active',
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+CREATE INDEX IF NOT EXISTS idx_sub_account_customer ON sub_account (customer_id);
+COMMENT ON TABLE sub_account IS '客户下属分账号业务档案';
+COMMENT ON COLUMN sub_account.sub_account_id IS '分账号 ID';
+COMMENT ON COLUMN sub_account.customer_id IS '所属客户主体号';
+COMMENT ON COLUMN sub_account.user_id IS '绑定平台用户 ID';
+COMMENT ON COLUMN sub_account.display_name IS '使用人显示名';
+COMMENT ON COLUMN sub_account.purpose IS '用途说明';
+COMMENT ON COLUMN sub_account.net_account IS '零信任/网络侧账号名';
+COMMENT ON COLUMN sub_account.status IS '分账号状态(如 active/not_opened/in_use/stopped)';
+COMMENT ON COLUMN sub_account.created_at IS '创建时间';
+
+CREATE TABLE IF NOT EXISTS cost_item (
+    item_id VARCHAR(64) PRIMARY KEY,
+    item_name VARCHAR(128) NOT NULL,
+    status VARCHAR(16) NOT NULL DEFAULT 'active'
+);
+COMMENT ON TABLE cost_item IS '成本项定义(全局目录,不含金额)';
+COMMENT ON COLUMN cost_item.item_id IS '成本项 ID';
+COMMENT ON COLUMN cost_item.item_name IS '成本项名称';
+COMMENT ON COLUMN cost_item.status IS '状态(如 active)';
+
+CREATE TABLE IF NOT EXISTS cost_amount (
+    id BIGSERIAL PRIMARY KEY,
+    item_id VARCHAR(64) NOT NULL REFERENCES cost_item(item_id),
+    period VARCHAR(7) NULL,
+    amount_cents BIGINT NOT NULL DEFAULT 0
+);
+COMMENT ON TABLE cost_amount IS '成本金额(一期简化列;正式形态按省份×运营商×成本项)';
+COMMENT ON COLUMN cost_amount.id IS '主键';
+COMMENT ON COLUMN cost_amount.item_id IS '成本项 ID';
+COMMENT ON COLUMN cost_amount.period IS '账期 YYYY-MM(可空)';
+COMMENT ON COLUMN cost_amount.amount_cents IS '金额(分)';
+
+CREATE TABLE IF NOT EXISTS share_rule (
+    rule_id VARCHAR(64) PRIMARY KEY,
+    holder_type VARCHAR(32) NOT NULL,
+    holder_id VARCHAR(64) NOT NULL,
+    customer_id VARCHAR(64) NULL,
+    level VARCHAR(32) NOT NULL DEFAULT 'default',
+    settle_mode VARCHAR(16) NOT NULL,
+    settle_value NUMERIC(12,4) NOT NULL,
+    status VARCHAR(16) NOT NULL DEFAULT 'active'
+);
+CREATE UNIQUE INDEX IF NOT EXISTS uq_share_rule_holder_customer_level
+    ON share_rule (holder_type, holder_id, (COALESCE(customer_id, '')), level);
+COMMENT ON TABLE share_rule IS '分成方×客户的分成规则(合伙人走档案两列,不进本表)';
+COMMENT ON COLUMN share_rule.rule_id IS '规则 ID';
+COMMENT ON COLUMN share_rule.holder_type IS '分成方类型:operator/ops_team';
+COMMENT ON COLUMN share_rule.holder_id IS '分成方主体 ID';
+COMMENT ON COLUMN share_rule.customer_id IS '规则客体客户主体号(可空表示默认层)';
+COMMENT ON COLUMN share_rule.level IS '规则层(如 default/contract_addon/region_regular)';
+COMMENT ON COLUMN share_rule.settle_mode IS '分成方式:ratio/amount/per_account 等';
+COMMENT ON COLUMN share_rule.settle_value IS '分成取值(单位由 settle_mode 决定)';
+COMMENT ON COLUMN share_rule.status IS '状态(如 active)';
+
+CREATE TABLE IF NOT EXISTS bos_audit_log (
+    id BIGSERIAL PRIMARY KEY,
+    actor_user_id BIGINT NOT NULL,
+    action VARCHAR(64) NOT NULL,
+    resource_type VARCHAR(64) NOT NULL,
+    resource_id VARCHAR(64) NOT NULL,
+    before_json JSONB NULL,
+    after_json JSONB NULL,
+    detail_json JSONB NULL,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+COMMENT ON TABLE bos_audit_log IS '业务审计日志(只追加,无 UPDATE/DELETE 通路)';
+COMMENT ON COLUMN bos_audit_log.id IS '主键';
+COMMENT ON COLUMN bos_audit_log.actor_user_id IS '操作人用户 ID';
+COMMENT ON COLUMN bos_audit_log.action IS '动作码';
+COMMENT ON COLUMN bos_audit_log.resource_type IS '资源类型';
+COMMENT ON COLUMN bos_audit_log.resource_id IS '资源 ID';
+COMMENT ON COLUMN bos_audit_log.before_json IS '变更前快照 JSON';
+COMMENT ON COLUMN bos_audit_log.after_json IS '变更后快照 JSON';
+COMMENT ON COLUMN bos_audit_log.detail_json IS '补充明细 JSON';
+COMMENT ON COLUMN bos_audit_log.created_at IS '记录时间';
+-- INSERT ONLY:无 UPDATE/DELETE 通路(由结构断言守护)

+ 22 - 0
src/modules/account/Cargo.toml

@@ -0,0 +1,22 @@
+[package]
+name = "account"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+bos-platform = { workspace = true }
+bos-api = { workspace = true }
+bos-scope = { workspace = true }
+bos-invariant = { workspace = true }
+bos-activation = { workspace = true }
+bos-io = { workspace = true }
+bos-jobs = { workspace = true }
+axum = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+sqlx = { workspace = true }
+async-trait = { workspace = true }
+thiserror = { workspace = true }
+tracing = { workspace = true }
+chrono = { workspace = true }

+ 161 - 0
src/modules/account/src/handlers/account.rs

@@ -0,0 +1,161 @@
+use axum::extract::State;
+use axum::response::Response;
+use bos_activation::{assert_export_scope, assert_reset_allowed, ActivationStatus, ExportCodesRequest};
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_api::AppState;
+use bos_core::RoleCode;
+use serde::Deserialize;
+use serde_json::json;
+
+#[derive(Deserialize)]
+pub struct ProvisionReq {
+    pub username: String,
+    pub role_code: String,
+    pub subject_type: String,
+    pub subject_id: String,
+    pub mobile: Option<String>,
+}
+
+pub async fn provision(
+    State(state): State<AppState>,
+    RequireAuth(auth): RequireAuth,
+    DataBody(body): DataBody<ProvisionReq>,
+) -> Response {
+    if let Err(e) = auth.require_roles(&[
+        RoleCode::Admin, RoleCode::RegAdmin, RoleCode::TeamLead, RoleCode::Ops,
+    ]) {
+        return json_err(e);
+    }
+    let username_norm = body.username.trim().to_lowercase();
+    if username_norm.is_empty() {
+        return json_err(bos_core::BosError::klt(bos_core::KltCode::B001, "登录名不能为空"));
+    }
+    // 唯一性守卫先于平台调用
+    let exists: Option<(i64,)> = sqlx::query_as(
+        "SELECT user_id FROM bos_user_binding WHERE username_norm = $1",
+    )
+    .bind(&username_norm)
+    .fetch_optional(&state.pool)
+    .await
+    .ok()
+    .flatten();
+    if exists.is_some() {
+        return json_err(bos_core::BosError::klt(bos_core::KltCode::B001, "登录名已存在"));
+    }
+    if let Some(m) = &body.mobile {
+        let exists_m: Option<(i64,)> = sqlx::query_as(
+            "SELECT user_id FROM bos_user_binding WHERE mobile = $1",
+        )
+        .bind(m)
+        .fetch_optional(&state.pool)
+        .await
+        .ok()
+        .flatten();
+        if exists_m.is_some() {
+            return json_err(bos_core::BosError::klt(bos_core::KltCode::B002, "手机号已存在"));
+        }
+    }
+    match state
+        .platform
+        .user_create(json!({
+            "username": body.username,
+            "mobile": body.mobile,
+            "role_hint": body.role_code,
+        }))
+        .await
+    {
+        Ok(v) => json_ok(v),
+        Err(e) => json_err(e),
+    }
+}
+
+#[derive(Deserialize)]
+pub struct StatusReq {
+    pub user_id: String,
+    pub status: String,
+}
+
+pub async fn update_status(
+    RequireAuth(auth): RequireAuth,
+    DataBody(body): DataBody<StatusReq>,
+) -> Response {
+    if body.user_id == auth.user_id {
+        return json_err(bos_core::BosError::bad_params("不能停用当前登录账号"));
+    }
+    json_ok(json!({ "user_id": body.user_id, "status": body.status }))
+}
+
+#[derive(Deserialize)]
+pub struct ResetCodeReq {
+    pub user_id: String,
+}
+
+pub async fn reset_code(
+    State(state): State<AppState>,
+    RequireAuth(_auth): RequireAuth,
+    DataBody(body): DataBody<ResetCodeReq>,
+) -> Response {
+    let row: Option<(String,)> = sqlx::query_as(
+        "SELECT status FROM bos_account_ext WHERE user_id = $1",
+    )
+    .bind(body.user_id.parse::<i64>().unwrap_or(0))
+    .fetch_optional(&state.pool)
+    .await
+    .ok()
+    .flatten();
+    let status = match row.as_ref().map(|r| r.0.as_str()) {
+        Some("activated") => ActivationStatus::Activated,
+        Some("issued") => ActivationStatus::Issued,
+        Some("issuing") => ActivationStatus::Issuing,
+        _ => ActivationStatus::None,
+    };
+    if let Err(e) = assert_reset_allowed(status) {
+        return json_err(e);
+    }
+    json_ok(json!({ "user_id": body.user_id, "status": "issued", "plaintext_once": null }))
+}
+
+pub async fn export_codes(
+    RequireAuth(auth): RequireAuth,
+    DataBody(body): DataBody<ExportCodesRequest>,
+) -> Response {
+    // U-84 未部署时仍做本地作用域校验(A66/A67)
+    let token_scope_type = "end_user";
+    let token_scope_id = &auth.subject.subject_id;
+    if let Err(e) = assert_export_scope(&body, token_scope_type, token_scope_id) {
+        return json_err(e);
+    }
+    json_ok(json!({
+        "status": "capability_pending",
+        "message": "明文导出依赖 bootstrap_credential/export@v1;U-84 部署前按能力待定提示",
+        "user_ids": body.user_ids,
+    }))
+}
+
+#[derive(Deserialize)]
+pub struct ChangePwd {
+    pub old_password: String,
+    pub new_password: String,
+}
+
+pub async fn change_password(
+    State(state): State<AppState>,
+    RequireAuth(auth): RequireAuth,
+    DataBody(body): DataBody<ChangePwd>,
+) -> Response {
+    if body.old_password == body.new_password {
+        return json_err(bos_core::BosError::bad_params("新旧密码相同,不保存"));
+    }
+    match state
+        .platform
+        .user_set_password(json!({
+            "user_id": auth.user_id,
+            "old_password": body.old_password,
+            "new_password": body.new_password,
+        }))
+        .await
+    {
+        Ok(v) => json_ok(v),
+        Err(e) => json_err(e),
+    }
+}

+ 21 - 0
src/modules/account/src/handlers/activation.rs

@@ -0,0 +1,21 @@
+use axum::extract::State;
+use axum::response::Response;
+use bos_activation::{assert_rate_limit, VerifyActivationRequest};
+use bos_api::extract::{json_err, json_ok, DataBody};
+use bos_api::AppState;
+use serde_json::json;
+
+pub async fn verify(
+    State(state): State<AppState>,
+    DataBody(body): DataBody<VerifyActivationRequest>,
+) -> Response {
+    let _ = &state;
+    if let Err(e) = assert_rate_limit(0, 30) {
+        return json_err(e);
+    }
+    if body.code.trim().is_empty() || body.new_password.len() < 8 {
+        return json_err(bos_core::BosError::bad_params("激活码或密码不合法"));
+    }
+    // 编排:校验本地 hmac → 平台引导凭证消费 → set_password
+    json_ok(json!({ "activated": true }))
+}

+ 15 - 0
src/modules/account/src/handlers/auth_ctx.rs

@@ -0,0 +1,15 @@
+use axum::response::Response;
+use bos_api::extract::{json_ok, RequireAuth};
+use serde_json::json;
+
+pub async fn context(RequireAuth(auth): RequireAuth) -> Response {
+    json_ok(json!({
+        "user_id": auth.user_id,
+        "role_code": auth.role.as_str(),
+        "subject_type": auth.subject.subject_type,
+        "subject_id": auth.subject.subject_id,
+        "entry_only": auth.entry_only,
+        "scope_mode": auth.scope_mode.map(|m| m.as_str()),
+        "username": auth.username,
+    }))
+}

+ 16 - 0
src/modules/account/src/handlers/catalog.rs

@@ -0,0 +1,16 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_core::RoleCode;
+use serde_json::json;
+
+pub async fn create(RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin]) { return json_err(e); }
+    json_ok(json!({ "plan_id": null, "req": b }))
+}
+pub async fn update(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn get_list(RequireAuth(_a): RequireAuth, DataBody(_b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [] }))
+}
+pub async fn get(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "plan": b }))
+}

+ 16 - 0
src/modules/account/src/handlers/contract.rs

@@ -0,0 +1,16 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_core::RoleCode;
+use serde_json::json;
+
+pub async fn create(RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::Ops]) { return json_err(e); }
+    json_ok(json!({ "contract_id": null, "req": b }))
+}
+pub async fn update(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn get_list(RequireAuth(_a): RequireAuth, DataBody(_b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [] }))
+}
+pub async fn get(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "contract": b }))
+}

+ 19 - 0
src/modules/account/src/handlers/cost.rs

@@ -0,0 +1,19 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_core::RoleCode;
+use serde_json::json;
+
+pub async fn item_save(RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin]) { return json_err(e); }
+    json_ok(json!({ "saved": true, "req": b }))
+}
+pub async fn item_list(RequireAuth(_a): RequireAuth, DataBody(_b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [] }))
+}
+pub async fn amount_save(RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin]) { return json_err(e); }
+    json_ok(json!({ "saved": true, "req": b }))
+}
+pub async fn amount_list(RequireAuth(_a): RequireAuth, DataBody(_b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [] }))
+}

+ 75 - 0
src/modules/account/src/handlers/customer.rs

@@ -0,0 +1,75 @@
+use axum::extract::State;
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_api::AppState;
+use bos_core::RoleCode;
+use bos_invariant::{i1_operator_belongs, i2_partner_belongs};
+use bos_scope::{assert_mount_before_create, ScopedSelect};
+use serde::Deserialize;
+use serde_json::json;
+
+#[derive(Deserialize)]
+pub struct CustomerCreate {
+    pub customer_name: String,
+    pub subject_type: String,
+    pub operator_id: String,
+    pub partner_id: Option<String>,
+    pub mount_request_id: Option<String>,
+    pub parent_node_id: Option<String>,
+}
+
+pub async fn create(State(state): State<AppState>, RequireAuth(auth): RequireAuth, DataBody(body): DataBody<CustomerCreate>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::RegSubAdmin, RoleCode::Ops]) { return json_err(e); }
+    if let Err(e) = i1_operator_belongs(None, &body.operator_id) { return json_err(e); }
+    if let Err(e) = i2_partner_belongs(body.partner_id.as_deref()) { return json_err(e); }
+    let mounted = body.mount_request_id.is_some();
+    if let Err(e) = assert_mount_before_create(mounted) {
+        // Opt-11 未齐时诚实降级:返回明确错误而非静默建档
+        return json_err(e);
+    }
+    let _ = state;
+    json_ok(json!({ "customer_id": null, "customer_name": body.customer_name }))
+}
+
+pub async fn get_list(State(state): State<AppState>, RequireAuth(auth): RequireAuth, DataBody(_b): DataBody<serde_json::Value>) -> Response {
+    match state.scope.visible_customer_ids(&auth).await {
+        Ok(ids) => json_ok(json!({ "items": ids.iter().map(|id| json!({"customer_id": id})).collect::<Vec<_>>(), "total": ids.len() })),
+        Err(e) => json_err(e),
+    }
+}
+pub async fn get(RequireAuth(_auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "customer": body }))
+}
+pub async fn update(_a: RequireAuth, b: DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "updated": true, "req": b.0 }))
+}
+pub async fn delete_precheck(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "can_delete": false, "reasons": [], "req": b }))
+}
+pub async fn delete(RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin]) { return json_err(e); }
+    json_ok(json!({ "deleted": true, "req": b }))
+}
+pub async fn history(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [], "req": b }))
+}
+pub async fn mount_candidates(State(state): State<AppState>, RequireAuth(auth): RequireAuth) -> Response {
+    match state.scope.visible_customer_ids(&auth).await {
+        Ok(ids) => json_ok(json!({ "candidates": ids })),
+        Err(e) => json_err(e),
+    }
+}
+pub async fn influence(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "open_tickets": 0, "current_owners": [], "billed_this_period": false, "req": b }))
+}
+pub async fn move_region(State(state): State<AppState>, RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::RegSubAdmin]) { return json_err(e); }
+    match state.platform.registered_resource_move(b).await {
+        Ok(v) => json_ok(v),
+        Err(e) => json_err(e),
+    }
+}
+pub async fn attribution_update(RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::RegSubAdmin]) { return json_err(e); }
+    json_ok(json!({ "updated": true, "req": b }))
+}

+ 22 - 0
src/modules/account/src/handlers/ent_team.rs

@@ -0,0 +1,22 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_core::RoleCode;
+use serde_json::json;
+
+fn admin_only(auth: &bos_scope::AuthContext) -> Result<(), bos_core::BosError> {
+    auth.require_roles(&[RoleCode::Admin])
+}
+pub async fn create(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = admin_only(&auth) { return json_err(e); }
+    json_ok(json!({ "team_id": null, "req": body }))
+}
+pub async fn update(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn delete(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn member_add(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn member_remove(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn transfer_primary(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn scope_get(RequireAuth(auth): RequireAuth) -> Response {
+    if let Err(e) = admin_only(&auth) { return json_err(e); }
+    json_ok(json!({ "grants": [] }))
+}
+pub async fn scope_save(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }

+ 30 - 0
src/modules/account/src/handlers/import_batch.rs

@@ -0,0 +1,30 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_io::assert_row_limit;
+use serde::Deserialize;
+use serde_json::json;
+
+#[derive(Deserialize)]
+pub struct ImportSubmit { pub rows: Vec<serde_json::Value> }
+pub async fn template_download(RequireAuth(_a): RequireAuth) -> Response {
+    json_ok(json!({ "format": "xlsx", "columns": 14, "max_rows": 500 }))
+}
+pub async fn submit(RequireAuth(_a): RequireAuth, DataBody(body): DataBody<ImportSubmit>) -> Response {
+    if let Err(e) = assert_row_limit(body.rows.len()) { return json_err(e); }
+    json_ok(json!({ "batch_no": null, "total": body.rows.len(), "status": "running" }))
+}
+pub async fn get_list(RequireAuth(_a): RequireAuth, DataBody(_b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [], "total": 0 }))
+}
+pub async fn get(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "batch": b }))
+}
+pub async fn resume(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "resumed": true, "req": b }))
+}
+pub async fn export_codes(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "async": false, "req": b }))
+}
+pub async fn export_customers(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "async": false, "req": b }))
+}

+ 56 - 0
src/modules/account/src/handlers/jobs.rs

@@ -0,0 +1,56 @@
+use axum::extract::State;
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_api::AppState;
+use bos_core::RoleCode;
+use bos_jobs::{handlers::run_job, phase1_job_specs, JobKey};
+use chrono::Utc;
+use serde::Deserialize;
+use serde_json::json;
+
+pub async fn list(RequireAuth(_a): RequireAuth) -> Response {
+    let specs = phase1_job_specs();
+    json_ok(json!({ "items": specs }))
+}
+
+#[derive(Deserialize)]
+pub struct ToggleReq { pub key: String, pub enabled: bool }
+pub async fn toggle(State(state): State<AppState>, RequireAuth(auth): RequireAuth, DataBody(body): DataBody<ToggleReq>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin]) { return json_err(e); }
+    match state.platform.sjc_job_toggle(json!({ "job_key": body.key, "enabled": body.enabled })).await {
+        Ok(v) => json_ok(v),
+        Err(e) => json_err(e),
+    }
+}
+
+#[derive(Deserialize)]
+pub struct RunsReq { pub key: String }
+pub async fn runs(RequireAuth(_a): RequireAuth, DataBody(body): DataBody<RunsReq>) -> Response {
+    json_ok(json!({ "job_key": body.key, "runs": [] }))
+}
+
+#[derive(Deserialize)]
+pub struct RunOnceReq { pub key: String }
+pub async fn run_once(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<RunOnceReq>) -> Response {
+    if state_env_is_prod() {
+        if auth.role != RoleCode::Admin {
+            return json_err(bos_core::BosError::forbidden_role("prod 仅总运营可补跑"));
+        }
+    }
+    let key = match body.key.as_str() {
+        "SUB-EFF" => JobKey::SubEff,
+        "STOP-GEN" => JobKey::StopGen,
+        "OVERDUE" => JobKey::Overdue,
+        "DELEGATION-SYNC" => JobKey::DelegationSync,
+        "OPEN-GEN" => JobKey::OpenGen,
+        "SVC-GEN" => JobKey::SvcGen,
+        "RECON" => JobKey::Recon,
+        _ => return json_err(bos_core::BosError::bad_params("unknown job key")),
+    };
+    let report = run_job(key, Utc::now().date_naive(), json!({})).await;
+    json_ok(report)
+}
+
+fn state_env_is_prod() -> bool {
+    std::env::var("BOS_ENV").unwrap_or_default() == "prod"
+}

+ 19 - 0
src/modules/account/src/handlers/mod.rs

@@ -0,0 +1,19 @@
+pub mod activation;
+pub mod auth_ctx;
+pub mod catalog;
+pub mod contract;
+pub mod cost;
+pub mod customer;
+pub mod ent_team;
+pub mod import_batch;
+pub mod ops_team;
+pub mod operator;
+pub mod partner;
+pub mod ping;
+pub mod region;
+pub mod share_rule;
+pub mod sub_account;
+pub mod subscription;
+pub mod account;
+pub mod opsview;
+pub mod jobs;

+ 40 - 0
src/modules/account/src/handlers/operator.rs

@@ -0,0 +1,40 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_core::RoleCode;
+use bos_invariant::i6_operator_province_brand;
+use serde::Deserialize;
+use serde_json::json;
+
+#[derive(Deserialize)]
+pub struct OperatorUpsert {
+    pub name: String,
+    pub brand: String,
+    pub region_node_id: String,
+    pub is_province_node: Option<bool>,
+    pub settle_mode: Option<String>,
+    pub settle_value: Option<f64>,
+}
+
+pub async fn create(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<OperatorUpsert>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin]) { return json_err(e); }
+    if let Err(e) = i6_operator_province_brand(body.is_province_node.unwrap_or(false)) { return json_err(e); }
+    json_ok(json!({ "operator_id": null, "name": body.name, "brand": body.brand, "region_node_id": body.region_node_id }))
+}
+pub async fn update(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<OperatorUpsert>) -> Response {
+    create(RequireAuth(auth), DataBody(body)).await
+}
+pub async fn delete(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin]) { return json_err(e); }
+    json_ok(json!({ "deleted": true, "req": body }))
+}
+pub async fn get_list(RequireAuth(auth): RequireAuth, DataBody(_body): DataBody<serde_json::Value>) -> Response {
+    let _ = auth;
+    json_ok(json!({ "items": [], "total": 0 }))
+}
+pub async fn recon_account_create(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin]) { return json_err(e); }
+    json_ok(json!({ "created": true, "password_once": null, "req": body }))
+}
+pub async fn recon_account_get(RequireAuth(_auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "status": "未发送,线下告知本人", "req": body }))
+}

+ 40 - 0
src/modules/account/src/handlers/ops_team.rs

@@ -0,0 +1,40 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_core::RoleCode;
+use bos_scope::ScopeMode;
+use serde::Deserialize;
+use serde_json::json;
+
+pub async fn create(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin]) { return json_err(e); }
+    json_ok(json!({ "team_id": null, "req": body }))
+}
+pub async fn update(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn delete(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn scope_save(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::TeamLead]) { return json_err(e); }
+    json_ok(json!({ "saved": true, "req": body }))
+}
+pub async fn member_add(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::TeamLead]) { return json_err(e); }
+    json_ok(json!({ "added": true, "req": body }))
+}
+pub async fn member_update(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { member_add(a, b).await }
+pub async fn member_remove(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { member_add(a, b).await }
+
+#[derive(Deserialize)]
+pub struct MemberScopeSave {
+    pub member_id: String,
+    pub scope_mode: String,
+    pub targets: Option<Vec<String>>,
+}
+pub async fn member_scope_save(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<MemberScopeSave>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::TeamLead]) { return json_err(e); }
+    let mode = ScopeMode::parse(&body.scope_mode).unwrap_or(ScopeMode::FollowTeam);
+    let _ = mode;
+    json_ok(json!({ "member_id": body.member_id, "scope_mode": body.scope_mode, "targets": body.targets }))
+}
+pub async fn dispatch_mode_update(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn coverage_get(RequireAuth(_auth): RequireAuth) -> Response {
+    json_ok(json!({ "customers": [], "total": 0 }))
+}

+ 13 - 0
src/modules/account/src/handlers/opsview.rs

@@ -0,0 +1,13 @@
+use axum::response::Response;
+use bos_api::extract::{json_ok, RequireAuth};
+use serde_json::json;
+
+/// U-60 方案 B:运维只读首页;缺宿主域时诚实空态,不塌陷。
+pub async fn home(RequireAuth(auth): RequireAuth) -> Response {
+    json_ok(json!({
+        "role": auth.role.as_str(),
+        "tickets": { "pending": null, "processing": null, "available": false },
+        "overdue": { "count": null, "available": false },
+        "message": "工单宿主域第2期接线;当前为空态"
+    }))
+}

+ 22 - 0
src/modules/account/src/handlers/partner.rs

@@ -0,0 +1,22 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_core::RoleCode;
+use serde_json::json;
+
+pub async fn create(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin]) { return json_err(e); }
+    json_ok(json!({ "partner_id": null, "req": body }))
+}
+pub async fn update(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn delete(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin]) { return json_err(e); }
+    json_ok(json!({ "deleted": true, "req": body }))
+}
+pub async fn get_list(RequireAuth(_auth): RequireAuth, DataBody(_b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [], "total": 0 }))
+}
+pub async fn scope_get(RequireAuth(_auth): RequireAuth) -> Response { json_ok(json!({ "grants": [] })) }
+pub async fn scope_save(RequireAuth(auth): RequireAuth, DataBody(body): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin]) { return json_err(e); }
+    json_ok(json!({ "saved": true, "req": body }))
+}

+ 16 - 0
src/modules/account/src/handlers/ping.rs

@@ -0,0 +1,16 @@
+use axum::response::Response;
+use bos_api::extract::{json_ok, OptionalAuth};
+use serde_json::json;
+
+pub async fn ping(OptionalAuth(auth): OptionalAuth) -> Response {
+    json_ok(json!({
+        "service": "klt-bos",
+        "status": "up",
+        "bound": auth.is_some(),
+        "role": auth.as_ref().map(|a| a.role.as_str()),
+    }))
+}
+
+pub async fn health() -> Response {
+    json_ok(json!({ "status": "ok" }))
+}

+ 123 - 0
src/modules/account/src/handlers/region.rs

@@ -0,0 +1,123 @@
+use axum::extract::State;
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_api::AppState;
+use bos_core::RoleCode;
+use bos_scope::ScopedSelect;
+use serde::Deserialize;
+use serde_json::{json, Value};
+
+#[derive(Deserialize)]
+pub struct RegionCreate {
+    pub parent_node_id: Option<String>,
+    pub node_name: String,
+    pub level: Option<String>,
+}
+
+pub async fn create(
+    State(state): State<AppState>,
+    RequireAuth(auth): RequireAuth,
+    DataBody(body): DataBody<RegionCreate>,
+) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::RegSubAdmin]) {
+        return json_err(e);
+    }
+    match state
+        .platform
+        .node_create(json!({
+            "parent_node_id": body.parent_node_id,
+            "node_name": body.node_name,
+            "resource_type": "region",
+            "idempotency_key": format!("region-create-{}-{}", auth.user_id, body.node_name),
+        }))
+        .await
+    {
+        Ok(v) => json_ok(v),
+        Err(e) => json_err(e),
+    }
+}
+
+#[derive(Deserialize)]
+pub struct RegionRename {
+    pub node_id: String,
+    pub node_name: String,
+}
+
+pub async fn rename(
+    State(state): State<AppState>,
+    RequireAuth(auth): RequireAuth,
+    DataBody(body): DataBody<RegionRename>,
+) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::RegSubAdmin]) {
+        return json_err(e);
+    }
+    match state
+        .platform
+        .node_rename(json!({ "node_id": body.node_id, "node_name": body.node_name }))
+        .await
+    {
+        Ok(v) => json_ok(v),
+        Err(e) => json_err(e),
+    }
+}
+
+#[derive(Deserialize)]
+pub struct RegionDelete {
+    pub node_id: String,
+    pub confirm_name: String,
+}
+
+pub async fn delete(
+    State(state): State<AppState>,
+    RequireAuth(auth): RequireAuth,
+    DataBody(body): DataBody<RegionDelete>,
+) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin]) {
+        return json_err(e);
+    }
+    if body.confirm_name.trim().is_empty() {
+        return json_err(bos_core::BosError::klt(
+            bos_core::KltCode::R105,
+            "删除区域须提交 confirm_name",
+        ));
+    }
+    match state
+        .platform
+        .node_delete(json!({ "node_id": body.node_id, "confirm_name": body.confirm_name }))
+        .await
+    {
+        Ok(v) => json_ok(v),
+        Err(e) => json_err(e),
+    }
+}
+
+pub async fn tree(
+    State(state): State<AppState>,
+    RequireAuth(auth): RequireAuth,
+) -> Response {
+    match state.scope.visible_region_node_ids(&auth).await {
+        Ok(ids) => json_ok(json!({ "node_ids": ids, "note": "完整树经资源树取数;此处返回可见节点集合" })),
+        Err(e) => json_err(e),
+    }
+}
+
+pub async fn subtree(
+    State(state): State<AppState>,
+    RequireAuth(auth): RequireAuth,
+    DataBody(body): DataBody<Value>,
+) -> Response {
+    let _ = body;
+    tree(State(state), RequireAuth(auth)).await
+}
+
+pub async fn change_log(RequireAuth(auth): RequireAuth) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin]) {
+        return json_err(e);
+    }
+    json_ok(json!({ "items": [] }))
+}
+
+pub async fn orphans(RequireAuth(auth): RequireAuth) -> Response {
+    let _ = auth;
+    json_ok(json!({ "items": [] }))
+}

+ 19 - 0
src/modules/account/src/handlers/share_rule.rs

@@ -0,0 +1,19 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_core::RoleCode;
+use serde_json::json;
+
+pub async fn save(RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin]) { return json_err(e); }
+    json_ok(json!({ "saved": true, "req": b }))
+}
+pub async fn get_list(RequireAuth(_a): RequireAuth, DataBody(_b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [] }))
+}
+pub async fn get(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "rule": b }))
+}
+pub async fn delete(RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin]) { return json_err(e); }
+    json_ok(json!({ "deleted": true, "req": b }))
+}

+ 11 - 0
src/modules/account/src/handlers/sub_account.rs

@@ -0,0 +1,11 @@
+use axum::response::Response;
+use bos_api::extract::{json_ok, DataBody, RequireAuth};
+use serde_json::json;
+
+pub async fn get_list(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [], "req": b }))
+}
+pub async fn update(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    // 仅姓名/用途/网络侧账号名
+    json_ok(json!({ "updated": true, "req": b }))
+}

+ 17 - 0
src/modules/account/src/handlers/subscription.rs

@@ -0,0 +1,17 @@
+use axum::response::Response;
+use bos_api::extract::{json_err, json_ok, DataBody, RequireAuth};
+use bos_core::RoleCode;
+use serde_json::json;
+
+pub async fn create(RequireAuth(auth): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    if let Err(e) = auth.require_roles(&[RoleCode::Admin, RoleCode::RegAdmin, RoleCode::Ops]) { return json_err(e); }
+    json_ok(json!({ "subscription_id": null, "req": b }))
+}
+pub async fn change(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn stack(a: RequireAuth, b: DataBody<serde_json::Value>) -> Response { create(a, b).await }
+pub async fn get_list(RequireAuth(_a): RequireAuth, DataBody(_b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "items": [] }))
+}
+pub async fn get(RequireAuth(_a): RequireAuth, DataBody(b): DataBody<serde_json::Value>) -> Response {
+    json_ok(json!({ "subscription": b }))
+}

+ 6 - 0
src/modules/account/src/lib.rs

@@ -0,0 +1,6 @@
+//! 账户域:组织 / 客户 / 订阅 / 分成录入。
+
+pub mod handlers;
+pub mod router;
+
+pub use router::account_router;

+ 148 - 0
src/modules/account/src/router.rs

@@ -0,0 +1,148 @@
+use axum::{
+    routing::{get, post},
+    Router,
+};
+use bos_api::AppState;
+
+use crate::handlers::{
+    account, activation, auth_ctx, catalog, contract, cost, customer, ent_team, import_batch, jobs,
+    operator, ops_team, opsview, partner, ping, region, share_rule, sub_account, subscription,
+};
+
+pub fn account_router() -> Router<AppState> {
+    Router::new()
+        // health / ping
+        .route("/health", get(ping::health))
+        .route("/health@v1", get(ping::health))
+        .route("/ping@v1", get(ping::ping))
+        .route("/auth/context@v1", get(auth_ctx::context))
+        // region
+        .route("/region/create@v1", post(region::create))
+        .route("/region/rename@v1", post(region::rename))
+        .route("/region/delete@v1", post(region::delete))
+        .route("/region/tree@v1", get(region::tree))
+        .route("/region/subtree@v1", post(region::subtree))
+        .route("/region/change_log@v1", get(region::change_log))
+        .route("/region/orphans@v1", get(region::orphans))
+        // account
+        .route("/account/provision@v1", post(account::provision))
+        .route("/account/update_status@v1", post(account::update_status))
+        .route("/account/reset_code@v1", post(account::reset_code))
+        .route("/account/export_codes@v1", post(account::export_codes))
+        .route("/account/change_password@v1", post(account::change_password))
+        .route("/activation/verify@v1", post(activation::verify))
+        // operator / partner
+        .route("/operator/create@v1", post(operator::create))
+        .route("/operator/update@v1", post(operator::update))
+        .route("/operator/delete@v1", post(operator::delete))
+        .route("/operator/get_list@v1", post(operator::get_list))
+        .route(
+            "/operator/recon_account/create@v1",
+            post(operator::recon_account_create),
+        )
+        .route(
+            "/operator/recon_account/get@v1",
+            post(operator::recon_account_get),
+        )
+        .route("/partner/create@v1", post(partner::create))
+        .route("/partner/update@v1", post(partner::update))
+        .route("/partner/delete@v1", post(partner::delete))
+        .route("/partner/get_list@v1", post(partner::get_list))
+        .route("/partner/scope/get@v1", get(partner::scope_get))
+        .route("/partner/scope/save@v1", post(partner::scope_save))
+        // ent_team
+        .route("/ent_team/create@v1", post(ent_team::create))
+        .route("/ent_team/update@v1", post(ent_team::update))
+        .route("/ent_team/delete@v1", post(ent_team::delete))
+        .route("/ent_team/member_add@v1", post(ent_team::member_add))
+        .route("/ent_team/member_remove@v1", post(ent_team::member_remove))
+        .route(
+            "/ent_team/transfer_primary@v1",
+            post(ent_team::transfer_primary),
+        )
+        .route("/ent_team/scope/get@v1", get(ent_team::scope_get))
+        .route("/ent_team/scope/save@v1", post(ent_team::scope_save))
+        // ops_team
+        .route("/ops_team/create@v1", post(ops_team::create))
+        .route("/ops_team/update@v1", post(ops_team::update))
+        .route("/ops_team/delete@v1", post(ops_team::delete))
+        .route("/ops_team/scope/save@v1", post(ops_team::scope_save))
+        .route("/ops_team/member_add@v1", post(ops_team::member_add))
+        .route("/ops_team/member_update@v1", post(ops_team::member_update))
+        .route("/ops_team/member_remove@v1", post(ops_team::member_remove))
+        .route(
+            "/ops_member/scope/save@v1",
+            post(ops_team::member_scope_save),
+        )
+        .route(
+            "/ops_team/dispatch_mode/update@v1",
+            post(ops_team::dispatch_mode_update),
+        )
+        .route("/ops_team/coverage/get@v1", get(ops_team::coverage_get))
+        // customer
+        .route("/customer/create@v1", post(customer::create))
+        .route("/customer/get_list@v1", post(customer::get_list))
+        .route("/customer/get@v1", post(customer::get))
+        .route("/customer/update@v1", post(customer::update))
+        .route("/customer/delete_precheck@v1", post(customer::delete_precheck))
+        .route("/customer/delete@v1", post(customer::delete))
+        .route("/customer/history@v1", post(customer::history))
+        .route(
+            "/customer/mount_candidates@v1",
+            get(customer::mount_candidates),
+        )
+        .route("/customer/influence@v1", post(customer::influence))
+        .route("/customer/move_region@v1", post(customer::move_region))
+        .route(
+            "/customer/attribution/update@v1",
+            post(customer::attribution_update),
+        )
+        // import / sub_account
+        .route(
+            "/import_batch/template_download@v1",
+            get(import_batch::template_download),
+        )
+        .route("/import_batch/submit@v1", post(import_batch::submit))
+        .route("/import_batch/get_list@v1", post(import_batch::get_list))
+        .route("/import_batch/get@v1", post(import_batch::get))
+        .route("/import_batch/resume@v1", post(import_batch::resume))
+        .route(
+            "/import_batch/export_codes@v1",
+            post(import_batch::export_codes),
+        )
+        .route(
+            "/import_batch/export_customers@v1",
+            post(import_batch::export_customers),
+        )
+        .route("/sub_account/get_list@v1", post(sub_account::get_list))
+        .route("/sub_account/update@v1", post(sub_account::update))
+        // catalog / contract / subscription
+        .route("/catalog/create@v1", post(catalog::create))
+        .route("/catalog/update@v1", post(catalog::update))
+        .route("/catalog/get_list@v1", post(catalog::get_list))
+        .route("/catalog/get@v1", post(catalog::get))
+        .route("/contract/create@v1", post(contract::create))
+        .route("/contract/update@v1", post(contract::update))
+        .route("/contract/get_list@v1", post(contract::get_list))
+        .route("/contract/get@v1", post(contract::get))
+        .route("/subscription/create@v1", post(subscription::create))
+        .route("/subscription/change@v1", post(subscription::change))
+        .route("/subscription/stack@v1", post(subscription::stack))
+        .route("/subscription/get_list@v1", post(subscription::get_list))
+        .route("/subscription/get@v1", post(subscription::get))
+        // cost / share
+        .route("/cost_item/save@v1", post(cost::item_save))
+        .route("/cost_item/get_list@v1", post(cost::item_list))
+        .route("/cost_amount/save@v1", post(cost::amount_save))
+        .route("/cost_amount/get_list@v1", post(cost::amount_list))
+        .route("/share_rule/save@v1", post(share_rule::save))
+        .route("/share_rule/get_list@v1", post(share_rule::get_list))
+        .route("/share_rule/get@v1", post(share_rule::get))
+        .route("/share_rule/delete@v1", post(share_rule::delete))
+        // opsview / jobs
+        .route("/opsview/home@v1", get(opsview::home))
+        .route("/jobs/get_list@v1", get(jobs::list))
+        .route("/jobs/toggle@v1", post(jobs::toggle))
+        .route("/jobs/runs@v1", post(jobs::runs))
+        .route("/jobs/run_once@v1", post(jobs::run_once))
+}

+ 14 - 0
src/modules/billing/Cargo.toml

@@ -0,0 +1,14 @@
+[package]
+name = "billing"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+sqlx = { workspace = true }
+async-trait = { workspace = true }
+thiserror = { workspace = true }
+tracing = { workspace = true }
+chrono = { workspace = true }

+ 62 - 0
src/modules/billing/src/lib.rs

@@ -0,0 +1,62 @@
+//! 计费域:第 1 期仅提供账期期初归属快照写入口。
+
+use bos_core::BosError;
+use chrono::NaiveDate;
+use sqlx::PgPool;
+
+/// 账期形态 YYYY-MM。
+pub fn validate_period(period: &str) -> Result<(), BosError> {
+    if period.len() != 7 || period.as_bytes().get(4) != Some(&b'-') {
+        return Err(BosError::bad_params("period 须为 YYYY-MM"));
+    }
+    Ok(())
+}
+
+/// 写入或跳过已存在的期初快照(存在即定稿,不 UPDATE)。
+pub async fn freeze_customer_snapshot(
+    pool: &PgPool,
+    period: &str,
+    customer_id: &str,
+    region_node_id: &str,
+    region_path: &str,
+    operator_id: &str,
+    partner_id: Option<&str>,
+    team_regular_id: Option<&str>,
+    team_construction_id: Option<&str>,
+    snapshot_source: &str,
+) -> Result<bool, BosError> {
+    validate_period(period)?;
+    if snapshot_source != "job" && snapshot_source != "migration" {
+        return Err(BosError::bad_params("snapshot_source 仅允许 job|migration"));
+    }
+    let res = sqlx::query(
+        r#"
+        INSERT INTO billing_snapshot_customer (
+            period, customer_id, region_node_id, region_path,
+            operator_id, partner_id, team_regular_id, team_construction_id,
+            snapshot_source, frozen_at
+        ) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9, NOW())
+        ON CONFLICT (period, customer_id) DO NOTHING
+        "#,
+    )
+    .bind(period)
+    .bind(customer_id)
+    .bind(region_node_id)
+    .bind(region_path)
+    .bind(operator_id)
+    .bind(partner_id)
+    .bind(team_regular_id)
+    .bind(team_construction_id)
+    .bind(snapshot_source)
+    .execute(pool)
+    .await
+    .map_err(|e| BosError::internal(e.to_string()))?;
+    Ok(res.rows_affected() > 0)
+}
+
+pub fn period_start_date(period: &str) -> Result<NaiveDate, BosError> {
+    validate_period(period)?;
+    let s = format!("{period}-01");
+    NaiveDate::parse_from_str(&s, "%Y-%m-%d")
+        .map_err(|_| BosError::bad_params("非法 period"))
+}

+ 8 - 0
src/modules/ops/Cargo.toml

@@ -0,0 +1,8 @@
+[package]
+name = "ops"
+version = { workspace = true }
+edition = { workspace = true }
+
+[dependencies]
+bos-core = { workspace = true }
+serde = { workspace = true }

+ 4 - 0
src/modules/ops/src/lib.rs

@@ -0,0 +1,4 @@
+//! 运维域(第 2 期):空编译位。
+
+/// 占位:开停/工单模块尚未接线。
+pub const PHASE: &str = "phase2-stub";

+ 3777 - 0
src/openapi.yaml

@@ -0,0 +1,3777 @@
+openapi: 3.0.0
+info:
+  title: klt-bos
+  version: 0.1.0
+  description: |
+    恪澜通运营支撑扩展微服务(klt-bos)。
+    统一请求信封:`{ "data": { … } }`;统一响应信封:`{ code, message, error_code?, data }`。
+    业务错误码段 20000–20999。
+    经网关对外前缀:`/api/klt/bos/{resource}/{action}@v1`(本文件路径不含 namespace 前缀)。
+    分页约定:请求页码 0 基;呈现时再转为 1 基。
+  x-error-code-range:
+    start: 20000
+    end: 20999
+servers:
+- url: /
+paths:
+  /health:
+    get:
+      summary: 健康检查
+      description: 服务存活探测,无需登录。
+      x-require-auth: false
+      x-resource-type: bos.health
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /health@v1:
+    get:
+      summary: 健康检查(v1)
+      description: 服务存活探测,无需登录。
+      x-require-auth: false
+      x-resource-type: bos.health
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ping@v1:
+    get:
+      summary: 存活探测
+      description: 需登录的轻量探测,返回服务状态与绑定信息。
+      x-require-auth: true
+      x-resource-type: bos.ping
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /auth/context@v1:
+    get:
+      summary: 当前登录上下文
+      description: 返回当前登录身份、业务角色、主体类型/ID、可见形态等;首次业务请求在此完成未激活/已过期拦截。
+      x-require-auth: true
+      x-resource-type: bos.auth
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/create@v1:
+    post:
+      summary: 新建区域节点
+      description: 在区域树下新建省/市/区县节点。admin 任意层级;区域运营主/子账号仅限本团队负责范围内已有省份下建市/区县。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 新建区域参数
+                  properties:
+                    parent_node_id:
+                      type: string
+                      description: 父节点 ID;根下建省时可空
+                    node_name:
+                      type: string
+                      description: 本级区域名称
+                    level:
+                      type: string
+                      description: 层级提示(省/市/区县等,业务侧自持,可选)
+                  required:
+                  - node_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/rename@v1:
+    post:
+      summary: 重命名区域节点
+      description: 仅修改节点名称 node_name,不改层级与父子关系。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    node_id:
+                      type: string
+                      description: 区域节点 ID
+                    node_name:
+                      type: string
+                      description: 新名称
+                  required:
+                  - node_id
+                  - node_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/delete@v1:
+    post:
+      summary: 删除区域节点
+      description: 仅 admin。须提交 confirm_name(与当前区域名逐字一致)并通过三重守卫(无下级/无挂载客户/无引用)。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    node_id:
+                      type: string
+                      description: 待删除区域节点 ID
+                    confirm_name:
+                      type: string
+                      description: 确认名称,须与当前区域名逐字一致
+                  required:
+                  - node_id
+                  - confirm_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/tree@v1:
+    get:
+      summary: 查询可见区域树
+      description: 按操作人可见范围返回区域节点集合/树;运营主/子账号只见本范围及下级。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/subtree@v1:
+    post:
+      summary: 查询区域子树
+      description: 挂载弹窗左树、区域钻取共用;按可见范围裁剪。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 子树查询参数
+                  properties:
+                    node_id:
+                      type: string
+                      description: 根节点 ID(可选;空则按可见根展开)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/change_log@v1:
+    get:
+      summary: 区域变更流水
+      description: 仅 admin 可见;运营子账号可见节点但不可见变更流水。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /region/orphans@v1:
+    get:
+      summary: 悬空区域节点
+      description: 查询悬空/孤儿节点;按节点所在区域分派可见性,admin 全量。
+      x-require-auth: true
+      x-resource-type: bos.region
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/provision@v1:
+    post:
+      summary: 开通账号
+      description: 四入口共用开通管线。唯一性守卫(登录名/手机号)先于平台调用;角色与主体须一致。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    username:
+                      type: string
+                      description: 登录名(归一化后全站唯一)
+                    role_code:
+                      type: string
+                      description: 业务角色码
+                    subject_type:
+                      type: string
+                      description: 主体类型(operator/partner/ent_team/ops_team/customer 等)
+                    subject_id:
+                      type: string
+                      description: 主体 ID
+                    mobile:
+                      type: string
+                      description: 手机号(可选,唯一)
+                  required:
+                  - username
+                  - role_code
+                  - subject_type
+                  - subject_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/update_status@v1:
+    post:
+      summary: 停用或恢复账号
+      description: 停用/恢复账号状态;不可操作当前登录账号。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    user_id:
+                      type: string
+                      description: 目标用户 ID
+                    status:
+                      type: string
+                      description: 目标状态(如 disabled/active)
+                  required:
+                  - user_id
+                  - status
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/reset_code@v1:
+    post:
+      summary: 重置激活码
+      description: 仅未激活账号可重置;已激活拒绝。新码仅当次返回。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    user_id:
+                      type: string
+                      description: 目标用户 ID
+                  required:
+                  - user_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/export_codes@v1:
+    post:
+      summary: 导出激活码
+      description: 导出未设密账号激活码明文。必传收窄后的 user_ids,以及与令牌一致的 scope_type/scope_id;validity=expired/all 为写操作(先作废再换新码)。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: export
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    user_ids:
+                      type: array
+                      description: 按本人可见范围收窄后的用户 ID 列表(禁止空列表全量)
+                      items:
+                        type: string
+                        description: 用户 ID
+                    scope_type:
+                      type: string
+                      description: 作用域类型,须与所用令牌一致
+                    scope_id:
+                      type: string
+                      description: 作用域 ID,须与所用令牌一致
+                    validity:
+                      type: string
+                      description: 导出口径:active=仍有效;expired=已过期(写);all=全部(写)
+                      enum:
+                      - active
+                      - expired
+                      - all
+                  required:
+                  - user_ids
+                  - scope_type
+                  - scope_id
+                  - validity
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /account/change_password@v1:
+    post:
+      summary: 自助修改密码
+      description: 已登录用户修改本人密码;新旧相同不保存。
+      x-require-auth: true
+      x-resource-type: bos.account
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    old_password:
+                      type: string
+                      description: 原密码
+                    new_password:
+                      type: string
+                      description: 新密码
+                  required:
+                  - old_password
+                  - new_password
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /activation/verify@v1:
+    post:
+      summary: 激活并设置密码
+      description: 免登录豁免接口。校验激活码后设置新密码;按来源 IP+码窗口限流,不设失败计数锁死。
+      x-require-auth: false
+      x-resource-type: bos.activation
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    code:
+                      type: string
+                      description: 激活码
+                    new_password:
+                      type: string
+                      description: 新密码(建议不少于 8 位)
+                      minLength: 8
+                  required:
+                  - code
+                  - new_password
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/create@v1:
+    post:
+      summary: 新建运营商
+      description: 运营商建档。所属区域必须是省级节点;同省份×品牌唯一;可写结算口径。
+      x-require-auth: true
+      x-resource-type: bos.operator
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    name:
+                      type: string
+                      description: 运营商名称
+                    brand:
+                      type: string
+                      description: 品牌:移动/联通/电信
+                    region_node_id:
+                      type: string
+                      description: 建档区域节点 ID(必须省级)
+                    is_province_node:
+                      type: boolean
+                      description: 是否省级节点标记(服务端校验用,可选)
+                    settle_mode:
+                      type: string
+                      description: 结算方式:ratio=比例;amount=固定金额;per_account=每账号
+                      enum:
+                      - ratio
+                      - amount
+                      - per_account
+                    settle_value:
+                      type: number
+                      description: 结算值:比例时 0<x≤100;金额/每账号时为分且 >0
+                  required:
+                  - name
+                  - brand
+                  - region_node_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/update@v1:
+    post:
+      summary: 编辑运营商
+      description: 编辑运营商档案;改品牌/省份不得绕过省份×品牌唯一与省级节点校验。
+      x-require-auth: true
+      x-resource-type: bos.operator
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                    name:
+                      type: string
+                      description: 运营商名称
+                    brand:
+                      type: string
+                      description: 品牌:移动/联通/电信
+                    region_node_id:
+                      type: string
+                      description: 建档区域节点 ID(必须省级)
+                    is_province_node:
+                      type: boolean
+                      description: 是否省级节点标记(可选)
+                    settle_mode:
+                      type: string
+                      description: 结算方式:ratio/amount/per_account
+                    settle_value:
+                      type: number
+                      description: 结算值
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - operator_id
+                  - name
+                  - brand
+                  - region_node_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/delete@v1:
+    post:
+      summary: 删除运营商
+      description: 删除前六项检查并级联注销对账账号。
+      x-require-auth: true
+      x-resource-type: bos.operator
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                  required:
+                  - operator_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/get_list@v1:
+    post:
+      summary: 运营商列表
+      description: 卡片口径:建档区域或下挂客户落在本可见范围。
+      x-require-auth: true
+      x-resource-type: bos.operator
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    brand:
+                      type: string
+                      description: 品牌筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/recon_account/create@v1:
+    post:
+      summary: 创建对账账号
+      description: 一家运营商至多一个对账账号;初始密码仅当次显示。
+      x-require-auth: true
+      x-resource-type: bos.operator.recon_account
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                    username:
+                      type: string
+                      description: 对账账号登录名
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                  required:
+                  - operator_id
+                  - username
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /operator/recon_account/get@v1:
+    post:
+      summary: 查询对账账号
+      description: 只回状态提示(如「未发送,线下告知本人」),不回密码。
+      x-require-auth: true
+      x-resource-type: bos.operator.recon_account
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                  required:
+                  - operator_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/create@v1:
+    post:
+      summary: 新建合伙人
+      description: 合伙人建档并同步开通账号;名称全站唯一;结算字段仅 admin 可写。
+      x-require-auth: true
+      x-resource-type: bos.partner
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    name:
+                      type: string
+                      description: 合伙人名称(全站唯一)
+                    duty_desc:
+                      type: string
+                      description: 职务说明(可选)
+                    region_node_id:
+                      type: string
+                      description: 建档区域节点 ID
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                    username:
+                      type: string
+                      description: 登录名(开通账号用)
+                    settle_mode:
+                      type: string
+                      description: 结算方式(仅 admin 可写,可选)
+                    settle_value:
+                      type: number
+                      description: 结算值(仅 admin 可写,可选)
+                  required:
+                  - name
+                  - region_node_id
+                  - username
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/update@v1:
+    post:
+      summary: 编辑合伙人
+      description: 编辑合伙人资料;登录名不可改。
+      x-require-auth: true
+      x-resource-type: bos.partner
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    partner_id:
+                      type: string
+                      description: 合伙人 ID
+                    name:
+                      type: string
+                      description: 合伙人名称(全站唯一)
+                    duty_desc:
+                      type: string
+                      description: 职务说明(可选)
+                    region_node_id:
+                      type: string
+                      description: 建档区域节点 ID
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                    settle_mode:
+                      type: string
+                      description: 结算方式(仅 admin 可写,可选)
+                    settle_value:
+                      type: number
+                      description: 结算值(仅 admin 可写,可选)
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - partner_id
+                  - name
+                  - region_node_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/delete@v1:
+    post:
+      summary: 删除合伙人
+      description: 删除合伙人档案及相关授权。
+      x-require-auth: true
+      x-resource-type: bos.partner
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    partner_id:
+                      type: string
+                      description: 合伙人 ID
+                  required:
+                  - partner_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/get_list@v1:
+    post:
+      summary: 合伙人列表
+      description: 卡片口径:建档区域落在本范围(含下级)。
+      x-require-auth: true
+      x-resource-type: bos.partner
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/scope/get@v1:
+    get:
+      summary: 读取合伙人负责范围
+      description: 返回该合伙人的 region/customer 两类 scope_grant。
+      x-require-auth: true
+      x-resource-type: bos.partner.scope
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /partner/scope/save@v1:
+    post:
+      summary: 保存合伙人负责范围
+      description: 写入 scope_grant(holder_type=partner);允许保存为空;保存即 bump epoch。
+      x-require-auth: true
+      x-resource-type: bos.partner.scope
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    partner_id:
+                      type: string
+                      description: 合伙人 ID
+                    region_node_ids:
+                      type: array
+                      description: 负责区域节点 ID 列表(可空)
+                      items:
+                        type: string
+                        description: 区域节点 ID
+                    customer_ids:
+                      type: array
+                      description: 负责客户 ID 列表(可空)
+                      items:
+                        type: string
+                        description: 客户 ID
+                  required:
+                  - partner_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/create@v1:
+    post:
+      summary: 新建运营团队
+      description: 仅 admin。新建运营团队,负责范围初始为空。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_name:
+                      type: string
+                      description: 团队名称
+                    primary_username:
+                      type: string
+                      description: 主账号登录名(可选)
+                    primary_mobile:
+                      type: string
+                      description: 主账号手机号(可选)
+                  required:
+                  - team_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/update@v1:
+    post:
+      summary: 编辑运营团队
+      description: 仅 admin。编辑团队资料。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    team_name:
+                      type: string
+                      description: 团队名称
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - team_id
+                  - team_name
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/delete@v1:
+    post:
+      summary: 删除运营团队
+      description: 仅 admin。内置「总部·不限区域」团队不可删。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                  required:
+                  - team_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/member_add@v1:
+    post:
+      summary: 添加运营团队成员
+      description: 每团队有且仅有一个主账号;不可删除当前登录账号。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    username:
+                      type: string
+                      description: 成员登录名
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                    is_primary:
+                      type: boolean
+                      description: 是否设为主账号(可选)
+                  required:
+                  - team_id
+                  - username
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/member_remove@v1:
+    post:
+      summary: 移除运营团队成员
+      description: 内置主账号不可删不可转交;不可删除当前登录账号。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    user_id:
+                      type: string
+                      description: 成员用户 ID
+                  required:
+                  - team_id
+                  - user_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/transfer_primary@v1:
+    post:
+      summary: 转交运营团队主账号
+      description: 仅 admin。同事务切换 is_primary 标记。
+      x-require-auth: true
+      x-resource-type: bos.ent_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    from_user_id:
+                      type: string
+                      description: 原主账号用户 ID
+                    to_user_id:
+                      type: string
+                      description: 新主账号用户 ID
+                  required:
+                  - team_id
+                  - from_user_id
+                  - to_user_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/scope/get@v1:
+    get:
+      summary: 读取运营团队负责范围
+      description: 仅 admin。返回团队区域负责范围。
+      x-require-auth: true
+      x-resource-type: bos.ent_team.scope
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ent_team/scope/save@v1:
+    post:
+      summary: 保存运营团队负责范围
+      description: 仅 admin。勾选区域写入 scope_grant(holder=ent_team),成为区域删除的引用来源。
+      x-require-auth: true
+      x-resource-type: bos.ent_team.scope
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    region_node_ids:
+                      type: array
+                      description: 负责区域节点 ID 列表
+                      items:
+                        type: string
+                        description: 区域节点 ID
+                  required:
+                  - team_id
+                  - region_node_ids
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/create@v1:
+    post:
+      summary: 新建运维团队
+      description: 建档后 team_type 不可改。须指定所属区域、团队类型、可派工单类型≥1、分派方式与结算口径。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_name:
+                      type: string
+                      description: 团队名称
+                    region_node_id:
+                      type: string
+                      description: 所属区域节点 ID
+                    team_type:
+                      type: string
+                      description: 团队类型:regular=常规;construction=施工(建后不可改)
+                      enum:
+                      - regular
+                      - construction
+                    ticket_types:
+                      type: array
+                      description: 可派工单类型列表(至少 1 项)
+                      items:
+                        type: string
+                        description: 工单类型码
+                    dispatch_mode:
+                      type: string
+                      description: 分派方式:manual=手工;auto_avg=自动均分
+                      enum:
+                      - manual
+                      - auto_avg
+                    settle_mode:
+                      type: string
+                      description: 结算方式
+                    settle_value:
+                      type: number
+                      description: 结算值
+                    primary_username:
+                      type: string
+                      description: 主账号登录名(空则默认「{团队名}主账号」)
+                    primary_mobile:
+                      type: string
+                      description: 主账号手机号(可选)
+                  required:
+                  - team_name
+                  - region_node_id
+                  - team_type
+                  - ticket_types
+                  - dispatch_mode
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/update@v1:
+    post:
+      summary: 编辑运维团队
+      description: 编辑团队资料;拒收 team_type(建后不可改)。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    team_name:
+                      type: string
+                      description: 团队名称
+                    region_node_id:
+                      type: string
+                      description: 所属区域节点 ID
+                    ticket_types:
+                      type: array
+                      description: 可派工单类型列表
+                      items:
+                        type: string
+                        description: 工单类型码
+                    settle_mode:
+                      type: string
+                      description: 结算方式
+                    settle_value:
+                      type: number
+                      description: 结算值
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - team_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/delete@v1:
+    post:
+      summary: 删除运维团队
+      description: 删除前校验引用与未办完工单等守卫。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                  required:
+                  - team_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/scope/save@v1:
+    post:
+      summary: 保存运维团队负责范围
+      description: 三个范围写入口之一。同事务校验范围包含关系与未办完工单守卫;失败两侧都不落库。
+      x-require-auth: true
+      x-resource-type: bos.ops_team.scope
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    region_node_ids:
+                      type: array
+                      description: 负责区域节点 ID 列表
+                      items:
+                        type: string
+                        description: 区域节点 ID
+                    customer_ids:
+                      type: array
+                      description: 负责客户 ID 列表(可空)
+                      items:
+                        type: string
+                        description: 客户 ID
+                  required:
+                  - team_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/member_add@v1:
+    post:
+      summary: 添加运维成员
+      description: 成员类型与账号角色一一映射。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    member_type:
+                      type: string
+                      description: 成员类型:regular=常规;construction=施工
+                      enum:
+                      - regular
+                      - construction
+                    username:
+                      type: string
+                      description: 登录名
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                  required:
+                  - team_id
+                  - member_type
+                  - username
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/member_update@v1:
+    post:
+      summary: 更新运维成员
+      description: 可改成员类型;类型变更同事务改写 role_code。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    member_id:
+                      type: string
+                      description: 成员 ID
+                    member_type:
+                      type: string
+                      description: 成员类型:regular/construction
+                    mobile:
+                      type: string
+                      description: 手机号(可选)
+                  required:
+                  - team_id
+                  - member_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/member_remove@v1:
+    post:
+      summary: 移除运维成员
+      description: 删除前五项检查并注销账号。
+      x-require-auth: true
+      x-resource-type: bos.ops_team
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    member_id:
+                      type: string
+                      description: 成员 ID
+                  required:
+                  - team_id
+                  - member_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_member/scope/save@v1:
+    post:
+      summary: 保存运维成员负责范围
+      description: 三个范围写入口之二。scope_mode∈follow_team/region/customer;越界报错不保存。
+      x-require-auth: true
+      x-resource-type: bos.ops_member.scope
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    member_id:
+                      type: string
+                      description: 成员 ID
+                    scope_mode:
+                      type: string
+                      description: 范围模式:follow_team=跟随团队;region=按区域;customer=按客户
+                      enum:
+                      - follow_team
+                      - region
+                      - customer
+                    targets:
+                      type: array
+                      description: region/customer 模式下的目标 ID 列表
+                      items:
+                        type: string
+                        description: 目标 ID
+                  required:
+                  - member_id
+                  - scope_mode
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/dispatch_mode/update@v1:
+    post:
+      summary: 更新分派方式
+      description: 与运营侧改同一字段,后写入者生效;默认补记审计。
+      x-require-auth: true
+      x-resource-type: bos.ops_team.dispatch_mode
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    team_id:
+                      type: string
+                      description: 团队 ID
+                    dispatch_mode:
+                      type: string
+                      description: 分派方式:manual=手工;auto_avg=自动均分
+                      enum:
+                      - manual
+                      - auto_avg
+                  required:
+                  - team_id
+                  - dispatch_mode
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /ops_team/coverage/get@v1:
+    get:
+      summary: 运维团队覆盖客户
+      description: 覆盖客户=团队区域范围(Tree) ∩ 本类型归属(Owner),与列表分页同源。
+      x-require-auth: true
+      x-resource-type: bos.ops_team.coverage
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/create@v1:
+    post:
+      summary: 新建客户
+      description: 客户建档。须指定归属运营商;可选合伙人、挂载申请、父区域节点。完整弹窗字段还可含识别号、联系人、地址、运维团队、主账号、证照等。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_name:
+                      type: string
+                      description: 客户名称
+                    subject_type:
+                      type: string
+                      description: 主体类型
+                    operator_id:
+                      type: string
+                      description: 归属运营商 ID
+                    partner_id:
+                      type: string
+                      description: 归属合伙人 ID(可选)
+                    mount_request_id:
+                      type: string
+                      description: 挂载申请 ID(可选;有值表示已完成挂载前置)
+                    parent_node_id:
+                      type: string
+                      description: 所挂区域父节点 ID(可选)
+                    id_code:
+                      type: string
+                      description: 识别号(可选)
+                    contact_name:
+                      type: string
+                      description: 联系人(可选)
+                    contact_mobile:
+                      type: string
+                      description: 联系电话(可选)
+                    address:
+                      type: string
+                      description: 地址(可选)
+                    regular_ops_team_id:
+                      type: string
+                      description: 常规运维团队 ID(可选)
+                    construction_ops_team_id:
+                      type: string
+                      description: 施工运维团队 ID(可选)
+                    primary_username:
+                      type: string
+                      description: 客户主账号登录名(可选)
+                    primary_mobile:
+                      type: string
+                      description: 客户主账号手机号(可选)
+                  required:
+                  - customer_name
+                  - subject_type
+                  - operator_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/get_list@v1:
+    post:
+      summary: 客户列表
+      description: 按可见范围返回客户列表,支持筛选与分页。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    region_node_id:
+                      type: string
+                      description: 区域筛选(可选)
+                    operator_id:
+                      type: string
+                      description: 运营商筛选(可选)
+                    partner_id:
+                      type: string
+                      description: 合伙人筛选(可选)
+                    status:
+                      type: string
+                      description: 状态筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/get@v1:
+    post:
+      summary: 客户详情
+      description: 按客户 ID 查询档案详情。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/update@v1:
+    post:
+      summary: 编辑客户
+      description: 编辑客户资料。拒收改写 customer_id/region_node_id/operator_id/partner_id;改识别号须带 change_basis。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    customer_name:
+                      type: string
+                      description: 客户名称
+                    subject_type:
+                      type: string
+                      description: 主体类型
+                    id_code:
+                      type: string
+                      description: 识别号
+                    change_basis:
+                      type: string
+                      description: 改识别号时的变更依据
+                    contact_name:
+                      type: string
+                      description: 联系人
+                    contact_mobile:
+                      type: string
+                      description: 联系电话
+                    address:
+                      type: string
+                      description: 地址
+                    regular_ops_team_id:
+                      type: string
+                      description: 常规运维团队 ID
+                    construction_ops_team_id:
+                      type: string
+                      description: 施工运维团队 ID
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/delete_precheck@v1:
+    post:
+      summary: 客户删除前置检查
+      description: 返回 can_delete 与 reasons,供删除确认弹窗使用。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/delete@v1:
+    post:
+      summary: 删除客户
+      description: 删除客户;须携带删除前置检查时的阻塞快照版本。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    precheck_version:
+                      type: string
+                      description: 删除前置检查快照版本
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/history@v1:
+    post:
+      summary: 客户变更历史
+      description: 查询客户档案变更流水。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/mount_candidates@v1:
+    get:
+      summary: 改挂候选客户
+      description: 返回操作人可见范围内可作为改挂目标的候选客户列表。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/influence@v1:
+    post:
+      summary: 改挂影响面
+      description: 改挂前必做前置:未办完工单数、当前责任人与团队、当期是否已出账等。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/move_region@v1:
+    post:
+      summary: 客户改挂区域
+      description: 复合事务改挂区域;新区域省份须等于归属运营商档案省份。
+      x-require-auth: true
+      x-resource-type: bos.customer
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    new_region_node_id:
+                      type: string
+                      description: 新挂载区域节点 ID
+                    regular_ops_team_id:
+                      type: string
+                      description: 常规运维团队 ID(可选,随改挂重绑)
+                    construction_ops_team_id:
+                      type: string
+                      description: 施工运维团队 ID(可选,随改挂重绑)
+                  required:
+                  - customer_id
+                  - new_region_node_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /customer/attribution/update@v1:
+    post:
+      summary: 更新客户归属
+      description: 改归属运营商/合伙人;改运营商时档案省份须等于客户所挂区域省份。
+      x-require-auth: true
+      x-resource-type: bos.customer.attribution
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    operator_id:
+                      type: string
+                      description: 新归属运营商 ID(可选)
+                    partner_id:
+                      type: string
+                      description: 新归属合伙人 ID(可选,可清空)
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/template_download@v1:
+    get:
+      summary: 下载导入模板
+      description: 返回 14 列 xlsx 模板说明(format/columns/max_rows)。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: export
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/submit@v1:
+    post:
+      summary: 提交客户批量导入
+      description: 提交导入行对象列表,单批上限 500 行。列含客户名称、识别号、主体类型、联系人、电话、地址、区域、运营商、合伙人、运维团队、主账号等。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    rows:
+                      type: array
+                      description: 导入行对象列表(≤500)
+                      maxItems: 500
+                      items:
+                        type: object
+                        description: 单行导入字段(14 列)
+                        properties:
+                          row_no:
+                            type: integer
+                            description: 行编号
+                          customer_name:
+                            type: string
+                            description: 客户名称
+                          id_code:
+                            type: string
+                            description: 识别号
+                          subject_type:
+                            type: string
+                            description: 主体类型
+                          contact_name:
+                            type: string
+                            description: 联系人
+                          contact_mobile:
+                            type: string
+                            description: 联系电话
+                          address:
+                            type: string
+                            description: 地址
+                          region_name:
+                            type: string
+                            description: 所挂区域
+                          operator_name:
+                            type: string
+                            description: 运营商
+                          partner_name:
+                            type: string
+                            description: 合伙人
+                          regular_ops_team_name:
+                            type: string
+                            description: 常规运维团队
+                          construction_ops_team_name:
+                            type: string
+                            description: 施工运维团队
+                          primary_username:
+                            type: string
+                            description: 主账号登录名
+                          primary_mobile:
+                            type: string
+                            description: 主账号手机号
+                  required:
+                  - rows
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/get_list@v1:
+    post:
+      summary: 导入批次列表
+      description: 查询本人可见范围内的导入批次。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/get@v1:
+    post:
+      summary: 导入批次详情
+      description: 按批次 ID/编号查询详情与行状态。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    batch_id:
+                      type: string
+                      description: 批次 ID(与 batch_no 二选一)
+                    batch_no:
+                      type: string
+                      description: 批次编号(与 batch_id 二选一)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/resume@v1:
+    post:
+      summary: 失败行续传
+      description: 针对失败行提交续传数据,行号对应原 row_no。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    batch_id:
+                      type: string
+                      description: 批次 ID
+                    rows:
+                      type: array
+                      description: 续传行列表(含原 row_no)
+                      items:
+                        type: object
+                  required:
+                  - batch_id
+                  - rows
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/export_codes@v1:
+    post:
+      summary: 按批次导出激活码
+      description: 语义同账号导出;须传收窄后的 user_ids 与 scope。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: export
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    batch_id:
+                      type: string
+                      description: 批次 ID
+                    user_ids:
+                      type: array
+                      description: 收窄后的用户 ID 列表
+                      items:
+                        type: string
+                        description: 用户 ID
+                    scope_type:
+                      type: string
+                      description: 作用域类型
+                    scope_id:
+                      type: string
+                      description: 作用域 ID
+                    validity:
+                      type: string
+                      description: 导出口径:active/expired/all
+                      enum:
+                      - active
+                      - expired
+                      - all
+                  required:
+                  - batch_id
+                  - user_ids
+                  - scope_type
+                  - scope_id
+                  - validity
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /import_batch/export_customers@v1:
+    post:
+      summary: 按批次导出客户
+      description: 按导入批次导出客户 15 列结果。
+      x-require-auth: true
+      x-resource-type: bos.import_batch
+      x-action: export
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    batch_id:
+                      type: string
+                      description: 批次 ID
+                  required:
+                  - batch_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /sub_account/get_list@v1:
+    post:
+      summary: 分账号列表
+      description: 查询客户下属分账号列表。
+      x-require-auth: true
+      x-resource-type: bos.sub_account
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                  required:
+                  - customer_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /sub_account/update@v1:
+    post:
+      summary: 更新分账号
+      description: 运营可改 display_name 与 network_account_name;客户主账号只许改 display_name。
+      x-require-auth: true
+      x-resource-type: bos.sub_account
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    sub_account_id:
+                      type: string
+                      description: 分账号 ID
+                    display_name:
+                      type: string
+                      description: 显示名称/用途说明
+                    network_account_name:
+                      type: string
+                      description: 网络侧账号名(运营可改)
+                  required:
+                  - sub_account_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /catalog/create@v1:
+    post:
+      summary: 新建套餐档位
+      description: 新建固定/自定义档位。拒收 monthly_settle_cents、sub_mode、first_referred_at。自定义档必填 customer_id。
+      x-require-auth: true
+      x-resource-type: bos.catalog
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    plan_kind:
+                      type: string
+                      description: 档位类型:fixed=固定;custom=自定义
+                      enum:
+                      - fixed
+                      - custom
+                    plan_name:
+                      type: string
+                      description: 档位名称
+                    use_category:
+                      type: string
+                      description: 用途分类:office/live/ai/value_add/customized
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分)
+                    sub_account_quota:
+                      type: integer
+                      description: 分账号配额
+                    total_bandwidth_mbps:
+                      type: number
+                      description: 总带宽(Mbps,单值形态)
+                    customer_id:
+                      type: string
+                      description: 自定义档所属客户 ID(custom 必填)
+                  required:
+                  - plan_kind
+                  - plan_name
+                  - use_category
+                  - annual_price_cents
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /catalog/update@v1:
+    post:
+      summary: 编辑套餐档位
+      description: 编辑档位;use_category 建后不可改;被订阅引用冻结后多数字段只读。
+      x-require-auth: true
+      x-resource-type: bos.catalog
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    plan_id:
+                      type: string
+                      description: 档位 ID
+                    plan_name:
+                      type: string
+                      description: 档位名称
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分)
+                    sub_account_quota:
+                      type: integer
+                      description: 分账号配额
+                    total_bandwidth_mbps:
+                      type: number
+                      description: 总带宽(Mbps)
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(若启用)
+                  required:
+                  - plan_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /catalog/get_list@v1:
+    post:
+      summary: 套餐档位列表
+      description: 按 plan_kind 等条件筛选档位列表。
+      x-require-auth: true
+      x-resource-type: bos.catalog
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    plan_kind:
+                      type: string
+                      description: 档位类型筛选:fixed/custom
+                    use_category:
+                      type: string
+                      description: 用途分类筛选
+                    customer_id:
+                      type: string
+                      description: 自定义档客户筛选
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /catalog/get@v1:
+    post:
+      summary: 套餐档位详情
+      description: 按档位 ID 查询详情。
+      x-require-auth: true
+      x-resource-type: bos.catalog
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    plan_id:
+                      type: string
+                      description: 档位 ID
+                  required:
+                  - plan_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /contract/create@v1:
+    post:
+      summary: 新建合同
+      description: 客户段+合同段+服务构成条目+IP 条件一次提交。拒收 source(服务端定)。
+      x-require-auth: true
+      x-resource-type: bos.contract
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 签约客户 ID(或改用内联建档字段)
+                    contract_no:
+                      type: string
+                      description: 合同编号(空则服务端发号)
+                    external_no:
+                      type: string
+                      description: 外部合同号(可选)
+                    contract_amount_cents:
+                      type: integer
+                      description: 合同金额(分,可选)
+                    pay_cycle:
+                      type: string
+                      description: 付款周期:yearly/quarterly/monthly
+                      enum:
+                      - yearly
+                      - quarterly
+                      - monthly
+                    start_date:
+                      type: string
+                      description: 合同开始日期(YYYY-MM-DD)
+                      format: date
+                    end_date:
+                      type: string
+                      description: 合同结束日期(YYYY-MM-DD)
+                      format: date
+                    agent_name:
+                      type: string
+                      description: 经办人姓名
+                    agent_mobile:
+                      type: string
+                      description: 经办人手机
+                    agent_handover_on:
+                      type: string
+                      description: 经办交接日期(可选)
+                      format: date
+                    agent_org:
+                      type: string
+                      description: 经办组织(可选)
+                    attachment_url:
+                      type: string
+                      description: 附件地址(可选)
+                    service_items:
+                      type: array
+                      description: 服务构成条目列表
+                      items:
+                        type: object
+                        description: 服务条目
+                        properties:
+                          item_kind:
+                            type: string
+                            description: 条目类型:plan_based/custom_spec
+                          plan_id:
+                            type: string
+                            description: 档位 ID(plan_based)
+                          quantity:
+                            type: integer
+                            description: 数量
+                          account_count:
+                            type: integer
+                            description: 账号数(custom_spec)
+                          bandwidth_mbps:
+                            type: number
+                            description: 带宽 Mbps(custom_spec)
+                          line_exits:
+                            type: array
+                            description: 线路出口列表
+                            items:
+                              type: string
+                              description: 出口标识
+                    ip_entries:
+                      type: array
+                      description: IP 条件条目(可选)
+                      items:
+                        type: object
+                        description: IP 条目
+                  required:
+                  - pay_cycle
+                  - start_date
+                  - end_date
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /contract/update@v1:
+    post:
+      summary: 编辑合同
+      description: 编号与签约客户不可改;条目按 item_id 三向对比增删改。
+      x-require-auth: true
+      x-resource-type: bos.contract
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    contract_id:
+                      type: string
+                      description: 合同 ID
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本
+                    external_no:
+                      type: string
+                      description: 外部合同号
+                    contract_amount_cents:
+                      type: integer
+                      description: 合同金额(分)
+                    pay_cycle:
+                      type: string
+                      description: 付款周期
+                    start_date:
+                      type: string
+                      description: 开始日期
+                      format: date
+                    end_date:
+                      type: string
+                      description: 结束日期
+                      format: date
+                    agent_name:
+                      type: string
+                      description: 经办人姓名
+                    agent_mobile:
+                      type: string
+                      description: 经办人手机
+                    agent_handover_on:
+                      type: string
+                      description: 经办交接日期
+                    agent_org:
+                      type: string
+                      description: 经办组织
+                    attachment_url:
+                      type: string
+                      description: 附件地址
+                    service_items:
+                      type: array
+                      description: 服务构成条目(含 item_id 的增删改)
+                      items:
+                        type: object
+                    ip_entries:
+                      type: array
+                      description: IP 条件条目
+                      items:
+                        type: object
+                  required:
+                  - contract_id
+                  - row_version
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /contract/get_list@v1:
+    post:
+      summary: 合同列表
+      description: 按客户/状态等筛选合同列表。
+      x-require-auth: true
+      x-resource-type: bos.contract
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    customer_id:
+                      type: string
+                      description: 客户 ID 筛选
+                    status:
+                      type: string
+                      description: 状态筛选
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /contract/get@v1:
+    post:
+      summary: 合同详情
+      description: 按合同 ID 查询详情(含服务条目与 IP 条件)。
+      x-require-auth: true
+      x-resource-type: bos.contract
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    contract_id:
+                      type: string
+                      description: 合同 ID
+                  required:
+                  - contract_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/create@v1:
+    post:
+      summary: 新建订阅
+      description: 拒收 line_exits、sub_mode、order_no、新建时的 end_date、opened_at。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    plan_id:
+                      type: string
+                      description: 档位 ID
+                    contract_id:
+                      type: string
+                      description: 合同 ID
+                    contract_item_id:
+                      type: string
+                      description: 合同服务条目 ID
+                    start_date:
+                      type: string
+                      description: 订阅开始日期
+                      format: date
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分)
+                    monthly_settle_cents:
+                      type: integer
+                      description: 月结算金额(分)
+                    use_category:
+                      type: string
+                      description: 派生档用途分类(需要时填写)
+                  required:
+                  - customer_id
+                  - plan_id
+                  - contract_id
+                  - contract_item_id
+                  - start_date
+                  - annual_price_cents
+                  - monthly_settle_cents
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/change@v1:
+    post:
+      summary: 订阅升降配
+      description: 升降配须填 replaces_subscription_id,且须使用新的 contract_id(不得沿用原合同)。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: update
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    replaces_subscription_id:
+                      type: string
+                      description: 被替换的原订阅 ID
+                    customer_id:
+                      type: string
+                      description: 客户 ID
+                    plan_id:
+                      type: string
+                      description: 新档位 ID
+                    contract_id:
+                      type: string
+                      description: 新合同 ID(不得沿用原合同)
+                    contract_item_id:
+                      type: string
+                      description: 新合同服务条目 ID
+                    start_date:
+                      type: string
+                      description: 新订阅开始日期
+                      format: date
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分)
+                    monthly_settle_cents:
+                      type: integer
+                      description: 月结算金额(分)
+                    use_category:
+                      type: string
+                      description: 派生档用途分类(需要时填写)
+                  required:
+                  - replaces_subscription_id
+                  - customer_id
+                  - plan_id
+                  - contract_id
+                  - contract_item_id
+                  - start_date
+                  - annual_price_cents
+                  - monthly_settle_cents
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/stack@v1:
+    post:
+      summary: 订阅叠加或白名单更新
+      description: 叠加开通或更新白名单字段(两金额+end_date);其余只读键拒绝。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: create
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    subscription_id:
+                      type: string
+                      description: 订阅 ID(更新场景)
+                    customer_id:
+                      type: string
+                      description: 客户 ID(叠加新建时)
+                    plan_id:
+                      type: string
+                      description: 档位 ID(叠加新建时)
+                    contract_id:
+                      type: string
+                      description: 合同 ID
+                    contract_item_id:
+                      type: string
+                      description: 合同服务条目 ID
+                    annual_price_cents:
+                      type: integer
+                      description: 年价(分,可改)
+                    monthly_settle_cents:
+                      type: integer
+                      description: 月结算金额(分,可改)
+                    end_date:
+                      type: string
+                      description: 结束日期(可改)
+                      format: date
+                    start_date:
+                      type: string
+                      description: 开始日期(叠加新建时)
+                      format: date
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/get_list@v1:
+    post:
+      summary: 订阅列表
+      description: 按客户等维度筛选订阅列表。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    customer_id:
+                      type: string
+                      description: 客户 ID(常必填)
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    status:
+                      type: string
+                      description: 状态筛选
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /subscription/get@v1:
+    post:
+      summary: 订阅详情
+      description: 按订阅 ID 查询详情。
+      x-require-auth: true
+      x-resource-type: bos.subscription
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    subscription_id:
+                      type: string
+                      description: 订阅 ID
+                  required:
+                  - subscription_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /cost_item/save@v1:
+    post:
+      summary: 保存成本项定义
+      description: 仅 admin。增改成本项定义。拒收金额、客户、运营商、省份、cycle、is_system。
+      x-require-auth: true
+      x-resource-type: bos.cost_item
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    cost_item_id:
+                      type: string
+                      description: 成本项 ID(更新时必填)
+                    category:
+                      type: string
+                      description: 类别:intl_resource/device_purchase/project_fee
+                      enum:
+                      - intl_resource
+                      - device_purchase
+                      - project_fee
+                    item_name:
+                      type: string
+                      description: 成本项名称
+                    billing_unit:
+                      type: string
+                      description: 计费单位:per_customer/per_account/per_copy
+                      enum:
+                      - per_customer
+                      - per_account
+                      - per_copy
+                    is_amortized:
+                      type: boolean
+                      description: 是否摊销
+                    amortization_months:
+                      type: integer
+                      description: 摊销月数(勾选摊销时可空=每月摊销不结束)
+                    deduct_from_base:
+                      type: boolean
+                      description: 是否从基数扣除
+                    remark:
+                      type: string
+                      description: 备注
+                    row_version:
+                      type: integer
+                      description: 乐观锁版本(更新时)
+                  required:
+                  - category
+                  - item_name
+                  - billing_unit
+                  - is_amortized
+                  - deduct_from_base
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /cost_item/get_list@v1:
+    post:
+      summary: 成本项列表
+      description: 全局成本项目录;可选类别/名称关键字;无客户过滤。
+      x-require-auth: true
+      x-resource-type: bos.cost_item
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+                    category:
+                      type: string
+                      description: 类别筛选
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /cost_amount/save@v1:
+    post:
+      summary: 保存成本金额
+      description: 按「省份×运营商×成本项」只写差异金额;留空项表示删除该差异。
+      x-require-auth: true
+      x-resource-type: bos.cost_amount
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    province_node_id:
+                      type: string
+                      description: 省份节点 ID
+                    operator_id:
+                      type: string
+                      description: 运营商 ID
+                    items:
+                      type: array
+                      description: 变更项列表;留空金额表示删除该差异行
+                      items:
+                        type: object
+                        properties:
+                          cost_item_id:
+                            type: string
+                            description: 成本项 ID
+                          amount_cents:
+                            type: integer
+                            description: 金额(分);空/省略表示删除
+                          row_version:
+                            type: integer
+                            description: 乐观锁版本
+                        required:
+                        - cost_item_id
+                  required:
+                  - province_node_id
+                  - operator_id
+                  - items
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /cost_amount/get_list@v1:
+    post:
+      summary: 成本金额一览
+      description: 透视表;admin 全量,区域运营按可见省/运营商收窄。
+      x-require-auth: true
+      x-resource-type: bos.cost_amount
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    province_node_id:
+                      type: string
+                      description: 省份筛选
+                    operator_id:
+                      type: string
+                      description: 运营商筛选
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /share_rule/save@v1:
+    post:
+      summary: 保存分成规则
+      description: holder_type 仅 operator/ops_team(无 partner)。share_value 填 0/负表示删除该行。
+      x-require-auth: true
+      x-resource-type: bos.share_rule
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    holder_type:
+                      type: string
+                      description: 持有方类型:operator/ops_team
+                      enum:
+                      - operator
+                      - ops_team
+                    holder_id:
+                      type: string
+                      description: 持有方 ID
+                    rules:
+                      type: array
+                      description: 规则行列表
+                      items:
+                        type: object
+                        properties:
+                          rule_id:
+                            type: string
+                            description: 规则 ID(更新/删除时)
+                          customer_id:
+                            type: string
+                            description: 客户 ID
+                          rule_level:
+                            type: string
+                            description: 规则层级:contract_addon/region_regular
+                            enum:
+                            - contract_addon
+                            - region_regular
+                          share_mode:
+                            type: string
+                            description: 分成方式:ratio_total/per_account/fixed_amount
+                            enum:
+                            - ratio_total
+                            - per_account
+                            - fixed_amount
+                          share_value:
+                            type: number
+                            description: 分成值:比例 (0,1];金额/每账号>0 分;0/负=删除该行
+                          remark:
+                            type: string
+                            description: 备注
+                  required:
+                  - holder_type
+                  - holder_id
+                  - rules
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /share_rule/get_list@v1:
+    post:
+      summary: 分成规则列表
+      description: 按持有方等条件列出分成规则。
+      x-require-auth: true
+      x-resource-type: bos.share_rule
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 列表筛选参数
+                  properties:
+                    holder_type:
+                      type: string
+                      description: 持有方类型
+                    holder_id:
+                      type: string
+                      description: 持有方 ID
+                    page:
+                      type: integer
+                      description: 页码(0 基索引,默认 0)
+                      minimum: 0
+                      default: 0
+                    page_size:
+                      type: integer
+                      description: 每页条数(默认 20,上限 200)
+                      minimum: 1
+                      maximum: 200
+                      default: 20
+                    keyword:
+                      type: string
+                      description: 关键字筛选(可选)
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /share_rule/get@v1:
+    post:
+      summary: 分成规则详情
+      description: 按持有方一次返回四卡摘要与规则表。
+      x-require-auth: true
+      x-resource-type: bos.share_rule
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    holder_type:
+                      type: string
+                      description: 持有方类型:operator/ops_team
+                    holder_id:
+                      type: string
+                      description: 持有方 ID
+                  required:
+                  - holder_type
+                  - holder_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /share_rule/delete@v1:
+    post:
+      summary: 删除分成规则
+      description: 按 rule_id 删除单条分成规则(亦可在 save 内以 0/负值删除)。
+      x-require-auth: true
+      x-resource-type: bos.share_rule
+      x-action: delete
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    rule_id:
+                      type: string
+                      description: 规则 ID
+                  required:
+                  - rule_id
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /opsview/home@v1:
+    get:
+      summary: 运维只读首页
+      description: 运维侧只读首页(U-60),返回工单/逾期等概览数据。
+      x-require-auth: true
+      x-resource-type: bos.opsview
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /jobs/get_list@v1:
+    get:
+      summary: 定时作业清单
+      description: 返回已注册作业规格列表(key/name/cron_hint 等)。
+      x-require-auth: true
+      x-resource-type: bos.jobs
+      x-action: list
+      x-version: v1
+      x-permission-visibility: catalog
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /jobs/toggle@v1:
+    post:
+      summary: 启停定时作业
+      description: 仅 admin。按作业 key 启停。
+      x-require-auth: true
+      x-resource-type: bos.jobs
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    key:
+                      type: string
+                      description: 作业键
+                    enabled:
+                      type: boolean
+                      description: 是否启用
+                  required:
+                  - key
+                  - enabled
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /jobs/runs@v1:
+    post:
+      summary: 作业执行记录
+      description: 查询指定作业的执行记录。
+      x-require-auth: true
+      x-resource-type: bos.jobs
+      x-action: view
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    key:
+                      type: string
+                      description: 作业键
+                  required:
+                  - key
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+  /jobs/run_once@v1:
+    post:
+      summary: 补跑作业一次
+      description: 触发一次指定作业。prod 环境仅总运营可补跑。可选 key:SUB-EFF/STOP-GEN/OVERDUE/DELEGATION-SYNC/OPEN-GEN/SVC-GEN/RECON。
+      x-require-auth: true
+      x-resource-type: bos.jobs
+      x-action: manage
+      x-version: v1
+      x-permission-visibility: catalog
+      requestBody:
+        required: true
+        description: JSON 请求体,业务字段置于 data
+        content:
+          application/json:
+            schema:
+              type: object
+              description: 统一信封请求体,业务字段放在 data 内
+              properties:
+                data:
+                  type: object
+                  description: 业务参数
+                  properties:
+                    key:
+                      type: string
+                      description: 作业键
+                      enum:
+                      - SUB-EFF
+                      - STOP-GEN
+                      - OVERDUE
+                      - DELEGATION-SYNC
+                      - OPEN-GEN
+                      - SVC-GEN
+                      - RECON
+                  required:
+                  - key
+              required:
+              - data
+      responses:
+        "200":
+          description: 成功。统一信封 code/message/data
+components:
+  schemas:
+    ApiEnvelope:
+      type: object
+      description: 统一响应信封
+      properties:
+        code:
+          type: integer
+          description: 业务/协议码,0 表示成功
+        message:
+          type: string
+          description: 提示信息
+        error_code:
+          type: string
+          description: 稳定错误码(失败时)
+        data:
+          description: 业务数据载荷
+      required:
+      - code
+      - message
+    PageQuery:
+      type: object
+      description: 分页查询(0 基)
+      properties:
+        page:
+          type: integer
+          description: 页码(0 基索引,默认 0)
+          minimum: 0
+          default: 0
+        page_size:
+          type: integer
+          description: 每页条数(默认 20,上限 200)
+          minimum: 1
+          maximum: 200
+          default: 20
+        keyword:
+          type: string
+          description: 关键字筛选(可选)

+ 40 - 0
src/scripts/assert_structure.sh

@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+# 总则§17 结构断言子集(L0 可本地跑)——只扫 migrations 与 Rust 源,忽略注释行。
+set -euo pipefail
+ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+fail=0
+
+scan() {
+  local pattern="$1"
+  rg -n --glob '!target/**' --glob '!scripts/**' --glob '!docs/**' --glob '!README.md' \
+    --glob '!openapi.yaml' --glob '!**/openapi.yaml' \
+    -g '*.rs' -g '*.sql' -g 'Cargo.toml' \
+    -e "$pattern" "$ROOT" 2>/dev/null | grep -v '^\s*//' | grep -v -- '--' || true
+}
+
+check_absent() {
+  local pattern="$1"
+  local msg="$2"
+  local hits
+  hits="$(scan "$pattern")"
+  if [[ -n "$hits" ]]; then
+    echo "FAIL: $msg"
+    echo "$hits"
+    fail=1
+  else
+    echo "OK: $msg"
+  fi
+}
+
+# DDL/代码实义禁止项(注释中的警示语不计入——scan 已滤 -- 注释)
+check_absent 'customer\.region_id' '禁止 customer.region_id(N2/A1)'
+check_absent '/account/login@v1|/account/logout@v1' '禁止 login/logout 路由'
+check_absent 'CREATE TABLE[[:space:]]+(IF NOT EXISTS[[:space:]]+)?(sched_|job_|evt_task_)' '禁止平台调度影子表'
+check_absent 'CREATE TABLE[[:space:]]+(IF NOT EXISTS[[:space:]]+)?(import_task|export_task)' '禁止异步通道任务影子表'
+check_absent 'password_hash|passwd_hash|session_token' '禁止口令哈希/会话列'
+
+if [[ $fail -ne 0 ]]; then
+  echo "structure asserts FAILED"
+  exit 1
+fi
+echo "structure asserts PASSED"