@powerhousedao/contributor-billing 0.1.27 → 0.1.30

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 (390) hide show
  1. package/README.md +165 -8
  2. package/dist/document-models/billing-statement/actions.d.ts +1 -0
  3. package/dist/document-models/billing-statement/actions.d.ts.map +1 -1
  4. package/dist/document-models/billing-statement/gen/document-model.d.ts.map +1 -1
  5. package/dist/document-models/billing-statement/gen/document-model.js +58 -47
  6. package/dist/document-models/billing-statement/gen/document-schema.d.ts +38 -38
  7. package/dist/document-models/billing-statement/gen/document-schema.d.ts.map +1 -1
  8. package/dist/document-models/billing-statement/gen/line-items/actions.d.ts +6 -2
  9. package/dist/document-models/billing-statement/gen/line-items/actions.d.ts.map +1 -1
  10. package/dist/document-models/billing-statement/gen/line-items/creators.d.ts +3 -2
  11. package/dist/document-models/billing-statement/gen/line-items/creators.d.ts.map +1 -1
  12. package/dist/document-models/billing-statement/gen/line-items/creators.js +2 -1
  13. package/dist/document-models/billing-statement/gen/line-items/operations.d.ts +2 -1
  14. package/dist/document-models/billing-statement/gen/line-items/operations.d.ts.map +1 -1
  15. package/dist/document-models/billing-statement/gen/ph-factories.js +1 -1
  16. package/dist/document-models/billing-statement/gen/reducer.d.ts.map +1 -1
  17. package/dist/document-models/billing-statement/gen/reducer.js +5 -1
  18. package/dist/document-models/billing-statement/gen/schema/types.d.ts +3 -0
  19. package/dist/document-models/billing-statement/gen/schema/types.d.ts.map +1 -1
  20. package/dist/document-models/billing-statement/gen/schema/zod.d.ts +2 -1
  21. package/dist/document-models/billing-statement/gen/schema/zod.d.ts.map +1 -1
  22. package/dist/document-models/billing-statement/gen/schema/zod.js +5 -0
  23. package/dist/document-models/billing-statement/gen/utils.js +2 -2
  24. package/dist/document-models/billing-statement/src/reducers/general.d.ts.map +1 -1
  25. package/dist/document-models/billing-statement/src/reducers/general.js +5 -4
  26. package/dist/document-models/billing-statement/src/reducers/line-items.d.ts.map +1 -1
  27. package/dist/document-models/billing-statement/src/reducers/line-items.js +7 -2
  28. package/dist/document-models/billing-statement/src/reducers/tags.d.ts.map +1 -1
  29. package/dist/document-models/billing-statement/src/reducers/tags.js +1 -1
  30. package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts +4 -0
  31. package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts.map +1 -1
  32. package/dist/document-models/billing-statement/src/tests/document-model.test.js +94 -7
  33. package/dist/document-models/billing-statement/src/tests/general.test.d.ts +2 -1
  34. package/dist/document-models/billing-statement/src/tests/general.test.d.ts.map +1 -1
  35. package/dist/document-models/billing-statement/src/tests/general.test.js +33 -88
  36. package/dist/document-models/billing-statement/src/tests/line-items.test.js +22 -125
  37. package/dist/document-models/billing-statement/src/tests/tags.test.js +13 -47
  38. package/dist/document-models/document-models.js +2 -2
  39. package/dist/document-models/expense-report/gen/document-model.d.ts.map +1 -1
  40. package/dist/document-models/expense-report/gen/document-model.js +48 -48
  41. package/dist/document-models/expense-report/gen/document-schema.d.ts +6 -6
  42. package/dist/document-models/expense-report/gen/utils.js +1 -1
  43. package/dist/document-models/expense-report/src/tests/document-model.test.d.ts +4 -0
  44. package/dist/document-models/expense-report/src/tests/document-model.test.d.ts.map +1 -1
  45. package/dist/document-models/expense-report/src/tests/document-model.test.js +94 -8
  46. package/dist/document-models/expense-report/src/tests/wallet.test.js +145 -10
  47. package/dist/document-models/index.d.ts +2 -6
  48. package/dist/document-models/index.d.ts.map +1 -1
  49. package/dist/document-models/index.js +2 -6
  50. package/dist/document-models/integrations/gen/document-model.js +33 -33
  51. package/dist/document-models/integrations/gen/document-schema.d.ts +6 -6
  52. package/dist/document-models/integrations/gen/utils.js +1 -1
  53. package/dist/document-models/integrations/src/reducers/integrations.d.ts.map +1 -1
  54. package/dist/document-models/integrations/src/reducers/integrations.js +9 -32
  55. package/dist/document-models/integrations/src/tests/document-model.test.d.ts +4 -0
  56. package/dist/document-models/integrations/src/tests/document-model.test.d.ts.map +1 -1
  57. package/dist/document-models/integrations/src/tests/document-model.test.js +91 -5
  58. package/dist/document-models/integrations/src/tests/integrations.test.js +21 -46
  59. package/dist/document-models/invoice/gen/document-model.js +147 -147
  60. package/dist/document-models/invoice/gen/document-schema.d.ts +127 -127
  61. package/dist/document-models/invoice/gen/document-schema.d.ts.map +1 -1
  62. package/dist/document-models/invoice/gen/ph-factories.d.ts.map +1 -1
  63. package/dist/document-models/invoice/gen/ph-factories.js +16 -122
  64. package/dist/document-models/invoice/gen/schema/types.d.ts +4 -4
  65. package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
  66. package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
  67. package/dist/document-models/invoice/gen/schema/zod.js +4 -4
  68. package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
  69. package/dist/document-models/invoice/gen/utils.js +17 -123
  70. package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
  71. package/dist/document-models/invoice/src/reducers/general.js +34 -10
  72. package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
  73. package/dist/document-models/invoice/src/reducers/items.js +7 -7
  74. package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -1
  75. package/dist/document-models/invoice/src/reducers/parties.js +96 -50
  76. package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
  77. package/dist/document-models/invoice/src/reducers/transitions.js +69 -53
  78. package/dist/document-models/invoice/src/tests/document-model.test.d.ts +4 -0
  79. package/dist/document-models/invoice/src/tests/document-model.test.d.ts.map +1 -1
  80. package/dist/document-models/invoice/src/tests/document-model.test.js +91 -4
  81. package/dist/document-models/invoice/src/tests/general.test.js +24 -26
  82. package/dist/document-models/invoice/src/tests/items.test.js +37 -17
  83. package/dist/document-models/invoice/src/tests/parties.test.js +32 -26
  84. package/dist/document-models/invoice/src/tests/transitions.test.js +52 -500
  85. package/dist/document-models/invoice/utils/statusTransitions.d.ts.map +1 -1
  86. package/dist/document-models/invoice/utils/statusTransitions.js +10 -10
  87. package/dist/editors/billing-statement/components/lineItemsTable.d.ts.map +1 -1
  88. package/dist/editors/billing-statement/components/lineItemsTable.js +32 -23
  89. package/dist/editors/billing-statement/components/objectSetTable.d.ts.map +1 -1
  90. package/dist/editors/billing-statement/components/objectSetTable.js +1 -2
  91. package/dist/editors/billing-statement/editor.d.ts +4 -0
  92. package/dist/editors/billing-statement/editor.d.ts.map +1 -1
  93. package/dist/editors/billing-statement/editor.js +34 -16
  94. package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts.map +1 -1
  95. package/dist/editors/billing-statement/lineItemTags/lineItemTags.js +36 -37
  96. package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts.map +1 -1
  97. package/dist/editors/billing-statement/lineItemTags/tagMapping.js +28 -10
  98. package/dist/editors/clean-new-editor/components/CreateDocument.d.ts +6 -0
  99. package/dist/editors/clean-new-editor/components/CreateDocument.d.ts.map +1 -0
  100. package/dist/editors/clean-new-editor/components/CreateDocument.js +18 -0
  101. package/dist/editors/clean-new-editor/components/DriveContents.d.ts +3 -0
  102. package/dist/editors/clean-new-editor/components/DriveContents.d.ts.map +1 -0
  103. package/dist/editors/clean-new-editor/components/DriveContents.js +10 -0
  104. package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts +7 -0
  105. package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts.map +1 -0
  106. package/dist/editors/clean-new-editor/components/DriveExplorer.js +16 -0
  107. package/dist/editors/clean-new-editor/components/EmptyState.d.ts +3 -0
  108. package/dist/editors/clean-new-editor/components/EmptyState.d.ts.map +1 -0
  109. package/dist/editors/clean-new-editor/components/EmptyState.js +10 -0
  110. package/dist/editors/clean-new-editor/components/Files.d.ts +3 -0
  111. package/dist/editors/clean-new-editor/components/Files.d.ts.map +1 -0
  112. package/dist/editors/clean-new-editor/components/Files.js +12 -0
  113. package/dist/editors/clean-new-editor/components/FolderTree.d.ts +6 -0
  114. package/dist/editors/clean-new-editor/components/FolderTree.d.ts.map +1 -0
  115. package/dist/editors/clean-new-editor/components/FolderTree.js +65 -0
  116. package/dist/editors/clean-new-editor/components/Folders.d.ts +3 -0
  117. package/dist/editors/clean-new-editor/components/Folders.d.ts.map +1 -0
  118. package/dist/editors/clean-new-editor/components/Folders.js +12 -0
  119. package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts +3 -0
  120. package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts.map +1 -0
  121. package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.js +6 -0
  122. package/dist/editors/clean-new-editor/config.d.ts +4 -0
  123. package/dist/editors/clean-new-editor/config.d.ts.map +1 -0
  124. package/dist/editors/clean-new-editor/config.js +5 -0
  125. package/dist/editors/clean-new-editor/editor.d.ts +4 -0
  126. package/dist/editors/clean-new-editor/editor.d.ts.map +1 -0
  127. package/dist/editors/clean-new-editor/editor.js +11 -0
  128. package/dist/editors/clean-new-editor/module.d.ts +3 -0
  129. package/dist/editors/clean-new-editor/module.d.ts.map +1 -0
  130. package/dist/editors/clean-new-editor/module.js +10 -0
  131. package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts +14 -0
  132. package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts.map +1 -0
  133. package/dist/editors/contributor-billing/components/ConfirmationModal.js +6 -0
  134. package/dist/editors/contributor-billing/components/CreateDocument.d.ts +6 -0
  135. package/dist/editors/contributor-billing/components/CreateDocument.d.ts.map +1 -0
  136. package/dist/editors/contributor-billing/components/CreateDocument.js +18 -0
  137. package/dist/editors/contributor-billing/components/DriveContents.d.ts +3 -0
  138. package/dist/editors/contributor-billing/components/DriveContents.d.ts.map +1 -0
  139. package/dist/editors/contributor-billing/components/DriveContents.js +10 -0
  140. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +3 -3
  141. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
  142. package/dist/editors/contributor-billing/components/DriveExplorer.js +13 -180
  143. package/dist/editors/contributor-billing/components/EmptyState.d.ts +3 -0
  144. package/dist/editors/contributor-billing/components/EmptyState.d.ts.map +1 -0
  145. package/dist/editors/contributor-billing/components/EmptyState.js +10 -0
  146. package/dist/editors/contributor-billing/components/Files.d.ts +3 -0
  147. package/dist/editors/contributor-billing/components/Files.d.ts.map +1 -0
  148. package/dist/editors/contributor-billing/components/Files.js +12 -0
  149. package/dist/editors/contributor-billing/components/FolderTree.d.ts +6 -0
  150. package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +1 -0
  151. package/dist/editors/contributor-billing/components/FolderTree.js +65 -0
  152. package/dist/editors/contributor-billing/components/Folders.d.ts +3 -0
  153. package/dist/editors/contributor-billing/components/Folders.d.ts.map +1 -0
  154. package/dist/editors/contributor-billing/components/Folders.js +12 -0
  155. package/dist/editors/contributor-billing/components/HeaderControls.d.ts +38 -0
  156. package/dist/editors/contributor-billing/components/HeaderControls.d.ts.map +1 -0
  157. package/dist/editors/contributor-billing/components/HeaderControls.js +124 -0
  158. package/dist/editors/contributor-billing/components/HeaderStats.d.ts.map +1 -0
  159. package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.js → HeaderStats.js} +1 -1
  160. package/dist/editors/contributor-billing/components/InvoiceTable.d.ts +22 -0
  161. package/dist/editors/contributor-billing/components/InvoiceTable.d.ts.map +1 -0
  162. package/dist/editors/contributor-billing/components/InvoiceTable.js +399 -0
  163. package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts +6 -0
  164. package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts.map +1 -0
  165. package/dist/editors/contributor-billing/components/InvoiceTableContainer.js +111 -0
  166. package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts +32 -0
  167. package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts.map +1 -0
  168. package/dist/editors/contributor-billing/components/InvoiceTableRow.js +55 -0
  169. package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts +13 -0
  170. package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts.map +1 -0
  171. package/dist/editors/contributor-billing/components/InvoiceTableSection.js +16 -0
  172. package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts +3 -0
  173. package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts.map +1 -0
  174. package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.js +6 -0
  175. package/dist/editors/contributor-billing/config.d.ts +1 -0
  176. package/dist/editors/contributor-billing/config.d.ts.map +1 -1
  177. package/dist/editors/contributor-billing/config.js +4 -1
  178. package/dist/editors/contributor-billing/editor.d.ts +1 -0
  179. package/dist/editors/contributor-billing/editor.d.ts.map +1 -1
  180. package/dist/editors/contributor-billing/editor.js +4 -1
  181. package/dist/editors/contributor-billing/module.d.ts +1 -1
  182. package/dist/editors/contributor-billing/module.d.ts.map +1 -1
  183. package/dist/editors/contributor-billing/module.js +3 -2
  184. package/dist/editors/contributor-billing/utils/exchangeRate.d.ts +15 -0
  185. package/dist/editors/contributor-billing/utils/exchangeRate.d.ts.map +1 -0
  186. package/dist/editors/contributor-billing/utils/exchangeRate.js +122 -0
  187. package/dist/editors/editors.js +2 -2
  188. package/dist/editors/expense-report/components/AddBillingStatementModal.d.ts.map +1 -1
  189. package/dist/editors/expense-report/editor.js +8 -8
  190. package/dist/editors/index.d.ts +2 -2
  191. package/dist/editors/index.d.ts.map +1 -1
  192. package/dist/editors/index.js +2 -2
  193. package/dist/editors/integrations/components/EditName.d.ts +3 -0
  194. package/dist/editors/integrations/components/EditName.d.ts.map +1 -0
  195. package/dist/editors/integrations/components/EditName.js +31 -0
  196. package/dist/editors/integrations/editor.d.ts +2 -4
  197. package/dist/editors/integrations/editor.d.ts.map +1 -1
  198. package/dist/editors/integrations/editor.js +5 -132
  199. package/dist/editors/integrations/module.d.ts +1 -0
  200. package/dist/editors/integrations/module.d.ts.map +1 -1
  201. package/dist/editors/integrations/module.js +3 -2
  202. package/dist/editors/invoice/components/confirmationModal.js +1 -1
  203. package/dist/editors/invoice/components/countryForm.d.ts.map +1 -1
  204. package/dist/editors/invoice/components/countryForm.js +1 -1
  205. package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -1
  206. package/dist/editors/invoice/components/currencyForm.js +1 -1
  207. package/dist/editors/invoice/components/datePicker.d.ts +1 -1
  208. package/dist/editors/invoice/components/datePicker.d.ts.map +1 -1
  209. package/dist/editors/invoice/components/datePicker.js +1 -1
  210. package/dist/editors/invoice/components/inputField.d.ts.map +1 -1
  211. package/dist/editors/invoice/components/inputField.js +3 -2
  212. package/dist/editors/invoice/components/lineItemMobileModal.d.ts.map +1 -1
  213. package/dist/editors/invoice/components/lineItemMobileModal.js +1 -1
  214. package/dist/editors/invoice/components/numberForm.d.ts.map +1 -1
  215. package/dist/editors/invoice/components/selectField.js +7 -7
  216. package/dist/editors/invoice/components/statusModalComponents.d.ts.map +1 -1
  217. package/dist/editors/invoice/components/statusModalComponents.js +27 -3
  218. package/dist/editors/invoice/editor.d.ts +1 -4
  219. package/dist/editors/invoice/editor.d.ts.map +1 -1
  220. package/dist/editors/invoice/editor.js +102 -40
  221. package/dist/editors/invoice/exportUBL.d.ts.map +1 -1
  222. package/dist/editors/invoice/exportUBL.js +35 -18
  223. package/dist/editors/invoice/ingestPDF.d.ts.map +1 -1
  224. package/dist/editors/invoice/ingestPDF.js +15 -9
  225. package/dist/editors/invoice/invoiceToGnosis.js +2 -2
  226. package/dist/editors/invoice/legalEntity/bankSection.d.ts.map +1 -1
  227. package/dist/editors/invoice/legalEntity/bankSection.js +19 -10
  228. package/dist/editors/invoice/legalEntity/legalEntity.d.ts +4 -0
  229. package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
  230. package/dist/editors/invoice/legalEntity/legalEntity.js +66 -2
  231. package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
  232. package/dist/editors/invoice/legalEntity/walletSection.js +3 -3
  233. package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
  234. package/dist/editors/invoice/lineItemTags/lineItemTags.js +1 -1
  235. package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts.map +1 -1
  236. package/dist/editors/invoice/lineItemTags/tagMobileModal.js +4 -3
  237. package/dist/editors/invoice/lineItems.d.ts.map +1 -1
  238. package/dist/editors/invoice/module.d.ts +1 -0
  239. package/dist/editors/invoice/module.d.ts.map +1 -1
  240. package/dist/editors/invoice/module.js +2 -1
  241. package/dist/editors/invoice/requestFinance.js +3 -3
  242. package/dist/editors/invoice/uploadPdfChunked.d.ts.map +1 -1
  243. package/dist/editors/invoice/uploadPdfChunked.js +5 -4
  244. package/dist/editors/invoice/utils/utils.d.ts.map +1 -1
  245. package/dist/editors/invoice/utils/utils.js +5 -4
  246. package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
  247. package/dist/editors/invoice/validation/validationHandler.js +11 -5
  248. package/dist/editors/invoice/validation/validationManager.d.ts +2 -2
  249. package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
  250. package/dist/editors/invoice/validation/validationManager.js +5 -5
  251. package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
  252. package/dist/editors/invoice/validation/validationRules.js +178 -178
  253. package/dist/index.d.ts +2 -2
  254. package/dist/index.d.ts.map +1 -1
  255. package/dist/index.js +4 -2
  256. package/dist/old-contributor-billing/components/DriveExplorer.d.ts +7 -0
  257. package/dist/old-contributor-billing/components/DriveExplorer.d.ts.map +1 -0
  258. package/dist/old-contributor-billing/components/DriveExplorer.js +184 -0
  259. package/dist/old-contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -0
  260. package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts +2 -0
  261. package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +1 -0
  262. package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.js +73 -0
  263. package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -0
  264. package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -0
  265. package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -0
  266. package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.js +1 -1
  267. package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/RowActionMenu.d.ts +1 -1
  268. package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +1 -0
  269. package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.js +2 -0
  270. package/dist/old-contributor-billing/config.d.ts +3 -0
  271. package/dist/old-contributor-billing/config.d.ts.map +1 -0
  272. package/dist/old-contributor-billing/config.js +4 -0
  273. package/dist/old-contributor-billing/editor.d.ts +3 -0
  274. package/dist/old-contributor-billing/editor.d.ts.map +1 -0
  275. package/dist/old-contributor-billing/editor.js +8 -0
  276. package/dist/old-contributor-billing/module.d.ts +3 -0
  277. package/dist/old-contributor-billing/module.d.ts.map +1 -0
  278. package/dist/old-contributor-billing/module.js +9 -0
  279. package/dist/old-contributor-billing/util.d.ts.map +1 -0
  280. package/dist/{editors/contributor-billing → old-contributor-billing}/util.js +11 -9
  281. package/dist/powerhouse.manifest.json +6 -41
  282. package/dist/processors/index.d.ts +1 -6
  283. package/dist/processors/index.d.ts.map +1 -1
  284. package/dist/processors/index.js +1 -18
  285. package/dist/scripts/contributor-billing/createExpenseReportCsv.d.ts.map +1 -1
  286. package/dist/scripts/contributor-billing/createExpenseReportCsv.js +24 -24
  287. package/dist/scripts/contributor-billing/createXeroCsv.d.ts.map +1 -1
  288. package/dist/scripts/contributor-billing/createXeroCsv.js +52 -46
  289. package/dist/scripts/invoice/autoTagging.d.ts +1 -1
  290. package/dist/scripts/invoice/autoTagging.d.ts.map +1 -1
  291. package/dist/scripts/invoice/autoTagging.js +168 -138
  292. package/dist/scripts/invoice/exampleBatchTxn.js +16 -16
  293. package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -1
  294. package/dist/scripts/invoice/gnosisTransactionBuilder.js +32 -25
  295. package/dist/scripts/invoice/pdfToClaudeAI.d.ts.map +1 -1
  296. package/dist/scripts/invoice/pdfToClaudeAI.js +36 -30
  297. package/dist/scripts/invoice/requestFinance.d.ts.map +1 -1
  298. package/dist/scripts/invoice/requestFinance.js +13 -13
  299. package/dist/style.css +407 -13659
  300. package/dist/subgraphs/billing-statement/resolvers.d.ts +1 -1
  301. package/dist/subgraphs/billing-statement/resolvers.d.ts.map +1 -1
  302. package/dist/subgraphs/billing-statement/resolvers.js +16 -5
  303. package/dist/subgraphs/billing-statement/schema.d.ts.map +1 -1
  304. package/dist/subgraphs/billing-statement/schema.js +12 -67
  305. package/dist/subgraphs/expense-report/resolvers.d.ts +1 -1
  306. package/dist/subgraphs/expense-report/resolvers.d.ts.map +1 -1
  307. package/dist/subgraphs/expense-report/resolvers.js +4 -5
  308. package/dist/subgraphs/expense-report/schema.d.ts.map +1 -1
  309. package/dist/subgraphs/expense-report/schema.js +5 -48
  310. package/dist/subgraphs/index.d.ts +1 -0
  311. package/dist/subgraphs/index.d.ts.map +1 -1
  312. package/dist/subgraphs/index.js +1 -0
  313. package/dist/subgraphs/integrations/resolvers.d.ts +1 -1
  314. package/dist/subgraphs/integrations/resolvers.d.ts.map +1 -1
  315. package/dist/subgraphs/integrations/resolvers.js +4 -5
  316. package/dist/subgraphs/integrations/schema.d.ts.map +1 -1
  317. package/dist/subgraphs/integrations/schema.js +3 -43
  318. package/dist/subgraphs/invoice/index.d.ts.map +1 -1
  319. package/dist/subgraphs/invoice/index.js +1 -20
  320. package/dist/subgraphs/invoice/resolvers.d.ts +1 -1
  321. package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
  322. package/dist/subgraphs/invoice/resolvers.js +4 -9
  323. package/dist/subgraphs/invoice/schema.d.ts.map +1 -1
  324. package/dist/subgraphs/invoice/schema.js +14 -232
  325. package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.d.ts +1 -1
  326. package/dist/subgraphs/invoice-addon/customResolvers.d.ts.map +1 -0
  327. package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.js +38 -34
  328. package/dist/subgraphs/invoice-addon/index.d.ts +11 -0
  329. package/dist/subgraphs/invoice-addon/index.d.ts.map +1 -0
  330. package/dist/subgraphs/invoice-addon/index.js +11 -0
  331. package/dist/subgraphs/invoice-addon/resolvers.d.ts +3 -0
  332. package/dist/subgraphs/invoice-addon/resolvers.d.ts.map +1 -0
  333. package/dist/subgraphs/invoice-addon/resolvers.js +12 -0
  334. package/dist/subgraphs/invoice-addon/schema.d.ts +3 -0
  335. package/dist/subgraphs/invoice-addon/schema.d.ts.map +1 -0
  336. package/dist/subgraphs/invoice-addon/schema.js +52 -0
  337. package/package.json +9 -20
  338. package/dist/document-models/expense-report/gen/expense-report/actions.d.ts +0 -8
  339. package/dist/document-models/expense-report/gen/expense-report/actions.d.ts.map +0 -1
  340. package/dist/document-models/expense-report/gen/expense-report/actions.js +0 -1
  341. package/dist/document-models/expense-report/gen/expense-report/creators.d.ts +0 -4
  342. package/dist/document-models/expense-report/gen/expense-report/creators.d.ts.map +0 -1
  343. package/dist/document-models/expense-report/gen/expense-report/creators.js +0 -3
  344. package/dist/document-models/expense-report/gen/expense-report/error.d.ts +0 -2
  345. package/dist/document-models/expense-report/gen/expense-report/error.d.ts.map +0 -1
  346. package/dist/document-models/expense-report/gen/expense-report/error.js +0 -1
  347. package/dist/document-models/expense-report/gen/expense-report/operations.d.ts +0 -7
  348. package/dist/document-models/expense-report/gen/expense-report/operations.d.ts.map +0 -1
  349. package/dist/document-models/expense-report/gen/expense-report/operations.js +0 -3
  350. package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts +0 -6
  351. package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts.map +0 -1
  352. package/dist/document-models/expense-report/src/tests/expense-report.test.js +0 -24
  353. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +0 -1
  354. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +0 -1
  355. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +0 -1
  356. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +0 -1
  357. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +0 -1
  358. package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +0 -1
  359. package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.js +0 -2
  360. package/dist/editors/contributor-billing/util.d.ts.map +0 -1
  361. package/dist/editors/hooks/useBillingStatementDocument.d.ts +0 -4
  362. package/dist/editors/hooks/useBillingStatementDocument.d.ts.map +0 -1
  363. package/dist/editors/hooks/useBillingStatementDocument.js +0 -8
  364. package/dist/editors/hooks/useExpenseReportDocument.d.ts +0 -4
  365. package/dist/editors/hooks/useExpenseReportDocument.d.ts.map +0 -1
  366. package/dist/editors/hooks/useExpenseReportDocument.js +0 -8
  367. package/dist/editors/hooks/useIntegrationsDocument.d.ts +0 -4
  368. package/dist/editors/hooks/useIntegrationsDocument.d.ts.map +0 -1
  369. package/dist/editors/hooks/useIntegrationsDocument.js +0 -8
  370. package/dist/editors/hooks/useInvoiceDocument.d.ts +0 -4
  371. package/dist/editors/hooks/useInvoiceDocument.d.ts.map +0 -1
  372. package/dist/editors/hooks/useInvoiceDocument.js +0 -8
  373. package/dist/editors/integrations/config.d.ts +0 -3
  374. package/dist/editors/integrations/config.d.ts.map +0 -1
  375. package/dist/editors/integrations/config.js +0 -3
  376. package/dist/processors/line-item-processor/index.d.ts +0 -11
  377. package/dist/processors/line-item-processor/index.d.ts.map +0 -1
  378. package/dist/processors/line-item-processor/index.js +0 -36
  379. package/dist/subgraphs/invoice/customResolvers.d.ts.map +0 -1
  380. package/editors/invoice/assets/custom.d.ts +0 -4
  381. package/editors/invoice/assets/powerhouseLogo.png +0 -0
  382. /package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.d.ts → HeaderStats.d.ts} +0 -0
  383. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.d.ts +0 -0
  384. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.js +0 -0
  385. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.d.ts +0 -0
  386. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.js +0 -0
  387. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.d.ts +0 -0
  388. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.js +0 -0
  389. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.d.ts +0 -0
  390. /package/dist/{editors/contributor-billing → old-contributor-billing}/util.d.ts +0 -0
