@r2wa-org/eden 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/README.md +28 -0
  2. package/dist/src/admin/index.d.ts +4793 -0
  3. package/dist/src/auth/better-auth.d.ts +2915 -0
  4. package/dist/src/auth/better-hooks.d.ts +16 -0
  5. package/dist/src/auth/db.schemas.d.ts +2076 -0
  6. package/dist/src/auth/permissions.d.ts +155 -0
  7. package/dist/src/auth/roles.d.ts +376 -0
  8. package/dist/src/auth/router.d.ts +385 -0
  9. package/dist/src/auth/schema.d.ts +1080 -0
  10. package/dist/src/bank-account/admin.router.d.ts +880 -0
  11. package/dist/src/bank-account/db.schemas.d.ts +1032 -0
  12. package/dist/src/bank-account/dto.schemas.d.ts +572 -0
  13. package/dist/src/bank-account/index.d.ts +8 -0
  14. package/dist/src/bank-account/permissions.d.ts +10 -0
  15. package/dist/src/bank-account/router.d.ts +680 -0
  16. package/dist/src/bank-account/schema.d.ts +535 -0
  17. package/dist/src/bank-account/seed.d.ts +4 -0
  18. package/dist/src/bank-account/service.d.ts +359 -0
  19. package/dist/src/check-in/admin.router.d.ts +533 -0
  20. package/dist/src/check-in/db.schemas.d.ts +312 -0
  21. package/dist/src/check-in/dto.schemas.d.ts +544 -0
  22. package/dist/src/check-in/errors/index.d.ts +13 -0
  23. package/dist/src/check-in/errors/locales/zh.d.ts +10 -0
  24. package/dist/src/check-in/index.d.ts +7 -0
  25. package/dist/src/check-in/permissions.d.ts +6 -0
  26. package/dist/src/check-in/router.d.ts +619 -0
  27. package/dist/src/check-in/schema.d.ts +168 -0
  28. package/dist/src/check-in/service.d.ts +99 -0
  29. package/dist/src/cors/index.d.ts +30 -0
  30. package/dist/src/cron/index.d.ts +76 -0
  31. package/dist/src/db/columns.helpers.d.ts +13 -0
  32. package/dist/src/db/enums.d.ts +1 -0
  33. package/dist/src/db/index.d.ts +4 -0
  34. package/dist/src/db/schemas.d.ts +24 -0
  35. package/dist/src/db/transaction.d.ts +3 -0
  36. package/dist/src/db/typebox.d.ts +19 -0
  37. package/dist/src/deposit/admin.router.d.ts +633 -0
  38. package/dist/src/deposit/db.schemas.d.ts +550 -0
  39. package/dist/src/deposit/dto.schemas.d.ts +707 -0
  40. package/dist/src/deposit/errors/index.d.ts +33 -0
  41. package/dist/src/deposit/errors/locales/zh.d.ts +18 -0
  42. package/dist/src/deposit/index.d.ts +7 -0
  43. package/dist/src/deposit/permissions.d.ts +9 -0
  44. package/dist/src/deposit/router.d.ts +621 -0
  45. package/dist/src/deposit/schema.d.ts +287 -0
  46. package/dist/src/deposit/service.d.ts +278 -0
  47. package/dist/src/dynamic-env/admin.router.d.ts +637 -0
  48. package/dist/src/dynamic-env/cache.d.ts +35 -0
  49. package/dist/src/dynamic-env/db.schemas.d.ts +182 -0
  50. package/dist/src/dynamic-env/dto.schema.d.ts +17 -0
  51. package/dist/src/dynamic-env/index.d.ts +3 -0
  52. package/dist/src/dynamic-env/schema.d.ts +96 -0
  53. package/dist/src/dynamic-env/service.d.ts +93 -0
  54. package/dist/src/eden/index.d.ts +57 -0
  55. package/dist/src/email/index.d.ts +2 -0
  56. package/dist/src/env/client.d.ts +2 -0
  57. package/dist/src/env/index.d.ts +2 -0
  58. package/dist/src/env/server.d.ts +50 -0
  59. package/dist/src/env/typebox-env.d.ts +7 -0
  60. package/dist/src/error/errorcode.d.ts +9 -0
  61. package/dist/src/error/index.d.ts +120 -0
  62. package/dist/src/error/locales/zh.d.ts +2 -0
  63. package/dist/src/error/messages.d.ts +10 -0
  64. package/dist/src/external/dto.schemas.d.ts +173 -0
  65. package/dist/src/external/errors/index.d.ts +13 -0
  66. package/dist/src/external/errors/locales/zh.d.ts +10 -0
  67. package/dist/src/external/index.d.ts +4 -0
  68. package/dist/src/external/router.d.ts +105 -0
  69. package/dist/src/external/service.d.ts +31 -0
  70. package/dist/src/file-storage/admin.router.d.ts +601 -0
  71. package/dist/src/file-storage/db.schemas.d.ts +1026 -0
  72. package/dist/src/file-storage/dto.schemas.d.ts +1238 -0
  73. package/dist/src/file-storage/errors/index.d.ts +19 -0
  74. package/dist/src/file-storage/errors/locales/zh.d.ts +18 -0
  75. package/dist/src/file-storage/index.d.ts +6 -0
  76. package/dist/src/file-storage/permissions.d.ts +5 -0
  77. package/dist/src/file-storage/router.d.ts +588 -0
  78. package/dist/src/file-storage/s3.client.d.ts +284 -0
  79. package/dist/src/file-storage/schema.d.ts +538 -0
  80. package/dist/src/file-storage/service.d.ts +264 -0
  81. package/dist/src/file-storage/share.router.d.ts +564 -0
  82. package/dist/src/index.d.ts +8664 -0
  83. package/dist/src/ledger/admin.router.d.ts +524 -0
  84. package/dist/src/ledger/db.schemas.d.ts +486 -0
  85. package/dist/src/ledger/dto.schemas.d.ts +160 -0
  86. package/dist/src/ledger/errors/index.d.ts +22 -0
  87. package/dist/src/ledger/errors/locales/zh.d.ts +14 -0
  88. package/dist/src/ledger/index.d.ts +6 -0
  89. package/dist/src/ledger/permissions.d.ts +8 -0
  90. package/dist/src/ledger/router.d.ts +486 -0
  91. package/dist/src/ledger/schema.d.ts +259 -0
  92. package/dist/src/ledger/service.d.ts +208 -0
  93. package/dist/src/nanoid/index.d.ts +2 -0
  94. package/dist/src/news/admin.router.d.ts +824 -0
  95. package/dist/src/news/db.schemas.d.ts +1150 -0
  96. package/dist/src/news/dto.schemas.d.ts +233 -0
  97. package/dist/src/news/errors/index.d.ts +20 -0
  98. package/dist/src/news/errors/locales/zh.d.ts +13 -0
  99. package/dist/src/news/index.d.ts +6 -0
  100. package/dist/src/news/permissions.d.ts +4 -0
  101. package/dist/src/news/router.d.ts +620 -0
  102. package/dist/src/news/schema.d.ts +616 -0
  103. package/dist/src/news/service.d.ts +495 -0
  104. package/dist/src/news-category/admin.router.d.ts +207 -0
  105. package/dist/src/news-category/constants.d.ts +1 -0
  106. package/dist/src/news-category/db.schemas.d.ts +324 -0
  107. package/dist/src/news-category/dto.schemas.d.ts +57 -0
  108. package/dist/src/news-category/errors/index.d.ts +19 -0
  109. package/dist/src/news-category/errors/locales/zh.d.ts +13 -0
  110. package/dist/src/news-category/index.d.ts +7 -0
  111. package/dist/src/news-category/permissions.d.ts +4 -0
  112. package/dist/src/news-category/router.d.ts +460 -0
  113. package/dist/src/news-category/schema.d.ts +173 -0
  114. package/dist/src/news-category/seed.d.ts +12 -0
  115. package/dist/src/news-category/service.d.ts +105 -0
  116. package/dist/src/notification/admin.router.d.ts +582 -0
  117. package/dist/src/notification/db.schemas.d.ts +624 -0
  118. package/dist/src/notification/dto.schemas.d.ts +457 -0
  119. package/dist/src/notification/errors/index.d.ts +19 -0
  120. package/dist/src/notification/errors/locales/zh.d.ts +13 -0
  121. package/dist/src/notification/index.d.ts +7 -0
  122. package/dist/src/notification/permissions.d.ts +6 -0
  123. package/dist/src/notification/router.d.ts +626 -0
  124. package/dist/src/notification/schema.d.ts +347 -0
  125. package/dist/src/notification/service.d.ts +195 -0
  126. package/dist/src/receipt-method/admin.router.d.ts +579 -0
  127. package/dist/src/receipt-method/db.schemas.d.ts +380 -0
  128. package/dist/src/receipt-method/dto.schemas.d.ts +418 -0
  129. package/dist/src/receipt-method/index.d.ts +7 -0
  130. package/dist/src/receipt-method/permissions.d.ts +4 -0
  131. package/dist/src/receipt-method/router.d.ts +602 -0
  132. package/dist/src/receipt-method/schema.d.ts +205 -0
  133. package/dist/src/receipt-method/service.d.ts +152 -0
  134. package/dist/src/referral/admin.router.d.ts +562 -0
  135. package/dist/src/referral/db.schemas.d.ts +420 -0
  136. package/dist/src/referral/dto.schemas.d.ts +665 -0
  137. package/dist/src/referral/errors/index.d.ts +14 -0
  138. package/dist/src/referral/errors/locales/zh.d.ts +13 -0
  139. package/dist/src/referral/index.d.ts +6 -0
  140. package/dist/src/referral/permissions.d.ts +8 -0
  141. package/dist/src/referral/router.d.ts +579 -0
  142. package/dist/src/referral/schema.d.ts +235 -0
  143. package/dist/src/referral/service.d.ts +42 -0
  144. package/dist/src/referral-depth-config/admin.router.d.ts +646 -0
  145. package/dist/src/referral-depth-config/db.schemas.d.ts +176 -0
  146. package/dist/src/referral-depth-config/dto.schemas.d.ts +208 -0
  147. package/dist/src/referral-depth-config/errors/index.d.ts +11 -0
  148. package/dist/src/referral-depth-config/errors/locales/zh.d.ts +10 -0
  149. package/dist/src/referral-depth-config/index.d.ts +5 -0
  150. package/dist/src/referral-depth-config/permissions.d.ts +8 -0
  151. package/dist/src/referral-depth-config/schema.d.ts +99 -0
  152. package/dist/src/referral-depth-config/service.d.ts +56 -0
  153. package/dist/src/server-test/errors/index.d.ts +10 -0
  154. package/dist/src/server-test/errors/locales/zh.d.ts +9 -0
  155. package/dist/src/server-test/index.d.ts +486 -0
  156. package/dist/src/shipping-address/admin.router.d.ts +507 -0
  157. package/dist/src/shipping-address/db.schemas.d.ts +278 -0
  158. package/dist/src/shipping-address/dto.schemas.d.ts +303 -0
  159. package/dist/src/shipping-address/index.d.ts +7 -0
  160. package/dist/src/shipping-address/permissions.d.ts +4 -0
  161. package/dist/src/shipping-address/router.d.ts +621 -0
  162. package/dist/src/shipping-address/schema.d.ts +150 -0
  163. package/dist/src/shipping-address/service.d.ts +109 -0
  164. package/dist/src/sms/index.d.ts +5 -0
  165. package/dist/src/subscription/admin.router.d.ts +818 -0
  166. package/dist/src/subscription/cron.d.ts +53 -0
  167. package/dist/src/subscription/db.schemas.d.ts +896 -0
  168. package/dist/src/subscription/dto.schemas.d.ts +1942 -0
  169. package/dist/src/subscription/errors/index.d.ts +21 -0
  170. package/dist/src/subscription/errors/locales/zh.d.ts +20 -0
  171. package/dist/src/subscription/index.d.ts +7 -0
  172. package/dist/src/subscription/permissions.d.ts +5 -0
  173. package/dist/src/subscription/router.d.ts +625 -0
  174. package/dist/src/subscription/schema.d.ts +475 -0
  175. package/dist/src/subscription/service.d.ts +306 -0
  176. package/dist/src/team/admin.router.d.ts +569 -0
  177. package/dist/src/team/dto.schemas.d.ts +2110 -0
  178. package/dist/src/team/errors/index.d.ts +12 -0
  179. package/dist/src/team/errors/locales/zh.d.ts +11 -0
  180. package/dist/src/team/index.d.ts +5 -0
  181. package/dist/src/team/permissions.d.ts +7 -0
  182. package/dist/src/team/router.d.ts +737 -0
  183. package/dist/src/team/service.d.ts +40 -0
  184. package/dist/src/transfer/admin.router.d.ts +595 -0
  185. package/dist/src/transfer/db.schemas.d.ts +318 -0
  186. package/dist/src/transfer/dto.schemas.d.ts +4209 -0
  187. package/dist/src/transfer/errors/index.d.ts +32 -0
  188. package/dist/src/transfer/errors/locales/zh.d.ts +19 -0
  189. package/dist/src/transfer/index.d.ts +8 -0
  190. package/dist/src/transfer/permissions.d.ts +8 -0
  191. package/dist/src/transfer/router.d.ts +597 -0
  192. package/dist/src/transfer/schema.d.ts +169 -0
  193. package/dist/src/transfer/service.d.ts +232 -0
  194. package/dist/src/user/admin.router.d.ts +827 -0
  195. package/dist/src/user/db.schemas.d.ts +1038 -0
  196. package/dist/src/user/dto.schemas.d.ts +1446 -0
  197. package/dist/src/user/errors/index.d.ts +38 -0
  198. package/dist/src/user/errors/locales/zh.d.ts +22 -0
  199. package/dist/src/user/index.d.ts +7 -0
  200. package/dist/src/user/permissions.d.ts +7 -0
  201. package/dist/src/user/router.d.ts +560 -0
  202. package/dist/src/user/schema.d.ts +541 -0
  203. package/dist/src/user/service.d.ts +294 -0
  204. package/dist/src/user-kyc/admin.router.d.ts +669 -0
  205. package/dist/src/user-kyc/db.schemas.d.ts +896 -0
  206. package/dist/src/user-kyc/dto.schemas.d.ts +939 -0
  207. package/dist/src/user-kyc/errors/index.d.ts +21 -0
  208. package/dist/src/user-kyc/errors/locales/zh.d.ts +14 -0
  209. package/dist/src/user-kyc/index.d.ts +8 -0
  210. package/dist/src/user-kyc/permissions.d.ts +6 -0
  211. package/dist/src/user-kyc/router.d.ts +602 -0
  212. package/dist/src/user-kyc/schema.d.ts +474 -0
  213. package/dist/src/user-kyc/service.d.ts +170 -0
  214. package/dist/src/user-security/admin.router.d.ts +493 -0
  215. package/dist/src/user-security/db.schemas.d.ts +414 -0
  216. package/dist/src/user-security/dto.schemas.d.ts +36 -0
  217. package/dist/src/user-security/index.d.ts +6 -0
  218. package/dist/src/user-security/router.d.ts +547 -0
  219. package/dist/src/user-security/schema.d.ts +215 -0
  220. package/dist/src/user-security/service.d.ts +51 -0
  221. package/dist/src/utils/date.d.ts +21 -0
  222. package/dist/src/utils/index.d.ts +4 -0
  223. package/dist/src/utils/order.d.ts +6 -0
  224. package/dist/src/utils/pagination.d.ts +113 -0
  225. package/dist/src/utils/password.d.ts +8 -0
  226. package/dist/src/wallet/admin.router.d.ts +616 -0
  227. package/dist/src/wallet/db.schemas.d.ts +278 -0
  228. package/dist/src/wallet/dto.schemas.d.ts +1690 -0
  229. package/dist/src/wallet/ensure.d.ts +11 -0
  230. package/dist/src/wallet/index.d.ts +6 -0
  231. package/dist/src/wallet/router.d.ts +654 -0
  232. package/dist/src/wallet/schema.d.ts +152 -0
  233. package/dist/src/wallet/service.d.ts +225 -0
  234. package/dist/src/wallet-import/admin.router.d.ts +690 -0
  235. package/dist/src/wallet-import/db.schemas.d.ts +1070 -0
  236. package/dist/src/wallet-import/dto.schemas.d.ts +1119 -0
  237. package/dist/src/wallet-import/errors/index.d.ts +17 -0
  238. package/dist/src/wallet-import/errors/locales/zh.d.ts +16 -0
  239. package/dist/src/wallet-import/index.d.ts +8 -0
  240. package/dist/src/wallet-import/permissions.d.ts +7 -0
  241. package/dist/src/wallet-import/schema.d.ts +566 -0
  242. package/dist/src/wallet-import/service.d.ts +101 -0
  243. package/dist/src/wallet-import/worker.d.ts +1 -0
  244. package/dist/src/wallet-transfer/dto.schemas.d.ts +64 -0
  245. package/dist/src/wallet-transfer/errors/index.d.ts +25 -0
  246. package/dist/src/wallet-transfer/errors/locales/zh.d.ts +16 -0
  247. package/dist/src/wallet-transfer/index.d.ts +4 -0
  248. package/dist/src/wallet-transfer/router.d.ts +465 -0
  249. package/dist/src/wallet-transfer/service.d.ts +26 -0
  250. package/dist/src/wallet-type/admin.router.d.ts +767 -0
  251. package/dist/src/wallet-type/constants.d.ts +4 -0
  252. package/dist/src/wallet-type/db.schemas.d.ts +794 -0
  253. package/dist/src/wallet-type/dto.schemas.d.ts +160 -0
  254. package/dist/src/wallet-type/errors/index.d.ts +25 -0
  255. package/dist/src/wallet-type/errors/locales/zh.d.ts +16 -0
  256. package/dist/src/wallet-type/index.d.ts +7 -0
  257. package/dist/src/wallet-type/permissions.d.ts +5 -0
  258. package/dist/src/wallet-type/schema.d.ts +408 -0
  259. package/dist/src/wallet-type/seed.d.ts +4 -0
  260. package/dist/src/wallet-type/service.d.ts +208 -0
  261. package/dist/src/withdraw/admin.router.d.ts +654 -0
  262. package/dist/src/withdraw/db.schemas.d.ts +516 -0
  263. package/dist/src/withdraw/dto.schemas.d.ts +816 -0
  264. package/dist/src/withdraw/errors/index.d.ts +41 -0
  265. package/dist/src/withdraw/errors/locales/zh.d.ts +22 -0
  266. package/dist/src/withdraw/index.d.ts +7 -0
  267. package/dist/src/withdraw/permissions.d.ts +9 -0
  268. package/dist/src/withdraw/router.d.ts +522 -0
  269. package/dist/src/withdraw/schema.d.ts +272 -0
  270. package/dist/src/withdraw/service.d.ts +143 -0
  271. package/package.json +19 -0
