@stamhoofd/models 2.39.0 → 2.40.0

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 (352) hide show
  1. package/dist/src/factories/AddressFactory.d.ts +3 -4
  2. package/dist/src/factories/AddressFactory.d.ts.map +1 -1
  3. package/dist/src/factories/AddressFactory.js +13 -13
  4. package/dist/src/factories/EmergencyContactFactory.d.ts +3 -4
  5. package/dist/src/factories/EmergencyContactFactory.d.ts.map +1 -1
  6. package/dist/src/factories/EmergencyContactFactory.js +27 -27
  7. package/dist/src/factories/EmergencyContactFactory.js.map +1 -1
  8. package/dist/src/factories/GroupFactory.d.ts +4 -4
  9. package/dist/src/factories/GroupFactory.d.ts.map +1 -1
  10. package/dist/src/factories/GroupFactory.js +8 -8
  11. package/dist/src/factories/GroupFactory.js.map +1 -1
  12. package/dist/src/factories/MemberFactory.d.ts +4 -4
  13. package/dist/src/factories/MemberFactory.d.ts.map +1 -1
  14. package/dist/src/factories/MemberFactory.js +17 -17
  15. package/dist/src/factories/MemberFactory.js.map +1 -1
  16. package/dist/src/factories/OrganizationFactory.d.ts +4 -4
  17. package/dist/src/factories/OrganizationFactory.js +8 -8
  18. package/dist/src/factories/OrganizationFactory.js.map +1 -1
  19. package/dist/src/factories/ParentFactory.d.ts +1 -1
  20. package/dist/src/factories/ParentFactory.js +19 -19
  21. package/dist/src/factories/ParentFactory.js.map +1 -1
  22. package/dist/src/factories/RecordFactory.d.ts +2 -3
  23. package/dist/src/factories/RecordFactory.d.ts.map +1 -1
  24. package/dist/src/factories/RecordFactory.js +1 -1
  25. package/dist/src/factories/RecordFactory.js.map +1 -1
  26. package/dist/src/factories/RegisterCodeFactory.d.ts +2 -2
  27. package/dist/src/factories/RegisterCodeFactory.d.ts.map +1 -1
  28. package/dist/src/factories/RegisterCodeFactory.js +2 -2
  29. package/dist/src/factories/RegistrationFactory.d.ts +3 -3
  30. package/dist/src/factories/RegistrationFactory.d.ts.map +1 -1
  31. package/dist/src/factories/RegistrationFactory.js.map +1 -1
  32. package/dist/src/factories/RegistrationPeriodFactory.d.ts +2 -2
  33. package/dist/src/factories/RegistrationPeriodFactory.js.map +1 -1
  34. package/dist/src/factories/UserFactory.d.ts +3 -3
  35. package/dist/src/factories/UserFactory.d.ts.map +1 -1
  36. package/dist/src/factories/UserFactory.js +3 -3
  37. package/dist/src/factories/UserFactory.js.map +1 -1
  38. package/dist/src/factories/WebshopFactory.d.ts +4 -4
  39. package/dist/src/factories/WebshopFactory.d.ts.map +1 -1
  40. package/dist/src/factories/WebshopFactory.js +1 -1
  41. package/dist/src/factories/WebshopFactory.js.map +1 -1
  42. package/dist/src/helpers/DNSValidator.d.ts +1 -1
  43. package/dist/src/helpers/DNSValidator.d.ts.map +1 -1
  44. package/dist/src/helpers/DNSValidator.js +33 -33
  45. package/dist/src/helpers/DNSValidator.js.map +1 -1
  46. package/dist/src/helpers/EmailBuilder.d.ts +10 -10
  47. package/dist/src/helpers/EmailBuilder.d.ts.map +1 -1
  48. package/dist/src/helpers/EmailBuilder.js +34 -34
  49. package/dist/src/helpers/EmailBuilder.js.map +1 -1
  50. package/dist/src/helpers/GroupBuilder.d.ts.map +1 -1
  51. package/dist/src/helpers/GroupBuilder.js +57 -57
  52. package/dist/src/helpers/GroupBuilder.js.map +1 -1
  53. package/dist/src/helpers/Handlebars.d.ts.map +1 -1
  54. package/dist/src/helpers/Handlebars.js +29 -29
  55. package/dist/src/helpers/Handlebars.js.map +1 -1
  56. package/dist/src/helpers/MemberMerger.d.ts +1 -1
  57. package/dist/src/helpers/MemberMerger.d.ts.map +1 -1
  58. package/dist/src/helpers/MemberMerger.js +33 -33
  59. package/dist/src/helpers/MemberMerger.js.map +1 -1
  60. package/dist/src/helpers/MemberMerger.test.js +194 -194
  61. package/dist/src/helpers/MemberMerger.test.js.map +1 -1
  62. package/dist/src/helpers/RateLimiter.d.ts.map +1 -1
  63. package/dist/src/helpers/RateLimiter.js +2 -2
  64. package/dist/src/helpers/RateLimiter.js.map +1 -1
  65. package/dist/src/helpers/SetupStepsUpdater.d.ts +22 -0
  66. package/dist/src/helpers/SetupStepsUpdater.d.ts.map +1 -0
  67. package/dist/src/helpers/SetupStepsUpdater.js +255 -0
  68. package/dist/src/helpers/SetupStepsUpdater.js.map +1 -0
  69. package/dist/src/helpers/WebshopCounter.d.ts +1 -1
  70. package/dist/src/helpers/WebshopCounter.d.ts.map +1 -1
  71. package/dist/src/helpers/WebshopCounter.js +1 -1
  72. package/dist/src/helpers/WebshopCounter.js.map +1 -1
  73. package/dist/src/helpers/WebshopCounter.test.js +6 -6
  74. package/dist/src/helpers/WebshopCounter.test.js.map +1 -1
  75. package/dist/src/index.d.ts +20 -19
  76. package/dist/src/index.d.ts.map +1 -1
  77. package/dist/src/index.js +1 -0
  78. package/dist/src/index.js.map +1 -1
  79. package/dist/src/migrations/1605262045-import-postcodes.js +12 -12
  80. package/dist/src/migrations/1605262046-import-postcodes-nl.js +10 -10
  81. package/dist/src/models/BalanceItem.d.ts.map +1 -1
  82. package/dist/src/models/BalanceItem.js +37 -37
  83. package/dist/src/models/BalanceItem.js.map +1 -1
  84. package/dist/src/models/BalanceItemPayment.d.ts.map +1 -1
  85. package/dist/src/models/BalanceItemPayment.js +13 -13
  86. package/dist/src/models/BalanceItemPayment.js.map +1 -1
  87. package/dist/src/models/BuckarooPayment.d.ts +1 -1
  88. package/dist/src/models/BuckarooPayment.d.ts.map +1 -1
  89. package/dist/src/models/BuckarooPayment.js +5 -5
  90. package/dist/src/models/BuckarooPayment.js.map +1 -1
  91. package/dist/src/models/CachedOutstandingBalance.d.ts.map +1 -1
  92. package/dist/src/models/CachedOutstandingBalance.js +37 -37
  93. package/dist/src/models/CachedOutstandingBalance.js.map +1 -1
  94. package/dist/src/models/Document.d.ts +4 -4
  95. package/dist/src/models/Document.d.ts.map +1 -1
  96. package/dist/src/models/Document.js +27 -27
  97. package/dist/src/models/Document.js.map +1 -1
  98. package/dist/src/models/DocumentTemplate.d.ts +4 -4
  99. package/dist/src/models/DocumentTemplate.d.ts.map +1 -1
  100. package/dist/src/models/DocumentTemplate.js +72 -72
  101. package/dist/src/models/DocumentTemplate.js.map +1 -1
  102. package/dist/src/models/Email.d.ts.map +1 -1
  103. package/dist/src/models/Email.js +63 -64
  104. package/dist/src/models/Email.js.map +1 -1
  105. package/dist/src/models/EmailRecipient.d.ts.map +1 -1
  106. package/dist/src/models/EmailRecipient.js +20 -20
  107. package/dist/src/models/EmailRecipient.js.map +1 -1
  108. package/dist/src/models/EmailTemplate.d.ts +3 -3
  109. package/dist/src/models/EmailTemplate.d.ts.map +1 -1
  110. package/dist/src/models/EmailTemplate.js +16 -16
  111. package/dist/src/models/EmailTemplate.js.map +1 -1
  112. package/dist/src/models/EmailVerificationCode.d.ts +2 -2
  113. package/dist/src/models/EmailVerificationCode.d.ts.map +1 -1
  114. package/dist/src/models/EmailVerificationCode.js +57 -55
  115. package/dist/src/models/EmailVerificationCode.js.map +1 -1
  116. package/dist/src/models/Event.d.ts +2 -2
  117. package/dist/src/models/Event.d.ts.map +1 -1
  118. package/dist/src/models/Event.js +15 -15
  119. package/dist/src/models/Event.js.map +1 -1
  120. package/dist/src/models/Group.d.ts +3 -1
  121. package/dist/src/models/Group.d.ts.map +1 -1
  122. package/dist/src/models/Group.js +46 -35
  123. package/dist/src/models/Group.js.map +1 -1
  124. package/dist/src/models/Image.d.ts +1 -1
  125. package/dist/src/models/Image.d.ts.map +1 -1
  126. package/dist/src/models/Image.js +26 -26
  127. package/dist/src/models/Image.js.map +1 -1
  128. package/dist/src/models/Member.d.ts +8 -8
  129. package/dist/src/models/Member.d.ts.map +1 -1
  130. package/dist/src/models/Member.js +60 -60
  131. package/dist/src/models/Member.js.map +1 -1
  132. package/dist/src/models/MemberPlatformMembership.d.ts +3 -3
  133. package/dist/src/models/MemberPlatformMembership.d.ts.map +1 -1
  134. package/dist/src/models/MemberPlatformMembership.js +26 -26
  135. package/dist/src/models/MemberPlatformMembership.js.map +1 -1
  136. package/dist/src/models/MemberResponsibilityRecord.d.ts.map +1 -1
  137. package/dist/src/models/MemberResponsibilityRecord.js +13 -13
  138. package/dist/src/models/MemberResponsibilityRecord.js.map +1 -1
  139. package/dist/src/models/MergedMember.d.ts +3 -3
  140. package/dist/src/models/MergedMember.d.ts.map +1 -1
  141. package/dist/src/models/MergedMember.js +19 -19
  142. package/dist/src/models/MergedMember.js.map +1 -1
  143. package/dist/src/models/MolliePayment.d.ts +1 -1
  144. package/dist/src/models/MolliePayment.d.ts.map +1 -1
  145. package/dist/src/models/MolliePayment.js +5 -5
  146. package/dist/src/models/MolliePayment.js.map +1 -1
  147. package/dist/src/models/MollieToken.d.ts.map +1 -1
  148. package/dist/src/models/MollieToken.js +60 -60
  149. package/dist/src/models/MollieToken.js.map +1 -1
  150. package/dist/src/models/OneTimeToken.d.ts +2 -2
  151. package/dist/src/models/OneTimeToken.d.ts.map +1 -1
  152. package/dist/src/models/OneTimeToken.js +13 -13
  153. package/dist/src/models/OneTimeToken.js.map +1 -1
  154. package/dist/src/models/Order.d.ts +1 -1
  155. package/dist/src/models/Order.d.ts.map +1 -1
  156. package/dist/src/models/Order.js +70 -70
  157. package/dist/src/models/Order.js.map +1 -1
  158. package/dist/src/models/Organization.d.ts +5 -5
  159. package/dist/src/models/Organization.d.ts.map +1 -1
  160. package/dist/src/models/Organization.js +127 -127
  161. package/dist/src/models/Organization.js.map +1 -1
  162. package/dist/src/models/OrganizationRegistrationPeriod.d.ts.map +1 -1
  163. package/dist/src/models/OrganizationRegistrationPeriod.js +15 -15
  164. package/dist/src/models/OrganizationRegistrationPeriod.js.map +1 -1
  165. package/dist/src/models/PasswordToken.d.ts +3 -3
  166. package/dist/src/models/PasswordToken.d.ts.map +1 -1
  167. package/dist/src/models/PasswordToken.js +17 -17
  168. package/dist/src/models/PasswordToken.js.map +1 -1
  169. package/dist/src/models/PayconiqPayment.d.ts +1 -1
  170. package/dist/src/models/PayconiqPayment.d.ts.map +1 -1
  171. package/dist/src/models/PayconiqPayment.js +49 -49
  172. package/dist/src/models/PayconiqPayment.js.map +1 -1
  173. package/dist/src/models/Payment.d.ts +3 -3
  174. package/dist/src/models/Payment.d.ts.map +1 -1
  175. package/dist/src/models/Payment.js +36 -36
  176. package/dist/src/models/Payment.js.map +1 -1
  177. package/dist/src/models/Platform.d.ts +2 -2
  178. package/dist/src/models/Platform.d.ts.map +1 -1
  179. package/dist/src/models/Platform.js +8 -8
  180. package/dist/src/models/Platform.js.map +1 -1
  181. package/dist/src/models/RegisterCode.d.ts +1 -1
  182. package/dist/src/models/RegisterCode.d.ts.map +1 -1
  183. package/dist/src/models/RegisterCode.js +11 -11
  184. package/dist/src/models/RegisterCode.js.map +1 -1
  185. package/dist/src/models/Registration.d.ts +1 -1
  186. package/dist/src/models/Registration.d.ts.map +1 -1
  187. package/dist/src/models/Registration.js +88 -88
  188. package/dist/src/models/Registration.js.map +1 -1
  189. package/dist/src/models/RegistrationPeriod.d.ts.map +1 -1
  190. package/dist/src/models/RegistrationPeriod.js +12 -12
  191. package/dist/src/models/RegistrationPeriod.js.map +1 -1
  192. package/dist/src/models/STCredit.d.ts +1 -1
  193. package/dist/src/models/STCredit.d.ts.map +1 -1
  194. package/dist/src/models/STCredit.js +12 -12
  195. package/dist/src/models/STCredit.js.map +1 -1
  196. package/dist/src/models/STInvoice.d.ts +1 -1
  197. package/dist/src/models/STInvoice.d.ts.map +1 -1
  198. package/dist/src/models/STInvoice.js +16 -16
  199. package/dist/src/models/STInvoice.js.map +1 -1
  200. package/dist/src/models/STPackage.d.ts +1 -1
  201. package/dist/src/models/STPackage.d.ts.map +1 -1
  202. package/dist/src/models/STPackage.js +39 -39
  203. package/dist/src/models/STPackage.js.map +1 -1
  204. package/dist/src/models/STPendingInvoice.d.ts +1 -1
  205. package/dist/src/models/STPendingInvoice.d.ts.map +1 -1
  206. package/dist/src/models/STPendingInvoice.js +11 -11
  207. package/dist/src/models/STPendingInvoice.js.map +1 -1
  208. package/dist/src/models/StripeAccount.d.ts.map +1 -1
  209. package/dist/src/models/StripeAccount.js +13 -13
  210. package/dist/src/models/StripeAccount.js.map +1 -1
  211. package/dist/src/models/StripeCheckoutSession.d.ts +1 -1
  212. package/dist/src/models/StripeCheckoutSession.d.ts.map +1 -1
  213. package/dist/src/models/StripeCheckoutSession.js +7 -7
  214. package/dist/src/models/StripeCheckoutSession.js.map +1 -1
  215. package/dist/src/models/StripePaymentIntent.d.ts +1 -1
  216. package/dist/src/models/StripePaymentIntent.d.ts.map +1 -1
  217. package/dist/src/models/StripePaymentIntent.js +7 -7
  218. package/dist/src/models/StripePaymentIntent.js.map +1 -1
  219. package/dist/src/models/Ticket.d.ts +2 -2
  220. package/dist/src/models/Ticket.d.ts.map +1 -1
  221. package/dist/src/models/Ticket.js +23 -23
  222. package/dist/src/models/Ticket.js.map +1 -1
  223. package/dist/src/models/Token.d.ts +3 -3
  224. package/dist/src/models/Token.d.ts.map +1 -1
  225. package/dist/src/models/Token.js +27 -27
  226. package/dist/src/models/Token.js.map +1 -1
  227. package/dist/src/models/Token.test.js +11 -11
  228. package/dist/src/models/UsedRegisterCode.d.ts +1 -1
  229. package/dist/src/models/UsedRegisterCode.d.ts.map +1 -1
  230. package/dist/src/models/UsedRegisterCode.js +10 -10
  231. package/dist/src/models/UsedRegisterCode.js.map +1 -1
  232. package/dist/src/models/User.d.ts +4 -4
  233. package/dist/src/models/User.d.ts.map +1 -1
  234. package/dist/src/models/User.js +53 -51
  235. package/dist/src/models/User.js.map +1 -1
  236. package/dist/src/models/UserPermissions.d.ts +3 -3
  237. package/dist/src/models/UserPermissions.d.ts.map +1 -1
  238. package/dist/src/models/UserPermissions.js +12 -12
  239. package/dist/src/models/UserPermissions.js.map +1 -1
  240. package/dist/src/models/Webshop.d.ts +1 -1
  241. package/dist/src/models/Webshop.d.ts.map +1 -1
  242. package/dist/src/models/Webshop.js +23 -23
  243. package/dist/src/models/Webshop.js.map +1 -1
  244. package/dist/src/models/WebshopDiscountCode.d.ts +1 -1
  245. package/dist/src/models/WebshopDiscountCode.d.ts.map +1 -1
  246. package/dist/src/models/WebshopDiscountCode.js +16 -16
  247. package/dist/src/models/WebshopDiscountCode.js.map +1 -1
  248. package/dist/src/models/addresses/City.d.ts.map +1 -1
  249. package/dist/src/models/addresses/City.js +9 -9
  250. package/dist/src/models/addresses/City.js.map +1 -1
  251. package/dist/src/models/addresses/PostalCode.d.ts.map +1 -1
  252. package/dist/src/models/addresses/PostalCode.js +11 -11
  253. package/dist/src/models/addresses/PostalCode.js.map +1 -1
  254. package/dist/src/models/addresses/PostalCode.test.js +22 -22
  255. package/dist/src/models/addresses/PostalCode.test.js.map +1 -1
  256. package/dist/src/models/addresses/Province.d.ts.map +1 -1
  257. package/dist/src/models/addresses/Province.js +5 -5
  258. package/dist/src/models/addresses/Province.js.map +1 -1
  259. package/dist/src/models/addresses/Street.d.ts.map +1 -1
  260. package/dist/src/models/addresses/Street.js +6 -6
  261. package/dist/src/models/addresses/Street.js.map +1 -1
  262. package/dist/src/models/index.d.ts +46 -46
  263. package/dist/src/models/index.d.ts.map +1 -1
  264. package/dist/src/models/index.js +0 -1
  265. package/dist/src/models/index.js.map +1 -1
  266. package/dist/src/structures/OrganizationServerMetaData.d.ts.map +1 -1
  267. package/dist/src/structures/OrganizationServerMetaData.js +4 -4
  268. package/dist/src/structures/OrganizationServerMetaData.js.map +1 -1
  269. package/dist/tests/jest.global.setup.d.ts.map +1 -1
  270. package/dist/tests/jest.global.setup.js +15 -13
  271. package/dist/tests/jest.global.setup.js.map +1 -1
  272. package/dist/tests/jest.setup.js +3 -1
  273. package/dist/tests/jest.setup.js.map +1 -1
  274. package/dist/tsconfig.tsbuildinfo +1 -0
  275. package/package.json +3 -3
  276. package/src/factories/AddressFactory.ts +17 -17
  277. package/src/factories/EmergencyContactFactory.ts +30 -31
  278. package/src/factories/GroupFactory.ts +30 -30
  279. package/src/factories/MemberFactory.ts +41 -38
  280. package/src/factories/OrganizationFactory.ts +15 -15
  281. package/src/factories/ParentFactory.ts +24 -24
  282. package/src/factories/RecordFactory.ts +5 -4
  283. package/src/factories/RegisterCodeFactory.ts +7 -7
  284. package/src/factories/RegistrationFactory.ts +16 -16
  285. package/src/factories/RegistrationPeriodFactory.ts +5 -5
  286. package/src/factories/UserFactory.ts +20 -19
  287. package/src/factories/WebshopFactory.ts +14 -14
  288. package/src/helpers/DNSValidator.ts +89 -84
  289. package/src/helpers/EmailBuilder.ts +141 -135
  290. package/src/helpers/GroupBuilder.ts +181 -181
  291. package/src/helpers/Handlebars.ts +57 -54
  292. package/src/helpers/MemberMerger.test.ts +702 -702
  293. package/src/helpers/MemberMerger.ts +83 -77
  294. package/src/helpers/RateLimiter.ts +25 -27
  295. package/src/helpers/SetupStepsUpdater.ts +402 -0
  296. package/src/helpers/WebshopCounter.test.ts +12 -12
  297. package/src/helpers/WebshopCounter.ts +20 -19
  298. package/src/index.ts +20 -19
  299. package/src/migrations/1605262045-import-postcodes.ts +59 -63
  300. package/src/migrations/1605262046-import-postcodes-nl.ts +41 -43
  301. package/src/models/BalanceItem.ts +173 -172
  302. package/src/models/BalanceItemPayment.ts +32 -33
  303. package/src/models/BuckarooPayment.ts +7 -7
  304. package/src/models/CachedOutstandingBalance.ts +98 -99
  305. package/src/models/Document.ts +90 -87
  306. package/src/models/DocumentTemplate.ts +207 -198
  307. package/src/models/Email.ts +198 -200
  308. package/src/models/EmailRecipient.ts +38 -39
  309. package/src/models/EmailTemplate.ts +36 -37
  310. package/src/models/EmailVerificationCode.ts +146 -142
  311. package/src/models/Event.ts +53 -53
  312. package/src/models/Group.ts +136 -123
  313. package/src/models/Image.ts +48 -48
  314. package/src/models/Member.ts +277 -275
  315. package/src/models/MemberPlatformMembership.ts +71 -71
  316. package/src/models/MemberResponsibilityRecord.ts +32 -32
  317. package/src/models/MergedMember.ts +77 -77
  318. package/src/models/MolliePayment.ts +7 -7
  319. package/src/models/MollieToken.ts +131 -126
  320. package/src/models/OneTimeToken.ts +40 -39
  321. package/src/models/Order.ts +379 -372
  322. package/src/models/Organization.ts +332 -325
  323. package/src/models/OrganizationRegistrationPeriod.ts +50 -50
  324. package/src/models/PasswordToken.ts +42 -42
  325. package/src/models/PayconiqPayment.ts +80 -76
  326. package/src/models/Payment.ts +86 -86
  327. package/src/models/Platform.ts +21 -22
  328. package/src/models/RegisterCode.ts +26 -26
  329. package/src/models/Registration.ts +167 -168
  330. package/src/models/RegistrationPeriod.ts +29 -29
  331. package/src/models/STCredit.ts +24 -25
  332. package/src/models/STInvoice.ts +34 -34
  333. package/src/models/STPackage.ts +143 -136
  334. package/src/models/STPendingInvoice.ts +26 -26
  335. package/src/models/StripeAccount.ts +27 -27
  336. package/src/models/StripeCheckoutSession.ts +10 -10
  337. package/src/models/StripePaymentIntent.ts +10 -10
  338. package/src/models/Ticket.ts +51 -52
  339. package/src/models/Token.test.ts +13 -13
  340. package/src/models/Token.ts +64 -63
  341. package/src/models/UsedRegisterCode.ts +20 -21
  342. package/src/models/User.ts +148 -144
  343. package/src/models/UserPermissions.ts +25 -28
  344. package/src/models/Webshop.ts +53 -53
  345. package/src/models/WebshopDiscountCode.ts +33 -33
  346. package/src/models/addresses/City.ts +12 -12
  347. package/src/models/addresses/PostalCode.test.ts +68 -69
  348. package/src/models/addresses/PostalCode.ts +57 -57
  349. package/src/models/addresses/Province.ts +8 -8
  350. package/src/models/addresses/Street.ts +10 -12
  351. package/src/models/index.ts +54 -55
  352. package/src/structures/OrganizationServerMetaData.ts +36 -36
