oak-pay-business 4.1.1 → 4.1.2

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 (582) hide show
  1. package/es/aspects/AspectDict.d.ts +2 -0
  2. package/es/aspects/index.js +2 -0
  3. package/es/aspects/invoice.d.ts +7 -0
  4. package/es/aspects/invoice.js +8 -0
  5. package/es/checkers/accountOper.js +28 -0
  6. package/es/checkers/index.js +4 -4
  7. package/es/checkers/invoice.d.ts +5 -0
  8. package/es/checkers/invoice.js +196 -0
  9. package/es/checkers/pay.js +9 -3
  10. package/es/checkers/redInvoice.d.ts +5 -0
  11. package/es/checkers/redInvoice.js +172 -0
  12. package/es/checkers/system.js +11 -0
  13. package/es/components/account/detail/index.d.ts +12 -0
  14. package/es/components/account/detail/index.js +32 -0
  15. package/es/components/account/detail/invoice/apply/channel.mobile.d.ts +1 -0
  16. package/es/components/account/detail/invoice/apply/channel.mobile.jsx +80 -0
  17. package/es/components/account/detail/invoice/apply/channel.pc.d.ts +1 -0
  18. package/es/components/account/detail/invoice/apply/channel.pc.jsx +140 -0
  19. package/es/components/account/detail/invoice/apply/channels.d.ts +1 -0
  20. package/es/components/account/detail/invoice/apply/channels.js +186 -0
  21. package/es/components/account/detail/invoice/apply/index.d.ts +22 -0
  22. package/es/components/account/detail/invoice/apply/index.js +347 -0
  23. package/es/components/account/detail/invoice/apply/locales/zh-CN.json +136 -0
  24. package/es/components/account/detail/invoice/apply/registry.d.ts +11 -0
  25. package/es/components/account/detail/invoice/apply/registry.js +10 -0
  26. package/es/components/account/detail/invoice/apply/types.d.ts +119 -0
  27. package/es/components/account/detail/invoice/apply/types.js +74 -0
  28. package/es/components/account/detail/invoice/apply/web.d.ts +282 -0
  29. package/es/components/account/detail/invoice/apply/web.jsx +68 -0
  30. package/es/components/account/detail/invoice/apply/web.pc.d.ts +282 -0
  31. package/es/components/account/detail/invoice/apply/web.pc.jsx +111 -0
  32. package/es/components/account/detail/invoice/history/index.d.ts +11 -0
  33. package/es/components/account/detail/invoice/history/index.js +96 -0
  34. package/es/components/account/detail/invoice/history/locales/zh-CN.json +25 -0
  35. package/es/components/account/detail/invoice/history/web.d.ts +18 -0
  36. package/es/components/account/detail/invoice/history/web.jsx +15 -0
  37. package/es/components/account/detail/invoice/history/web.pc.d.ts +18 -0
  38. package/es/components/account/detail/invoice/history/web.pc.jsx +27 -0
  39. package/es/components/account/detail/locales/zh-CN.json +33 -0
  40. package/es/components/account/detail/web.d.ts +20 -0
  41. package/es/components/account/detail/web.jsx +20 -2
  42. package/es/components/account/detail/web.pc.d.ts +20 -0
  43. package/es/components/account/detail/web.pc.jsx +16 -2
  44. package/es/components/aliPay/upsert/web.pc.jsx +2 -1
  45. package/es/components/apAccount/config/web.pc.jsx +11 -7
  46. package/es/components/apAccount/config/web.pc.module.less +3 -3
  47. package/es/components/apAccount/upsert/index.js +2 -1
  48. package/es/components/apAccount/upsert/web.pc.jsx +2 -1
  49. package/es/components/apProduct/config/web.pc.jsx +8 -6
  50. package/es/components/apProduct/config/web.pc.module.less +4 -4
  51. package/es/components/apProduct/upsert/web.pc.jsx +2 -1
  52. package/es/components/cpAccount/config/web.pc.jsx +10 -6
  53. package/es/components/cpAccount/config/web.pc.module.less +3 -3
  54. package/es/components/cpAccount/upsert/web.pc.jsx +2 -1
  55. package/es/components/cpProduct/config/web.pc.jsx +8 -6
  56. package/es/components/cpProduct/config/web.pc.module.less +4 -4
  57. package/es/components/cpProduct/upsert/web.pc.jsx +2 -1
  58. package/es/components/creemPay/upsert/web.pc.jsx +2 -1
  59. package/es/components/deposit/new/web.pc.jsx +2 -1
  60. package/es/components/epAccount/config/web.pc.jsx +11 -7
  61. package/es/components/epAccount/config/web.pc.module.less +3 -3
  62. package/es/components/epAccount/upsert/web.pc.jsx +2 -1
  63. package/es/components/epProduct/config/web.pc.jsx +8 -6
  64. package/es/components/epProduct/config/web.pc.module.less +4 -4
  65. package/es/components/epProduct/upsert/web.pc.jsx +2 -1
  66. package/es/components/epay/upsert/web.pc.jsx +2 -1
  67. package/es/components/invoice/manage/index.d.ts +7 -0
  68. package/es/components/invoice/manage/index.js +105 -0
  69. package/es/components/invoice/manage/locales/zh-CN.json +31 -0
  70. package/es/components/invoice/manage/manualItem/index.d.ts +6 -0
  71. package/es/components/invoice/manage/manualItem/index.js +73 -0
  72. package/es/components/invoice/manage/manualItem/locales/zh-CN.json +16 -0
  73. package/es/components/invoice/manage/manualItem/web.pc.d.ts +9 -0
  74. package/es/components/invoice/manage/manualItem/web.pc.jsx +69 -0
  75. package/es/components/invoice/manage/web.pc.d.ts +14 -0
  76. package/es/components/invoice/manage/web.pc.jsx +66 -0
  77. package/es/components/invoice/manage/web.pc.module.less +22 -0
  78. package/es/components/invoiceConfig/system/index.config.d.ts +2 -0
  79. package/es/components/invoiceConfig/system/index.config.js +4 -0
  80. package/es/components/invoiceConfig/system/index.d.ts +3 -0
  81. package/es/components/invoiceConfig/system/index.js +41 -0
  82. package/es/components/invoiceConfig/system/locales/zh-CN.json +22 -0
  83. package/es/components/invoiceConfig/system/web.pc.d.ts +18 -0
  84. package/es/components/invoiceConfig/system/web.pc.jsx +108 -0
  85. package/es/components/nuonuoInvoice/config/index.d.ts +4 -0
  86. package/es/components/nuonuoInvoice/config/index.js +48 -0
  87. package/es/components/nuonuoInvoice/config/locales/zh-CN.json +9 -0
  88. package/es/components/nuonuoInvoice/config/web.pc.d.ts +8 -0
  89. package/es/components/nuonuoInvoice/config/web.pc.jsx +97 -0
  90. package/es/components/nuonuoInvoice/config/web.pc.module.less +17 -0
  91. package/es/components/nuonuoInvoice/upsert/index.d.ts +4 -0
  92. package/es/components/nuonuoInvoice/upsert/index.js +53 -0
  93. package/es/components/nuonuoInvoice/upsert/locales/zh-CN.json +68 -0
  94. package/es/components/nuonuoInvoice/upsert/web.pc.d.ts +13 -0
  95. package/es/components/nuonuoInvoice/upsert/web.pc.jsx +124 -0
  96. package/es/components/nuonuoInvoice/upsert/web.pc.module.less +19 -0
  97. package/es/components/offlineAccount/config/web.pc.jsx +10 -6
  98. package/es/components/offlineAccount/config/web.pc.module.less +3 -3
  99. package/es/components/offlineAccount/upsert/index.d.ts +1 -1
  100. package/es/components/offlineAccount/upsert/web.pc.jsx +2 -1
  101. package/es/components/offlineInvoice/config/index.d.ts +4 -0
  102. package/es/components/offlineInvoice/config/index.js +31 -0
  103. package/es/components/offlineInvoice/config/locales/zh-CN.json +9 -0
  104. package/es/components/offlineInvoice/config/web.pc.d.ts +8 -0
  105. package/es/components/offlineInvoice/config/web.pc.jsx +58 -0
  106. package/es/components/offlineInvoice/config/web.pc.module.less +26 -0
  107. package/es/components/offlineInvoice/upsert/index.d.ts +4 -0
  108. package/es/components/offlineInvoice/upsert/index.js +34 -0
  109. package/es/components/offlineInvoice/upsert/locales/zh-CN.json +23 -0
  110. package/es/components/offlineInvoice/upsert/web.pc.d.ts +13 -0
  111. package/es/components/offlineInvoice/upsert/web.pc.jsx +45 -0
  112. package/es/components/offlineInvoice/upsert/web.pc.module.less +11 -0
  113. package/es/components/order/list/index.d.ts +1 -1
  114. package/es/components/pay/detail/index.js +1 -4
  115. package/es/components/pay/detail/web.d.ts +10 -0
  116. package/es/components/pay/detail/web.pc.d.ts +10 -0
  117. package/es/components/pay/detail/web.pc.jsx +2 -1
  118. package/es/components/pay/list/index.d.ts +6 -0
  119. package/es/components/pay/list/index.js +41 -1
  120. package/es/components/pay/list/web.pc.d.ts +5 -0
  121. package/es/components/pay/list/web.pc.jsx +45 -19
  122. package/es/components/pay/list/web.pc.module.less +40 -2
  123. package/es/components/payConfig/system/index.d.ts +1 -1
  124. package/es/components/payConfig/system/locales/zh-CN.json +2 -1
  125. package/es/components/payConfig/system/web.pc.jsx +22 -13
  126. package/es/components/payConfig/system/web.pc.module.less +25 -5
  127. package/es/components/paypalPay/upsert/web.pc.jsx +2 -1
  128. package/es/components/ppAccount/config/web.pc.jsx +10 -6
  129. package/es/components/ppAccount/config/web.pc.module.less +3 -3
  130. package/es/components/ppAccount/upsert/web.pc.jsx +2 -1
  131. package/es/components/ppProduct/config/web.pc.jsx +8 -6
  132. package/es/components/ppProduct/config/web.pc.module.less +4 -4
  133. package/es/components/ppProduct/upsert/web.pc.jsx +2 -1
  134. package/es/components/redInvoice/apply/index.d.ts +7 -0
  135. package/es/components/redInvoice/apply/index.js +39 -0
  136. package/es/components/redInvoice/apply/locales/zh-CN.json +12 -0
  137. package/es/components/redInvoice/apply/web.pc.d.ts +10 -0
  138. package/es/components/redInvoice/apply/web.pc.jsx +37 -0
  139. package/es/components/redInvoice/apply/web.pc.module.less +13 -0
  140. package/es/components/redInvoice/manage/index.d.ts +7 -0
  141. package/es/components/redInvoice/manage/index.js +70 -0
  142. package/es/components/redInvoice/manage/locales/zh-CN.json +29 -0
  143. package/es/components/redInvoice/manage/manualItem/index.d.ts +6 -0
  144. package/es/components/redInvoice/manage/manualItem/index.js +60 -0
  145. package/es/components/redInvoice/manage/manualItem/locales/zh-CN.json +12 -0
  146. package/es/components/redInvoice/manage/manualItem/web.pc.d.ts +9 -0
  147. package/es/components/redInvoice/manage/manualItem/web.pc.jsx +62 -0
  148. package/es/components/redInvoice/manage/web.pc.d.ts +12 -0
  149. package/es/components/redInvoice/manage/web.pc.jsx +38 -0
  150. package/es/components/redInvoice/manage/web.pc.module.less +22 -0
  151. package/es/components/refund/list/index.d.ts +1 -1
  152. package/es/components/refund/list/web.pc.jsx +2 -1
  153. package/es/components/ship/system/index.d.ts +1 -1
  154. package/es/components/ship/system/web.pc.jsx +1 -1
  155. package/es/components/ship/wechatMpShip/upsert/index.d.ts +1 -1
  156. package/es/components/ship/wechatMpShip/upsert/web.pc.jsx +2 -1
  157. package/es/components/shipServiceSystem/list/web.pc.jsx +2 -1
  158. package/es/components/spAccount/config/web.pc.jsx +10 -6
  159. package/es/components/spAccount/config/web.pc.module.less +3 -3
  160. package/es/components/spAccount/upsert/web.pc.jsx +2 -1
  161. package/es/components/spProduct/config/web.pc.jsx +8 -6
  162. package/es/components/spProduct/config/web.pc.module.less +4 -4
  163. package/es/components/spProduct/upsert/web.pc.jsx +2 -1
  164. package/es/components/stripePay/upsert/web.pc.jsx +2 -1
  165. package/es/components/sysAccount/orderList/index.config.d.ts +2 -0
  166. package/es/components/sysAccount/orderList/index.config.js +4 -0
  167. package/es/components/sysAccount/orderList/index.d.ts +2 -0
  168. package/es/components/sysAccount/orderList/index.js +34 -0
  169. package/es/components/sysAccount/orderList/web.pc.d.ts +4 -0
  170. package/es/components/sysAccount/orderList/web.pc.jsx +51 -0
  171. package/es/components/sysAccount/refundList/index.config.d.ts +2 -0
  172. package/es/components/sysAccount/refundList/index.config.js +4 -0
  173. package/es/components/sysAccount/refundList/index.d.ts +2 -0
  174. package/es/components/sysAccount/refundList/index.js +44 -0
  175. package/es/components/sysAccount/refundList/web.pc.d.ts +4 -0
  176. package/es/components/sysAccount/refundList/web.pc.jsx +48 -0
  177. package/es/components/sysAccount/survey/locales/zh-CN.json +9 -9
  178. package/es/components/sysAccount/survey/web.pc.d.ts +10 -0
  179. package/es/components/sysAccount/survey/web.pc.jsx +22 -12
  180. package/es/components/sysAccount/survey/web.pc.module.less +1 -15
  181. package/es/components/sysAccount/transferList/index.d.ts +1 -1
  182. package/es/components/sysAccountMove/create/web.pc.jsx +4 -3
  183. package/es/components/waffoPay/upsert/web.pc.jsx +2 -1
  184. package/es/components/wechatPay/upsert/web.pc.jsx +2 -1
  185. package/es/components/wfAccount/config/web.pc.jsx +10 -6
  186. package/es/components/wfAccount/config/web.pc.module.less +3 -3
  187. package/es/components/wfAccount/upsert/web.pc.jsx +2 -1
  188. package/es/components/wfProduct/config/web.pc.jsx +8 -6
  189. package/es/components/wfProduct/config/web.pc.module.less +4 -4
  190. package/es/components/wfProduct/upsert/web.pc.jsx +2 -1
  191. package/es/components/withdraw/detail/index.d.ts +1 -1
  192. package/es/components/withdrawAccount/upsert/web.pc.jsx +2 -1
  193. package/es/components/withdrawTransfer/list/index.d.ts +1 -1
  194. package/es/components/withdrawTransfer/list/web.pc.jsx +2 -1
  195. package/es/components/wpAccount/config/web.pc.jsx +11 -7
  196. package/es/components/wpAccount/config/web.pc.module.less +3 -3
  197. package/es/components/wpAccount/upsert/web.pc.jsx +2 -1
  198. package/es/components/wpProduct/config/web.pc.jsx +8 -6
  199. package/es/components/wpProduct/config/web.pc.module.less +4 -4
  200. package/es/configuration/attrUpdateMatrix.js +60 -0
  201. package/es/configuration/relation.js +11 -1
  202. package/es/context/BackendRuntimeContext.js +11 -1
  203. package/es/context/FrontendRuntimeContext.d.ts +2 -2
  204. package/es/context/FrontendRuntimeContext.js +6 -3
  205. package/es/data/actionAuth.js +79 -1
  206. package/es/data/path.js +70 -0
  207. package/es/entities/AbstractInvoiceChannel.d.ts +10 -0
  208. package/es/entities/AbstractInvoiceChannel.js +18 -0
  209. package/es/entities/Account.d.ts +7 -1
  210. package/es/entities/Account.js +24 -0
  211. package/es/entities/AccountOper.d.ts +4 -1
  212. package/es/entities/AccountOper.js +18 -0
  213. package/es/entities/Deposit.d.ts +4 -1
  214. package/es/entities/Deposit.js +4 -0
  215. package/es/entities/Invoice.d.ts +44 -0
  216. package/es/entities/Invoice.js +110 -0
  217. package/es/entities/InvoicePay.d.ts +17 -0
  218. package/es/entities/InvoicePay.js +19 -0
  219. package/es/entities/NuonuoInvoice.d.ts +34 -0
  220. package/es/entities/NuonuoInvoice.js +73 -0
  221. package/es/entities/OfflineInvoice.d.ts +16 -0
  222. package/es/entities/OfflineInvoice.js +35 -0
  223. package/es/entities/Pay.js +1 -1
  224. package/es/entities/RedInvoice.d.ts +35 -0
  225. package/es/entities/RedInvoice.js +38 -0
  226. package/es/entities/System.d.ts +6 -0
  227. package/es/index.d.ts +1 -0
  228. package/es/index.js +1 -0
  229. package/es/locales/error/zh-CN.json +25 -1
  230. package/es/oak-app-domain/AbstractInvoiceChannel/Schema.d.ts +19 -0
  231. package/es/oak-app-domain/AbstractInvoiceChannel/Schema.js +1 -0
  232. package/es/oak-app-domain/AbstractInvoiceChannel/Storage.d.ts +3 -0
  233. package/es/oak-app-domain/AbstractInvoiceChannel/Storage.js +16 -0
  234. package/es/oak-app-domain/AbstractInvoiceChannel/_baseSchema.d.ts +41 -0
  235. package/es/oak-app-domain/AbstractInvoiceChannel/_baseSchema.js +1 -0
  236. package/es/oak-app-domain/AbstractInvoiceChannel/locales/en_US.json +7 -0
  237. package/es/oak-app-domain/AbstractInvoiceChannel/locales/zh_CN.json +7 -0
  238. package/es/oak-app-domain/Account/Action.d.ts +1 -1
  239. package/es/oak-app-domain/Account/Action.js +1 -1
  240. package/es/oak-app-domain/Account/Storage.js +42 -0
  241. package/es/oak-app-domain/Account/Style.js +5 -1
  242. package/es/oak-app-domain/Account/_baseSchema.d.ts +24 -0
  243. package/es/oak-app-domain/Account/locales/en_US.json +12 -2
  244. package/es/oak-app-domain/Account/locales/zh_CN.json +12 -2
  245. package/es/oak-app-domain/AccountOper/Storage.js +23 -2
  246. package/es/oak-app-domain/AccountOper/Style.js +5 -1
  247. package/es/oak-app-domain/AccountOper/_baseSchema.d.ts +15 -3
  248. package/es/oak-app-domain/AccountOper/locales/en_US.json +8 -1
  249. package/es/oak-app-domain/AccountOper/locales/zh_CN.json +8 -1
  250. package/es/oak-app-domain/ActionDefDict.d.ts +7 -0
  251. package/es/oak-app-domain/ActionDefDict.js +6 -0
  252. package/es/oak-app-domain/Deposit/Storage.js +12 -0
  253. package/es/oak-app-domain/Deposit/_baseSchema.d.ts +9 -1
  254. package/es/oak-app-domain/Deposit/locales/en_US.json +2 -0
  255. package/es/oak-app-domain/Deposit/locales/zh_CN.json +2 -0
  256. package/es/oak-app-domain/EntityDict.d.ts +556 -1
  257. package/es/oak-app-domain/ExtraFile/Storage.js +1 -1
  258. package/es/oak-app-domain/ExtraFile/_baseSchema.d.ts +2 -2
  259. package/es/oak-app-domain/Invoice/Action.d.ts +11 -0
  260. package/es/oak-app-domain/Invoice/Action.js +19 -0
  261. package/es/oak-app-domain/Invoice/Schema.d.ts +19 -0
  262. package/es/oak-app-domain/Invoice/Schema.js +1 -0
  263. package/es/oak-app-domain/Invoice/Storage.d.ts +3 -0
  264. package/es/oak-app-domain/Invoice/Storage.js +163 -0
  265. package/es/oak-app-domain/Invoice/Style.d.ts +3 -0
  266. package/es/oak-app-domain/Invoice/Style.js +24 -0
  267. package/es/oak-app-domain/Invoice/_baseSchema.d.ts +131 -0
  268. package/es/oak-app-domain/Invoice/_baseSchema.js +1 -0
  269. package/es/oak-app-domain/Invoice/locales/en_US.json +54 -0
  270. package/es/oak-app-domain/Invoice/locales/zh_CN.json +54 -0
  271. package/es/oak-app-domain/InvoicePay/Schema.d.ts +19 -0
  272. package/es/oak-app-domain/InvoicePay/Schema.js +1 -0
  273. package/es/oak-app-domain/InvoicePay/Storage.d.ts +3 -0
  274. package/es/oak-app-domain/InvoicePay/Storage.js +55 -0
  275. package/es/oak-app-domain/InvoicePay/_baseSchema.d.ts +64 -0
  276. package/es/oak-app-domain/InvoicePay/_baseSchema.js +1 -0
  277. package/es/oak-app-domain/InvoicePay/locales/en_US.json +13 -0
  278. package/es/oak-app-domain/InvoicePay/locales/zh_CN.json +13 -0
  279. package/es/oak-app-domain/Log/Storage.js +4 -0
  280. package/es/oak-app-domain/Log/_baseSchema.d.ts +5 -0
  281. package/es/oak-app-domain/Log/locales/en_US.json +1 -0
  282. package/es/oak-app-domain/Log/locales/zh_CN.json +1 -0
  283. package/es/oak-app-domain/NuonuoInvoice/Schema.d.ts +19 -0
  284. package/es/oak-app-domain/NuonuoInvoice/Schema.js +1 -0
  285. package/es/oak-app-domain/NuonuoInvoice/Storage.d.ts +3 -0
  286. package/es/oak-app-domain/NuonuoInvoice/Storage.js +165 -0
  287. package/es/oak-app-domain/NuonuoInvoice/_baseSchema.d.ts +137 -0
  288. package/es/oak-app-domain/NuonuoInvoice/_baseSchema.js +1 -0
  289. package/es/oak-app-domain/NuonuoInvoice/locales/en_US.json +31 -0
  290. package/es/oak-app-domain/NuonuoInvoice/locales/zh_CN.json +31 -0
  291. package/es/oak-app-domain/OauthProvider/Storage.js +6 -0
  292. package/es/oak-app-domain/OauthProvider/_baseSchema.d.ts +4 -0
  293. package/es/oak-app-domain/OauthProvider/locales/en_US.json +1 -0
  294. package/es/oak-app-domain/OauthProvider/locales/zh_CN.json +1 -0
  295. package/es/oak-app-domain/OfflineInvoice/Schema.d.ts +19 -0
  296. package/es/oak-app-domain/OfflineInvoice/Schema.js +1 -0
  297. package/es/oak-app-domain/OfflineInvoice/Storage.d.ts +3 -0
  298. package/es/oak-app-domain/OfflineInvoice/Storage.js +57 -0
  299. package/es/oak-app-domain/OfflineInvoice/_baseSchema.d.ts +61 -0
  300. package/es/oak-app-domain/OfflineInvoice/_baseSchema.js +1 -0
  301. package/es/oak-app-domain/OfflineInvoice/locales/en_US.json +12 -0
  302. package/es/oak-app-domain/OfflineInvoice/locales/zh_CN.json +12 -0
  303. package/es/oak-app-domain/Pay/locales/zh_CN.json +1 -1
  304. package/es/oak-app-domain/RedInvoice/Action.d.ts +11 -0
  305. package/es/oak-app-domain/RedInvoice/Action.js +13 -0
  306. package/es/oak-app-domain/RedInvoice/Schema.d.ts +19 -0
  307. package/es/oak-app-domain/RedInvoice/Schema.js +1 -0
  308. package/es/oak-app-domain/RedInvoice/Storage.d.ts +3 -0
  309. package/es/oak-app-domain/RedInvoice/Storage.js +92 -0
  310. package/es/oak-app-domain/RedInvoice/Style.d.ts +3 -0
  311. package/es/oak-app-domain/RedInvoice/Style.js +15 -0
  312. package/es/oak-app-domain/RedInvoice/_baseSchema.d.ts +100 -0
  313. package/es/oak-app-domain/RedInvoice/_baseSchema.js +1 -0
  314. package/es/oak-app-domain/RedInvoice/locales/en_US.json +37 -0
  315. package/es/oak-app-domain/RedInvoice/locales/zh_CN.json +37 -0
  316. package/es/oak-app-domain/Storage.js +14 -0
  317. package/es/oak-app-domain/StyleDict.js +6 -0
  318. package/es/oak-app-domain/System/_baseSchema.d.ts +6 -0
  319. package/es/oak-app-domain/Version/Action.d.ts +6 -0
  320. package/es/oak-app-domain/Version/Action.js +2 -0
  321. package/es/oak-app-domain/Version/Schema.d.ts +19 -0
  322. package/es/oak-app-domain/Version/Schema.js +1 -0
  323. package/es/oak-app-domain/Version/Storage.d.ts +3 -0
  324. package/es/oak-app-domain/Version/Storage.js +54 -0
  325. package/es/oak-app-domain/Version/Style.d.ts +3 -0
  326. package/es/oak-app-domain/Version/Style.js +6 -0
  327. package/es/oak-app-domain/Version/_baseSchema.d.ts +57 -0
  328. package/es/oak-app-domain/Version/_baseSchema.js +1 -0
  329. package/es/oak-app-domain/Version/locales/en_US.json +21 -0
  330. package/es/oak-app-domain/Version/locales/zh_CN.json +21 -0
  331. package/es/registry.backend.d.ts +1 -0
  332. package/es/registry.backend.js +1 -0
  333. package/es/registry.frontend.d.ts +3 -0
  334. package/es/registry.frontend.js +2 -0
  335. package/es/triggers/account.js +2 -2
  336. package/es/triggers/accountOper.js +42 -1
  337. package/es/triggers/deposit.js +87 -1
  338. package/es/triggers/index.js +4 -0
  339. package/es/triggers/invoice.d.ts +7 -0
  340. package/es/triggers/invoice.js +642 -0
  341. package/es/triggers/pay.js +23 -4
  342. package/es/triggers/refund.js +48 -0
  343. package/es/triggers/system.js +20 -0
  344. package/es/triggers/withdraw.js +170 -1
  345. package/es/types/InvoiceClazz.d.ts +44 -0
  346. package/es/types/InvoiceClazz.js +1 -0
  347. package/es/utils/application.js +25 -0
  348. package/es/utils/exception.d.ts +3 -0
  349. package/es/utils/exception.js +13 -0
  350. package/es/utils/invoiceAmount.d.ts +9 -0
  351. package/es/utils/invoiceAmount.js +36 -0
  352. package/es/utils/invoiceClazz/NuonuoInvoiceClazz.d.ts +80 -0
  353. package/es/utils/invoiceClazz/NuonuoInvoiceClazz.js +676 -0
  354. package/es/utils/invoiceClazz/index.d.ts +16 -0
  355. package/es/utils/invoiceClazz/index.js +134 -0
  356. package/es/utils/payClazz/AliPay/AliPay.js +2 -2
  357. package/es/utils/payClazz/AliPay/config.d.ts +2 -0
  358. package/es/utils/payClazz/AliPay/config.js +10 -0
  359. package/es/watchers/index.js +3 -0
  360. package/es/watchers/invoice.d.ts +6 -0
  361. package/es/watchers/invoice.js +193 -0
  362. package/lib/aspects/AspectDict.d.ts +2 -0
  363. package/lib/aspects/index.js +2 -0
  364. package/lib/aspects/invoice.d.ts +7 -0
  365. package/lib/aspects/invoice.js +11 -0
  366. package/lib/checkers/accountOper.js +28 -0
  367. package/lib/checkers/index.js +4 -4
  368. package/lib/checkers/invoice.d.ts +5 -0
  369. package/lib/checkers/invoice.js +199 -0
  370. package/lib/checkers/pay.js +9 -3
  371. package/lib/checkers/redInvoice.d.ts +5 -0
  372. package/lib/checkers/redInvoice.js +174 -0
  373. package/lib/checkers/system.js +11 -0
  374. package/lib/configuration/attrUpdateMatrix.js +60 -0
  375. package/lib/configuration/relation.js +11 -1
  376. package/lib/context/BackendRuntimeContext.js +11 -1
  377. package/lib/context/FrontendRuntimeContext.d.ts +2 -2
  378. package/lib/context/FrontendRuntimeContext.js +5 -3
  379. package/lib/data/actionAuth.js +79 -1
  380. package/lib/data/path.js +70 -0
  381. package/lib/entities/AbstractInvoiceChannel.d.ts +10 -0
  382. package/lib/entities/AbstractInvoiceChannel.js +21 -0
  383. package/lib/entities/Account.d.ts +7 -1
  384. package/lib/entities/Account.js +24 -0
  385. package/lib/entities/AccountOper.d.ts +4 -1
  386. package/lib/entities/AccountOper.js +18 -0
  387. package/lib/entities/Deposit.d.ts +4 -1
  388. package/lib/entities/Deposit.js +4 -0
  389. package/lib/entities/Invoice.d.ts +44 -0
  390. package/lib/entities/Invoice.js +113 -0
  391. package/lib/entities/InvoicePay.d.ts +17 -0
  392. package/lib/entities/InvoicePay.js +22 -0
  393. package/lib/entities/NuonuoInvoice.d.ts +34 -0
  394. package/lib/entities/NuonuoInvoice.js +76 -0
  395. package/lib/entities/OfflineInvoice.d.ts +16 -0
  396. package/lib/entities/OfflineInvoice.js +38 -0
  397. package/lib/entities/Pay.js +1 -1
  398. package/lib/entities/RedInvoice.d.ts +35 -0
  399. package/lib/entities/RedInvoice.js +41 -0
  400. package/lib/entities/System.d.ts +6 -0
  401. package/lib/index.d.ts +1 -0
  402. package/lib/index.js +1 -0
  403. package/lib/locales/error/zh-CN.json +25 -1
  404. package/lib/oak-app-domain/AbstractInvoiceChannel/Schema.d.ts +19 -0
  405. package/lib/oak-app-domain/AbstractInvoiceChannel/Schema.js +4 -0
  406. package/lib/oak-app-domain/AbstractInvoiceChannel/Storage.d.ts +3 -0
  407. package/lib/oak-app-domain/AbstractInvoiceChannel/Storage.js +19 -0
  408. package/lib/oak-app-domain/AbstractInvoiceChannel/_baseSchema.d.ts +41 -0
  409. package/lib/oak-app-domain/AbstractInvoiceChannel/_baseSchema.js +2 -0
  410. package/lib/oak-app-domain/AbstractInvoiceChannel/locales/en_US.json +7 -0
  411. package/lib/oak-app-domain/AbstractInvoiceChannel/locales/zh_CN.json +7 -0
  412. package/lib/oak-app-domain/Account/Action.d.ts +1 -1
  413. package/lib/oak-app-domain/Account/Action.js +1 -1
  414. package/lib/oak-app-domain/Account/Storage.js +42 -0
  415. package/lib/oak-app-domain/Account/Style.js +5 -1
  416. package/lib/oak-app-domain/Account/_baseSchema.d.ts +24 -0
  417. package/lib/oak-app-domain/Account/locales/en_US.json +12 -2
  418. package/lib/oak-app-domain/Account/locales/zh_CN.json +12 -2
  419. package/lib/oak-app-domain/AccountOper/Storage.js +23 -2
  420. package/lib/oak-app-domain/AccountOper/Style.js +5 -1
  421. package/lib/oak-app-domain/AccountOper/_baseSchema.d.ts +15 -3
  422. package/lib/oak-app-domain/AccountOper/locales/en_US.json +8 -1
  423. package/lib/oak-app-domain/AccountOper/locales/zh_CN.json +8 -1
  424. package/lib/oak-app-domain/ActionDefDict.d.ts +7 -0
  425. package/lib/oak-app-domain/ActionDefDict.js +86 -80
  426. package/lib/oak-app-domain/Deposit/Storage.js +12 -0
  427. package/lib/oak-app-domain/Deposit/_baseSchema.d.ts +9 -1
  428. package/lib/oak-app-domain/Deposit/locales/en_US.json +2 -0
  429. package/lib/oak-app-domain/Deposit/locales/zh_CN.json +2 -0
  430. package/lib/oak-app-domain/EntityDict.d.ts +556 -1
  431. package/lib/oak-app-domain/ExtraFile/Storage.js +1 -1
  432. package/lib/oak-app-domain/ExtraFile/_baseSchema.d.ts +2 -2
  433. package/lib/oak-app-domain/Invoice/Action.d.ts +11 -0
  434. package/lib/oak-app-domain/Invoice/Action.js +22 -0
  435. package/lib/oak-app-domain/Invoice/Schema.d.ts +19 -0
  436. package/lib/oak-app-domain/Invoice/Schema.js +4 -0
  437. package/lib/oak-app-domain/Invoice/Storage.d.ts +3 -0
  438. package/lib/oak-app-domain/Invoice/Storage.js +166 -0
  439. package/lib/oak-app-domain/Invoice/Style.d.ts +3 -0
  440. package/lib/oak-app-domain/Invoice/Style.js +27 -0
  441. package/lib/oak-app-domain/Invoice/_baseSchema.d.ts +131 -0
  442. package/lib/oak-app-domain/Invoice/_baseSchema.js +2 -0
  443. package/lib/oak-app-domain/Invoice/locales/en_US.json +54 -0
  444. package/lib/oak-app-domain/Invoice/locales/zh_CN.json +54 -0
  445. package/lib/oak-app-domain/InvoicePay/Schema.d.ts +19 -0
  446. package/lib/oak-app-domain/InvoicePay/Schema.js +4 -0
  447. package/lib/oak-app-domain/InvoicePay/Storage.d.ts +3 -0
  448. package/lib/oak-app-domain/InvoicePay/Storage.js +58 -0
  449. package/lib/oak-app-domain/InvoicePay/_baseSchema.d.ts +64 -0
  450. package/lib/oak-app-domain/InvoicePay/_baseSchema.js +2 -0
  451. package/lib/oak-app-domain/InvoicePay/locales/en_US.json +13 -0
  452. package/lib/oak-app-domain/InvoicePay/locales/zh_CN.json +13 -0
  453. package/lib/oak-app-domain/Log/Storage.js +4 -0
  454. package/lib/oak-app-domain/Log/_baseSchema.d.ts +5 -0
  455. package/lib/oak-app-domain/Log/locales/en_US.json +1 -0
  456. package/lib/oak-app-domain/Log/locales/zh_CN.json +1 -0
  457. package/lib/oak-app-domain/NuonuoInvoice/Schema.d.ts +19 -0
  458. package/lib/oak-app-domain/NuonuoInvoice/Schema.js +4 -0
  459. package/lib/oak-app-domain/NuonuoInvoice/Storage.d.ts +3 -0
  460. package/lib/oak-app-domain/NuonuoInvoice/Storage.js +168 -0
  461. package/lib/oak-app-domain/NuonuoInvoice/_baseSchema.d.ts +137 -0
  462. package/lib/oak-app-domain/NuonuoInvoice/_baseSchema.js +2 -0
  463. package/lib/oak-app-domain/NuonuoInvoice/locales/en_US.json +31 -0
  464. package/lib/oak-app-domain/NuonuoInvoice/locales/zh_CN.json +31 -0
  465. package/lib/oak-app-domain/OauthProvider/Storage.js +6 -0
  466. package/lib/oak-app-domain/OauthProvider/_baseSchema.d.ts +4 -0
  467. package/lib/oak-app-domain/OauthProvider/locales/en_US.json +1 -0
  468. package/lib/oak-app-domain/OauthProvider/locales/zh_CN.json +1 -0
  469. package/lib/oak-app-domain/OfflineInvoice/Schema.d.ts +19 -0
  470. package/lib/oak-app-domain/OfflineInvoice/Schema.js +4 -0
  471. package/lib/oak-app-domain/OfflineInvoice/Storage.d.ts +3 -0
  472. package/lib/oak-app-domain/OfflineInvoice/Storage.js +60 -0
  473. package/lib/oak-app-domain/OfflineInvoice/_baseSchema.d.ts +61 -0
  474. package/lib/oak-app-domain/OfflineInvoice/_baseSchema.js +2 -0
  475. package/lib/oak-app-domain/OfflineInvoice/locales/en_US.json +12 -0
  476. package/lib/oak-app-domain/OfflineInvoice/locales/zh_CN.json +12 -0
  477. package/lib/oak-app-domain/Passport/_baseSchema.d.ts +1 -1
  478. package/lib/oak-app-domain/Pay/locales/zh_CN.json +1 -1
  479. package/lib/oak-app-domain/RedInvoice/Action.d.ts +11 -0
  480. package/lib/oak-app-domain/RedInvoice/Action.js +16 -0
  481. package/lib/oak-app-domain/RedInvoice/Schema.d.ts +19 -0
  482. package/lib/oak-app-domain/RedInvoice/Schema.js +4 -0
  483. package/lib/oak-app-domain/RedInvoice/Storage.d.ts +3 -0
  484. package/lib/oak-app-domain/RedInvoice/Storage.js +95 -0
  485. package/lib/oak-app-domain/RedInvoice/Style.d.ts +3 -0
  486. package/lib/oak-app-domain/RedInvoice/Style.js +18 -0
  487. package/lib/oak-app-domain/RedInvoice/_baseSchema.d.ts +100 -0
  488. package/lib/oak-app-domain/RedInvoice/_baseSchema.js +2 -0
  489. package/lib/oak-app-domain/RedInvoice/locales/en_US.json +37 -0
  490. package/lib/oak-app-domain/RedInvoice/locales/zh_CN.json +37 -0
  491. package/lib/oak-app-domain/Storage.js +218 -204
  492. package/lib/oak-app-domain/StyleDict.js +126 -120
  493. package/lib/oak-app-domain/System/_baseSchema.d.ts +6 -0
  494. package/lib/oak-app-domain/Version/Action.d.ts +6 -0
  495. package/lib/oak-app-domain/Version/Action.js +5 -0
  496. package/lib/oak-app-domain/Version/Schema.d.ts +19 -0
  497. package/lib/oak-app-domain/Version/Schema.js +4 -0
  498. package/lib/oak-app-domain/Version/Storage.d.ts +3 -0
  499. package/lib/oak-app-domain/Version/Storage.js +57 -0
  500. package/lib/oak-app-domain/Version/Style.d.ts +3 -0
  501. package/lib/oak-app-domain/Version/Style.js +9 -0
  502. package/lib/oak-app-domain/Version/_baseSchema.d.ts +57 -0
  503. package/lib/oak-app-domain/Version/_baseSchema.js +2 -0
  504. package/lib/oak-app-domain/Version/locales/en_US.json +21 -0
  505. package/lib/oak-app-domain/Version/locales/zh_CN.json +21 -0
  506. package/lib/oak-app-domain/WechatLogin/Storage.js +1 -1
  507. package/lib/oak-app-domain/WechatQrCode/Storage.js +1 -1
  508. package/lib/registry.backend.d.ts +1 -0
  509. package/lib/registry.backend.js +4 -1
  510. package/lib/triggers/account.js +2 -2
  511. package/lib/triggers/accountOper.js +41 -0
  512. package/lib/triggers/deposit.js +86 -0
  513. package/lib/triggers/index.js +4 -0
  514. package/lib/triggers/invoice.d.ts +7 -0
  515. package/lib/triggers/invoice.js +646 -0
  516. package/lib/triggers/pay.js +23 -4
  517. package/lib/triggers/refund.js +48 -0
  518. package/lib/triggers/system.js +20 -0
  519. package/lib/triggers/withdraw.js +169 -0
  520. package/lib/types/InvoiceClazz.d.ts +44 -0
  521. package/lib/types/InvoiceClazz.js +2 -0
  522. package/lib/utils/application.js +25 -0
  523. package/lib/utils/exception.d.ts +3 -0
  524. package/lib/utils/exception.js +16 -0
  525. package/lib/utils/invoiceAmount.d.ts +9 -0
  526. package/lib/utils/invoiceAmount.js +40 -0
  527. package/lib/utils/invoiceClazz/NuonuoInvoiceClazz.d.ts +80 -0
  528. package/lib/utils/invoiceClazz/NuonuoInvoiceClazz.js +680 -0
  529. package/lib/utils/invoiceClazz/index.d.ts +16 -0
  530. package/lib/utils/invoiceClazz/index.js +143 -0
  531. package/lib/utils/payClazz/AliPay/AliPay.js +2 -2
  532. package/lib/utils/payClazz/AliPay/config.d.ts +2 -0
  533. package/lib/utils/payClazz/AliPay/config.js +13 -0
  534. package/lib/watchers/index.js +3 -0
  535. package/lib/watchers/invoice.d.ts +6 -0
  536. package/lib/watchers/invoice.js +196 -0
  537. package/package.json +12 -8
  538. package/src/components/account/detail/index.ts +32 -0
  539. package/src/components/account/detail/invoice/apply/index.ts +391 -0
  540. package/src/components/account/detail/invoice/history/index.ts +107 -0
  541. package/src/components/apAccount/upsert/index.ts +2 -1
  542. package/src/components/invoice/manage/index.ts +110 -0
  543. package/src/components/invoice/manage/manualItem/index.ts +75 -0
  544. package/src/components/invoiceConfig/system/index.ts +44 -0
  545. package/src/components/nuonuoInvoice/config/index.ts +48 -0
  546. package/src/components/nuonuoInvoice/upsert/index.ts +53 -0
  547. package/src/components/offlineInvoice/config/index.ts +31 -0
  548. package/src/components/offlineInvoice/upsert/index.ts +34 -0
  549. package/src/components/pay/detail/index.ts +1 -4
  550. package/src/components/pay/list/index.ts +41 -1
  551. package/src/components/redInvoice/apply/index.ts +39 -0
  552. package/src/components/redInvoice/manage/index.ts +72 -0
  553. package/src/components/redInvoice/manage/manualItem/index.ts +62 -0
  554. package/src/components/sysAccount/orderList/index.ts +34 -0
  555. package/src/components/sysAccount/refundList/index.ts +44 -0
  556. package/src/entities/AbstractInvoiceChannel.ts +29 -0
  557. package/src/entities/Account.ts +32 -1
  558. package/src/entities/AccountOper.ts +23 -1
  559. package/src/entities/Deposit.ts +7 -0
  560. package/src/entities/Invoice.ts +177 -0
  561. package/src/entities/InvoicePay.ts +36 -0
  562. package/src/entities/NuonuoInvoice.ts +108 -0
  563. package/src/entities/OfflineInvoice.ts +52 -0
  564. package/src/entities/Pay.ts +1 -1
  565. package/src/entities/RedInvoice.ts +73 -0
  566. package/src/entities/System.ts +6 -0
  567. package/template/initializeFeatures.ts +4 -6
  568. package/template/src/pages/console/invoice/manage/index.config.ts +16 -0
  569. package/template/src/pages/console/invoice/manage/index.json +1 -0
  570. package/template/src/pages/console/invoice/manage/index.ts +11 -0
  571. package/template/src/pages/console/invoice/manage/locales/zh-CN.json +5 -0
  572. package/template/src/pages/console/invoice/manage/web.pc.tsx +47 -0
  573. package/template/src/pages/console/system/invoiceConfig/index.config.ts +16 -0
  574. package/template/src/pages/console/system/invoiceConfig/index.json +1 -0
  575. package/template/src/pages/console/system/invoiceConfig/index.ts +11 -0
  576. package/template/src/pages/console/system/invoiceConfig/locales/zh-CN.json +3 -0
  577. package/template/src/pages/console/system/invoiceConfig/web.pc.tsx +27 -0
  578. package/es/checkers/deposit.js +0 -82
  579. package/es/checkers/withdraw.js +0 -178
  580. package/lib/checkers/deposit.js +0 -84
  581. package/lib/checkers/withdraw.js +0 -180
  582. package/template/src/entities/System.ts +0 -32