@@ -0,0 +1,474 @@
1
+ /** KYC 状态枚举 */
2
+ export declare const kycStatusEnum: import("drizzle-orm/pg-core").PgEnum<["unverified", "pending", "approved", "rejected"]>;
3
+ /** KYC 认证方式枚举 */
4
+ export declare const kycMethodEnum: import("drizzle-orm/pg-core").PgEnum<["passport", "id_card", "selfie", "utility_bill"]>;
5
+ /** 用户 KYC 主表(仅记录等级) */
6
+ export declare const userKyc: import("drizzle-orm/pg-core").PgTableWithColumns<{
7
+ name: "user_kyc";
8
+ schema: undefined;
9
+ columns: {
10
+ deletedAt: import("drizzle-orm/pg-core").PgColumn<{
11
+ name: "deleted_at";
12
+ tableName: "user_kyc";
13
+ dataType: "date";
14
+ columnType: "PgTimestamp";
15
+ data: Date;
16
+ driverParam: string;
17
+ notNull: false;
18
+ hasDefault: false;
19
+ isPrimaryKey: false;
20
+ isAutoincrement: false;
21
+ hasRuntimeDefault: false;
22
+ enumValues: undefined;
23
+ baseColumn: never;
24
+ identity: undefined;
25
+ generated: undefined;
26
+ }, {}, {}>;
27
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
28
+ name: "created_at";
29
+ tableName: "user_kyc";
30
+ dataType: "date";
31
+ columnType: "PgTimestamp";
32
+ data: Date;
33
+ driverParam: string;
34
+ notNull: true;
35
+ hasDefault: true;
36
+ isPrimaryKey: false;
37
+ isAutoincrement: false;
38
+ hasRuntimeDefault: false;
39
+ enumValues: undefined;
40
+ baseColumn: never;
41
+ identity: undefined;
42
+ generated: undefined;
43
+ }, {}, {}>;
44
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
45
+ name: "updated_at";
46
+ tableName: "user_kyc";
47
+ dataType: "date";
48
+ columnType: "PgTimestamp";
49
+ data: Date;
50
+ driverParam: string;
51
+ notNull: true;
52
+ hasDefault: true;
53
+ isPrimaryKey: false;
54
+ isAutoincrement: false;
55
+ hasRuntimeDefault: false;
56
+ enumValues: undefined;
57
+ baseColumn: never;
58
+ identity: undefined;
59
+ generated: undefined;
60
+ }, {}, {}>;
61
+ userId: import("drizzle-orm/pg-core").PgColumn<{
62
+ name: "user_id";
63
+ tableName: "user_kyc";
64
+ dataType: "string";
65
+ columnType: "PgText";
66
+ data: string;
67
+ driverParam: string;
68
+ notNull: true;
69
+ hasDefault: false;
70
+ isPrimaryKey: true;
71
+ isAutoincrement: false;
72
+ hasRuntimeDefault: false;
73
+ enumValues: [string, ...string[]];
74
+ baseColumn: never;
75
+ identity: undefined;
76
+ generated: undefined;
77
+ }, {}, {}>;
78
+ kycLevel: import("drizzle-orm/pg-core").PgColumn<{
79
+ name: "kyc_level";
80
+ tableName: "user_kyc";
81
+ dataType: "number";
82
+ columnType: "PgInteger";
83
+ data: number;
84
+ driverParam: string | number;
85
+ notNull: true;
86
+ hasDefault: true;
87
+ isPrimaryKey: false;
88
+ isAutoincrement: false;
89
+ hasRuntimeDefault: false;
90
+ enumValues: undefined;
91
+ baseColumn: never;
92
+ identity: undefined;
93
+ generated: undefined;
94
+ }, {}, {}>;
95
+ currentMethod: import("drizzle-orm/pg-core").PgColumn<{
96
+ name: "current_method";
97
+ tableName: "user_kyc";
98
+ dataType: "string";
99
+ columnType: "PgEnumColumn";
100
+ data: "passport" | "id_card" | "selfie" | "utility_bill";
101
+ driverParam: string;
102
+ notNull: false;
103
+ hasDefault: false;
104
+ isPrimaryKey: false;
105
+ isAutoincrement: false;
106
+ hasRuntimeDefault: false;
107
+ enumValues: ["passport", "id_card", "selfie", "utility_bill"];
108
+ baseColumn: never;
109
+ identity: undefined;
110
+ generated: undefined;
111
+ }, {}, {}>;
112
+ lastApprovedAt: import("drizzle-orm/pg-core").PgColumn<{
113
+ name: "last_approved_at";
114
+ tableName: "user_kyc";
115
+ dataType: "date";
116
+ columnType: "PgTimestamp";
117
+ data: Date;
118
+ driverParam: string;
119
+ notNull: false;
120
+ hasDefault: false;
121
+ isPrimaryKey: false;
122
+ isAutoincrement: false;
123
+ hasRuntimeDefault: false;
124
+ enumValues: undefined;
125
+ baseColumn: never;
126
+ identity: undefined;
127
+ generated: undefined;
128
+ }, {}, {}>;
129
+ lastRejectedAt: import("drizzle-orm/pg-core").PgColumn<{
130
+ name: "last_rejected_at";
131
+ tableName: "user_kyc";
132
+ dataType: "date";
133
+ columnType: "PgTimestamp";
134
+ data: Date;
135
+ driverParam: string;
136
+ notNull: false;
137
+ hasDefault: false;
138
+ isPrimaryKey: false;
139
+ isAutoincrement: false;
140
+ hasRuntimeDefault: false;
141
+ enumValues: undefined;
142
+ baseColumn: never;
143
+ identity: undefined;
144
+ generated: undefined;
145
+ }, {}, {}>;
146
+ lastSubmittedAt: import("drizzle-orm/pg-core").PgColumn<{
147
+ name: "last_submitted_at";
148
+ tableName: "user_kyc";
149
+ dataType: "date";
150
+ columnType: "PgTimestamp";
151
+ data: Date;
152
+ driverParam: string;
153
+ notNull: false;
154
+ hasDefault: false;
155
+ isPrimaryKey: false;
156
+ isAutoincrement: false;
157
+ hasRuntimeDefault: false;
158
+ enumValues: undefined;
159
+ baseColumn: never;
160
+ identity: undefined;
161
+ generated: undefined;
162
+ }, {}, {}>;
163
+ };
164
+ dialect: "pg";
165
+ }>;
166
+ /** KYC 认证方式表 */
167
+ export declare const userKycMethod: import("drizzle-orm/pg-core").PgTableWithColumns<{
168
+ name: "user_kyc_method";
169
+ schema: undefined;
170
+ columns: {
171
+ deletedAt: import("drizzle-orm/pg-core").PgColumn<{
172
+ name: "deleted_at";
173
+ tableName: "user_kyc_method";
174
+ dataType: "date";
175
+ columnType: "PgTimestamp";
176
+ data: Date;
177
+ driverParam: string;
178
+ notNull: false;
179
+ hasDefault: false;
180
+ isPrimaryKey: false;
181
+ isAutoincrement: false;
182
+ hasRuntimeDefault: false;
183
+ enumValues: undefined;
184
+ baseColumn: never;
185
+ identity: undefined;
186
+ generated: undefined;
187
+ }, {}, {}>;
188
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
189
+ name: "created_at";
190
+ tableName: "user_kyc_method";
191
+ dataType: "date";
192
+ columnType: "PgTimestamp";
193
+ data: Date;
194
+ driverParam: string;
195
+ notNull: true;
196
+ hasDefault: true;
197
+ isPrimaryKey: false;
198
+ isAutoincrement: false;
199
+ hasRuntimeDefault: false;
200
+ enumValues: undefined;
201
+ baseColumn: never;
202
+ identity: undefined;
203
+ generated: undefined;
204
+ }, {}, {}>;
205
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
206
+ name: "updated_at";
207
+ tableName: "user_kyc_method";
208
+ dataType: "date";
209
+ columnType: "PgTimestamp";
210
+ data: Date;
211
+ driverParam: string;
212
+ notNull: true;
213
+ hasDefault: true;
214
+ isPrimaryKey: false;
215
+ isAutoincrement: false;
216
+ hasRuntimeDefault: false;
217
+ enumValues: undefined;
218
+ baseColumn: never;
219
+ identity: undefined;
220
+ generated: undefined;
221
+ }, {}, {}>;
222
+ id: import("drizzle-orm/pg-core").PgColumn<{
223
+ name: "id";
224
+ tableName: "user_kyc_method";
225
+ dataType: "string";
226
+ columnType: "PgUUID";
227
+ data: string;
228
+ driverParam: string;
229
+ notNull: true;
230
+ hasDefault: true;
231
+ isPrimaryKey: true;
232
+ isAutoincrement: false;
233
+ hasRuntimeDefault: false;
234
+ enumValues: undefined;
235
+ baseColumn: never;
236
+ identity: undefined;
237
+ generated: undefined;
238
+ }, {}, {}>;
239
+ userId: import("drizzle-orm/pg-core").PgColumn<{
240
+ name: "user_id";
241
+ tableName: "user_kyc_method";
242
+ dataType: "string";
243
+ columnType: "PgText";
244
+ data: string;
245
+ driverParam: string;
246
+ notNull: true;
247
+ hasDefault: false;
248
+ isPrimaryKey: false;
249
+ isAutoincrement: false;
250
+ hasRuntimeDefault: false;
251
+ enumValues: [string, ...string[]];
252
+ baseColumn: never;
253
+ identity: undefined;
254
+ generated: undefined;
255
+ }, {}, {}>;
256
+ method: import("drizzle-orm/pg-core").PgColumn<{
257
+ name: "method";
258
+ tableName: "user_kyc_method";
259
+ dataType: "string";
260
+ columnType: "PgEnumColumn";
261
+ data: "passport" | "id_card" | "selfie" | "utility_bill";
262
+ driverParam: string;
263
+ notNull: true;
264
+ hasDefault: false;
265
+ isPrimaryKey: false;
266
+ isAutoincrement: false;
267
+ hasRuntimeDefault: false;
268
+ enumValues: ["passport", "id_card", "selfie", "utility_bill"];
269
+ baseColumn: never;
270
+ identity: undefined;
271
+ generated: undefined;
272
+ }, {}, {}>;
273
+ documentName: import("drizzle-orm/pg-core").PgColumn<{
274
+ name: "document_name";
275
+ tableName: "user_kyc_method";
276
+ dataType: "string";
277
+ columnType: "PgText";
278
+ data: string;
279
+ driverParam: string;
280
+ notNull: false;
281
+ hasDefault: false;
282
+ isPrimaryKey: false;
283
+ isAutoincrement: false;
284
+ hasRuntimeDefault: false;
285
+ enumValues: [string, ...string[]];
286
+ baseColumn: never;
287
+ identity: undefined;
288
+ generated: undefined;
289
+ }, {}, {}>;
290
+ documentNumber: import("drizzle-orm/pg-core").PgColumn<{
291
+ name: "document_number";
292
+ tableName: "user_kyc_method";
293
+ dataType: "string";
294
+ columnType: "PgText";
295
+ data: string;
296
+ driverParam: string;
297
+ notNull: false;
298
+ hasDefault: false;
299
+ isPrimaryKey: false;
300
+ isAutoincrement: false;
301
+ hasRuntimeDefault: false;
302
+ enumValues: [string, ...string[]];
303
+ baseColumn: never;
304
+ identity: undefined;
305
+ generated: undefined;
306
+ }, {}, {}>;
307
+ fileId1: import("drizzle-orm/pg-core").PgColumn<{
308
+ name: "file_id_1";
309
+ tableName: "user_kyc_method";
310
+ dataType: "string";
311
+ columnType: "PgText";
312
+ data: string;
313
+ driverParam: string;
314
+ notNull: false;
315
+ hasDefault: false;
316
+ isPrimaryKey: false;
317
+ isAutoincrement: false;
318
+ hasRuntimeDefault: false;
319
+ enumValues: [string, ...string[]];
320
+ baseColumn: never;
321
+ identity: undefined;
322
+ generated: undefined;
323
+ }, {}, {}>;
324
+ fileId2: import("drizzle-orm/pg-core").PgColumn<{
325
+ name: "file_id_2";
326
+ tableName: "user_kyc_method";
327
+ dataType: "string";
328
+ columnType: "PgText";
329
+ data: string;
330
+ driverParam: string;
331
+ notNull: false;
332
+ hasDefault: false;
333
+ isPrimaryKey: false;
334
+ isAutoincrement: false;
335
+ hasRuntimeDefault: false;
336
+ enumValues: [string, ...string[]];
337
+ baseColumn: never;
338
+ identity: undefined;
339
+ generated: undefined;
340
+ }, {}, {}>;
341
+ fileId3: import("drizzle-orm/pg-core").PgColumn<{
342
+ name: "file_id_3";
343
+ tableName: "user_kyc_method";
344
+ dataType: "string";
345
+ columnType: "PgText";
346
+ data: string;
347
+ driverParam: string;
348
+ notNull: false;
349
+ hasDefault: false;
350
+ isPrimaryKey: false;
351
+ isAutoincrement: false;
352
+ hasRuntimeDefault: false;
353
+ enumValues: [string, ...string[]];
354
+ baseColumn: never;
355
+ identity: undefined;
356
+ generated: undefined;
357
+ }, {}, {}>;
358
+ fileId4: import("drizzle-orm/pg-core").PgColumn<{
359
+ name: "file_id_4";
360
+ tableName: "user_kyc_method";
361
+ dataType: "string";
362
+ columnType: "PgText";
363
+ data: string;
364
+ driverParam: string;
365
+ notNull: false;
366
+ hasDefault: false;
367
+ isPrimaryKey: false;
368
+ isAutoincrement: false;
369
+ hasRuntimeDefault: false;
370
+ enumValues: [string, ...string[]];
371
+ baseColumn: never;
372
+ identity: undefined;
373
+ generated: undefined;
374
+ }, {}, {}>;
375
+ status: import("drizzle-orm/pg-core").PgColumn<{
376
+ name: "status";
377
+ tableName: "user_kyc_method";
378
+ dataType: "string";
379
+ columnType: "PgEnumColumn";
380
+ data: "unverified" | "pending" | "approved" | "rejected";
381
+ driverParam: string;
382
+ notNull: true;
383
+ hasDefault: true;
384
+ isPrimaryKey: false;
385
+ isAutoincrement: false;
386
+ hasRuntimeDefault: false;
387
+ enumValues: ["unverified", "pending", "approved", "rejected"];
388
+ baseColumn: never;
389
+ identity: undefined;
390
+ generated: undefined;
391
+ }, {}, {}>;
392
+ submittedAt: import("drizzle-orm/pg-core").PgColumn<{
393
+ name: "submitted_at";
394
+ tableName: "user_kyc_method";
395
+ dataType: "date";
396
+ columnType: "PgTimestamp";
397
+ data: Date;
398
+ driverParam: string;
399
+ notNull: false;
400
+ hasDefault: false;
401
+ isPrimaryKey: false;
402
+ isAutoincrement: false;
403
+ hasRuntimeDefault: false;
404
+ enumValues: undefined;
405
+ baseColumn: never;
406
+ identity: undefined;
407
+ generated: undefined;
408
+ }, {}, {}>;
409
+ reviewedAt: import("drizzle-orm/pg-core").PgColumn<{
410
+ name: "reviewed_at";
411
+ tableName: "user_kyc_method";
412
+ dataType: "date";
413
+ columnType: "PgTimestamp";
414
+ data: Date;
415
+ driverParam: string;
416
+ notNull: false;
417
+ hasDefault: false;
418
+ isPrimaryKey: false;
419
+ isAutoincrement: false;
420
+ hasRuntimeDefault: false;
421
+ enumValues: undefined;
422
+ baseColumn: never;
423
+ identity: undefined;
424
+ generated: undefined;
425
+ }, {}, {}>;
426
+ reviewedBy: import("drizzle-orm/pg-core").PgColumn<{
427
+ name: "reviewed_by";
428
+ tableName: "user_kyc_method";
429
+ dataType: "string";
430
+ columnType: "PgText";
431
+ data: string;
432
+ driverParam: string;
433
+ notNull: false;
434
+ hasDefault: false;
435
+ isPrimaryKey: false;
436
+ isAutoincrement: false;
437
+ hasRuntimeDefault: false;
438
+ enumValues: [string, ...string[]];
439
+ baseColumn: never;
440
+ identity: undefined;
441
+ generated: undefined;
442
+ }, {}, {}>;
443
+ rejectionReason: import("drizzle-orm/pg-core").PgColumn<{
444
+ name: "rejection_reason";
445
+ tableName: "user_kyc_method";
446
+ dataType: "string";
447
+ columnType: "PgText";
448
+ data: string;
449
+ driverParam: string;
450
+ notNull: false;
451
+ hasDefault: false;
452
+ isPrimaryKey: false;
453
+ isAutoincrement: false;
454
+ hasRuntimeDefault: false;
455
+ enumValues: [string, ...string[]];
456
+ baseColumn: never;
457
+ identity: undefined;
458
+ generated: undefined;
459
+ }, {}, {}>;
460
+ };
461
+ dialect: "pg";
462
+ }>;
463
+ export declare const userKycRelations: import("drizzle-orm").Relations<"user_kyc", {
464
+ user: import("drizzle-orm").One<"user", true>;
465
+ methods: import("drizzle-orm").Many<"user_kyc_method">;
466
+ }>;
467
+ export declare const userKycMethodRelations: import("drizzle-orm").Relations<"user_kyc_method", {
468
+ user: import("drizzle-orm").One<"user", true>;
469
+ file1: import("drizzle-orm").One<"file_storage", false>;
470
+ file2: import("drizzle-orm").One<"file_storage", false>;
471
+ file3: import("drizzle-orm").One<"file_storage", false>;
472
+ file4: import("drizzle-orm").One<"file_storage", false>;
473
+ kyc: import("drizzle-orm").One<"user_kyc", true>;
474
+ }>;
@@ -0,0 +1,170 @@
1
+ import type { KycMethodAdminApproveSchemaType, KycMethodAdminListQuerySchemaType, KycMethodAdminRejectSchemaType, KycMethodParamsSchemaType, KycMethodSubmitSchemaType } from "./dto.schemas";
2
+ /**
3
+ * KYC 基础服务(抽象类)
4
+ */
5
+ declare abstract class BaseUserKycService {
6
+ protected static validateUserId(userId: string): void;
7
+ protected static ensureIdCardFields(method: KycMethodParamsSchemaType["kycMethod"], payload: KycMethodSubmitSchemaType): void;
8
+ protected static ensureStatusEditable(status: "unverified" | "pending" | "approved" | "rejected"): void;
9
+ }
10
+ /**
11
+ * 用户侧 KYC 服务
12
+ */
13
+ export declare abstract class UserUserKycService extends BaseUserKycService {
14
+ static submitMethod(userId: string, method: KycMethodParamsSchemaType["kycMethod"], payload: KycMethodSubmitSchemaType): Promise<{
15
+ id: string;
16
+ createdAt: Date;
17
+ updatedAt: Date;
18
+ userId: string;
19
+ deletedAt: Date | null;
20
+ status: "unverified" | "pending" | "approved" | "rejected";
21
+ method: "passport" | "id_card" | "selfie" | "utility_bill";
22
+ documentName: string | null;
23
+ documentNumber: string | null;
24
+ fileId1: string | null;
25
+ fileId2: string | null;
26
+ fileId3: string | null;
27
+ fileId4: string | null;
28
+ submittedAt: Date | null;
29
+ reviewedAt: Date | null;
30
+ reviewedBy: string | null;
31
+ rejectionReason: string | null;
32
+ }>;
33
+ static getMethod(userId: string, method: KycMethodParamsSchemaType["kycMethod"]): Promise<{
34
+ id: string;
35
+ createdAt: Date;
36
+ updatedAt: Date;
37
+ userId: string;
38
+ deletedAt: Date | null;
39
+ status: "unverified" | "pending" | "approved" | "rejected";
40
+ method: "passport" | "id_card" | "selfie" | "utility_bill";
41
+ documentName: string | null;
42
+ documentNumber: string | null;
43
+ fileId1: string | null;
44
+ fileId2: string | null;
45
+ fileId3: string | null;
46
+ fileId4: string | null;
47
+ submittedAt: Date | null;
48
+ reviewedAt: Date | null;
49
+ reviewedBy: string | null;
50
+ rejectionReason: string | null;
51
+ }>;
52
+ static updateMethod(userId: string, method: KycMethodParamsSchemaType["kycMethod"], payload: KycMethodSubmitSchemaType): Promise<{
53
+ deletedAt: Date | null;
54
+ createdAt: Date;
55
+ updatedAt: Date;
56
+ id: string;
57
+ userId: string;
58
+ method: "passport" | "id_card" | "selfie" | "utility_bill";
59
+ documentName: string | null;
60
+ documentNumber: string | null;
61
+ fileId1: string | null;
62
+ fileId2: string | null;
63
+ fileId3: string | null;
64
+ fileId4: string | null;
65
+ status: "unverified" | "pending" | "approved" | "rejected";
66
+ submittedAt: Date | null;
67
+ reviewedAt: Date | null;
68
+ reviewedBy: string | null;
69
+ rejectionReason: string | null;
70
+ }>;
71
+ static isMethodVerified(userId: string, method: KycMethodParamsSchemaType["kycMethod"]): Promise<{
72
+ verified: boolean;
73
+ }>;
74
+ }
75
+ /**
76
+ * 管理侧 KYC 服务
77
+ */
78
+ export declare abstract class AdminUserKycService extends BaseUserKycService {
79
+ static listMethods(query: KycMethodAdminListQuerySchemaType): Promise<{
80
+ data: {
81
+ id: string;
82
+ createdAt: Date;
83
+ updatedAt: Date;
84
+ userId: string;
85
+ deletedAt: Date | null;
86
+ status: "unverified" | "pending" | "approved" | "rejected";
87
+ method: "passport" | "id_card" | "selfie" | "utility_bill";
88
+ documentName: string | null;
89
+ documentNumber: string | null;
90
+ fileId1: string | null;
91
+ fileId2: string | null;
92
+ fileId3: string | null;
93
+ fileId4: string | null;
94
+ submittedAt: Date | null;
95
+ reviewedAt: Date | null;
96
+ reviewedBy: string | null;
97
+ rejectionReason: string | null;
98
+ }[];
99
+ pagination: {
100
+ pageSize: number;
101
+ pageIndex: number;
102
+ total: number;
103
+ totalPages: number;
104
+ hasNextPage: boolean;
105
+ };
106
+ }>;
107
+ static getMethod(id: string): Promise<{
108
+ id: string;
109
+ createdAt: Date;
110
+ updatedAt: Date;
111
+ userId: string;
112
+ deletedAt: Date | null;
113
+ status: "unverified" | "pending" | "approved" | "rejected";
114
+ method: "passport" | "id_card" | "selfie" | "utility_bill";
115
+ documentName: string | null;
116
+ documentNumber: string | null;
117
+ fileId1: string | null;
118
+ fileId2: string | null;
119
+ fileId3: string | null;
120
+ fileId4: string | null;
121
+ submittedAt: Date | null;
122
+ reviewedAt: Date | null;
123
+ reviewedBy: string | null;
124
+ rejectionReason: string | null;
125
+ }>;
126
+ static approveMethod(id: string, reviewerId: string, input: KycMethodAdminApproveSchemaType): Promise<{
127
+ deletedAt: Date | null;
128
+ createdAt: Date;
129
+ updatedAt: Date;
130
+ id: string;
131
+ userId: string;
132
+ method: "passport" | "id_card" | "selfie" | "utility_bill";
133
+ documentName: string | null;
134
+ documentNumber: string | null;
135
+ fileId1: string | null;
136
+ fileId2: string | null;
137
+ fileId3: string | null;
138
+ fileId4: string | null;
139
+ status: "unverified" | "pending" | "approved" | "rejected";
140
+ submittedAt: Date | null;
141
+ reviewedAt: Date | null;
142
+ reviewedBy: string | null;
143
+ rejectionReason: string | null;
144
+ }>;
145
+ static rejectMethod(id: string, reviewerId: string, input: KycMethodAdminRejectSchemaType): Promise<{
146
+ deletedAt: Date | null;
147
+ createdAt: Date;
148
+ updatedAt: Date;
149
+ id: string;
150
+ userId: string;
151
+ method: "passport" | "id_card" | "selfie" | "utility_bill";
152
+ documentName: string | null;
153
+ documentNumber: string | null;
154
+ fileId1: string | null;
155
+ fileId2: string | null;
156
+ fileId3: string | null;
157
+ fileId4: string | null;
158
+ status: "unverified" | "pending" | "approved" | "rejected";
159
+ submittedAt: Date | null;
160
+ reviewedAt: Date | null;
161
+ reviewedBy: string | null;
162
+ rejectionReason: string | null;
163
+ }>;
164
+ }
165
+ /**
166
+ * 内部 KYC 服务(预留扩展)
167
+ */
168
+ export declare abstract class InternalUserKycService extends BaseUserKycService {
169
+ }
170
+ export {};