@@ -1,26 +1,26 @@
1
1
  export const documentModel = {
2
2
  author: {
3
3
  name: "Powerhouse",
4
- website: "https://powerhouse.inc/",
4
+ website: "https://powerhouse.inc",
5
5
  },
6
6
  description: "A document that contains expenses for n amount wallets across different dimensions, such as expense types and categories. The flow inside a new expense report starts with the user adding wallets that would represent the expenses. Each wallet would be able to extract the expenses from the list of billing statements that are added to the wallet. From the billing statements, the line items inside the wallet are built with the rich data. For example, a line item has a tag that could be directly linked to a LineItemGroup by the group field. Once all line items are added to the Wallet.lineItems list, the next Wallet.totals field could start being populated. This Wallet.total field holds a list of GroupTotals. These group totals aggregate the line item values by the group they belong to. Once the Wallet.totals is finished, the user will be able to see a full expense report. The last steps for the user are to set the periodStart and periodEnd fields to complete the report. ",
7
- extension: ".phdm",
7
+ extension: "",
8
8
  id: "powerhouse/expense-report",
9
- name: "Expense Report",
9
+ name: "ExpenseReport",
10
10
  specifications: [
11
11
  {
12
12
  changeLog: [],
13
13
  modules: [
14
14
  {
15
15
  description: "",
16
- id: "4dae174e-5d8b-4a9a-b523-39ccc07a5f8e",
16
+ id: "17d59066-f922-45f9-b5c4-69bf3e7c951c",
17
17
  name: "wallet",
18
18
  operations: [
19
19
  {
20
- description: "Adds a new wallet to the expense report",
20
+ description: "",
21
21
  errors: [],
22
22
  examples: [],
23
- id: "dd1d8daa-4975-43d9-8460-c3676d2db722",
23
+ id: "4aee28bb-309e-4e12-8805-9b57506fcba1",
24
24
  name: "ADD_WALLET",
25
25
  reducer: "",
26
26
  schema: "input AddWalletInput {\n wallet: EthereumAddress!\n name: String\n}",
@@ -28,153 +28,153 @@ export const documentModel = {
28
28
  template: "",
29
29
  },
30
30
  {
31
- description: "Removes a wallet from the expense report",
31
+ description: "",
32
32
  errors: [],
33
33
  examples: [],
34
- id: "8f2e3c1d-9a4b-4c5d-8e6f-1a2b3c4d5e6f",
34
+ id: "c7b274ca-b24a-4142-b46a-ecb431b0f502",
35
35
  name: "REMOVE_WALLET",
36
36
  reducer: "",
37
37
  schema: "input RemoveWalletInput {\n wallet: EthereumAddress!\n}",
38
38
  scope: "global",
39
- template: "Removes a wallet from the expense report",
39
+ template: "",
40
40
  },
41
41
  {
42
- description: "Adds a billing statement reference to a specific wallet",
42
+ description: "",
43
43
  errors: [],
44
44
  examples: [],
45
- id: "7a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
45
+ id: "6e735183-a4fd-4355-8db4-63902d5a7348",
46
46
  name: "ADD_BILLING_STATEMENT",
47
47
  reducer: "",
48
48
  schema: "input AddBillingStatementInput {\n wallet: EthereumAddress!\n billingStatementId: OID!\n}",
49
49
  scope: "global",
50
- template: "Adds a billing statement reference to a specific wallet",
50
+ template: "",
51
51
  },
52
52
  {
53
- description: "Removes a billing statement reference from a specific wallet",
53
+ description: "",
54
54
  errors: [],
55
55
  examples: [],
56
- id: "9b2c3d4e-5f6a-7b8c-9d0e-1f2a3b4c5d6e",
56
+ id: "f8c5a682-cff9-4d68-a07e-b8f6187e3d6d",
57
57
  name: "REMOVE_BILLING_STATEMENT",
58
58
  reducer: "",
59
59
  schema: "input RemoveBillingStatementInput {\n wallet: EthereumAddress!\n billingStatementId: OID!\n}",
60
60
  scope: "global",
61
- template: "Removes a billing statement reference from a specific wallet",
61
+ template: "",
62
62
  },
63
63
  {
64
- description: "Adds a new line item to a specific wallet",
64
+ description: "",
65
65
  errors: [],
66
66
  examples: [],
67
- id: "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
67
+ id: "6a7fa2df-5ecb-422d-8626-6c74eb1efd35",
68
68
  name: "ADD_LINE_ITEM",
69
69
  reducer: "",
70
70
  schema: "input AddLineItemInput {\n wallet: EthereumAddress!\n lineItem: LineItemInput!\n}\n\ninput LineItemInput {\n id: ID!\n label: String\n group: ID\n budget: Float\n actuals: Float\n forecast: Float\n payments: Float\n comments: String\n}",
71
71
  scope: "global",
72
- template: "Adds a new line item to a specific wallet",
72
+ template: "",
73
73
  },
74
74
  {
75
- description: "Updates an existing line item in a specific wallet",
75
+ description: "",
76
76
  errors: [],
77
77
  examples: [],
78
- id: "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
78
+ id: "efe1b4b0-d8bf-4ad0-970e-ea100d197da3",
79
79
  name: "UPDATE_LINE_ITEM",
80
80
  reducer: "",
81
81
  schema: "input UpdateLineItemInput {\n wallet: EthereumAddress!\n lineItemId: ID!\n label: String\n group: ID\n budget: Float\n actuals: Float\n forecast: Float\n payments: Float\n comments: String\n}",
82
82
  scope: "global",
83
- template: "Updates an existing line item in a specific wallet",
83
+ template: "",
84
84
  },
85
85
  {
86
- description: "Removes a line item from a specific wallet",
86
+ description: "",
87
87
  errors: [],
88
88
  examples: [],
89
- id: "3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f",
89
+ id: "526341c8-c9fb-4c9e-b948-458a6bd53eda",
90
90
  name: "REMOVE_LINE_ITEM",
91
91
  reducer: "",
92
92
  schema: "input RemoveLineItemInput {\n wallet: EthereumAddress!\n lineItemId: ID!\n}",
93
93
  scope: "global",
94
- template: "Removes a line item from a specific wallet",
94
+ template: "",
95
95
  },
96
96
  {
97
- description: "Adds a new line item group for categorizing expenses",
97
+ description: "",
98
98
  errors: [],
99
99
  examples: [],
100
- id: "4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f9a",
100
+ id: "1a96ab65-6b2a-4424-906b-75c2d83e6306",
101
101
  name: "ADD_LINE_ITEM_GROUP",
102
102
  reducer: "",
103
103
  schema: "input AddLineItemGroupInput {\n id: ID!\n label: String\n parentId: ID\n}",
104
104
  scope: "global",
105
- template: "Adds a new line item group for categorizing expenses",
105
+ template: "",
106
106
  },
107
107
  {
108
- description: "Updates an existing line item group",
108
+ description: "",
109
109
  errors: [],
110
110
  examples: [],
111
- id: "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
111
+ id: "847cff5a-32a1-4246-941c-62b0a4045717",
112
112
  name: "UPDATE_LINE_ITEM_GROUP",
113
113
  reducer: "",
114
114
  schema: "input UpdateLineItemGroupInput {\n id: ID!\n label: String\n parentId: ID\n}",
115
115
  scope: "global",
116
- template: "Updates an existing line item group",
116
+ template: "",
117
117
  },
118
118
  {
119
- description: "Removes a line item group",
119
+ description: "",
120
120
  errors: [],
121
121
  examples: [],
122
- id: "6f7a8b9c-0d1e-2f3a-4b5c-6d7e8f9a0b1c",
122
+ id: "1085423f-fb20-4a9e-8e51-97e317c70d93",
123
123
  name: "REMOVE_LINE_ITEM_GROUP",
124
124
  reducer: "",
125
125
  schema: "input RemoveLineItemGroupInput {\n id: ID!\n}",
126
126
  scope: "global",
127
- template: "Removes a line item group",
127
+ template: "",
128
128
  },
129
129
  {
130
- description: "Sets or updates the totals for a specific group within a wallet",
130
+ description: "",
131
131
  errors: [],
132
132
  examples: [],
133
- id: "7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d",
133
+ id: "fa19fce6-ace0-4867-b50a-7401a1f2a8d4",
134
134
  name: "SET_GROUP_TOTALS",
135
135
  reducer: "",
136
136
  schema: "input SetGroupTotalsInput {\n wallet: EthereumAddress!\n groupTotals: GroupTotalsInput!\n}\n\ninput GroupTotalsInput {\n group: ID!\n totalBudget: Float\n totalForecast: Float\n totalActuals: Float\n totalPayments: Float\n}",
137
137
  scope: "global",
138
- template: "Sets or updates the totals for a specific group within a wallet",
138
+ template: "",
139
139
  },
140
140
  {
141
- description: "Removes group totals for a specific group within a wallet",
141
+ description: "",
142
142
  errors: [],
143
143
  examples: [],
144
- id: "8b9c0d1e-2f3a-4b5c-6d7e-8f9a0b1c2d3e",
144
+ id: "9671164b-7f09-4cdd-b52e-335791e9f94b",
145
145
  name: "REMOVE_GROUP_TOTALS",
146
146
  reducer: "",
147
147
  schema: "input RemoveGroupTotalsInput {\n wallet: EthereumAddress!\n groupId: ID!\n}",
148
148
  scope: "global",
149
- template: "Removes group totals for a specific group within a wallet",
149
+ template: "",
150
150
  },
151
151
  {
152
- description: "Sets the start date for the expense report period",
152
+ description: "",
153
153
  errors: [],
154
154
  examples: [],
155
- id: "9c0d1e2f-3a4b-5c6d-7e8f-9a0b1c2d3e4f",
155
+ id: "0b4aa24e-fdd6-46ee-ab87-eefbd51ad9e2",
156
156
  name: "SET_PERIOD_START",
157
157
  reducer: "",
158
158
  schema: "input SetPeriodStartInput {\n periodStart: DateTime!\n}",
159
159
  scope: "global",
160
- template: "Sets the start date for the expense report period",
160
+ template: "",
161
161
  },
162
162
  {
163
- description: "Sets the end date for the expense report period",
163
+ description: "",
164
164
  errors: [],
165
165
  examples: [],
166
- id: "0d1e2f3a-4b5c-6d7e-8f9a-0b1c2d3e4f5a",
166
+ id: "3e496dde-9119-4d20-916e-37119b58f5a6",
167
167
  name: "SET_PERIOD_END",
168
168
  reducer: "",
169
169
  schema: "input SetPeriodEndInput {\n periodEnd: DateTime!\n}",
170
170
  scope: "global",
171
- template: "Sets the end date for the expense report period",
171
+ template: "",
172
172
  },
173
173
  {
174
174
  description: "",
175
175
  errors: [],
176
176
  examples: [],
177
- id: "68206262-544c-475a-8803-1871f00207cc",
177
+ id: "59eacc42-f916-44c1-ac75-7027d8e69a23",
178
178
  name: "UPDATE_WALLET",
179
179
  reducer: "",
180
180
  schema: "input UpdateWalletInput {\n address: EthereumAddress!\n name: String\n}",
@@ -187,8 +187,8 @@ export const documentModel = {
187
187
  state: {
188
188
  global: {
189
189
  examples: [],
190
- initialValue: '"{\\"wallets\\": [], \\"groups\\": [{\\"id\\": \\"57b0fdd7-51f5-4725-8a05-7ab3c15d90c2\\", \\"label\\": \\"Headcount Expenses\\", \\"parentId\\": null}, {\\"id\\": \\"4971def8-64f8-4eab-b69b-a869d10452c2\\", \\"label\\": \\"Non-Headcount Expenses\\", \\"parentId\\": null}, {\\"id\\": \\"e27b7f51-dc22-4ebe-8659-4e41824ae58c\\", \\"label\\": \\"Travel & Entertainment\\", \\"parentId\\": \\"57b0fdd7-51f5-4725-8a05-7ab3c15d90c2\\"}, {\\"id\\": \\"e4dce6df-1aa6-4861-b9f4-d861ad74d66c\\", \\"label\\": \\"Compensation & Benefits\\", \\"parentId\\": \\"57b0fdd7-51f5-4725-8a05-7ab3c15d90c2\\"}, {\\"id\\": \\"92e445ba-96af-4793-ae01-9b71035174ba\\", \\"label\\": \\"Marketing Expense\\", \\"parentId\\": \\"4971def8-64f8-4eab-b69b-a869d10452c2\\"}, {\\"id\\": \\"778dbd41-3d4a-4c8f-9004-7797f04e5b40\\", \\"label\\": \\"Admin Expense\\", \\"parentId\\": \\"4971def8-64f8-4eab-b69b-a869d10452c2\\"}, {\\"id\\": \\"5f024d53-7d0e-4818-9661-256aee69709d\\", \\"label\\": \\"Professional Services\\", \\"parentId\\": \\"4971def8-64f8-4eab-b69b-a869d10452c2\\"}, {\\"id\\": \\"659337f4-01c3-495a-89d7-c177c4137620\\", \\"label\\": \\"Cost of Goods Sold\\", \\"parentId\\": \\"4971def8-64f8-4eab-b69b-a869d10452c2\\"}, {\\"id\\": \\"1d6f0601-966a-4982-811d-981ac28db0b4\\", \\"label\\": \\"Software Development Expense\\", \\"parentId\\": \\"4971def8-64f8-4eab-b69b-a869d10452c2\\"}, {\\"id\\": \\"800dac9a-5665-4826-a972-b3170c789d92\\", \\"label\\": \\"Income Tax Expense\\", \\"parentId\\": \\"4971def8-64f8-4eab-b69b-a869d10452c2\\"}, {\\"id\\": \\"30ed3523-c15a-411f-a8f6-7bb6b978f6f8\\", \\"label\\": \\"Software Expense\\", \\"parentId\\": \\"4971def8-64f8-4eab-b69b-a869d10452c2\\"}, {\\"id\\": \\"ba7688ad-1329-4344-8f8a-e0f27dc648b8\\", \\"label\\": \\"Gas Expense\\", \\"parentId\\": \\"4971def8-64f8-4eab-b69b-a869d10452c2\\"}, {\\"label\\": \\"Budget\\", \\"parentId\\": null, \\"id\\": \\"465367d1-636a-45a1-9e43-4a48dd074918\\"}, {\\"label\\": \\"Interest Income\\", \\"parentId\\": null, \\"id\\": \\"aa5b7188-2231-445e-9f3d-7e5d1ce5754f\\"}, {\\"label\\": \\"Other Income Expense (Non-operating)\\", \\"parentId\\": null, \\"id\\": \\"d1e9bd15-930d-4faa-ba61-8f2a3b1d0e8f\\"}, {\\"label\\": \\"Other Income\\", \\"parentId\\": null, \\"id\\": \\"133b762c-a240-4a42-8bf6-9c29b3675f91\\"}, {\\"label\\": \\"Current Asset\\", \\"parentId\\": null, \\"id\\": \\"1c61e841-c599-4c38-944a-7c9450c27d17\\"}, {\\"label\\": \\"Fixed Asset\\", \\"parentId\\": null, \\"id\\": \\"5a33a954-09d0-4ddd-95fc-c56853de4dbd\\"}, {\\"label\\": \\"Non-Current Asset\\", \\"parentId\\": null, \\"id\\": \\"75130e59-7c11-44ae-980c-eaa4968a4a56\\"}, {\\"label\\": \\"Current Liability\\", \\"parentId\\": null, \\"id\\": \\"b3091879-f549-4227-beef-c8d4947be2e7\\"}, {\\"label\\": \\"Non-current Liability\\", \\"parentId\\": null, \\"id\\": \\"2f64aca7-38db-4ff4-8cc5-8e0952c23151\\"}, {\\"label\\": \\"Owner Equity\\", \\"parentId\\": null, \\"id\\": \\"42e480eb-9790-49ed-af35-3ab124af556e\\"}, {\\"label\\": \\"Equity\\", \\"parentId\\": null, \\"id\\": \\"248f0af0-74b1-4fd9-9e7f-3d723f5c4c56\\"}, {\\"label\\": \\"Adjustment A/C\\", \\"parentId\\": null, \\"id\\": \\"5044752a-5618-4ab2-90b7-54b5d95e38cf\\"}, {\\"label\\": \\"Temporary Holding Account\\", \\"parentId\\": null, \\"id\\": \\"566fede7-b593-43d0-84b6-50301e5a84ed\\"}, {\\"label\\": \\"Other\\", \\"parentId\\": null, \\"id\\": \\"f0077e3f-2931-4637-8715-ba3a01ce3786\\"}, {\\"label\\": \\"Internal Transfers\\", \\"parentId\\": null, \\"id\\": \\"470504f0-a89f-4555-a46e-667c74240238\\"}], \\"periodStart\\": null, \\"periodEnd\\": null}"',
191
- schema: "type ExpenseReportState {\n wallets: [Wallet!]!\n groups: [LineItemGroup!]!\n periodStart: DateTime\n periodEnd: DateTime\n}\n\ntype Wallet {\n name: String\n wallet: EthereumAddress\n totals: [GroupTotals]\n billingStatements: [OID]\n lineItems: [LineItem]\n}\n\ntype LineItemGroup {\n id: ID!\n label: String\n parentId: ID\n}\n\ntype GroupTotals {\n group: ID ## LineItemGroupId\n totalBudget: Float\n totalForecast: Float\n totalActuals: Float\n totalPayments: Float\n}\n\ntype LineItem {\n id: ID\n label: String\n group: ID ## LineItemGroupId\n budget: Float\n actuals: Float\n forecast: Float\n payments: Float\n comments: String\n}\n",
190
+ initialValue: '"{\\n \\"wallets\\": [],\\n \\"groups\\": [\\n {\\n id: \\"57b0fdd7-51f5-4725-8a05-7ab3c15d90c2\\",\\n label: \\"Headcount Expenses\\",\\n parentId: null,\\n },\\n {\\n id: \\"4971def8-64f8-4eab-b69b-a869d10452c2\\",\\n label: \\"Non-Headcount Expenses\\",\\n parentId: null,\\n },\\n {\\n id: \\"e27b7f51-dc22-4ebe-8659-4e41824ae58c\\",\\n label: \\"Travel & Entertainment\\",\\n parentId: \\"57b0fdd7-51f5-4725-8a05-7ab3c15d90c2\\",\\n },\\n {\\n id: \\"e4dce6df-1aa6-4861-b9f4-d861ad74d66c\\",\\n label: \\"Compensation & Benefits\\",\\n parentId: \\"57b0fdd7-51f5-4725-8a05-7ab3c15d90c2\\",\\n },\\n {\\n id: \\"92e445ba-96af-4793-ae01-9b71035174ba\\",\\n label: \\"Marketing Expense\\",\\n parentId: \\"4971def8-64f8-4eab-b69b-a869d10452c2\\",\\n },\\n {\\n id: \\"778dbd41-3d4a-4c8f-9004-7797f04e5b40\\",\\n label: \\"Admin Expense\\",\\n parentId: \\"4971def8-64f8-4eab-b69b-a869d10452c2\\",\\n },\\n {\\n id: \\"5f024d53-7d0e-4818-9661-256aee69709d\\",\\n label: \\"Professional Services\\",\\n parentId: \\"4971def8-64f8-4eab-b69b-a869d10452c2\\",\\n },\\n {\\n id: \\"659337f4-01c3-495a-89d7-c177c4137620\\",\\n label: \\"Cost of Goods Sold\\",\\n parentId: \\"4971def8-64f8-4eab-b69b-a869d10452c2\\",\\n },\\n {\\n id: \\"1d6f0601-966a-4982-811d-981ac28db0b4\\",\\n label: \\"Software Development Expense\\",\\n parentId: \\"4971def8-64f8-4eab-b69b-a869d10452c2\\",\\n },\\n {\\n id: \\"800dac9a-5665-4826-a972-b3170c789d92\\",\\n label: \\"Income Tax Expense\\",\\n parentId: \\"4971def8-64f8-4eab-b69b-a869d10452c2\\",\\n },\\n {\\n id: \\"30ed3523-c15a-411f-a8f6-7bb6b978f6f8\\",\\n label: \\"Software Expense\\",\\n parentId: \\"4971def8-64f8-4eab-b69b-a869d10452c2\\",\\n },\\n {\\n id: \\"ba7688ad-1329-4344-8f8a-e0f27dc648b8\\",\\n label: \\"Gas Expense\\",\\n parentId: \\"4971def8-64f8-4eab-b69b-a869d10452c2\\",\\n },\\n {\\n label: \\"Budget\\",\\n parentId: null,\\n id: \\"465367d1-636a-45a1-9e43-4a48dd074918\\",\\n },\\n {\\n label: \\"Interest Income\\",\\n parentId: null,\\n id: \\"aa5b7188-2231-445e-9f3d-7e5d1ce5754f\\",\\n },\\n {\\n label: \\"Other Income Expense (Non-operating)\\",\\n parentId: null,\\n id: \\"d1e9bd15-930d-4faa-ba61-8f2a3b1d0e8f\\",\\n },\\n {\\n label: \\"Other Income\\",\\n parentId: null,\\n id: \\"133b762c-a240-4a42-8bf6-9c29b3675f91\\",\\n },\\n {\\n label: \\"Current Asset\\",\\n parentId: null,\\n id: \\"1c61e841-c599-4c38-944a-7c9450c27d17\\",\\n },\\n {\\n label: \\"Fixed Asset\\",\\n parentId: null,\\n id: \\"5a33a954-09d0-4ddd-95fc-c56853de4dbd\\",\\n },\\n {\\n label: \\"Non-Current Asset\\",\\n parentId: null,\\n id: \\"75130e59-7c11-44ae-980c-eaa4968a4a56\\",\\n },\\n {\\n label: \\"Current Liability\\",\\n parentId: null,\\n id: \\"b3091879-f549-4227-beef-c8d4947be2e7\\",\\n },\\n {\\n label: \\"Non-current Liability\\",\\n parentId: null,\\n id: \\"2f64aca7-38db-4ff4-8cc5-8e0952c23151\\",\\n },\\n {\\n label: \\"Owner Equity\\",\\n parentId: null,\\n id: \\"42e480eb-9790-49ed-af35-3ab124af556e\\",\\n },\\n {\\n label: \\"Equity\\",\\n parentId: null,\\n id: \\"248f0af0-74b1-4fd9-9e7f-3d723f5c4c56\\",\\n },\\n {\\n label: \\"Adjustment A/C\\",\\n parentId: null,\\n id: \\"5044752a-5618-4ab2-90b7-54b5d95e38cf\\",\\n },\\n {\\n label: \\"Temporary Holding Account\\",\\n parentId: null,\\n id: \\"566fede7-b593-43d0-84b6-50301e5a84ed\\",\\n },\\n {\\n label: \\"Other\\",\\n parentId: null,\\n id: \\"f0077e3f-2931-4637-8715-ba3a01ce3786\\",\\n },\\n {\\n label: \\"Internal Transfers\\",\\n parentId: null,\\n id: \\"470504f0-a89f-4555-a46e-667c74240238\\",\\n },\\n ],\\n \\"periodStart\\": null,\\n \\"periodEnd\\": null\\n}"',
191
+ schema: "type ExpenseReportState {\n wallets: [Wallet!]!\n groups: [LineItemGroup!]!\n periodStart: DateTime\n periodEnd: DateTime\n}\n\ntype Wallet {\n name: String\n wallet: EthereumAddress\n totals: [GroupTotals]\n billingStatements: [OID]\n lineItems: [LineItem]\n}\n\ntype LineItemGroup {\n id: ID!\n label: String\n parentId: ID\n}\n\ntype GroupTotals {\n group: ID ## LineItemGroupId\n totalBudget: Float\n totalForecast: Float\n totalActuals: Float\n totalPayments: Float\n}\n\ntype LineItem {\n id: ID\n label: String\n group: ID ## LineItemGroupId\n budget: Float\n actuals: Float\n forecast: Float\n payments: Float\n comments: String\n}",
192
192
  },
193
193
  local: {
194
194
  examples: [],
@@ -10,14 +10,14 @@ export declare const ExpenseReportDocumentHeaderSchema: z.ZodObject<{
10
10
  documentType: z.ZodLiteral<"powerhouse/expense-report">;
11
11
  }, "strip", z.ZodTypeAny, {
12
12
  id: string;
13
- documentType: "powerhouse/expense-report";
14
13
  name: string;
14
+ documentType: "powerhouse/expense-report";
15
15
  createdAtUtcIso: string;
16
16
  lastModifiedAtUtcIso: string;
17
17
  }, {
18
18
  id: string;
19
- documentType: "powerhouse/expense-report";
20
19
  name: string;
20
+ documentType: "powerhouse/expense-report";
21
21
  createdAtUtcIso: string;
22
22
  lastModifiedAtUtcIso: string;
23
23
  }>;
@@ -64,14 +64,14 @@ export declare const ExpenseReportDocumentSchema: z.ZodObject<{
64
64
  documentType: z.ZodLiteral<"powerhouse/expense-report">;
65
65
  }, "strip", z.ZodTypeAny, {
66
66
  id: string;
67
- documentType: "powerhouse/expense-report";
68
67
  name: string;
68
+ documentType: "powerhouse/expense-report";
69
69
  createdAtUtcIso: string;
70
70
  lastModifiedAtUtcIso: string;
71
71
  }, {
72
72
  id: string;
73
- documentType: "powerhouse/expense-report";
74
73
  name: string;
74
+ documentType: "powerhouse/expense-report";
75
75
  createdAtUtcIso: string;
76
76
  lastModifiedAtUtcIso: string;
77
77
  }>;
@@ -142,8 +142,8 @@ export declare const ExpenseReportDocumentSchema: z.ZodObject<{
142
142
  }, "strip", z.ZodTypeAny, {
143
143
  header: {
144
144
  id: string;
145
- documentType: "powerhouse/expense-report";
146
145
  name: string;
146
+ documentType: "powerhouse/expense-report";
147
147
  createdAtUtcIso: string;
148
148
  lastModifiedAtUtcIso: string;
149
149
  };
@@ -166,8 +166,8 @@ export declare const ExpenseReportDocumentSchema: z.ZodObject<{
166
166
  }, {
167
167
  header: {
168
168
  id: string;
169
- documentType: "powerhouse/expense-report";
170
169
  name: string;
170
+ documentType: "powerhouse/expense-report";
171
171
  createdAtUtcIso: string;
172
172
  lastModifiedAtUtcIso: string;
173
173
  };
@@ -146,7 +146,7 @@ export const initialGlobalState = {
146
146
  };
147
147
  export const initialLocalState = {};
148
148
  export const utils = {
149
- fileExtension: ".phdm",
149
+ fileExtension: "",
150
150
  createState(state) {
151
151
  return {
152
152
  ...defaultBaseState(),
@@ -1,3 +1,7 @@
1
+ /**
2
+ * This is a scaffold file meant for customization:
3
+ * - change it by adding new tests or modifying the existing ones
4
+ */
1
5
  /**
2
6
  * This is a scaffold file meant for customization:
3
7
  * - change it by adding new tests or modifying the existing ones
@@ -1 +1 @@
1
- {"version":3,"file":"document-model.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/expense-report/src/tests/document-model.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
1
+ {"version":3,"file":"document-model.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/expense-report/src/tests/document-model.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;;GAGG"}
@@ -2,17 +2,103 @@
2
2
  * This is a scaffold file meant for customization:
3
3
  * - change it by adding new tests or modifying the existing ones
4
4
  */
5
- import { describe, it, expect, beforeEach } from "vitest";
6
- import { initialGlobalState, initialLocalState, createDocument, } from "../../gen/utils.js";
7
- describe("Expense Report Document Model", () => {
8
- it("should create a new Expense Report document", () => {
9
- const document = createDocument();
5
+ /**
6
+ * This is a scaffold file meant for customization:
7
+ * - change it by adding new tests or modifying the existing ones
8
+ */
9
+ import { describe, it, expect } from "vitest";
10
+ import { utils, initialGlobalState, initialLocalState, expenseReportDocumentType, isExpenseReportDocument, assertIsExpenseReportDocument, isExpenseReportState, assertIsExpenseReportState, } from "@powerhousedao/contributor-billing/document-models/expense-report";
11
+ import { ZodError } from "zod";
12
+ describe("ExpenseReport Document Model", () => {
13
+ it("should create a new ExpenseReport document", () => {
14
+ const document = utils.createDocument();
10
15
  expect(document).toBeDefined();
11
- expect(document.header.documentType).toBe("powerhouse/expense-report");
16
+ expect(document.header.documentType).toBe(expenseReportDocumentType);
12
17
  });
13
- it("should create a new Expense Report document with a valid initial state", () => {
14
- const document = createDocument();
18
+ it("should create a new ExpenseReport document with a valid initial state", () => {
19
+ const document = utils.createDocument();
15
20
  expect(document.state.global).toStrictEqual(initialGlobalState);
16
21
  expect(document.state.local).toStrictEqual(initialLocalState);
22
+ expect(isExpenseReportDocument(document)).toBe(true);
23
+ expect(isExpenseReportState(document.state)).toBe(true);
24
+ });
25
+ it("should reject a document that is not a ExpenseReport document", () => {
26
+ const wrongDocumentType = utils.createDocument();
27
+ wrongDocumentType.header.documentType = "the-wrong-thing-1234";
28
+ try {
29
+ expect(assertIsExpenseReportDocument(wrongDocumentType)).toThrow();
30
+ expect(isExpenseReportDocument(wrongDocumentType)).toBe(false);
31
+ }
32
+ catch (error) {
33
+ expect(error).toBeInstanceOf(ZodError);
34
+ }
17
35
  });
36
+ const wrongState = utils.createDocument();
37
+ // @ts-expect-error - we are testing the error case
38
+ wrongState.state.global = {
39
+ ...{ notWhat: "you want" },
40
+ };
41
+ try {
42
+ expect(isExpenseReportState(wrongState.state)).toBe(false);
43
+ expect(assertIsExpenseReportState(wrongState.state)).toThrow();
44
+ expect(isExpenseReportDocument(wrongState)).toBe(false);
45
+ expect(assertIsExpenseReportDocument(wrongState)).toThrow();
46
+ }
47
+ catch (error) {
48
+ expect(error).toBeInstanceOf(ZodError);
49
+ }
50
+ const wrongInitialState = utils.createDocument();
51
+ // @ts-expect-error - we are testing the error case
52
+ wrongInitialState.initialState.global = {
53
+ ...{ notWhat: "you want" },
54
+ };
55
+ try {
56
+ expect(isExpenseReportState(wrongInitialState.state)).toBe(false);
57
+ expect(assertIsExpenseReportState(wrongInitialState.state)).toThrow();
58
+ expect(isExpenseReportDocument(wrongInitialState)).toBe(false);
59
+ expect(assertIsExpenseReportDocument(wrongInitialState)).toThrow();
60
+ }
61
+ catch (error) {
62
+ expect(error).toBeInstanceOf(ZodError);
63
+ }
64
+ const missingIdInHeader = utils.createDocument();
65
+ // @ts-expect-error - we are testing the error case
66
+ delete missingIdInHeader.header.id;
67
+ try {
68
+ expect(isExpenseReportDocument(missingIdInHeader)).toBe(false);
69
+ expect(assertIsExpenseReportDocument(missingIdInHeader)).toThrow();
70
+ }
71
+ catch (error) {
72
+ expect(error).toBeInstanceOf(ZodError);
73
+ }
74
+ const missingNameInHeader = utils.createDocument();
75
+ // @ts-expect-error - we are testing the error case
76
+ delete missingNameInHeader.header.name;
77
+ try {
78
+ expect(isExpenseReportDocument(missingNameInHeader)).toBe(false);
79
+ expect(assertIsExpenseReportDocument(missingNameInHeader)).toThrow();
80
+ }
81
+ catch (error) {
82
+ expect(error).toBeInstanceOf(ZodError);
83
+ }
84
+ const missingCreatedAtUtcIsoInHeader = utils.createDocument();
85
+ // @ts-expect-error - we are testing the error case
86
+ delete missingCreatedAtUtcIsoInHeader.header.createdAtUtcIso;
87
+ try {
88
+ expect(isExpenseReportDocument(missingCreatedAtUtcIsoInHeader)).toBe(false);
89
+ expect(assertIsExpenseReportDocument(missingCreatedAtUtcIsoInHeader)).toThrow();
90
+ }
91
+ catch (error) {
92
+ expect(error).toBeInstanceOf(ZodError);
93
+ }
94
+ const missingLastModifiedAtUtcIsoInHeader = utils.createDocument();
95
+ // @ts-expect-error - we are testing the error case
96
+ delete missingLastModifiedAtUtcIsoInHeader.header.lastModifiedAtUtcIso;
97
+ try {
98
+ expect(isExpenseReportDocument(missingLastModifiedAtUtcIsoInHeader)).toBe(false);
99
+ expect(assertIsExpenseReportDocument(missingLastModifiedAtUtcIsoInHeader)).toThrow();
100
+ }
101
+ catch (error) {
102
+ expect(error).toBeInstanceOf(ZodError);
103
+ }
18
104
  });
@@ -2,23 +2,158 @@
2
2
  * This is a scaffold file meant for customization:
3
3
  * - change it by adding new tests or modifying the existing ones
4
4
  */
5
- import { describe, it, expect, beforeEach } from "vitest";
5
+ import { describe, it, expect } from "vitest";
6
6
  import { generateMock } from "@powerhousedao/codegen";
7
- import * as utils from "../../gen/utils.js";
8
- import { AddWalletInputSchema } from "../../gen/schema/index.js";
9
- import { reducer } from "../../gen/reducer.js";
10
- import * as creators from "../../gen/wallet/creators.js";
7
+ import { reducer, utils, isExpenseReportDocument, addWallet, AddWalletInputSchema, removeWallet, RemoveWalletInputSchema, addBillingStatement, AddBillingStatementInputSchema, removeBillingStatement, RemoveBillingStatementInputSchema, addLineItem, AddLineItemInputSchema, updateLineItem, UpdateLineItemInputSchema, removeLineItem, RemoveLineItemInputSchema, addLineItemGroup, AddLineItemGroupInputSchema, updateLineItemGroup, UpdateLineItemGroupInputSchema, removeLineItemGroup, RemoveLineItemGroupInputSchema, setGroupTotals, SetGroupTotalsInputSchema, removeGroupTotals, RemoveGroupTotalsInputSchema, setPeriodStart, SetPeriodStartInputSchema, setPeriodEnd, SetPeriodEndInputSchema, updateWallet, UpdateWalletInputSchema, } from "@powerhousedao/contributor-billing/document-models/expense-report";
11
8
  describe("Wallet Operations", () => {
12
- let document;
13
- beforeEach(() => {
14
- document = utils.createDocument();
15
- });
16
9
  it("should handle addWallet operation", () => {
10
+ const document = utils.createDocument();
17
11
  const input = generateMock(AddWalletInputSchema());
18
- const updatedDocument = reducer(document, creators.addWallet(input));
12
+ const updatedDocument = reducer(document, addWallet(input));
13
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
19
14
  expect(updatedDocument.operations.global).toHaveLength(1);
20
15
  expect(updatedDocument.operations.global[0].action.type).toBe("ADD_WALLET");
21
16
  expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
22
17
  expect(updatedDocument.operations.global[0].index).toEqual(0);
23
18
  });
19
+ it("should handle removeWallet operation", () => {
20
+ const document = utils.createDocument();
21
+ const input = generateMock(RemoveWalletInputSchema());
22
+ const updatedDocument = reducer(document, removeWallet(input));
23
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
24
+ expect(updatedDocument.operations.global).toHaveLength(1);
25
+ expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_WALLET");
26
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
27
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
28
+ });
29
+ it("should handle addBillingStatement operation", () => {
30
+ const document = utils.createDocument();
31
+ const input = generateMock(AddBillingStatementInputSchema());
32
+ const updatedDocument = reducer(document, addBillingStatement(input));
33
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
34
+ expect(updatedDocument.operations.global).toHaveLength(1);
35
+ expect(updatedDocument.operations.global[0].action.type).toBe("ADD_BILLING_STATEMENT");
36
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
37
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
38
+ });
39
+ it("should handle removeBillingStatement operation", () => {
40
+ const document = utils.createDocument();
41
+ const input = generateMock(RemoveBillingStatementInputSchema());
42
+ const updatedDocument = reducer(document, removeBillingStatement(input));
43
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
44
+ expect(updatedDocument.operations.global).toHaveLength(1);
45
+ expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_BILLING_STATEMENT");
46
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
47
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
48
+ });
49
+ it("should handle addLineItem operation", () => {
50
+ const document = utils.createDocument();
51
+ const input = generateMock(AddLineItemInputSchema());
52
+ const updatedDocument = reducer(document, addLineItem(input));
53
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
54
+ expect(updatedDocument.operations.global).toHaveLength(1);
55
+ expect(updatedDocument.operations.global[0].action.type).toBe("ADD_LINE_ITEM");
56
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
57
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
58
+ });
59
+ it("should handle updateLineItem operation", () => {
60
+ const document = utils.createDocument();
61
+ const input = generateMock(UpdateLineItemInputSchema());
62
+ const updatedDocument = reducer(document, updateLineItem(input));
63
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
64
+ expect(updatedDocument.operations.global).toHaveLength(1);
65
+ expect(updatedDocument.operations.global[0].action.type).toBe("UPDATE_LINE_ITEM");
66
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
67
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
68
+ });
69
+ it("should handle removeLineItem operation", () => {
70
+ const document = utils.createDocument();
71
+ const input = generateMock(RemoveLineItemInputSchema());
72
+ const updatedDocument = reducer(document, removeLineItem(input));
73
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
74
+ expect(updatedDocument.operations.global).toHaveLength(1);
75
+ expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_LINE_ITEM");
76
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
77
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
78
+ });
79
+ it("should handle addLineItemGroup operation", () => {
80
+ const document = utils.createDocument();
81
+ const input = generateMock(AddLineItemGroupInputSchema());
82
+ const updatedDocument = reducer(document, addLineItemGroup(input));
83
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
84
+ expect(updatedDocument.operations.global).toHaveLength(1);
85
+ expect(updatedDocument.operations.global[0].action.type).toBe("ADD_LINE_ITEM_GROUP");
86
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
87
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
88
+ });
89
+ it("should handle updateLineItemGroup operation", () => {
90
+ const document = utils.createDocument();
91
+ const input = generateMock(UpdateLineItemGroupInputSchema());
92
+ const updatedDocument = reducer(document, updateLineItemGroup(input));
93
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
94
+ expect(updatedDocument.operations.global).toHaveLength(1);
95
+ expect(updatedDocument.operations.global[0].action.type).toBe("UPDATE_LINE_ITEM_GROUP");
96
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
97
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
98
+ });
99
+ it("should handle removeLineItemGroup operation", () => {
100
+ const document = utils.createDocument();
101
+ const input = generateMock(RemoveLineItemGroupInputSchema());
102
+ const updatedDocument = reducer(document, removeLineItemGroup(input));
103
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
104
+ expect(updatedDocument.operations.global).toHaveLength(1);
105
+ expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_LINE_ITEM_GROUP");
106
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
107
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
108
+ });
109
+ it("should handle setGroupTotals operation", () => {
110
+ const document = utils.createDocument();
111
+ const input = generateMock(SetGroupTotalsInputSchema());
112
+ const updatedDocument = reducer(document, setGroupTotals(input));
113
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
114
+ expect(updatedDocument.operations.global).toHaveLength(1);
115
+ expect(updatedDocument.operations.global[0].action.type).toBe("SET_GROUP_TOTALS");
116
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
117
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
118
+ });
119
+ it("should handle removeGroupTotals operation", () => {
120
+ const document = utils.createDocument();
121
+ const input = generateMock(RemoveGroupTotalsInputSchema());
122
+ const updatedDocument = reducer(document, removeGroupTotals(input));
123
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
124
+ expect(updatedDocument.operations.global).toHaveLength(1);
125
+ expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_GROUP_TOTALS");
126
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
127
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
128
+ });
129
+ it("should handle setPeriodStart operation", () => {
130
+ const document = utils.createDocument();
131
+ const input = generateMock(SetPeriodStartInputSchema());
132
+ const updatedDocument = reducer(document, setPeriodStart(input));
133
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
134
+ expect(updatedDocument.operations.global).toHaveLength(1);
135
+ expect(updatedDocument.operations.global[0].action.type).toBe("SET_PERIOD_START");
136
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
137
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
138
+ });
139
+ it("should handle setPeriodEnd operation", () => {
140
+ const document = utils.createDocument();
141
+ const input = generateMock(SetPeriodEndInputSchema());
142
+ const updatedDocument = reducer(document, setPeriodEnd(input));
143
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
144
+ expect(updatedDocument.operations.global).toHaveLength(1);
145
+ expect(updatedDocument.operations.global[0].action.type).toBe("SET_PERIOD_END");
146
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
147
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
148
+ });
149
+ it("should handle updateWallet operation", () => {
150
+ const document = utils.createDocument();
151
+ const input = generateMock(UpdateWalletInputSchema());
152
+ const updatedDocument = reducer(document, updateWallet(input));
153
+ expect(isExpenseReportDocument(updatedDocument)).toBe(true);
154
+ expect(updatedDocument.operations.global).toHaveLength(1);
155
+ expect(updatedDocument.operations.global[0].action.type).toBe("UPDATE_WALLET");
156
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
157
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
158
+ });
24
159
  });