@@ -1,6 +1,8 @@
1
1
  import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
2
2
  import { EntityDict } from '../oak-app-domain';
3
3
  export type AspectDict<ED extends EntityDict> = {
4
+ /** 返回当前后端已注册的开票渠道标识。 */
5
+ getInvoiceChannels: (params: {}, context: BackendRuntimeContext<ED>) => Promise<string[]>;
4
6
  getWithdrawCreateData: (params: {
5
7
  accountId: string;
6
8
  price: string;
@@ -1,6 +1,8 @@
1
1
  import { getWithdrawCreateData } from './withdraw';
2
2
  import { getExpressPrintInfo, getMpShipState, shipConfirmSuccess } from './ship';
3
+ import { getInvoiceChannels } from './invoice';
3
4
  const aspectDict = {
5
+ getInvoiceChannels,
4
6
  getMpShipState,
5
7
  getWithdrawCreateData,
6
8
  getExpressPrintInfo,
@@ -0,0 +1,7 @@
1
+ import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
2
+ import { EntityDict } from '../oak-app-domain';
3
+ /**
4
+ * Only expose channel identifiers. Invoice constructors and their credentials
5
+ * remain backend-only implementation details.
6
+ */
7
+ export declare function getInvoiceChannels(_params: {}, _context: BackendRuntimeContext<EntityDict>): Promise<string[]>;
@@ -0,0 +1,8 @@
1
+ import { getInvoiceChannels as getRegisteredInvoiceChannels } from '../utils/invoiceClazz';
2
+ /**
3
+ * Only expose channel identifiers. Invoice constructors and their credentials
4
+ * remain backend-only implementation details.
5
+ */
6
+ export async function getInvoiceChannels(_params, _context) {
7
+ return Array.from(new Set(['manual', 'offline', ...getRegisteredInvoiceChannels()]));
8
+ }
@@ -26,6 +26,13 @@ const checkers = [
26
26
  if (typeof availPlus !== 'string') {
27
27
  throw new OakInputIllegalException('accountOper', ['availPlus'], 'accountOper中的availPlus不是数字');
28
28
  }
29
+ // Applications can extend the polymorphic accountOper relation.
30
+ // Keep the closed-loop check aligned with the generated runtime schema.
31
+ const entityRef = context.getSchema().accountOper.attributes.entity.ref;
32
+ assert(typeof data.entity === 'string'
33
+ && (Array.isArray(entityRef)
34
+ ? entityRef.includes(data.entity)
35
+ : entityRef === data.entity));
29
36
  switch (type) {
30
37
  case 'consume': {
31
38
  if (decimalGt(totalPlus, '0') || decimalGt(availPlus, '0') || decimalGt(totalPlus, availPlus)) {
@@ -96,6 +103,20 @@ const checkers = [
96
103
  }
97
104
  break;
98
105
  }
106
+ case 'grant': {
107
+ if (decimalLte(totalPlus, '0') || decimalLte(availPlus, '0') || !decimalEq(totalPlus, availPlus)
108
+ || typeof refundablePlus !== 'string' || !decimalEq(refundablePlus, '0')) {
109
+ throw new OakInputIllegalException('accountOper', ['totalPlus', 'availPlus', 'refundablePlus'], 'accountOper为grant时,其totalPlus和availPlus必须为相等的正数,refundablePlus必须为0');
110
+ }
111
+ break;
112
+ }
113
+ case 'grantRevoke': {
114
+ if (decimalGte(totalPlus, '0') || decimalGte(availPlus, '0') || !decimalEq(totalPlus, availPlus)
115
+ || typeof refundablePlus !== 'string' || !decimalEq(refundablePlus, '0')) {
116
+ throw new OakInputIllegalException('accountOper', ['totalPlus', 'availPlus', 'refundablePlus'], 'accountOper为grantRevoke时,其totalPlus和availPlus必须为相等的负数,refundablePlus必须为0');
117
+ }
118
+ break;
119
+ }
99
120
  case 'cutoffRefundable': {
100
121
  if (!decimalEq(totalPlus, '0') || !decimalEq(availPlus, '0') || typeof refundablePlus !== 'string' || decimalGte(refundablePlus, '0')) {
101
122
  throw new OakInputIllegalException('accountOper', ['refundablePlus'], 'accountOper为cutoffRefundable时,其totalPlus/availPlus必须为0,且refundablePlus必须为负数');
@@ -128,6 +149,13 @@ const checkers = [
128
149
  }
129
150
  break;
130
151
  }
152
+ case 'invoiceReserve':
153
+ case 'invoiceRelease': {
154
+ if (!decimalEq(totalPlus, '0') || !decimalEq(availPlus, '0')) {
155
+ throw new OakInputIllegalException('accountOper', ['totalPlus', 'availPlus'], 'Invoice account operations must not change the account balance');
156
+ }
157
+ break;
158
+ }
131
159
  default: {
132
160
  // assert(false);
133
161
  break;
@@ -14,13 +14,13 @@ import refundCheckers from './refund';
14
14
  import withdrawTransferCheckers from './withdrawTransfer';
15
15
  import shipCheckers from './ship';
16
16
  import settlePlanCheckers from './settlePlan';
17
- import depositCheckers from './deposit';
18
- import withdrawCheckers from './withdraw';
19
17
  import systemCheckers from './system';
18
+ import invoiceCheckers from './invoice';
19
+ import redInvoiceCheckers from './redInvoice';
20
20
  const checkers = [
21
21
  ...systemCheckers,
22
- ...depositCheckers,
23
- ...withdrawCheckers,
22
+ ...invoiceCheckers,
23
+ ...redInvoiceCheckers,
24
24
  ...refundCheckers,
25
25
  ...withdrawAccounts,
26
26
  ...abstractCheckers,
@@ -0,0 +1,5 @@
1
+ import { Checker } from 'oak-domain/es/types/Auth';
2
+ import { EntityDict } from '../oak-app-domain';
3
+ import { RuntimeCxt } from '../types/RuntimeCxt';
4
+ declare const checkers: Checker<EntityDict, 'invoice', RuntimeCxt>[];
5
+ export default checkers;
@@ -0,0 +1,196 @@
1
+ import { OakInputIllegalException } from 'oak-domain/es/types';
2
+ import { pipeline } from 'oak-domain/es/utils/executor';
3
+ import { decimalAdd, decimalGt, decimalLt } from 'oak-domain/es/utils/decimal';
4
+ import assert from 'assert';
5
+ function getEvidenceCreate(data) {
6
+ const nested = getNestedExtraFile(data);
7
+ if (nested) {
8
+ const operations = Array.isArray(nested) ? nested : [nested];
9
+ for (const operation of operations) {
10
+ if (!operation || typeof operation !== 'object')
11
+ continue;
12
+ const op = operation;
13
+ if (op.action !== 'create' || !op.data || typeof op.data !== 'object')
14
+ continue;
15
+ const records = Array.isArray(op.data) ? op.data : [op.data];
16
+ for (const record of records) {
17
+ if (record && typeof record === 'object') {
18
+ return record;
19
+ }
20
+ }
21
+ }
22
+ }
23
+ return undefined;
24
+ }
25
+ function getNestedExtraFile(data) {
26
+ return data.extraFile$entity;
27
+ }
28
+ const checkers = [
29
+ {
30
+ entity: 'invoice', action: 'create', type: 'logicalData',
31
+ checker(operation, context) {
32
+ const data = operation.data;
33
+ if (data instanceof Array)
34
+ return;
35
+ const nested = data.invoicePay$invoice || [];
36
+ const details = nested.flatMap((op) => {
37
+ assert(op.action === 'create', 'invoice details must be create operations');
38
+ return op.data instanceof Array ? op.data : [op.data];
39
+ });
40
+ if (!details.length)
41
+ throw new OakInputIllegalException('invoice', ['invoicePay$invoice'], 'invoice.detailsRequired');
42
+ return pipeline(() => context.select('application', {
43
+ data: {
44
+ id: 1,
45
+ system: {
46
+ id: 1,
47
+ payConfig: 1,
48
+ },
49
+ },
50
+ filter: { id: data.applicationId },
51
+ }, { dontCollect: true }), (applications) => {
52
+ const application = applications[0];
53
+ return pipeline(() => context.select('pay', {
54
+ data: {
55
+ id: 1,
56
+ currency: 1,
57
+ entity: 1,
58
+ iState: 1,
59
+ applicationId: 1,
60
+ },
61
+ filter: { id: { $in: details.map((d) => d.payId) } },
62
+ }, { dontCollect: true }), (pays) => {
63
+ if (pays.length !== details.length) {
64
+ throw new OakInputIllegalException('invoice', ['invoicePay$invoice'], 'invoice.payNotFound');
65
+ }
66
+ for (const d of details) {
67
+ const pay = pays.find((p) => p.id === d.payId);
68
+ if (!pay) {
69
+ throw new OakInputIllegalException('invoice', ['invoicePay$invoice'], 'invoice.payNotFound');
70
+ }
71
+ if (pay.entity === 'account'
72
+ || pay.applicationId !== data.applicationId
73
+ || pay.currency !== data.currency
74
+ || pay.iState !== 'paid'
75
+ || !decimalGt(d.price, '0')) {
76
+ throw new OakInputIllegalException('invoice', ['invoicePay$invoice'], 'invoice.payNotInvoiceable');
77
+ }
78
+ }
79
+ const invoiceMinCent = application?.system?.payConfig?.invoiceMinCent;
80
+ const selectedAmount = details.reduce((total, detail) => decimalAdd(total, detail.price), '0');
81
+ if (invoiceMinCent !== undefined
82
+ && invoiceMinCent > 0
83
+ && decimalLt(selectedAmount, String(invoiceMinCent))) {
84
+ throw new OakInputIllegalException('invoice', ['invoicePay$invoice'], 'invoice.amountBelowMinimum');
85
+ }
86
+ });
87
+ });
88
+ },
89
+ },
90
+ {
91
+ entity: 'invoice', action: ['succeed', 'manualSucceed'], type: 'data',
92
+ checker(data) {
93
+ if (!data || data instanceof Array)
94
+ return;
95
+ if (!data.invoiceNo?.trim()) {
96
+ throw new OakInputIllegalException('invoice', ['invoiceNo'], 'invoice.evidenceRequired');
97
+ }
98
+ },
99
+ },
100
+ {
101
+ entity: 'invoice', action: 'manualSucceed', type: 'data',
102
+ checker(data) {
103
+ if (!data || data instanceof Array)
104
+ return;
105
+ if (!data.invoiceDate) {
106
+ throw new OakInputIllegalException('invoice', ['invoiceDate'], 'invoice.invoiceDateRequired');
107
+ }
108
+ },
109
+ },
110
+ {
111
+ entity: 'invoice', action: ['fail', 'manualFail'], type: 'data',
112
+ checker(data) {
113
+ if (!data || data instanceof Array)
114
+ return;
115
+ if (!data.reason?.trim())
116
+ throw new OakInputIllegalException('invoice', ['reason'], 'invoice.reasonRequired');
117
+ },
118
+ },
119
+ {
120
+ entity: 'invoice', action: ['manualSucceed', 'manualFail'], type: 'row',
121
+ filter: { channel: { $in: ['offline', 'manual'] } },
122
+ },
123
+ {
124
+ entity: 'invoice', action: 'manualSucceed', type: 'logicalData',
125
+ checker(operation, context) {
126
+ const { data, filter } = operation;
127
+ const mutableData = data;
128
+ const evidenceCreate = getEvidenceCreate(mutableData);
129
+ if (evidenceCreate) {
130
+ const extension = typeof evidenceCreate.extension === 'string'
131
+ ? evidenceCreate.extension.toLowerCase()
132
+ : '';
133
+ const fileType = typeof evidenceCreate.fileType === 'string'
134
+ ? evidenceCreate.fileType
135
+ : '';
136
+ const isSupported = fileType === 'application/pdf'
137
+ || fileType.startsWith('image/')
138
+ || extension === 'pdf'
139
+ || ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp'].includes(extension);
140
+ if (evidenceCreate.entity !== 'invoice'
141
+ || evidenceCreate.entityId !== filter?.id
142
+ || !isSupported
143
+ || (typeof evidenceCreate.size === 'number' && evidenceCreate.size > 20 * 1024 * 1024)) {
144
+ throw new OakInputIllegalException('invoice', ['files'], 'invoice.invalidEvidence');
145
+ }
146
+ return;
147
+ }
148
+ const externalMeta = mutableData.externalMeta;
149
+ const externalFileUrl = externalMeta && (externalMeta.fileUrl
150
+ || externalMeta.pdfUrl
151
+ || (externalMeta.result && typeof externalMeta.result === 'object'
152
+ ? externalMeta.result.pdfUrl
153
+ : undefined));
154
+ if (typeof externalFileUrl === 'string')
155
+ return;
156
+ // 本地开发时允许先确认开票信息,附件可以稍后补传;生产环境仍必须提供凭证。
157
+ if (process.env.NODE_ENV === 'development')
158
+ return;
159
+ return pipeline(() => context.select('extraFile', {
160
+ data: {
161
+ id: 1,
162
+ entity: 1,
163
+ entityId: 1,
164
+ fileType: 1,
165
+ extension: 1,
166
+ size: 1,
167
+ },
168
+ filter: { entity: 'invoice', entityId: filter?.id },
169
+ }, { dontCollect: true }), (files) => {
170
+ const file = files.find((candidate) => candidate.entity === 'invoice' && candidate.entityId === filter?.id);
171
+ const extension = file?.extension?.toLowerCase();
172
+ const isSupported = file?.fileType === 'application/pdf'
173
+ || file?.fileType?.startsWith('image/')
174
+ || extension === 'pdf'
175
+ || ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp'].includes(extension || '');
176
+ if (!file
177
+ || file.entity !== 'invoice'
178
+ || !isSupported
179
+ || (file.size || 0) > 20 * 1024 * 1024) {
180
+ throw new OakInputIllegalException('invoice', ['files'], 'invoice.invalidEvidence');
181
+ }
182
+ return context.select('invoice', {
183
+ data: { id: 1 },
184
+ filter: {
185
+ $and: [filter, { id: file.entityId }],
186
+ },
187
+ }, { dontCollect: true });
188
+ }, (invoices) => {
189
+ if (invoices.length !== 1) {
190
+ throw new OakInputIllegalException('invoice', ['files'], 'invoice.invalidEvidence');
191
+ }
192
+ });
193
+ },
194
+ },
195
+ ];
196
+ export default checkers;
@@ -48,12 +48,18 @@ const checkers = [
48
48
  const dataList = operationData instanceof Array
49
49
  ? operationData
50
50
  : [operationData];
51
- const defaultCurrency = normalizePayCurrency(context.getApplication()?.system?.payConfig?.defaultCurrency, 'CNY');
51
+ const defaultCurrency = dataList.some((data) => !data.currency)
52
+ ? normalizePayCurrency(context.getApplication()?.system?.payConfig?.defaultCurrency, 'CNY')
53
+ : 'CNY';
52
54
  dataList.forEach((data) => {
53
55
  data.refunded = toDecimalString('0');
54
56
  data.paid = toDecimalString('0');
55
- data.applicationId = context.getApplicationId();
56
- data.creatorId = context.getCurrentUserId();
57
+ if (!data.applicationId) {
58
+ data.applicationId = context.getApplicationId();
59
+ }
60
+ if (!data.creatorId) {
61
+ data.creatorId = context.getCurrentUserId();
62
+ }
57
63
  data.refundable = false;
58
64
  data.meta = data.meta || {};
59
65
  checkPayPrice(data);
@@ -0,0 +1,5 @@
1
+ import { Checker } from 'oak-domain/es/types/Auth';
2
+ import { EntityDict } from '../oak-app-domain';
3
+ import { RuntimeCxt } from '../types/RuntimeCxt';
4
+ declare const checkers: Checker<EntityDict, 'redInvoice', RuntimeCxt>[];
5
+ export default checkers;
@@ -0,0 +1,172 @@
1
+ import { OakInputIllegalException } from 'oak-domain/es/types';
2
+ import { pipeline } from 'oak-domain/es/utils/executor';
3
+ import { decimalAdd, decimalGt, decimalLt, decimalSub } from 'oak-domain/es/utils/decimal';
4
+ function getEvidenceCreate(data) {
5
+ const nested = getNestedExtraFile(data);
6
+ if (nested) {
7
+ const operations = Array.isArray(nested) ? nested : [nested];
8
+ for (const operation of operations) {
9
+ if (!operation || typeof operation !== 'object')
10
+ continue;
11
+ const op = operation;
12
+ if (op.action !== 'create' || !op.data || typeof op.data !== 'object')
13
+ continue;
14
+ const records = Array.isArray(op.data) ? op.data : [op.data];
15
+ for (const record of records) {
16
+ if (record && typeof record === 'object') {
17
+ return record;
18
+ }
19
+ }
20
+ }
21
+ }
22
+ return undefined;
23
+ }
24
+ function getNestedExtraFile(data) {
25
+ return data.extraFile$entity;
26
+ }
27
+ const checkers = [
28
+ {
29
+ entity: 'redInvoice',
30
+ action: 'create',
31
+ type: 'logicalData',
32
+ checker(operation, context) {
33
+ const data = operation.data;
34
+ if (data instanceof Array)
35
+ return;
36
+ if (!data.invoiceId || !decimalGt(data.price, '0')) {
37
+ throw new OakInputIllegalException('redInvoice', ['invoiceId', 'price'], 'redInvoice.invalid');
38
+ }
39
+ return pipeline(() => context.select('invoice', {
40
+ data: {
41
+ id: 1,
42
+ price: 1,
43
+ iState: 1,
44
+ redInvoice$invoice: {
45
+ $entity: 'redInvoice',
46
+ data: { id: 1, price: 1, iState: 1 },
47
+ },
48
+ },
49
+ filter: { id: data.invoiceId },
50
+ }, { dontCollect: true }), (invoices) => {
51
+ const invoice = invoices[0];
52
+ if (!invoice || !['successful', 'partiallyRedSuccessful'].includes(invoice.iState || '')) {
53
+ throw new OakInputIllegalException('redInvoice', ['invoiceId'], 'redInvoice.invoiceInvalid');
54
+ }
55
+ let successful = '0';
56
+ for (const red of invoice.redInvoice$invoice || []) {
57
+ if (red.iState === 'applying') {
58
+ throw new OakInputIllegalException('redInvoice', ['invoiceId'], 'redInvoice.applyingExists');
59
+ }
60
+ if (red.iState === 'successful') {
61
+ successful = decimalAdd(successful, red.price);
62
+ }
63
+ }
64
+ if (decimalLt(decimalSub(invoice.price, successful), data.price)) {
65
+ throw new OakInputIllegalException('redInvoice', ['price'], 'redInvoice.amountExceeded');
66
+ }
67
+ });
68
+ },
69
+ },
70
+ {
71
+ entity: 'redInvoice', action: ['succeed', 'manualSucceed'], type: 'data',
72
+ checker(data) {
73
+ if (!data || data instanceof Array)
74
+ return;
75
+ if (!data.redInvoiceNo?.trim()) {
76
+ throw new OakInputIllegalException('redInvoice', ['redInvoiceNo'], 'redInvoice.evidenceRequired');
77
+ }
78
+ },
79
+ },
80
+ {
81
+ entity: 'redInvoice', action: 'manualSucceed', type: 'data',
82
+ checker(data) {
83
+ if (!data || data instanceof Array)
84
+ return;
85
+ if (!data.successAt) {
86
+ throw new OakInputIllegalException('redInvoice', ['successAt'], 'redInvoice.successAtRequired');
87
+ }
88
+ },
89
+ },
90
+ {
91
+ entity: 'redInvoice', action: ['manualSucceed', 'manualFail'], type: 'row',
92
+ filter: { invoice: { channel: { $in: ['offline', 'manual'] } } },
93
+ },
94
+ {
95
+ entity: 'redInvoice', action: ['fail', 'manualFail'], type: 'data',
96
+ checker(data) {
97
+ if (!data || data instanceof Array)
98
+ return;
99
+ if (!data.failureReason?.trim()) {
100
+ throw new OakInputIllegalException('redInvoice', ['failureReason'], 'redInvoice.reasonRequired');
101
+ }
102
+ },
103
+ },
104
+ {
105
+ entity: 'redInvoice', action: 'manualSucceed', type: 'logicalData',
106
+ checker(operation, context) {
107
+ const { data, filter } = operation;
108
+ const mutableData = data;
109
+ const evidenceCreate = getEvidenceCreate(mutableData);
110
+ if (evidenceCreate) {
111
+ const extension = typeof evidenceCreate.extension === 'string'
112
+ ? evidenceCreate.extension.toLowerCase()
113
+ : '';
114
+ const fileType = typeof evidenceCreate.fileType === 'string'
115
+ ? evidenceCreate.fileType
116
+ : '';
117
+ const isSupported = fileType === 'application/pdf'
118
+ || fileType.startsWith('image/')
119
+ || extension === 'pdf'
120
+ || ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp'].includes(extension);
121
+ if (evidenceCreate.entity !== 'redInvoice'
122
+ || evidenceCreate.entityId !== filter?.id
123
+ || !isSupported
124
+ || (typeof evidenceCreate.size === 'number' && evidenceCreate.size > 20 * 1024 * 1024)) {
125
+ throw new OakInputIllegalException('redInvoice', ['files'], 'redInvoice.invalidEvidence');
126
+ }
127
+ return;
128
+ }
129
+ const externalMeta = mutableData.externalMeta;
130
+ if (typeof externalMeta?.fileUrl === 'string')
131
+ return;
132
+ // 本地开发时允许先确认冲红信息,附件可以稍后补传;生产环境仍必须提供凭证。
133
+ if (process.env.NODE_ENV === 'development')
134
+ return;
135
+ return pipeline(() => context.select('extraFile', {
136
+ data: {
137
+ id: 1,
138
+ entity: 1,
139
+ entityId: 1,
140
+ fileType: 1,
141
+ extension: 1,
142
+ size: 1,
143
+ },
144
+ filter: { entity: 'redInvoice', entityId: filter?.id },
145
+ }, { dontCollect: true }), (files) => {
146
+ const file = files.find((candidate) => candidate.entity === 'redInvoice' && candidate.entityId === filter?.id);
147
+ const extension = file?.extension?.toLowerCase();
148
+ const isSupported = file?.fileType === 'application/pdf'
149
+ || file?.fileType?.startsWith('image/')
150
+ || extension === 'pdf'
151
+ || ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp'].includes(extension || '');
152
+ if (!file
153
+ || file.entity !== 'redInvoice'
154
+ || !isSupported
155
+ || (file.size || 0) > 20 * 1024 * 1024) {
156
+ throw new OakInputIllegalException('redInvoice', ['files'], 'redInvoice.invalidEvidence');
157
+ }
158
+ return context.select('redInvoice', {
159
+ data: { id: 1 },
160
+ filter: {
161
+ $and: [filter, { id: file.entityId }],
162
+ },
163
+ }, { dontCollect: true });
164
+ }, (redInvoices) => {
165
+ if (redInvoices.length !== 1) {
166
+ throw new OakInputIllegalException('redInvoice', ['files'], 'redInvoice.invalidEvidence');
167
+ }
168
+ });
169
+ },
170
+ },
171
+ ];
172
+ export default checkers;
@@ -22,6 +22,12 @@ function checkBounds(lowest, highest, prefix) {
22
22
  }
23
23
  }
24
24
  export function normalizeAndCheckPayConfig(payConfig) {
25
+ if (payConfig.invoiceChannel !== undefined) {
26
+ if (typeof payConfig.invoiceChannel !== 'string' || payConfig.invoiceChannel.length > 32) {
27
+ throwInvalidPayConfig('开票渠道必须是32位以内的字符串');
28
+ }
29
+ payConfig.invoiceChannel = payConfig.invoiceChannel.trim() || undefined;
30
+ }
25
31
  if (payConfig.defaultCurrency !== undefined) {
26
32
  const currency = normalizeCurrencyCode(payConfig.defaultCurrency);
27
33
  if (currency && !isCurrencyCode(currency)) {
@@ -34,6 +40,11 @@ export function normalizeAndCheckPayConfig(payConfig) {
34
40
  || payConfig.depositMinCent < 0)) {
35
41
  throwInvalidPayConfig('最低充值金额必须是非负整数');
36
42
  }
43
+ if (payConfig.invoiceMinCent !== undefined
44
+ && (!Number.isSafeInteger(payConfig.invoiceMinCent)
45
+ || payConfig.invoiceMinCent < 0)) {
46
+ throwInvalidPayConfig('最低开票金额必须是非负整数');
47
+ }
37
48
  const { depositLoss, withdrawLoss } = payConfig;
38
49
  if (depositLoss) {
39
50
  checkLimit(depositLoss.ratio, '充值手续费比例', { max: 20 });
@@ -14,6 +14,18 @@ declare const _default: (props: import("oak-frontend-base/es").ReactComponentPro
14
14
  onGoToHistory: () => void;
15
15
  showLoanAmount: boolean;
16
16
  showWithdrawAction: boolean;
17
+ enableInvoice: boolean;
18
+ invoiceBuyerName: string;
19
+ invoiceBuyerTaxNo: string;
20
+ invoiceBuyerTel: string;
21
+ invoiceBuyerPhone: string;
22
+ invoiceBuyerAddress: string;
23
+ invoiceBuyerAccount: string;
24
+ showBuyerOptionalFields: boolean;
25
+ showInvoiceOptions: boolean;
26
+ showDeliveryOptions: boolean;
27
+ showDetailOptions: boolean;
28
+ allowAmountEdit: boolean;
17
29
  depositActionText: string;
18
30
  extraActions: React.ReactNode | undefined;
19
31
  }>) => React.ReactElement;
@@ -81,6 +81,18 @@ export default OakComponent({
81
81
  onGoToHistory: () => undefined,
82
82
  showLoanAmount: true,
83
83
  showWithdrawAction: true,
84
+ enableInvoice: false,
85
+ invoiceBuyerName: '',
86
+ invoiceBuyerTaxNo: '',
87
+ invoiceBuyerTel: '',
88
+ invoiceBuyerPhone: '',
89
+ invoiceBuyerAddress: '',
90
+ invoiceBuyerAccount: '',
91
+ showBuyerOptionalFields: false,
92
+ showInvoiceOptions: false,
93
+ showDeliveryOptions: false,
94
+ showDetailOptions: false,
95
+ allowAmountEdit: false,
84
96
  depositActionText: '',
85
97
  extraActions: undefined,
86
98
  },
@@ -252,6 +264,24 @@ export default OakComponent({
252
264
  setDepositing(depositing) {
253
265
  this.setState({ depositing });
254
266
  },
267
+ setInvoiceApplyOpen(invoiceApplyOpen) {
268
+ this.setState({ invoiceApplyOpen });
269
+ },
270
+ setInvoiceHistoryOpen(invoiceHistoryOpen) {
271
+ this.setState({ invoiceHistoryOpen });
272
+ },
273
+ openInvoiceApply() {
274
+ this.setState({ invoiceApplyOpen: true, invoiceHistoryOpen: false });
275
+ },
276
+ closeInvoiceApply() {
277
+ this.setState({ invoiceApplyOpen: false });
278
+ },
279
+ openInvoiceHistory() {
280
+ this.setState({ invoiceHistoryOpen: true, invoiceApplyOpen: false });
281
+ },
282
+ closeInvoiceHistory() {
283
+ this.setState({ invoiceHistoryOpen: false });
284
+ },
255
285
  async onDepositClick() {
256
286
  const { preWithdraw } = this.props;
257
287
  if (preWithdraw) {
@@ -453,6 +483,8 @@ export default OakComponent({
453
483
  depositChannel: undefined,
454
484
  depositLoss: ['0', '', undefined],
455
485
  depositing: false,
486
+ invoiceApplyOpen: false,
487
+ invoiceHistoryOpen: false,
456
488
  setDepPriceMp(price) { this.setDepPrice(price); },
457
489
  setDepositChannelMp(depositChannel) { this.setDepositChannel(depositChannel); },
458
490
  focus: false,