@@ -1,91 +1,92 @@
1
- import { column, Model } from "@simonbackx/simple-database";
2
- import { SimpleError } from "@simonbackx/simple-errors";
1
+ import { column, Model } from '@simonbackx/simple-database';
2
+ import { SimpleError } from '@simonbackx/simple-errors';
3
3
  import { EmailTemplateType, Recipient, Replacement, STPackageMeta, STPackageStatus, STPackageType } from '@stamhoofd/structures';
4
- import { Formatter } from "@stamhoofd/utility";
5
- import { v4 as uuidv4 } from "uuid";
4
+ import { Formatter } from '@stamhoofd/utility';
5
+ import { v4 as uuidv4 } from 'uuid';
6
6
 
7
- import { sendEmailTemplate } from "../helpers/EmailBuilder";
8
- import { GroupBuilder } from "../helpers/GroupBuilder";
9
- import { Organization } from "./";
7
+ import { sendEmailTemplate } from '../helpers/EmailBuilder';
8
+ import { GroupBuilder } from '../helpers/GroupBuilder';
9
+ import { Organization } from './';
10
10
 
11
11
  export class STPackage extends Model {
12
- static table = "stamhoofd_packages";
12
+ static table = 'stamhoofd_packages';
13
13
 
14
14
  // Columns
15
15
  @column({
16
- primary: true, type: "string", beforeSave(value) {
16
+ primary: true, type: 'string', beforeSave(value) {
17
17
  return value ?? uuidv4();
18
- }
18
+ },
19
19
  })
20
20
  id!: string;
21
21
 
22
22
  /**
23
23
  * We keep packages of deleted organizations for statistics, so this doesn't have a foreign key
24
24
  */
25
- @column({ type: "string"})
26
- organizationId: string
25
+ @column({ type: 'string' })
26
+ organizationId: string;
27
27
 
28
- @column({ type: "json", decoder: STPackageMeta })
29
- meta: STPackageMeta
28
+ @column({ type: 'json', decoder: STPackageMeta })
29
+ meta: STPackageMeta;
30
30
 
31
31
  @column({
32
- type: "datetime", beforeSave(old?: any) {
32
+ type: 'datetime', beforeSave(old?: any) {
33
33
  if (old !== undefined) {
34
34
  return old;
35
35
  }
36
- const date = new Date()
37
- date.setMilliseconds(0)
38
- return date
39
- }
36
+ const date = new Date();
37
+ date.setMilliseconds(0);
38
+ return date;
39
+ },
40
40
  })
41
- createdAt: Date
41
+ createdAt: Date;
42
42
 
43
43
  @column({
44
- type: "datetime", beforeSave() {
45
- const date = new Date()
46
- date.setMilliseconds(0)
47
- return date
44
+ type: 'datetime', beforeSave() {
45
+ const date = new Date();
46
+ date.setMilliseconds(0);
47
+ return date;
48
48
  },
49
- skipUpdate: true
49
+ skipUpdate: true,
50
50
  })
51
- updatedAt: Date
51
+ updatedAt: Date;
52
52
 
53
- @column({ type: "datetime", nullable: true })
54
- validAt: Date | null = null
53
+ @column({ type: 'datetime', nullable: true })
54
+ validAt: Date | null = null;
55
55
 
56
- @column({ type: "datetime", nullable: true })
57
- validUntil: Date | null = null
56
+ @column({ type: 'datetime', nullable: true })
57
+ validUntil: Date | null = null;
58
58
 
59
- @column({ type: "datetime", nullable: true })
60
- removeAt: Date | null = null
59
+ @column({ type: 'datetime', nullable: true })
60
+ removeAt: Date | null = null;
61
61
 
62
- @column({ type: "integer" })
63
- emailCount = 0
62
+ @column({ type: 'integer' })
63
+ emailCount = 0;
64
64
 
65
- @column({ type: "datetime", nullable: true })
66
- lastEmailAt: Date | null = null
65
+ @column({ type: 'datetime', nullable: true })
66
+ lastEmailAt: Date | null = null;
67
67
 
68
68
  static async getForOrganization(organizationId: string) {
69
- const pack1 = await STPackage.where({ organizationId, validAt: { sign: "!=", value: null }, removeAt: { sign: ">", value: new Date() }})
70
- const pack2 = await STPackage.where({ organizationId, validAt: { sign: "!=", value: null }, removeAt: null })
69
+ const pack1 = await STPackage.where({ organizationId, validAt: { sign: '!=', value: null }, removeAt: { sign: '>', value: new Date() } });
70
+ const pack2 = await STPackage.where({ organizationId, validAt: { sign: '!=', value: null }, removeAt: null });
71
71
 
72
- return [...pack1, ...pack2]
72
+ return [...pack1, ...pack2];
73
73
  }
74
74
 
75
75
  static async getForOrganizationIncludingExpired(organizationId: string) {
76
- return await STPackage.where({ organizationId, validAt: { sign: "!=", value: null }}, {sort: [{column: 'validAt', direction: 'DESC'}]})
76
+ return await STPackage.where({ organizationId, validAt: { sign: '!=', value: null } }, { sort: [{ column: 'validAt', direction: 'DESC' }] });
77
77
  }
78
78
 
79
79
  static async getOrganizationPackagesMap(organizationId: string): Promise<Map<STPackageType, STPackageStatus>> {
80
- const packages = await this.getForOrganizationIncludingExpired(organizationId)
80
+ const packages = await this.getForOrganizationIncludingExpired(organizationId);
81
81
 
82
- const map = new Map<STPackageType, STPackageStatus>()
82
+ const map = new Map<STPackageType, STPackageStatus>();
83
83
  for (const pack of packages) {
84
- const exist = map.get(pack.meta.type)
84
+ const exist = map.get(pack.meta.type);
85
85
  if (exist) {
86
- exist.merge(pack.createStatus())
87
- } else {
88
- map.set(pack.meta.type, pack.createStatus())
86
+ exist.merge(pack.createStatus());
87
+ }
88
+ else {
89
+ map.set(pack.meta.type, pack.createStatus());
89
90
  }
90
91
  }
91
92
 
@@ -93,52 +94,53 @@ export class STPackage extends Model {
93
94
  }
94
95
 
95
96
  static async updateOrganizationPackages(organizationId: string) {
96
- console.log("Updating packages for organization "+organizationId)
97
- const map = await this.getOrganizationPackagesMap(organizationId)
97
+ console.log('Updating packages for organization ' + organizationId);
98
+ const map = await this.getOrganizationPackagesMap(organizationId);
98
99
 
99
- const organization = await Organization.getByID(organizationId)
100
+ const organization = await Organization.getByID(organizationId);
100
101
  if (organization) {
101
- const didUseMembers = organization.meta.packages.useMembers && organization.meta.packages.useActivities
102
- organization.meta.packages.packages = map
103
- await organization.save()
102
+ const didUseMembers = organization.meta.packages.useMembers && organization.meta.packages.useActivities;
103
+ organization.meta.packages.packages = map;
104
+ await organization.save();
104
105
 
105
106
  if (!didUseMembers && organization.meta.packages.useMembers && organization.meta.packages.useActivities) {
106
- console.log("Building groups and categories for "+organization.id)
107
- const builder = new GroupBuilder(organization)
108
- await builder.build()
107
+ console.log('Building groups and categories for ' + organization.id);
108
+ const builder = new GroupBuilder(organization);
109
+ await builder.build();
109
110
  }
110
- } else {
111
- console.error("Couldn't find organization when updating packages "+organizationId)
111
+ }
112
+ else {
113
+ console.error("Couldn't find organization when updating packages " + organizationId);
112
114
  }
113
115
  }
114
116
 
115
117
  async activate() {
116
118
  if (this.validAt !== null) {
117
- return
119
+ return;
118
120
  }
119
- this.validAt = new Date()
120
- await this.save()
121
+ this.validAt = new Date();
122
+ await this.save();
121
123
 
122
124
  if (this.meta.didRenewId) {
123
- const pack = await STPackage.getByID(this.meta.didRenewId)
125
+ const pack = await STPackage.getByID(this.meta.didRenewId);
124
126
  if (pack && pack.organizationId === this.organizationId) {
125
- await pack.didRenew(this)
127
+ await pack.didRenew(this);
126
128
  }
127
129
  }
128
130
  }
129
131
 
130
132
  async didRenew(renewed: STPackage) {
131
- this.removeAt = renewed.meta.startDate ?? renewed.validAt ?? new Date()
132
- this.meta.allowRenew = false
133
- await this.save()
133
+ this.removeAt = renewed.meta.startDate ?? renewed.validAt ?? new Date();
134
+ this.meta.allowRenew = false;
135
+ await this.save();
134
136
  }
135
137
 
136
138
  async deactivate() {
137
139
  if (this.removeAt !== null && this.removeAt <= new Date()) {
138
- return
140
+ return;
139
141
  }
140
- this.removeAt = new Date()
141
- await this.save()
142
+ this.removeAt = new Date();
143
+ await this.save();
142
144
  }
143
145
 
144
146
  /**
@@ -147,43 +149,43 @@ export class STPackage extends Model {
147
149
  createRenewed(): STPackage {
148
150
  if (!this.meta.allowRenew) {
149
151
  throw new SimpleError({
150
- code: "not_allowed",
151
- message: "Not allowed",
152
- human: "Je kan dit pakket niet verlengen"
153
- })
152
+ code: 'not_allowed',
153
+ message: 'Not allowed',
154
+ human: 'Je kan dit pakket niet verlengen',
155
+ });
154
156
  }
155
157
 
156
- const pack = new STPackage()
157
- pack.id = uuidv4()
158
- pack.meta = this.meta
158
+ const pack = new STPackage();
159
+ pack.id = uuidv4();
160
+ pack.meta = this.meta;
159
161
 
160
162
  // Not yet valid / active (ignored until valid)
161
- pack.validAt = null
162
- pack.organizationId = this.organizationId
163
-
164
- pack.meta.startDate = new Date(Math.max(new Date().getTime(), this.validUntil?.getTime() ?? 0))
165
- pack.meta.paidAmount = 0
166
- pack.meta.paidPrice = 0
167
- pack.meta.firstFailedPayment = null
168
- pack.meta.didRenewId = this.id
169
-
163
+ pack.validAt = null;
164
+ pack.organizationId = this.organizationId;
165
+
166
+ pack.meta.startDate = new Date(Math.max(new Date().getTime(), this.validUntil?.getTime() ?? 0));
167
+ pack.meta.paidAmount = 0;
168
+ pack.meta.paidPrice = 0;
169
+ pack.meta.firstFailedPayment = null;
170
+ pack.meta.didRenewId = this.id;
171
+
170
172
  // Duration for renewals is always a year ATM
171
- pack.validUntil = new Date(pack.meta.startDate)
172
- pack.validUntil.setFullYear(pack.validUntil.getFullYear() + 1)
173
+ pack.validUntil = new Date(pack.meta.startDate);
174
+ pack.validUntil.setFullYear(pack.validUntil.getFullYear() + 1);
173
175
 
174
176
  // Remove (= not renewable) if not renewed after 3 months
175
- pack.removeAt = new Date(pack.validUntil)
176
- pack.removeAt.setMonth(pack.removeAt.getMonth() + 3)
177
+ pack.removeAt = new Date(pack.validUntil);
178
+ pack.removeAt.setMonth(pack.removeAt.getMonth() + 3);
177
179
 
178
180
  // Custom renewals for single webshop:
179
181
  if (this.meta.type === STPackageType.SingleWebshop) {
180
182
  // Disable functions after two months
181
- pack.validUntil = new Date(pack.meta.startDate)
182
- pack.validUntil.setMonth(pack.validUntil.getMonth() + 2)
183
- pack.removeAt = new Date(pack.validUntil)
183
+ pack.validUntil = new Date(pack.meta.startDate);
184
+ pack.validUntil.setMonth(pack.validUntil.getMonth() + 2);
185
+ pack.removeAt = new Date(pack.validUntil);
184
186
  }
185
187
 
186
- return pack
188
+ return pack;
187
189
  }
188
190
 
189
191
  createStatus(): STPackageStatus {
@@ -193,19 +195,19 @@ export class STPackage extends Model {
193
195
  startDate: this.meta.startDate,
194
196
  validUntil: this.validUntil,
195
197
  removeAt: this.removeAt,
196
- firstFailedPayment: this.meta.firstFailedPayment
197
- })
198
+ firstFailedPayment: this.meta.firstFailedPayment,
199
+ });
198
200
  }
199
201
 
200
202
  async sendExpiryEmail() {
201
203
  if (this.validAt === null) {
202
204
  // never activated
203
- return
205
+ return;
204
206
  }
205
207
 
206
208
  if (this.removeAt && this.removeAt <= new Date()) {
207
- this.emailCount += 1
208
- await this.save()
209
+ this.emailCount += 1;
210
+ await this.save();
209
211
  return;
210
212
  }
211
213
 
@@ -215,91 +217,96 @@ export class STPackage extends Model {
215
217
  if (this.meta.type === STPackageType.Members) {
216
218
  type = EmailTemplateType.MembersExpirationReminder;
217
219
  allowDays = 32;
218
- } else if (this.meta.type === STPackageType.Webshops) {
220
+ }
221
+ else if (this.meta.type === STPackageType.Webshops) {
219
222
  type = EmailTemplateType.WebshopsExpirationReminder;
220
223
  allowDays = 32;
221
- } else if (this.meta.type === STPackageType.SingleWebshop) {
224
+ }
225
+ else if (this.meta.type === STPackageType.SingleWebshop) {
222
226
  type = EmailTemplateType.SingleWebshopExpirationReminder;
223
227
  allowDays = 7;
224
- } else if (this.meta.type === STPackageType.TrialMembers) {
228
+ }
229
+ else if (this.meta.type === STPackageType.TrialMembers) {
225
230
  type = EmailTemplateType.TrialMembersExpirationReminder;
226
231
  allowDays = 3;
227
- } else if (this.meta.type === STPackageType.TrialWebshops) {
232
+ }
233
+ else if (this.meta.type === STPackageType.TrialWebshops) {
228
234
  type = EmailTemplateType.TrialWebshopsExpirationReminder;
229
235
  allowDays = 3;
230
236
  }
231
237
 
232
- const allowFrom = new Date(Date.now() + 1000 * 60 * 60 * 24 * allowDays)
238
+ const allowFrom = new Date(Date.now() + 1000 * 60 * 60 * 24 * allowDays);
233
239
  if (type && (this.validUntil === null || this.validUntil < new Date() || this.validUntil > allowFrom)) {
234
- console.log('Skip sending expiration email for '+this.id)
240
+ console.log('Skip sending expiration email for ' + this.id);
235
241
  return;
236
242
  }
237
243
 
238
244
  if (type) {
239
- console.log('Sending expiration email for '+this.id, type)
240
- if (STAMHOOFD.environment === "production") {
245
+ console.log('Sending expiration email for ' + this.id, type);
246
+ if (STAMHOOFD.environment === 'production') {
241
247
  await this.sendEmailTemplate({
242
- type
243
- })
248
+ type,
249
+ });
244
250
  }
245
- this.lastEmailAt = new Date()
246
- } else {
247
- console.log('Skip sending expiration email for '+this.id+' (no type)')
251
+ this.lastEmailAt = new Date();
248
252
  }
249
-
250
- this.emailCount += 1
251
- await this.save()
253
+ else {
254
+ console.log('Skip sending expiration email for ' + this.id + ' (no type)');
255
+ }
256
+
257
+ this.emailCount += 1;
258
+ await this.save();
252
259
  }
253
260
 
254
261
  async sendEmailTemplate(data: {
255
- type: EmailTemplateType,
256
- replyTo?: string
262
+ type: EmailTemplateType;
263
+ replyTo?: string;
257
264
  }) {
258
- const organization = await Organization.getByID(this.organizationId)
265
+ const organization = await Organization.getByID(this.organizationId);
259
266
 
260
267
  if (!organization) {
261
- console.error("Could not find package organization "+this.id)
262
- return
268
+ console.error('Could not find package organization ' + this.id);
269
+ return;
263
270
  }
264
271
 
265
- const admins = await organization.getFullAdmins()
272
+ const admins = await organization.getFullAdmins();
266
273
 
267
- const recipients = admins.map(admin =>
274
+ const recipients = admins.map(admin =>
268
275
  Recipient.create({
269
276
  firstName: admin.firstName,
270
277
  lastName: admin.lastName,
271
278
  email: admin.email,
272
279
  replacements: [
273
280
  Replacement.create({
274
- token: "organizationName",
275
- value: organization.name
281
+ token: 'organizationName',
282
+ value: organization.name,
276
283
  }),
277
284
  Replacement.create({
278
- token: "packageName",
279
- value: this.meta.name ?? ""
285
+ token: 'packageName',
286
+ value: this.meta.name ?? '',
280
287
  }),
281
288
  Replacement.create({
282
- token: "validUntil",
283
- value: this.validUntil ? Formatter.dateTime(this.validUntil) : "nooit"
289
+ token: 'validUntil',
290
+ value: this.validUntil ? Formatter.dateTime(this.validUntil) : 'nooit',
284
291
  }),
285
292
  Replacement.create({
286
- token: "validUntilDate",
287
- value: this.validUntil ? Formatter.date(this.validUntil) : "nooit"
293
+ token: 'validUntilDate',
294
+ value: this.validUntil ? Formatter.date(this.validUntil) : 'nooit',
288
295
  }),
289
296
  Replacement.create({
290
- token: "renewUrl",
291
- value: "https://"+(STAMHOOFD.domains.dashboard ?? "stamhoofd.app")+"/"+organization.i18n.locale+"/settings/packages"
297
+ token: 'renewUrl',
298
+ value: 'https://' + (STAMHOOFD.domains.dashboard ?? 'stamhoofd.app') + '/' + organization.i18n.locale + '/settings/packages',
292
299
  }),
293
- ]
294
- })
300
+ ],
301
+ }),
295
302
  );
296
-
303
+
297
304
  // Create e-mail builder
298
305
  await sendEmailTemplate(null, {
299
306
  template: {
300
- type: data.type
307
+ type: data.type,
301
308
  },
302
- recipients
303
- })
309
+ recipients,
310
+ });
304
311
  }
305
312
  }
@@ -1,6 +1,6 @@
1
- import { column, ManyToOneRelation, Model } from "@simonbackx/simple-database";
1
+ import { column, ManyToOneRelation, Model } from '@simonbackx/simple-database';
2
2
  import { STInvoiceMeta } from '@stamhoofd/structures';
3
- import { v4 as uuidv4 } from "uuid";
3
+ import { v4 as uuidv4 } from 'uuid';
4
4
 
5
5
  import { Organization } from './';
6
6
 
@@ -8,56 +8,56 @@ import { Organization } from './';
8
8
  * Things that should get paid, but are not yet invoiced yet because:
9
9
  * - total price is too low
10
10
  * - auto renewals waiting for payment
11
- *
11
+ *
12
12
  * When they are about to get paid, we create a new invoice model
13
13
  * and if that model is marked as paid, it will remove the corresponding
14
14
  * items in this pending invoice.
15
- *
15
+ *
16
16
  * So please make sure you don't edit existing items, unless you change the id
17
17
  */
18
18
  export class STPendingInvoice extends Model {
19
- static table = "stamhoofd_pending_invoices";
19
+ static table = 'stamhoofd_pending_invoices';
20
20
 
21
21
  // Columns
22
22
  @column({
23
- primary: true, type: "string", beforeSave(value) {
23
+ primary: true, type: 'string', beforeSave(value) {
24
24
  return value ?? uuidv4();
25
- }
25
+ },
26
26
  })
27
27
  id!: string;
28
28
 
29
- @column({ foreignKey: STPendingInvoice.organization, type: "string", nullable: true })
29
+ @column({ foreignKey: STPendingInvoice.organization, type: 'string', nullable: true })
30
30
  organizationId: string | null;
31
-
32
- @column({ type: "json", decoder: STInvoiceMeta })
33
- meta: STInvoiceMeta
31
+
32
+ @column({ type: 'json', decoder: STInvoiceMeta })
33
+ meta: STInvoiceMeta;
34
34
 
35
35
  /// We can only have one invoice at a time for the pending invoice items
36
36
  /// So until this invoice is marked as 'failed', we don't create new invoices for this pending invoice
37
- @column({ type: "string", nullable: true })
38
- invoiceId: string | null = null
37
+ @column({ type: 'string', nullable: true })
38
+ invoiceId: string | null = null;
39
39
 
40
40
  @column({
41
- type: "datetime", beforeSave(old?: any) {
41
+ type: 'datetime', beforeSave(old?: any) {
42
42
  if (old !== undefined) {
43
43
  return old;
44
44
  }
45
- const date = new Date()
46
- date.setMilliseconds(0)
47
- return date
48
- }
45
+ const date = new Date();
46
+ date.setMilliseconds(0);
47
+ return date;
48
+ },
49
49
  })
50
- createdAt: Date
50
+ createdAt: Date;
51
51
 
52
52
  @column({
53
- type: "datetime", beforeSave() {
54
- const date = new Date()
55
- date.setMilliseconds(0)
56
- return date
53
+ type: 'datetime', beforeSave() {
54
+ const date = new Date();
55
+ date.setMilliseconds(0);
56
+ return date;
57
57
  },
58
- skipUpdate: true
58
+ skipUpdate: true,
59
59
  })
60
- updatedAt: Date
60
+ updatedAt: Date;
61
61
 
62
- static organization = new ManyToOneRelation(Organization, "organization");
62
+ static organization = new ManyToOneRelation(Organization, 'organization');
63
63
  }
@@ -1,60 +1,60 @@
1
1
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
2
2
  import { column, Model } from '@simonbackx/simple-database';
3
3
  import { Requirements, StripeBusinessProfile, StripeCompany, StripeMetaAccountSettings, StripeMetaData } from '@stamhoofd/structures';
4
- import { v4 as uuidv4 } from "uuid";
4
+ import { v4 as uuidv4 } from 'uuid';
5
5
 
6
6
  /**
7
7
  * Keeps track of how much a member/user owes or needs to be reimbursed.
8
8
  */
9
9
  export class StripeAccount extends Model {
10
- static table = "stripe_accounts"
10
+ static table = 'stripe_accounts';
11
11
 
12
12
  @column({
13
- primary: true, type: "string", beforeSave(value) {
13
+ primary: true, type: 'string', beforeSave(value) {
14
14
  return value ?? uuidv4();
15
- }
15
+ },
16
16
  })
17
17
  id!: string;
18
18
 
19
- @column({ type: "string" })
20
- organizationId: string
19
+ @column({ type: 'string' })
20
+ organizationId: string;
21
21
 
22
- @column({ type: "string" })
23
- accountId: string
22
+ @column({ type: 'string' })
23
+ accountId: string;
24
24
 
25
- @column({ type: "json", decoder: StripeMetaData })
26
- meta = StripeMetaData.create({})
25
+ @column({ type: 'json', decoder: StripeMetaData })
26
+ meta = StripeMetaData.create({});
27
27
 
28
- @column({ type: "string" })
29
- status: 'active' | 'deleted' = 'active'
28
+ @column({ type: 'string' })
29
+ status: 'active' | 'deleted' = 'active';
30
30
 
31
31
  @column({
32
- type: "datetime", beforeSave(old?: any) {
32
+ type: 'datetime', beforeSave(old?: any) {
33
33
  if (old !== undefined) {
34
34
  return old;
35
35
  }
36
- const date = new Date()
37
- date.setMilliseconds(0)
38
- return date
39
- }
36
+ const date = new Date();
37
+ date.setMilliseconds(0);
38
+ return date;
39
+ },
40
40
  })
41
- createdAt: Date
41
+ createdAt: Date;
42
42
 
43
43
  @column({
44
- type: "datetime", beforeSave() {
45
- const date = new Date()
46
- date.setMilliseconds(0)
47
- return date
44
+ type: 'datetime', beforeSave() {
45
+ const date = new Date();
46
+ date.setMilliseconds(0);
47
+ return date;
48
48
  },
49
- skipUpdate: true
49
+ skipUpdate: true,
50
50
  })
51
- updatedAt: Date
51
+ updatedAt: Date;
52
52
 
53
53
  setMetaFromStripeAccount(account: any) {
54
54
  this.meta = StripeMetaData.create({
55
55
  type: account.type ?? 'express',
56
56
  blob: account,
57
- business_profile: StripeBusinessProfile.create(!account.business_profile?.name ? {...account.business_profile, name: ''} : account.business_profile),
57
+ business_profile: StripeBusinessProfile.create(!account.business_profile?.name ? { ...account.business_profile, name: '' } : account.business_profile),
58
58
  business_type: account.business_type ?? this.meta.business_type ?? null,
59
59
  company: account.company ? StripeCompany.create(account.company) : (this.meta.company ?? null),
60
60
  charges_enabled: account.charges_enabled,
@@ -64,8 +64,8 @@ export class StripeAccount extends Model {
64
64
  requirements: Requirements.create(account.requirements),
65
65
  future_requirements: Requirements.create(account.future_requirements),
66
66
  settings: StripeMetaAccountSettings.create(account.settings),
67
- bank_account_last4: account.external_accounts?.data[0]?.last4 ?? this.meta.bank_account_last4 ?? "",
68
- bank_account_bank_name: account.external_accounts?.data[0]?.bank_name ?? this.meta.bank_account_bank_name ?? "",
67
+ bank_account_last4: account.external_accounts?.data[0]?.last4 ?? this.meta.bank_account_last4 ?? '',
68
+ bank_account_bank_name: account.external_accounts?.data[0]?.bank_name ?? this.meta.bank_account_bank_name ?? '',
69
69
  });
70
70
  }
71
71
  }