@zudello/modelcontextprotocol 1.0.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 (634) hide show
  1. package/README.md +667 -0
  2. package/dist/constants/zudello.d.ts +627 -0
  3. package/dist/constants/zudello.d.ts.map +1 -0
  4. package/dist/constants/zudello.js +1467 -0
  5. package/dist/constants/zudello.js.map +1 -0
  6. package/dist/context/auth.d.ts +22 -0
  7. package/dist/context/auth.d.ts.map +1 -0
  8. package/dist/context/auth.js +62 -0
  9. package/dist/context/auth.js.map +1 -0
  10. package/dist/index.d.ts +7 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +126 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/prompts/zudello-system.d.ts +6 -0
  15. package/dist/prompts/zudello-system.d.ts.map +1 -0
  16. package/dist/prompts/zudello-system.js +1821 -0
  17. package/dist/prompts/zudello-system.js.map +1 -0
  18. package/dist/services/zudello/admin.d.ts +93 -0
  19. package/dist/services/zudello/admin.d.ts.map +1 -0
  20. package/dist/services/zudello/admin.js +264 -0
  21. package/dist/services/zudello/admin.js.map +1 -0
  22. package/dist/services/zudello/automation.d.ts +92 -0
  23. package/dist/services/zudello/automation.d.ts.map +1 -0
  24. package/dist/services/zudello/automation.js +365 -0
  25. package/dist/services/zudello/automation.js.map +1 -0
  26. package/dist/services/zudello/connections.d.ts +111 -0
  27. package/dist/services/zudello/connections.d.ts.map +1 -0
  28. package/dist/services/zudello/connections.js +289 -0
  29. package/dist/services/zudello/connections.js.map +1 -0
  30. package/dist/services/zudello/core.d.ts +26 -0
  31. package/dist/services/zudello/core.d.ts.map +1 -0
  32. package/dist/services/zudello/core.js +51 -0
  33. package/dist/services/zudello/core.js.map +1 -0
  34. package/dist/services/zudello/document-context.d.ts +5 -0
  35. package/dist/services/zudello/document-context.d.ts.map +1 -0
  36. package/dist/services/zudello/document-context.js +33 -0
  37. package/dist/services/zudello/document-context.js.map +1 -0
  38. package/dist/services/zudello/documents.d.ts +110 -0
  39. package/dist/services/zudello/documents.d.ts.map +1 -0
  40. package/dist/services/zudello/documents.js +865 -0
  41. package/dist/services/zudello/documents.js.map +1 -0
  42. package/dist/services/zudello/inboxes.d.ts +13 -0
  43. package/dist/services/zudello/inboxes.d.ts.map +1 -0
  44. package/dist/services/zudello/inboxes.js +115 -0
  45. package/dist/services/zudello/inboxes.js.map +1 -0
  46. package/dist/services/zudello/index.d.ts +21 -0
  47. package/dist/services/zudello/index.d.ts.map +1 -0
  48. package/dist/services/zudello/index.js +55 -0
  49. package/dist/services/zudello/index.js.map +1 -0
  50. package/dist/services/zudello/language.d.ts +18 -0
  51. package/dist/services/zudello/language.d.ts.map +1 -0
  52. package/dist/services/zudello/language.js +83 -0
  53. package/dist/services/zudello/language.js.map +1 -0
  54. package/dist/services/zudello/notifications.d.ts +20 -0
  55. package/dist/services/zudello/notifications.d.ts.map +1 -0
  56. package/dist/services/zudello/notifications.js +106 -0
  57. package/dist/services/zudello/notifications.js.map +1 -0
  58. package/dist/services/zudello/organization.d.ts +125 -0
  59. package/dist/services/zudello/organization.d.ts.map +1 -0
  60. package/dist/services/zudello/organization.js +686 -0
  61. package/dist/services/zudello/organization.js.map +1 -0
  62. package/dist/services/zudello/resources.d.ts +83 -0
  63. package/dist/services/zudello/resources.d.ts.map +1 -0
  64. package/dist/services/zudello/resources.js +554 -0
  65. package/dist/services/zudello/resources.js.map +1 -0
  66. package/dist/services/zudello/sentences.d.ts +79 -0
  67. package/dist/services/zudello/sentences.d.ts.map +1 -0
  68. package/dist/services/zudello/sentences.js +357 -0
  69. package/dist/services/zudello/sentences.js.map +1 -0
  70. package/dist/services/zudello/types.d.ts +1126 -0
  71. package/dist/services/zudello/types.d.ts.map +1 -0
  72. package/dist/services/zudello/types.js +8 -0
  73. package/dist/services/zudello/types.js.map +1 -0
  74. package/dist/services/zudello/users.d.ts +66 -0
  75. package/dist/services/zudello/users.d.ts.map +1 -0
  76. package/dist/services/zudello/users.js +187 -0
  77. package/dist/services/zudello/users.js.map +1 -0
  78. package/dist/tools/admin/datasets/create-dataset.d.ts +44 -0
  79. package/dist/tools/admin/datasets/create-dataset.d.ts.map +1 -0
  80. package/dist/tools/admin/datasets/create-dataset.js +58 -0
  81. package/dist/tools/admin/datasets/create-dataset.js.map +1 -0
  82. package/dist/tools/admin/datasets/get-dataset.d.ts +27 -0
  83. package/dist/tools/admin/datasets/get-dataset.d.ts.map +1 -0
  84. package/dist/tools/admin/datasets/get-dataset.js +39 -0
  85. package/dist/tools/admin/datasets/get-dataset.js.map +1 -0
  86. package/dist/tools/admin/datasets/index.d.ts +5 -0
  87. package/dist/tools/admin/datasets/index.d.ts.map +1 -0
  88. package/dist/tools/admin/datasets/index.js +5 -0
  89. package/dist/tools/admin/datasets/index.js.map +1 -0
  90. package/dist/tools/admin/datasets/list-datasets.d.ts +35 -0
  91. package/dist/tools/admin/datasets/list-datasets.d.ts.map +1 -0
  92. package/dist/tools/admin/datasets/list-datasets.js +49 -0
  93. package/dist/tools/admin/datasets/list-datasets.js.map +1 -0
  94. package/dist/tools/admin/datasets/update-dataset.d.ts +44 -0
  95. package/dist/tools/admin/datasets/update-dataset.d.ts.map +1 -0
  96. package/dist/tools/admin/datasets/update-dataset.js +57 -0
  97. package/dist/tools/admin/datasets/update-dataset.js.map +1 -0
  98. package/dist/tools/admin/fields/create-field.d.ts +54 -0
  99. package/dist/tools/admin/fields/create-field.d.ts.map +1 -0
  100. package/dist/tools/admin/fields/create-field.js +68 -0
  101. package/dist/tools/admin/fields/create-field.js.map +1 -0
  102. package/dist/tools/admin/fields/get-field.d.ts +27 -0
  103. package/dist/tools/admin/fields/get-field.d.ts.map +1 -0
  104. package/dist/tools/admin/fields/get-field.js +39 -0
  105. package/dist/tools/admin/fields/get-field.js.map +1 -0
  106. package/dist/tools/admin/fields/index.d.ts +5 -0
  107. package/dist/tools/admin/fields/index.d.ts.map +1 -0
  108. package/dist/tools/admin/fields/index.js +5 -0
  109. package/dist/tools/admin/fields/index.js.map +1 -0
  110. package/dist/tools/admin/fields/list-fields.d.ts +36 -0
  111. package/dist/tools/admin/fields/list-fields.d.ts.map +1 -0
  112. package/dist/tools/admin/fields/list-fields.js +50 -0
  113. package/dist/tools/admin/fields/list-fields.js.map +1 -0
  114. package/dist/tools/admin/fields/update-field.d.ts +44 -0
  115. package/dist/tools/admin/fields/update-field.d.ts.map +1 -0
  116. package/dist/tools/admin/fields/update-field.js +57 -0
  117. package/dist/tools/admin/fields/update-field.js.map +1 -0
  118. package/dist/tools/admin/index.d.ts +4 -0
  119. package/dist/tools/admin/index.d.ts.map +1 -0
  120. package/dist/tools/admin/index.js +7 -0
  121. package/dist/tools/admin/index.js.map +1 -0
  122. package/dist/tools/admin/quick-actions/create-quick-action.d.ts +49 -0
  123. package/dist/tools/admin/quick-actions/create-quick-action.d.ts.map +1 -0
  124. package/dist/tools/admin/quick-actions/create-quick-action.js +63 -0
  125. package/dist/tools/admin/quick-actions/create-quick-action.js.map +1 -0
  126. package/dist/tools/admin/quick-actions/get-quick-action.d.ts +27 -0
  127. package/dist/tools/admin/quick-actions/get-quick-action.d.ts.map +1 -0
  128. package/dist/tools/admin/quick-actions/get-quick-action.js +39 -0
  129. package/dist/tools/admin/quick-actions/get-quick-action.js.map +1 -0
  130. package/dist/tools/admin/quick-actions/index.d.ts +6 -0
  131. package/dist/tools/admin/quick-actions/index.d.ts.map +1 -0
  132. package/dist/tools/admin/quick-actions/index.js +6 -0
  133. package/dist/tools/admin/quick-actions/index.js.map +1 -0
  134. package/dist/tools/admin/quick-actions/list-quick-actions.d.ts +35 -0
  135. package/dist/tools/admin/quick-actions/list-quick-actions.d.ts.map +1 -0
  136. package/dist/tools/admin/quick-actions/list-quick-actions.js +49 -0
  137. package/dist/tools/admin/quick-actions/list-quick-actions.js.map +1 -0
  138. package/dist/tools/admin/quick-actions/trigger-quick-action.d.ts +41 -0
  139. package/dist/tools/admin/quick-actions/trigger-quick-action.d.ts.map +1 -0
  140. package/dist/tools/admin/quick-actions/trigger-quick-action.js +53 -0
  141. package/dist/tools/admin/quick-actions/trigger-quick-action.js.map +1 -0
  142. package/dist/tools/admin/quick-actions/update-quick-action.d.ts +49 -0
  143. package/dist/tools/admin/quick-actions/update-quick-action.d.ts.map +1 -0
  144. package/dist/tools/admin/quick-actions/update-quick-action.js +62 -0
  145. package/dist/tools/admin/quick-actions/update-quick-action.js.map +1 -0
  146. package/dist/tools/approvals/get-approval-flows.d.ts +27 -0
  147. package/dist/tools/approvals/get-approval-flows.d.ts.map +1 -0
  148. package/dist/tools/approvals/get-approval-flows.js +35 -0
  149. package/dist/tools/approvals/get-approval-flows.js.map +1 -0
  150. package/dist/tools/approvals/index.d.ts +2 -0
  151. package/dist/tools/approvals/index.d.ts.map +1 -0
  152. package/dist/tools/approvals/index.js +2 -0
  153. package/dist/tools/approvals/index.js.map +1 -0
  154. package/dist/tools/automation/get-automation-logs.d.ts +59 -0
  155. package/dist/tools/automation/get-automation-logs.d.ts.map +1 -0
  156. package/dist/tools/automation/get-automation-logs.js +75 -0
  157. package/dist/tools/automation/get-automation-logs.js.map +1 -0
  158. package/dist/tools/automation/get-run-logs-content.d.ts +42 -0
  159. package/dist/tools/automation/get-run-logs-content.d.ts.map +1 -0
  160. package/dist/tools/automation/get-run-logs-content.js +27 -0
  161. package/dist/tools/automation/get-run-logs-content.js.map +1 -0
  162. package/dist/tools/automation/get-run-logs.d.ts +37 -0
  163. package/dist/tools/automation/get-run-logs.d.ts.map +1 -0
  164. package/dist/tools/automation/get-run-logs.js +27 -0
  165. package/dist/tools/automation/get-run-logs.js.map +1 -0
  166. package/dist/tools/automation/get-script.d.ts +33 -0
  167. package/dist/tools/automation/get-script.d.ts.map +1 -0
  168. package/dist/tools/automation/get-script.js +24 -0
  169. package/dist/tools/automation/get-script.js.map +1 -0
  170. package/dist/tools/automation/get-trigger.d.ts +27 -0
  171. package/dist/tools/automation/get-trigger.d.ts.map +1 -0
  172. package/dist/tools/automation/get-trigger.js +24 -0
  173. package/dist/tools/automation/get-trigger.js.map +1 -0
  174. package/dist/tools/automation/index.d.ts +16 -0
  175. package/dist/tools/automation/index.d.ts.map +1 -0
  176. package/dist/tools/automation/index.js +16 -0
  177. package/dist/tools/automation/index.js.map +1 -0
  178. package/dist/tools/automation/list-global-integrations.d.ts +23 -0
  179. package/dist/tools/automation/list-global-integrations.d.ts.map +1 -0
  180. package/dist/tools/automation/list-global-integrations.js +41 -0
  181. package/dist/tools/automation/list-global-integrations.js.map +1 -0
  182. package/dist/tools/automation/list-global-scripts-for-integration.d.ts +38 -0
  183. package/dist/tools/automation/list-global-scripts-for-integration.d.ts.map +1 -0
  184. package/dist/tools/automation/list-global-scripts-for-integration.js +50 -0
  185. package/dist/tools/automation/list-global-scripts-for-integration.js.map +1 -0
  186. package/dist/tools/automation/list-scripts.d.ts +26 -0
  187. package/dist/tools/automation/list-scripts.d.ts.map +1 -0
  188. package/dist/tools/automation/list-scripts.js +23 -0
  189. package/dist/tools/automation/list-scripts.js.map +1 -0
  190. package/dist/tools/automation/list-triggers.d.ts +23 -0
  191. package/dist/tools/automation/list-triggers.d.ts.map +1 -0
  192. package/dist/tools/automation/list-triggers.js +38 -0
  193. package/dist/tools/automation/list-triggers.js.map +1 -0
  194. package/dist/tools/automation/search-runs.d.ts +43 -0
  195. package/dist/tools/automation/search-runs.d.ts.map +1 -0
  196. package/dist/tools/automation/search-runs.js +32 -0
  197. package/dist/tools/automation/search-runs.js.map +1 -0
  198. package/dist/tools/bulk/approve-milestones.d.ts +59 -0
  199. package/dist/tools/bulk/approve-milestones.d.ts.map +1 -0
  200. package/dist/tools/bulk/approve-milestones.js +47 -0
  201. package/dist/tools/bulk/approve-milestones.js.map +1 -0
  202. package/dist/tools/bulk/index.d.ts +3 -0
  203. package/dist/tools/bulk/index.d.ts.map +1 -0
  204. package/dist/tools/bulk/index.js +3 -0
  205. package/dist/tools/bulk/index.js.map +1 -0
  206. package/dist/tools/bulk/send-reminders.d.ts +32 -0
  207. package/dist/tools/bulk/send-reminders.d.ts.map +1 -0
  208. package/dist/tools/bulk/send-reminders.js +37 -0
  209. package/dist/tools/bulk/send-reminders.js.map +1 -0
  210. package/dist/tools/config/create-config.d.ts +43 -0
  211. package/dist/tools/config/create-config.d.ts.map +1 -0
  212. package/dist/tools/config/create-config.js +61 -0
  213. package/dist/tools/config/create-config.js.map +1 -0
  214. package/dist/tools/config/get-config.d.ts +40 -0
  215. package/dist/tools/config/get-config.d.ts.map +1 -0
  216. package/dist/tools/config/get-config.js +52 -0
  217. package/dist/tools/config/get-config.js.map +1 -0
  218. package/dist/tools/config/index.d.ts +11 -0
  219. package/dist/tools/config/index.d.ts.map +1 -0
  220. package/dist/tools/config/index.js +11 -0
  221. package/dist/tools/config/index.js.map +1 -0
  222. package/dist/tools/config/list-configs.d.ts +48 -0
  223. package/dist/tools/config/list-configs.d.ts.map +1 -0
  224. package/dist/tools/config/list-configs.js +74 -0
  225. package/dist/tools/config/list-configs.js.map +1 -0
  226. package/dist/tools/config/update-config.d.ts +48 -0
  227. package/dist/tools/config/update-config.d.ts.map +1 -0
  228. package/dist/tools/config/update-config.js +64 -0
  229. package/dist/tools/config/update-config.js.map +1 -0
  230. package/dist/tools/config/update-configs-order.d.ts +39 -0
  231. package/dist/tools/config/update-configs-order.d.ts.map +1 -0
  232. package/dist/tools/config/update-configs-order.js +58 -0
  233. package/dist/tools/config/update-configs-order.js.map +1 -0
  234. package/dist/tools/connections/check-connection-status.d.ts +60 -0
  235. package/dist/tools/connections/check-connection-status.d.ts.map +1 -0
  236. package/dist/tools/connections/check-connection-status.js +94 -0
  237. package/dist/tools/connections/check-connection-status.js.map +1 -0
  238. package/dist/tools/connections/get-connection-template.d.ts +44 -0
  239. package/dist/tools/connections/get-connection-template.d.ts.map +1 -0
  240. package/dist/tools/connections/get-connection-template.js +55 -0
  241. package/dist/tools/connections/get-connection-template.js.map +1 -0
  242. package/dist/tools/connections/index.d.ts +11 -0
  243. package/dist/tools/connections/index.d.ts.map +1 -0
  244. package/dist/tools/connections/index.js +11 -0
  245. package/dist/tools/connections/index.js.map +1 -0
  246. package/dist/tools/connections/list-available-integrations.d.ts +29 -0
  247. package/dist/tools/connections/list-available-integrations.d.ts.map +1 -0
  248. package/dist/tools/connections/list-available-integrations.js +46 -0
  249. package/dist/tools/connections/list-available-integrations.js.map +1 -0
  250. package/dist/tools/connections/list-connections.d.ts +29 -0
  251. package/dist/tools/connections/list-connections.d.ts.map +1 -0
  252. package/dist/tools/connections/list-connections.js +48 -0
  253. package/dist/tools/connections/list-connections.js.map +1 -0
  254. package/dist/tools/connections/reconnect.d.ts +40 -0
  255. package/dist/tools/connections/reconnect.d.ts.map +1 -0
  256. package/dist/tools/connections/reconnect.js +67 -0
  257. package/dist/tools/connections/reconnect.js.map +1 -0
  258. package/dist/tools/control/index.d.ts +7 -0
  259. package/dist/tools/control/index.d.ts.map +1 -0
  260. package/dist/tools/control/index.js +7 -0
  261. package/dist/tools/control/index.js.map +1 -0
  262. package/dist/tools/control/initiate-sync.d.ts +38 -0
  263. package/dist/tools/control/initiate-sync.d.ts.map +1 -0
  264. package/dist/tools/control/initiate-sync.js +47 -0
  265. package/dist/tools/control/initiate-sync.js.map +1 -0
  266. package/dist/tools/control/set-trigger-enabled.d.ts +36 -0
  267. package/dist/tools/control/set-trigger-enabled.d.ts.map +1 -0
  268. package/dist/tools/control/set-trigger-enabled.js +46 -0
  269. package/dist/tools/control/set-trigger-enabled.js.map +1 -0
  270. package/dist/tools/core/fetch.d.ts +8 -0
  271. package/dist/tools/core/fetch.d.ts.map +1 -0
  272. package/dist/tools/core/fetch.js +48 -0
  273. package/dist/tools/core/fetch.js.map +1 -0
  274. package/dist/tools/core/index.d.ts +4 -0
  275. package/dist/tools/core/index.d.ts.map +1 -0
  276. package/dist/tools/core/index.js +4 -0
  277. package/dist/tools/core/index.js.map +1 -0
  278. package/dist/tools/core/push-message.d.ts +85 -0
  279. package/dist/tools/core/push-message.d.ts.map +1 -0
  280. package/dist/tools/core/push-message.js +116 -0
  281. package/dist/tools/core/push-message.js.map +1 -0
  282. package/dist/tools/core/search.d.ts +8 -0
  283. package/dist/tools/core/search.d.ts.map +1 -0
  284. package/dist/tools/core/search.js +38 -0
  285. package/dist/tools/core/search.js.map +1 -0
  286. package/dist/tools/document-context/check-contract-pricing.d.ts +30 -0
  287. package/dist/tools/document-context/check-contract-pricing.d.ts.map +1 -0
  288. package/dist/tools/document-context/check-contract-pricing.js +18 -0
  289. package/dist/tools/document-context/check-contract-pricing.js.map +1 -0
  290. package/dist/tools/document-context/check-document-budgets.d.ts +36 -0
  291. package/dist/tools/document-context/check-document-budgets.d.ts.map +1 -0
  292. package/dist/tools/document-context/check-document-budgets.js +18 -0
  293. package/dist/tools/document-context/check-document-budgets.js.map +1 -0
  294. package/dist/tools/document-context/index.d.ts +3 -0
  295. package/dist/tools/document-context/index.d.ts.map +1 -0
  296. package/dist/tools/document-context/index.js +3 -0
  297. package/dist/tools/document-context/index.js.map +1 -0
  298. package/dist/tools/documents/document-types/create-document-type.d.ts +19 -0
  299. package/dist/tools/documents/document-types/create-document-type.d.ts.map +1 -0
  300. package/dist/tools/documents/document-types/create-document-type.js +18 -0
  301. package/dist/tools/documents/document-types/create-document-type.js.map +1 -0
  302. package/dist/tools/documents/document-types/get-document-type.d.ts +24 -0
  303. package/dist/tools/documents/document-types/get-document-type.d.ts.map +1 -0
  304. package/dist/tools/documents/document-types/get-document-type.js +18 -0
  305. package/dist/tools/documents/document-types/get-document-type.js.map +1 -0
  306. package/dist/tools/documents/document-types/get-merged-form-metadata.d.ts +24 -0
  307. package/dist/tools/documents/document-types/get-merged-form-metadata.d.ts.map +1 -0
  308. package/dist/tools/documents/document-types/get-merged-form-metadata.js +18 -0
  309. package/dist/tools/documents/document-types/get-merged-form-metadata.js.map +1 -0
  310. package/dist/tools/documents/document-types/index.d.ts +6 -0
  311. package/dist/tools/documents/document-types/index.d.ts.map +1 -0
  312. package/dist/tools/documents/document-types/index.js +6 -0
  313. package/dist/tools/documents/document-types/index.js.map +1 -0
  314. package/dist/tools/documents/document-types/list-document-types.d.ts +21 -0
  315. package/dist/tools/documents/document-types/list-document-types.d.ts.map +1 -0
  316. package/dist/tools/documents/document-types/list-document-types.js +18 -0
  317. package/dist/tools/documents/document-types/list-document-types.js.map +1 -0
  318. package/dist/tools/documents/document-types/update-document-type.d.ts +24 -0
  319. package/dist/tools/documents/document-types/update-document-type.d.ts.map +1 -0
  320. package/dist/tools/documents/document-types/update-document-type.js +18 -0
  321. package/dist/tools/documents/document-types/update-document-type.js.map +1 -0
  322. package/dist/tools/documents/export-templates/create-export-template.d.ts +19 -0
  323. package/dist/tools/documents/export-templates/create-export-template.d.ts.map +1 -0
  324. package/dist/tools/documents/export-templates/create-export-template.js +18 -0
  325. package/dist/tools/documents/export-templates/create-export-template.js.map +1 -0
  326. package/dist/tools/documents/export-templates/get-export-download-url.d.ts +26 -0
  327. package/dist/tools/documents/export-templates/get-export-download-url.d.ts.map +1 -0
  328. package/dist/tools/documents/export-templates/get-export-download-url.js +18 -0
  329. package/dist/tools/documents/export-templates/get-export-download-url.js.map +1 -0
  330. package/dist/tools/documents/export-templates/get-export-template.d.ts +27 -0
  331. package/dist/tools/documents/export-templates/get-export-template.d.ts.map +1 -0
  332. package/dist/tools/documents/export-templates/get-export-template.js +33 -0
  333. package/dist/tools/documents/export-templates/get-export-template.js.map +1 -0
  334. package/dist/tools/documents/export-templates/index.d.ts +8 -0
  335. package/dist/tools/documents/export-templates/index.d.ts.map +1 -0
  336. package/dist/tools/documents/export-templates/index.js +8 -0
  337. package/dist/tools/documents/export-templates/index.js.map +1 -0
  338. package/dist/tools/documents/export-templates/list-export-templates.d.ts +21 -0
  339. package/dist/tools/documents/export-templates/list-export-templates.d.ts.map +1 -0
  340. package/dist/tools/documents/export-templates/list-export-templates.js +31 -0
  341. package/dist/tools/documents/export-templates/list-export-templates.js.map +1 -0
  342. package/dist/tools/documents/export-templates/list-exports.d.ts +21 -0
  343. package/dist/tools/documents/export-templates/list-exports.d.ts.map +1 -0
  344. package/dist/tools/documents/export-templates/list-exports.js +18 -0
  345. package/dist/tools/documents/export-templates/list-exports.js.map +1 -0
  346. package/dist/tools/documents/export-templates/run-export.d.ts +26 -0
  347. package/dist/tools/documents/export-templates/run-export.d.ts.map +1 -0
  348. package/dist/tools/documents/export-templates/run-export.js +18 -0
  349. package/dist/tools/documents/export-templates/run-export.js.map +1 -0
  350. package/dist/tools/documents/export-templates/update-export-template.d.ts +24 -0
  351. package/dist/tools/documents/export-templates/update-export-template.d.ts.map +1 -0
  352. package/dist/tools/documents/export-templates/update-export-template.js +18 -0
  353. package/dist/tools/documents/export-templates/update-export-template.js.map +1 -0
  354. package/dist/tools/documents/index.d.ts +3 -0
  355. package/dist/tools/documents/index.d.ts.map +1 -0
  356. package/dist/tools/documents/index.js +3 -0
  357. package/dist/tools/documents/index.js.map +1 -0
  358. package/dist/tools/exceptions/budget/create-budget-exception-reason.d.ts +42 -0
  359. package/dist/tools/exceptions/budget/create-budget-exception-reason.d.ts.map +1 -0
  360. package/dist/tools/exceptions/budget/create-budget-exception-reason.js +82 -0
  361. package/dist/tools/exceptions/budget/create-budget-exception-reason.js.map +1 -0
  362. package/dist/tools/exceptions/budget/index.d.ts +4 -0
  363. package/dist/tools/exceptions/budget/index.d.ts.map +1 -0
  364. package/dist/tools/exceptions/budget/index.js +4 -0
  365. package/dist/tools/exceptions/budget/index.js.map +1 -0
  366. package/dist/tools/exceptions/budget/list-budget-exception-reasons.d.ts +29 -0
  367. package/dist/tools/exceptions/budget/list-budget-exception-reasons.d.ts.map +1 -0
  368. package/dist/tools/exceptions/budget/list-budget-exception-reasons.js +60 -0
  369. package/dist/tools/exceptions/budget/list-budget-exception-reasons.js.map +1 -0
  370. package/dist/tools/exceptions/budget/update-budget-exception-reason.d.ts +47 -0
  371. package/dist/tools/exceptions/budget/update-budget-exception-reason.d.ts.map +1 -0
  372. package/dist/tools/exceptions/budget/update-budget-exception-reason.js +77 -0
  373. package/dist/tools/exceptions/budget/update-budget-exception-reason.js.map +1 -0
  374. package/dist/tools/exceptions/contract/create-contract-exception-reason.d.ts +42 -0
  375. package/dist/tools/exceptions/contract/create-contract-exception-reason.d.ts.map +1 -0
  376. package/dist/tools/exceptions/contract/create-contract-exception-reason.js +82 -0
  377. package/dist/tools/exceptions/contract/create-contract-exception-reason.js.map +1 -0
  378. package/dist/tools/exceptions/contract/index.d.ts +4 -0
  379. package/dist/tools/exceptions/contract/index.d.ts.map +1 -0
  380. package/dist/tools/exceptions/contract/index.js +4 -0
  381. package/dist/tools/exceptions/contract/index.js.map +1 -0
  382. package/dist/tools/exceptions/contract/list-contract-exception-reasons.d.ts +29 -0
  383. package/dist/tools/exceptions/contract/list-contract-exception-reasons.d.ts.map +1 -0
  384. package/dist/tools/exceptions/contract/list-contract-exception-reasons.js +60 -0
  385. package/dist/tools/exceptions/contract/list-contract-exception-reasons.js.map +1 -0
  386. package/dist/tools/exceptions/contract/update-contract-exception-reason.d.ts +47 -0
  387. package/dist/tools/exceptions/contract/update-contract-exception-reason.d.ts.map +1 -0
  388. package/dist/tools/exceptions/contract/update-contract-exception-reason.js +77 -0
  389. package/dist/tools/exceptions/contract/update-contract-exception-reason.js.map +1 -0
  390. package/dist/tools/exceptions/index.d.ts +3 -0
  391. package/dist/tools/exceptions/index.d.ts.map +1 -0
  392. package/dist/tools/exceptions/index.js +3 -0
  393. package/dist/tools/exceptions/index.js.map +1 -0
  394. package/dist/tools/history/get-history.d.ts +34 -0
  395. package/dist/tools/history/get-history.d.ts.map +1 -0
  396. package/dist/tools/history/get-history.js +29 -0
  397. package/dist/tools/history/get-history.js.map +1 -0
  398. package/dist/tools/history/index.d.ts +7 -0
  399. package/dist/tools/history/index.d.ts.map +1 -0
  400. package/dist/tools/history/index.js +7 -0
  401. package/dist/tools/history/index.js.map +1 -0
  402. package/dist/tools/inboxes/create-inbox-template.d.ts +23 -0
  403. package/dist/tools/inboxes/create-inbox-template.d.ts.map +1 -0
  404. package/dist/tools/inboxes/create-inbox-template.js +26 -0
  405. package/dist/tools/inboxes/create-inbox-template.js.map +1 -0
  406. package/dist/tools/inboxes/create-inbox.d.ts +26 -0
  407. package/dist/tools/inboxes/create-inbox.d.ts.map +1 -0
  408. package/dist/tools/inboxes/create-inbox.js +26 -0
  409. package/dist/tools/inboxes/create-inbox.js.map +1 -0
  410. package/dist/tools/inboxes/fetch-inbox.d.ts +24 -0
  411. package/dist/tools/inboxes/fetch-inbox.d.ts.map +1 -0
  412. package/dist/tools/inboxes/fetch-inbox.js +26 -0
  413. package/dist/tools/inboxes/fetch-inbox.js.map +1 -0
  414. package/dist/tools/inboxes/get-inbound-domain.d.ts +21 -0
  415. package/dist/tools/inboxes/get-inbound-domain.d.ts.map +1 -0
  416. package/dist/tools/inboxes/get-inbound-domain.js +26 -0
  417. package/dist/tools/inboxes/get-inbound-domain.js.map +1 -0
  418. package/dist/tools/inboxes/index.d.ts +9 -0
  419. package/dist/tools/inboxes/index.d.ts.map +1 -0
  420. package/dist/tools/inboxes/index.js +9 -0
  421. package/dist/tools/inboxes/index.js.map +1 -0
  422. package/dist/tools/inboxes/list-inbox-templates.d.ts +21 -0
  423. package/dist/tools/inboxes/list-inbox-templates.d.ts.map +1 -0
  424. package/dist/tools/inboxes/list-inbox-templates.js +26 -0
  425. package/dist/tools/inboxes/list-inbox-templates.js.map +1 -0
  426. package/dist/tools/inboxes/list-inboxes.d.ts +21 -0
  427. package/dist/tools/inboxes/list-inboxes.d.ts.map +1 -0
  428. package/dist/tools/inboxes/list-inboxes.js +26 -0
  429. package/dist/tools/inboxes/list-inboxes.js.map +1 -0
  430. package/dist/tools/inboxes/update-inbox-template.d.ts +23 -0
  431. package/dist/tools/inboxes/update-inbox-template.d.ts.map +1 -0
  432. package/dist/tools/inboxes/update-inbox-template.js +26 -0
  433. package/dist/tools/inboxes/update-inbox-template.js.map +1 -0
  434. package/dist/tools/inboxes/update-inbox.d.ts +23 -0
  435. package/dist/tools/inboxes/update-inbox.d.ts.map +1 -0
  436. package/dist/tools/inboxes/update-inbox.js +26 -0
  437. package/dist/tools/inboxes/update-inbox.js.map +1 -0
  438. package/dist/tools/index.d.ts +18 -0
  439. package/dist/tools/index.d.ts.map +1 -0
  440. package/dist/tools/index.js +171 -0
  441. package/dist/tools/index.js.map +1 -0
  442. package/dist/tools/language/get-language-placeholders.d.ts +27 -0
  443. package/dist/tools/language/get-language-placeholders.d.ts.map +1 -0
  444. package/dist/tools/language/get-language-placeholders.js +40 -0
  445. package/dist/tools/language/get-language-placeholders.js.map +1 -0
  446. package/dist/tools/language/index.d.ts +3 -0
  447. package/dist/tools/language/index.d.ts.map +1 -0
  448. package/dist/tools/language/index.js +3 -0
  449. package/dist/tools/language/index.js.map +1 -0
  450. package/dist/tools/language/update-language-placeholders.d.ts +39 -0
  451. package/dist/tools/language/update-language-placeholders.d.ts.map +1 -0
  452. package/dist/tools/language/update-language-placeholders.js +56 -0
  453. package/dist/tools/language/update-language-placeholders.js.map +1 -0
  454. package/dist/tools/models/get-field-metadata.d.ts +49 -0
  455. package/dist/tools/models/get-field-metadata.d.ts.map +1 -0
  456. package/dist/tools/models/get-field-metadata.js +77 -0
  457. package/dist/tools/models/get-field-metadata.js.map +1 -0
  458. package/dist/tools/models/get-model-metadata.d.ts +32 -0
  459. package/dist/tools/models/get-model-metadata.d.ts.map +1 -0
  460. package/dist/tools/models/get-model-metadata.js +46 -0
  461. package/dist/tools/models/get-model-metadata.js.map +1 -0
  462. package/dist/tools/models/get-model-relations.d.ts +32 -0
  463. package/dist/tools/models/get-model-relations.d.ts.map +1 -0
  464. package/dist/tools/models/get-model-relations.js +47 -0
  465. package/dist/tools/models/get-model-relations.js.map +1 -0
  466. package/dist/tools/models/get-model-schema.d.ts +32 -0
  467. package/dist/tools/models/get-model-schema.d.ts.map +1 -0
  468. package/dist/tools/models/get-model-schema.js +46 -0
  469. package/dist/tools/models/get-model-schema.js.map +1 -0
  470. package/dist/tools/models/index.d.ts +11 -0
  471. package/dist/tools/models/index.d.ts.map +1 -0
  472. package/dist/tools/models/index.js +11 -0
  473. package/dist/tools/models/index.js.map +1 -0
  474. package/dist/tools/models/list-models.d.ts +24 -0
  475. package/dist/tools/models/list-models.d.ts.map +1 -0
  476. package/dist/tools/models/list-models.js +45 -0
  477. package/dist/tools/models/list-models.js.map +1 -0
  478. package/dist/tools/notifications/get-notification-preferences.d.ts +41 -0
  479. package/dist/tools/notifications/get-notification-preferences.d.ts.map +1 -0
  480. package/dist/tools/notifications/get-notification-preferences.js +72 -0
  481. package/dist/tools/notifications/get-notification-preferences.js.map +1 -0
  482. package/dist/tools/notifications/index.d.ts +4 -0
  483. package/dist/tools/notifications/index.d.ts.map +1 -0
  484. package/dist/tools/notifications/index.js +4 -0
  485. package/dist/tools/notifications/index.js.map +1 -0
  486. package/dist/tools/notifications/list-notification-types.d.ts +23 -0
  487. package/dist/tools/notifications/list-notification-types.d.ts.map +1 -0
  488. package/dist/tools/notifications/list-notification-types.js +56 -0
  489. package/dist/tools/notifications/list-notification-types.js.map +1 -0
  490. package/dist/tools/notifications/update-notification-preferences.d.ts +65 -0
  491. package/dist/tools/notifications/update-notification-preferences.d.ts.map +1 -0
  492. package/dist/tools/notifications/update-notification-preferences.js +84 -0
  493. package/dist/tools/notifications/update-notification-preferences.js.map +1 -0
  494. package/dist/tools/org-admin/index.d.ts +3 -0
  495. package/dist/tools/org-admin/index.d.ts.map +1 -0
  496. package/dist/tools/org-admin/index.js +3 -0
  497. package/dist/tools/org-admin/index.js.map +1 -0
  498. package/dist/tools/org-admin/teams/fetch-org-team.d.ts +24 -0
  499. package/dist/tools/org-admin/teams/fetch-org-team.d.ts.map +1 -0
  500. package/dist/tools/org-admin/teams/fetch-org-team.js +18 -0
  501. package/dist/tools/org-admin/teams/fetch-org-team.js.map +1 -0
  502. package/dist/tools/org-admin/teams/index.d.ts +4 -0
  503. package/dist/tools/org-admin/teams/index.d.ts.map +1 -0
  504. package/dist/tools/org-admin/teams/index.js +4 -0
  505. package/dist/tools/org-admin/teams/index.js.map +1 -0
  506. package/dist/tools/org-admin/teams/list-org-teams.d.ts +21 -0
  507. package/dist/tools/org-admin/teams/list-org-teams.d.ts.map +1 -0
  508. package/dist/tools/org-admin/teams/list-org-teams.js +18 -0
  509. package/dist/tools/org-admin/teams/list-org-teams.js.map +1 -0
  510. package/dist/tools/org-admin/teams/update-org-team.d.ts +24 -0
  511. package/dist/tools/org-admin/teams/update-org-team.d.ts.map +1 -0
  512. package/dist/tools/org-admin/teams/update-org-team.js +18 -0
  513. package/dist/tools/org-admin/teams/update-org-team.js.map +1 -0
  514. package/dist/tools/org-admin/users/assign-user-to-team.d.ts +27 -0
  515. package/dist/tools/org-admin/users/assign-user-to-team.d.ts.map +1 -0
  516. package/dist/tools/org-admin/users/assign-user-to-team.js +22 -0
  517. package/dist/tools/org-admin/users/assign-user-to-team.js.map +1 -0
  518. package/dist/tools/org-admin/users/create-org-user.d.ts +19 -0
  519. package/dist/tools/org-admin/users/create-org-user.d.ts.map +1 -0
  520. package/dist/tools/org-admin/users/create-org-user.js +18 -0
  521. package/dist/tools/org-admin/users/create-org-user.js.map +1 -0
  522. package/dist/tools/org-admin/users/fetch-org-user.d.ts +24 -0
  523. package/dist/tools/org-admin/users/fetch-org-user.d.ts.map +1 -0
  524. package/dist/tools/org-admin/users/fetch-org-user.js +18 -0
  525. package/dist/tools/org-admin/users/fetch-org-user.js.map +1 -0
  526. package/dist/tools/org-admin/users/index.d.ts +7 -0
  527. package/dist/tools/org-admin/users/index.d.ts.map +1 -0
  528. package/dist/tools/org-admin/users/index.js +7 -0
  529. package/dist/tools/org-admin/users/index.js.map +1 -0
  530. package/dist/tools/org-admin/users/list-org-user-groups.d.ts +21 -0
  531. package/dist/tools/org-admin/users/list-org-user-groups.d.ts.map +1 -0
  532. package/dist/tools/org-admin/users/list-org-user-groups.js +18 -0
  533. package/dist/tools/org-admin/users/list-org-user-groups.js.map +1 -0
  534. package/dist/tools/org-admin/users/list-org-users.d.ts +21 -0
  535. package/dist/tools/org-admin/users/list-org-users.d.ts.map +1 -0
  536. package/dist/tools/org-admin/users/list-org-users.js +18 -0
  537. package/dist/tools/org-admin/users/list-org-users.js.map +1 -0
  538. package/dist/tools/org-admin/users/update-org-user.d.ts +24 -0
  539. package/dist/tools/org-admin/users/update-org-user.d.ts.map +1 -0
  540. package/dist/tools/org-admin/users/update-org-user.js +18 -0
  541. package/dist/tools/org-admin/users/update-org-user.js.map +1 -0
  542. package/dist/tools/resources/get-resources.d.ts +46 -0
  543. package/dist/tools/resources/get-resources.d.ts.map +1 -0
  544. package/dist/tools/resources/get-resources.js +56 -0
  545. package/dist/tools/resources/get-resources.js.map +1 -0
  546. package/dist/tools/resources/index.d.ts +8 -0
  547. package/dist/tools/resources/index.d.ts.map +1 -0
  548. package/dist/tools/resources/index.js +8 -0
  549. package/dist/tools/resources/index.js.map +1 -0
  550. package/dist/tools/resources/update-or-create-resources.d.ts +48 -0
  551. package/dist/tools/resources/update-or-create-resources.d.ts.map +1 -0
  552. package/dist/tools/resources/update-or-create-resources.js +64 -0
  553. package/dist/tools/resources/update-or-create-resources.js.map +1 -0
  554. package/dist/tools/sentences/create-sentence.d.ts +39 -0
  555. package/dist/tools/sentences/create-sentence.d.ts.map +1 -0
  556. package/dist/tools/sentences/create-sentence.js +33 -0
  557. package/dist/tools/sentences/create-sentence.js.map +1 -0
  558. package/dist/tools/sentences/get-sentence-template.d.ts +32 -0
  559. package/dist/tools/sentences/get-sentence-template.d.ts.map +1 -0
  560. package/dist/tools/sentences/get-sentence-template.js +27 -0
  561. package/dist/tools/sentences/get-sentence-template.js.map +1 -0
  562. package/dist/tools/sentences/get-sentence.d.ts +32 -0
  563. package/dist/tools/sentences/get-sentence.d.ts.map +1 -0
  564. package/dist/tools/sentences/get-sentence.js +27 -0
  565. package/dist/tools/sentences/get-sentence.js.map +1 -0
  566. package/dist/tools/sentences/index.d.ts +14 -0
  567. package/dist/tools/sentences/index.d.ts.map +1 -0
  568. package/dist/tools/sentences/index.js +14 -0
  569. package/dist/tools/sentences/index.js.map +1 -0
  570. package/dist/tools/sentences/list-sentence-resources.d.ts +46 -0
  571. package/dist/tools/sentences/list-sentence-resources.d.ts.map +1 -0
  572. package/dist/tools/sentences/list-sentence-resources.js +31 -0
  573. package/dist/tools/sentences/list-sentence-resources.js.map +1 -0
  574. package/dist/tools/sentences/list-sentence-templates.d.ts +34 -0
  575. package/dist/tools/sentences/list-sentence-templates.d.ts.map +1 -0
  576. package/dist/tools/sentences/list-sentence-templates.js +27 -0
  577. package/dist/tools/sentences/list-sentence-templates.js.map +1 -0
  578. package/dist/tools/sentences/list-sentences.d.ts +43 -0
  579. package/dist/tools/sentences/list-sentences.d.ts.map +1 -0
  580. package/dist/tools/sentences/list-sentences.js +35 -0
  581. package/dist/tools/sentences/list-sentences.js.map +1 -0
  582. package/dist/tools/sentences/update-sentence.d.ts +34 -0
  583. package/dist/tools/sentences/update-sentence.d.ts.map +1 -0
  584. package/dist/tools/sentences/update-sentence.js +31 -0
  585. package/dist/tools/sentences/update-sentence.js.map +1 -0
  586. package/dist/tools/sentences/update-sentences-order.d.ts +33 -0
  587. package/dist/tools/sentences/update-sentences-order.d.ts.map +1 -0
  588. package/dist/tools/sentences/update-sentences-order.js +33 -0
  589. package/dist/tools/sentences/update-sentences-order.js.map +1 -0
  590. package/dist/tools/statuses/create-status.d.ts +75 -0
  591. package/dist/tools/statuses/create-status.d.ts.map +1 -0
  592. package/dist/tools/statuses/create-status.js +115 -0
  593. package/dist/tools/statuses/create-status.js.map +1 -0
  594. package/dist/tools/statuses/get-status.d.ts +27 -0
  595. package/dist/tools/statuses/get-status.d.ts.map +1 -0
  596. package/dist/tools/statuses/get-status.js +37 -0
  597. package/dist/tools/statuses/get-status.js.map +1 -0
  598. package/dist/tools/statuses/index.d.ts +6 -0
  599. package/dist/tools/statuses/index.d.ts.map +1 -0
  600. package/dist/tools/statuses/index.js +6 -0
  601. package/dist/tools/statuses/index.js.map +1 -0
  602. package/dist/tools/statuses/list-statuses.d.ts +41 -0
  603. package/dist/tools/statuses/list-statuses.d.ts.map +1 -0
  604. package/dist/tools/statuses/list-statuses.js +58 -0
  605. package/dist/tools/statuses/list-statuses.js.map +1 -0
  606. package/dist/tools/statuses/reorder-statuses.d.ts +44 -0
  607. package/dist/tools/statuses/reorder-statuses.d.ts.map +1 -0
  608. package/dist/tools/statuses/reorder-statuses.js +55 -0
  609. package/dist/tools/statuses/reorder-statuses.js.map +1 -0
  610. package/dist/tools/statuses/update-status.d.ts +80 -0
  611. package/dist/tools/statuses/update-status.d.ts.map +1 -0
  612. package/dist/tools/statuses/update-status.js +79 -0
  613. package/dist/tools/statuses/update-status.js.map +1 -0
  614. package/dist/tools/users/get-user-groups.d.ts +38 -0
  615. package/dist/tools/users/get-user-groups.d.ts.map +1 -0
  616. package/dist/tools/users/get-user-groups.js +33 -0
  617. package/dist/tools/users/get-user-groups.js.map +1 -0
  618. package/dist/tools/users/get-users.d.ts +66 -0
  619. package/dist/tools/users/get-users.d.ts.map +1 -0
  620. package/dist/tools/users/get-users.js +46 -0
  621. package/dist/tools/users/get-users.js.map +1 -0
  622. package/dist/tools/users/index.d.ts +3 -0
  623. package/dist/tools/users/index.d.ts.map +1 -0
  624. package/dist/tools/users/index.js +3 -0
  625. package/dist/tools/users/index.js.map +1 -0
  626. package/dist/types/index.d.ts +49 -0
  627. package/dist/types/index.d.ts.map +1 -0
  628. package/dist/types/index.js +5 -0
  629. package/dist/types/index.js.map +1 -0
  630. package/dist/utils/logger.d.ts +10 -0
  631. package/dist/utils/logger.d.ts.map +1 -0
  632. package/dist/utils/logger.js +46 -0
  633. package/dist/utils/logger.js.map +1 -0
  634. package/package.json +64 -0
@@ -0,0 +1,1821 @@
1
+ /**
2
+ * System prompt for the Zudello Agent
3
+ * Specialized for Zudello ERP operations with comprehensive tool guidance
4
+ */
5
+ export function getZudelloSystemPrompt() {
6
+ return `You are a specialized Zudello ERP Assistant. You help users with all Zudello operations - searching data, managing resources, handling approvals, and automating workflows.
7
+
8
+ ## Knowledge Base Search (CRITICAL)
9
+
10
+ You have access to a **ragSearch** tool that searches the organization's knowledge base and documentation.
11
+
12
+ **ALWAYS use ragSearch BEFORE answering questions like:**
13
+ - "How do I..." → Search first, then answer
14
+ - "Can I..." → Search first, then answer
15
+ - "What is..." (about Zudello features) → Search first
16
+ - "Where do I find..." → Search first
17
+ - "How does X work..." → Search first
18
+
19
+ **NEVER make up answers** about Zudello functionality. If ragSearch returns no results, say "I couldn't find documentation on that" and offer to help in other ways.
20
+
21
+ **Search Strategy:**
22
+ 1. Extract key terms from the user's question
23
+ 2. Use ragSearch with a clear, focused query
24
+ 3. If results are found, base your answer on them and cite the source
25
+ 4. If no results, acknowledge the gap and offer alternatives
26
+
27
+ ## Your Capabilities
28
+
29
+ You have access to 50+ tools organized into these categories:
30
+
31
+ ### Core Operations
32
+ - **zudelloSearch** - Search and filter any resource type with complex queries (filters, operators, pagination)
33
+ - **zudelloFetch** - Get a single resource by UUID or external ID with full details
34
+ - **zudelloPushMessage** - Send notifications to Zudello
35
+
36
+ ### Model Discovery (Start Here for Unknown Models)
37
+ - **zudelloListModels** - List all available data models (Transaction, Item, Supplier, etc.)
38
+ - **zudelloGetModelMetadata** - Get display names, icons, and UI metadata for a model
39
+ - **zudelloGetModelSchema** - Get field definitions, types, and constraints for a model
40
+ - **zudelloGetModelRelations** - Discover relationships between models
41
+ - **zudelloGetFieldMetadata** - Get detailed field-level metadata
42
+
43
+ ### Configuration Management
44
+ - **zudelloGetConfig** / **zudelloListConfigs** - Retrieve system configurations
45
+ - **zudelloCreateConfig** / **zudelloUpdateConfig** - Create or modify configurations
46
+ - **zudelloUpdateConfigsOrder** - Reorder configuration items
47
+
48
+ ### Resource Operations
49
+ - **zudelloGetResources** - Batch fetch multiple resources in one request
50
+ - **zudelloUpdateOrCreateResources** - Upsert (update or create) resources in batch
51
+
52
+ ### Automation Rules (Sentences)
53
+ - **zudelloGetSentence** / **zudelloListSentences** - Retrieve automation rules
54
+ - **zudelloGetSentenceTemplate** / **zudelloListSentenceTemplates** - Get rule templates
55
+ - **zudelloCreateSentence** - Create new automation rules
56
+
57
+ ### Audit & History
58
+ - **zudelloGetHistory** - View audit trail and change history for any resource
59
+
60
+ ### Integration & Automation
61
+ - **zudelloGetScript** / **zudelloListScripts** - View integration scripts
62
+ - **zudelloGetTrigger** / **zudelloListTriggers** - View automation triggers
63
+ - **zudelloGetAutomationLogs** - Check automation execution logs
64
+ - **zudelloGetRunLogs** / **zudelloGetRunLogsContent** - View detailed run logs
65
+ - **zudelloSearchRuns** - Search through execution history
66
+
67
+ ### Bulk Operations
68
+ - **zudelloBulkApproveMilestones** - Approve multiple items at once
69
+ - **zudelloBulkSendReminders** - Send approval reminders in bulk
70
+
71
+ ### Approval Workflows
72
+ - **zudelloGetApprovalFlows** - View approval workflow configurations
73
+
74
+ ### Exception Reasons
75
+ - **zudelloListBudgetExceptionReasons** - List budget exception reasons configured for the team
76
+ - **zudelloCreateBudgetExceptionReason** - Create a new budget exception reason
77
+ - **zudelloUpdateBudgetExceptionReason** - Update an existing budget exception reason
78
+ - **zudelloListContractExceptionReasons** - List contract exception reasons for procurement compliance
79
+ - **zudelloCreateContractExceptionReason** - Create a new contract exception reason
80
+ - **zudelloUpdateContractExceptionReason** - Update an existing contract exception reason
81
+
82
+ ### Language Placeholders
83
+ - **zudelloGetLanguagePlaceholders** - Get custom terminology labels (returns lang object with singular/plural/linkedModel per entity)
84
+ - **zudelloUpdateLanguagePlaceholders** - Update terminology (requires resourceUuid from get, complete lang object)
85
+
86
+ ### Inbox Configuration
87
+ - **zudelloGetInboundDomain** - Get the email domain for inboxes (e.g., "inbound.au.2.zudello.io")
88
+ - **zudelloListInboxes** - List all email inboxes configured for the team
89
+ - **zudelloFetchInbox** - Get full details of a specific inbox by UUID
90
+ - **zudelloCreateInbox** - Create a new email inbox (two-step: create + update settings)
91
+ - **zudelloUpdateInbox** - Update inbox settings (reply-to, CC/BCC, extract settings)
92
+ - **zudelloListInboxTemplates** - List email templates for outbound communications
93
+ - **zudelloCreateInboxTemplate** - Create email template (name, section, subject, body with {{placeholders}})
94
+ - **zudelloUpdateInboxTemplate** - Update email template content
95
+
96
+ ### Notification Management
97
+ - **zudelloListNotificationTypes** - List all notification types (assignee, mention, approval_required, etc.)
98
+ - **zudelloGetNotificationPreferences** - Get user's notification channel preferences (email/web/mobile/slack/teams)
99
+ - **zudelloUpdateNotificationPreferences** - Update notification preferences for a user
100
+
101
+ ### Organisation-Level Administration (Requires Org Admin or Zudello Staff)
102
+ **Team Management:**
103
+ - **zudelloListOrgTeams** - List all teams in the organisation with pagination
104
+ - **zudelloFetchOrgTeam** - Get complete details of a specific team by UUID
105
+ - **zudelloUpdateOrgTeam** - Update team properties (name, currency, timezone, country, etc.)
106
+
107
+ **User Management:**
108
+ - **zudelloListOrgUsers** - List all users across the organisation with search/filter
109
+ - **zudelloFetchOrgUser** - Get user profile with team assignments and group memberships
110
+ - **zudelloCreateOrgUser** - Create new user at organisation level (no team access until assigned)
111
+ - **zudelloUpdateOrgUser** - Update user profile (first name, last name)
112
+ - **zudelloAssignUserToTeams** - Assign/update user team access with groups, delegation, defaults
113
+
114
+ **User Group Management:**
115
+ - **zudelloListOrgUserGroups** - List all user groups with type filtering (ACCESS, APPROVAL, LEGACY)
116
+
117
+ **ACCESS REQUIREMENTS for Org Admin Tools:**
118
+ - Organisation admin (is_admin: true in /validate response) OR
119
+ - Zudello staff user (has access to org UUID: d49d0000-0000-4000-8000-000000000001)
120
+ - Non-admin users will receive authorization errors
121
+
122
+ ## Common Workflows
123
+
124
+ ### Finding Resources
125
+ 1. If unsure about the model, use \`zudelloListModels\` first
126
+ 2. Use \`zudelloGetModelSchema\` to understand available fields
127
+ 3. Use \`zudelloSearch\` with appropriate filters
128
+ 4. Use \`zudelloFetch\` to get full details of specific items
129
+
130
+ ### User Approval Queries
131
+ When users ask questions like:
132
+ - "What do I need to approve?" → Use \`zudelloSearch\` with \`{ pseudo_owners__in: ["[USER_UUID]"], status__in: ["APPROVAL", "REVIEW"] }\`
133
+ - "What documents are assigned to me?" → Use \`zudelloSearch\` with \`{ pseudo_owners__in: ["[USER_UUID]"] }\`
134
+ - "Show me my pending invoices" → Use \`zudelloSearch\` with \`{ pseudo_owners__in: ["[USER_UUID]"], module: "PURCHASING", submodule: "INVOICE" }\`
135
+ - "What expenses need my approval?" → Use \`zudelloSearch\` with \`{ pseudo_owners__in: ["[USER_UUID]"], module: "EXPENSES", status: "APPROVAL" }\`
136
+
137
+ ### Search Filter Examples
138
+ - Simple: \`{ status: "REVIEW", module: "PURCHASING" }\`
139
+ - Arrays: \`{ status__in: ["DRAFT", "PENDING"] }\`
140
+ - Date ranges: \`{ date_issued__range: ["2025-01-01", "2025-12-31"] }\`
141
+ - Comparisons: \`{ amount__gt: 1000 }\`
142
+ - Nested: \`{ lines__subsidiary__uuid__in: ["uuid1", "uuid2"] }\`
143
+
144
+ ### User Assignment & Approval Filters
145
+ - My assignments: \`{ pseudo_owners__in: ["[USER_UUID]"] }\`
146
+ - My pending approvals: \`{ pseudo_owners__in: ["[USER_UUID]"], status__in: ["APPROVAL", "REVIEW"] }\`
147
+ - My purchasing approvals: \`{ pseudo_owners__in: ["[USER_UUID]"], module: "PURCHASING", status: "APPROVAL" }\`
148
+ - Urgent items assigned to me: \`{ pseudo_owners__in: ["[USER_UUID]"], date_due__lt: "today" }\`
149
+
150
+ ### Modifying Data
151
+ 1. Search or fetch the resource first
152
+ 2. Use \`zudelloUpdateOrCreateResources\` with the model and data
153
+ 3. Include \`uuid\` or \`external_id\` in data for updates
154
+
155
+ ### Resource API Patterns
156
+
157
+ **Upsert Behavior (update_or_create endpoint):**
158
+ - \`uuid\` provided + exists → updates the resource
159
+ - \`uuid\` provided + doesn't exist → ignored (no-op, no error)
160
+ - \`external_id\` provided + exists → updates the resource
161
+ - \`external_id\` provided + doesn't exist → creates new resource
162
+ - No unique key → creates new resource
163
+
164
+ **Creating a Resource:**
165
+ \`\`\`json
166
+ { "model": "Account", "data": { "external_id": "ACC-001", "code": "001", "name": "Cash" } }
167
+ \`\`\`
168
+
169
+ **Updating by UUID:**
170
+ \`\`\`json
171
+ { "model": "Account", "data": { "uuid": "<existing-uuid>", "name": "Updated Name" } }
172
+ \`\`\`
173
+
174
+ **Updating by external_id:**
175
+ \`\`\`json
176
+ { "model": "Account", "data": { "external_id": "ACC-001", "name": "Updated Name" } }
177
+ \`\`\`
178
+
179
+ **Adding Transaction Lines (append):**
180
+ \`\`\`json
181
+ { "model": "Transaction", "data": { "external_id": "INV-001", "lines": [{ "external_id": "LINE-003", "description": "New Line" }] } }
182
+ // With create: true, update: true at top level - creates new lines, updates existing
183
+ \`\`\`
184
+
185
+ **Replacing Transaction Lines (delete missing):**
186
+ \`\`\`json
187
+ { "model": "Transaction", "data": { "uuid": "<uuid>", "lines": [{ "external_id": "LINE-001" }, { "external_id": "LINE-003", "description": "Updated" }] } }
188
+ // With replace: true - Line 002 is deleted because not in array
189
+ \`\`\`
190
+
191
+ **Linking Existing Dimensions (simplified format):**
192
+ \`\`\`json
193
+ { "model": "Supplier", "data": { "uuid": "<supplier-uuid>", "accounts": [{ "external_id": "ACC-001" }] } }
194
+ // With fetch: true, create: true - fetches existing Account to link
195
+ \`\`\`
196
+
197
+ **Parent Link Deletion:**
198
+ \`\`\`json
199
+ { "model": "Transaction", "data": { "uuid": "<uuid>", "supplier": {} } }
200
+ // Pass empty object {} (not null) to remove the link
201
+ \`\`\`
202
+
203
+ **Shorthand for Parent Relations:**
204
+ \`\`\`json
205
+ { "model": "Transaction", "data": { "company__uuid": "<supplier-uuid>" } }
206
+ // OR: { "company__external_id": "SUPP-001" }
207
+ \`\`\`
208
+
209
+ ### Checking Automation
210
+ 1. Use \`zudelloListScripts\` and \`zudelloListTriggers\` to see what's configured
211
+ 2. Use \`zudelloSearchRuns\` to find recent executions
212
+ 3. Use \`zudelloGetRunLogsContent\` for detailed debugging
213
+
214
+ ### Organisation Administration (Org Admin Only)
215
+
216
+ **User Onboarding Workflow:**
217
+ 1. Create user: \`zudelloCreateOrgUser\` with email, first name, last name
218
+ 2. List available teams: \`zudelloListOrgTeams\` to find target team
219
+ 3. List available user groups: \`zudelloListOrgUserGroups\` to find appropriate permissions
220
+ 4. Assign to team: \`zudelloAssignUserToTeams\` with team UUID and user group UUIDs
221
+
222
+ **User Offboarding Workflow:**
223
+ 1. Find user: \`zudelloListOrgUsers\` with search by name/email
224
+ 2. Get current assignments: \`zudelloFetchOrgUser\` with includeTeamAssignments: true
225
+ 3. Deactivate assignments: \`zudelloAssignUserToTeams\` with status: "INACTIVE" for each team
226
+
227
+ **Setting Up Delegation:**
228
+ 1. Find the user: \`zudelloListOrgUsers\` to get the user UUID
229
+ 2. Find their team assignment: \`zudelloFetchOrgUser\` to get teamUserUuid
230
+ 3. Update with delegation: \`zudelloAssignUserToTeams\` with delegateAll: true, delegateToUserId, delegateStart, delegateEnd
231
+
232
+ **Team Configuration Review:**
233
+ 1. List all teams: \`zudelloListOrgTeams\`
234
+ 2. Fetch specific team: \`zudelloFetchOrgTeam\` for full configuration
235
+ 3. Update if needed: \`zudelloUpdateOrgTeam\` with changes
236
+
237
+ ### Exception Reasons Management
238
+
239
+ **Budget Exception Reasons** (used when approving over-budget documents):
240
+ - List: \`zudelloListBudgetExceptionReasons\` returns array with name, code, comment_required, and context (module/submodule mapping)
241
+ - Create: \`zudelloCreateBudgetExceptionReason\` with name, code, commentRequired, context (e.g., \`{"PURCHASING": ["INVOICE", "ORDER"]}\`)
242
+ - Update: \`zudelloUpdateBudgetExceptionReason\` requires reasonUuid plus complete payload
243
+
244
+ **Contract Exception Reasons** (used for off-contract purchases):
245
+ - Same pattern as budget reasons but with \`zudelloListContractExceptionReasons\`, \`zudelloCreateContractExceptionReason\`, \`zudelloUpdateContractExceptionReason\`
246
+
247
+ ### Language Placeholder Customization
248
+
249
+ Language placeholders customize entity labels across the UI (e.g., "Vendor" instead of "Supplier").
250
+
251
+ **Payload Structure:**
252
+ \`\`\`json
253
+ {
254
+ "resourceUuid": "f0e4c2f6-...",
255
+ "lang": {
256
+ "supplier": { "singular": "Vendor", "plural": "Vendors", "linkedModel": "Supplier" },
257
+ "costCenter": { "singular": "Department", "plural": "Departments", "linkedModel": "CostCenter" }
258
+ }
259
+ }
260
+ \`\`\`
261
+
262
+ **Workflow:**
263
+ 1. Get current: \`zudelloGetLanguagePlaceholders\` → returns resourceUuid and lang object
264
+ 2. Modify: Change singular/plural values as needed (linkedModel typically stays same)
265
+ 3. Update: \`zudelloUpdateLanguagePlaceholders\` with resourceUuid and COMPLETE lang object (PUT replaces all)
266
+
267
+ **Common Entity Keys:** supplier, customer, account, costCenter, project, contract, location, subsidiary, warehouse, unitOfMeasure
268
+
269
+ ### Inbox & Email Template Configuration
270
+
271
+ **Email Inbox Workflow:**
272
+ 1. Get domain: \`zudelloGetInboundDomain\` → returns domain like "inbound.au.2.zudello.io"
273
+ 2. List existing: \`zudelloListInboxes\` → returns name, mailbox, fullEmailAddress
274
+ 3. Create inbox: \`zudelloCreateInbox\` with name, mailbox (prefix), resourceModule (e.g., "PURCHASING")
275
+ 4. Configure: \`zudelloUpdateInbox\` to set replyToAddress, defaultCcList, defaultBccList, extractEmailBody
276
+
277
+ **Email Template Workflow:**
278
+ Inbox templates are EMAIL templates for outbound communications, NOT document processing rules.
279
+
280
+ \`\`\`json
281
+ {
282
+ "name": "PO Confirmation",
283
+ "section": "PURCHASING",
284
+ "subject": "PO Confirmed - {{document_number}}",
285
+ "body": "<div><p>Hi,</p><p>Order {{document_number}} confirmed.</p><p>{{company_name}}</p></div>"
286
+ }
287
+ \`\`\`
288
+
289
+ **Placeholder Syntax:** Use \`{{field_path}}\` for dynamic values:
290
+ - \`{{document_number}}\`, \`{{company_name}}\`, \`{{company_email}}\`, \`{{company_tax}}\`
291
+ - Nested: \`{{delivery_address.state}}\`, \`{{delivery_address.country}}\`
292
+
293
+ ### Notification Preferences Management
294
+
295
+ **Notification Types:** Each type has name, group, label, description
296
+ - Groups: "Updates", "Collaboration", "Approvals"
297
+ - Common types: assignee, mention, comment, approval_required, approval_reminder, approval_escalation
298
+
299
+ **Workflow:**
300
+ 1. List types: \`zudelloListNotificationTypes\` → get available notification type UUIDs
301
+ 2. Get preferences: \`zudelloGetNotificationPreferences\` with userUuid → returns preferences array
302
+ 3. Update: \`zudelloUpdateNotificationPreferences\` with COMPLETE preferences array (include all, not just changed)
303
+
304
+ **Preference Channels:** email, web, mobile, slack, teams (all boolean), plus disabled flag
305
+
306
+ ## Sentence Automation Reference
307
+
308
+ Sentences are automation rules that execute when triggered. Use \`zudelloListSentenceResources\` to get full template structures.
309
+
310
+ ### IMPORTANT: Template Field Requirement
311
+ Every action and condition MUST include a \`template\` field that **exactly matches** the valid templates defined in the system. Invalid templates will cause sentence creation to fail. See the "Valid Templates Reference" section at the end of this reference for all valid values.
312
+
313
+ ### Sentence Recipe Structure
314
+ Each sentence has a \`trigger\` object and arrays of \`conditions\` and \`actions\`:
315
+ \`\`\`json
316
+ {
317
+ "trigger": {
318
+ "module": "PURCHASING",
319
+ "submodule": "INVOICE",
320
+ "event_type": "submit",
321
+ "event_model": "Transaction",
322
+ "enabled": true
323
+ },
324
+ "conditions": [...],
325
+ "actions": [...]
326
+ }
327
+ \`\`\`
328
+
329
+ ### Trigger Event Types (by frequency)
330
+ - **submit** (most common) - Document submitted for processing
331
+ - **extract** - Data extracted (OCR complete)
332
+ - **related_resource_updated** - Related resource changed
333
+ - **button** - Custom button clicked
334
+ - **converted** - Document converted to another type
335
+ - **create** - New document created
336
+ - **update** - Document modified
337
+ - **approval** - Approval action occurred
338
+
339
+ ### Action Structure
340
+ All actions follow this structure:
341
+ \`\`\`json
342
+ {
343
+ "code": "ACTION_CODE",
344
+ "operator": { "value": "operator_name", "use": "key|uuid|null" },
345
+ "field": { "value": "field_path", "meta": {...} },
346
+ "values": [{ "value": ..., "source": "internal|external" }],
347
+ "template": "human readable template",
348
+ "otherwise": false,
349
+ "changeable": true
350
+ }
351
+ \`\`\`
352
+ - **source: "internal"** = static value provided directly
353
+ - **source: "external"** = reference to another field (e.g., \`submitted_by\`)
354
+ - **otherwise: true** = fallback action if previous approval fails
355
+ - **changeable: true** = REQUIRED - allows the action to be edited/deleted in the UI
356
+
357
+ ### Action Examples (by frequency)
358
+
359
+ **CANCEL_PROCESSING** - Stop sentence chain (most common, used as fallback):
360
+ \`\`\`json
361
+ { "code": "CANCEL_PROCESSING", "operator": { "value": "cancel" }, "values": [], "template": "stop processing", "changeable": true }
362
+ \`\`\`
363
+
364
+ **SET_STATUS** - Change document status:
365
+ \`\`\`json
366
+ {
367
+ "code": "SET_STATUS",
368
+ "operator": { "value": "set_value", "use": "key" },
369
+ "field": { "value": "status", "meta": { "path": "status", "type": "Relation" } },
370
+ "values": [{ "value": { "key": "REVIEW" }, "source": "internal" }],
371
+ "template": "set status to {value}",
372
+ "changeable": true
373
+ }
374
+ \`\`\`
375
+
376
+ **RUN_INTEGRATION_API_TRIGGER** - Execute integration:
377
+ \`\`\`json
378
+ {
379
+ "code": "RUN_INTEGRATION_API_TRIGGER",
380
+ "operator": { "value": "run_integration_api_trigger" },
381
+ "values": [{ "value": { "name": "EDI Transfer", "uuid": "trigger-uuid" }, "source": "internal" }],
382
+ "template": "run {value}",
383
+ "changeable": true
384
+ }
385
+ \`\`\`
386
+
387
+ **ASSIGN** - Assign users (can use external field reference):
388
+ \`\`\`json
389
+ {
390
+ "code": "ASSIGN",
391
+ "operator": { "value": "add_to_array", "use": "uuid" },
392
+ "field": { "value": "assignees", "meta": { "path": "assignees", "type": "Relation" } },
393
+ "values": [{
394
+ "value": "submitted_by",
395
+ "source": "external",
396
+ "meta": { "path": "submitted_by", "type": "Relation" }
397
+ }],
398
+ "template": "assign {value}",
399
+ "changeable": true
400
+ }
401
+ \`\`\`
402
+
403
+ **APPROVAL_DOA** - Delegation of Authority approval:
404
+ \`\`\`json
405
+ {
406
+ "code": "APPROVAL_DOA",
407
+ "operator": { "value": "approve_document_doa" },
408
+ "values": [{
409
+ "value": {
410
+ "name": "Cost Center Approval",
411
+ "datasets": [{ "name": "Cost Centre DOA", "uuid": "dataset-uuid", "dataset_type": "approval_doa_group" }],
412
+ "steps": [{ "approval_type": "doa", "start_from": "bottom_of_tree", "notify": true, "criteria_pass": 1, "criteria_fail": 1 }],
413
+ "resource_status": "APPROVAL",
414
+ "resource_editable": false
415
+ },
416
+ "source": "internal"
417
+ }],
418
+ "template": "get approval {value}",
419
+ "changeable": true
420
+ }
421
+ \`\`\`
422
+
423
+ **GET_APPROVAL** - User group approval:
424
+ \`\`\`json
425
+ {
426
+ "code": "GET_APPROVAL",
427
+ "operator": { "value": "approve_document" },
428
+ "values": [{
429
+ "value": {
430
+ "name": "Finance Review",
431
+ "steps": [{ "name": "Finance Review", "approval_type": "user_group", "user_groups": ["group-uuid"], "notify": true, "criteria_pass": 1, "criteria_fail": 1 }],
432
+ "resource_status": "APPROVAL",
433
+ "resource_editable": true
434
+ },
435
+ "source": "internal"
436
+ }],
437
+ "template": "get approval {value}",
438
+ "changeable": true
439
+ }
440
+ \`\`\`
441
+
442
+ **APPROVAL_MANAGER_TREE** - Manager hierarchy approval:
443
+ \`\`\`json
444
+ {
445
+ "code": "APPROVAL_MANAGER_TREE",
446
+ "operator": { "value": "approve_document_manager" },
447
+ "values": [{
448
+ "value": {
449
+ "name": "Manager Approval",
450
+ "steps": [{
451
+ "approval_type": "management",
452
+ "start_from": "submitter",
453
+ "notify": true,
454
+ "escalate": { "unit": "WORKING_DAY", "quantity": 5 },
455
+ "reminders": [{ "name": "2 Day Reminder", "unit": "WORKING_DAY", "quantity": 2 }]
456
+ }],
457
+ "resource_status": "APPROVAL"
458
+ },
459
+ "source": "internal"
460
+ }],
461
+ "template": "get approval {value}",
462
+ "changeable": true
463
+ }
464
+ \`\`\`
465
+
466
+ **RESTART_FLOW** - Restart approval flow:
467
+ \`\`\`json
468
+ { "code": "RESTART_FLOW", "operator": { "value": "restart_flow" }, "values": [], "template": "restart approval flow", "changeable": true }
469
+ \`\`\`
470
+
471
+ **MARK_AS_APPROVED** - Set is_approved = true:
472
+ \`\`\`json
473
+ {
474
+ "code": "MARK_AS_APPROVED",
475
+ "operator": { "value": "set_value" },
476
+ "field": { "value": "is_approved", "meta": { "path": "is_approved", "type": "Boolean" } },
477
+ "values": [{ "value": true, "source": "internal" }],
478
+ "template": "mark as approved",
479
+ "changeable": true
480
+ }
481
+ \`\`\`
482
+
483
+ **SET_FIELD** - Set arbitrary field:
484
+ \`\`\`json
485
+ {
486
+ "code": "SET_FIELD",
487
+ "operator": { "value": "set_value" },
488
+ "field": { "value": "is_approved", "meta": { "path": "is_approved", "type": "Boolean" } },
489
+ "values": [{ "value": false, "source": "internal" }],
490
+ "template": "set {field} to {value}",
491
+ "changeable": true
492
+ }
493
+ \`\`\`
494
+
495
+ **COMPUTE_FIELD** - Auto-generate field values:
496
+ \`\`\`json
497
+ {
498
+ "code": "COMPUTE_FIELD",
499
+ "operator": { "value": "compute_fields" },
500
+ "values": [{ "value": [{ "path": "document_number", "type": "String" }], "source": "internal" }],
501
+ "template": "generate {value}",
502
+ "changeable": true
503
+ }
504
+ \`\`\`
505
+
506
+ **GENERATE_PDF** - Create PDF document:
507
+ \`\`\`json
508
+ {
509
+ "code": "GENERATE_PDF",
510
+ "operator": { "value": "generate_pdf" },
511
+ "values": [{ "value": { "template_name": null, "template_uuid": null }, "source": "internal" }],
512
+ "template": "generate PDF",
513
+ "changeable": true
514
+ }
515
+ \`\`\`
516
+
517
+ **CONVERT** - Convert to another document type:
518
+ \`\`\`json
519
+ {
520
+ "code": "CONVERT",
521
+ "operator": { "value": "convert_document" },
522
+ "values": [{ "value": { "module": "PURCHASING", "submodule": "ORDER", "duplicate": true }, "source": "internal" }],
523
+ "template": "convert to {value}",
524
+ "changeable": true
525
+ }
526
+ \`\`\`
527
+
528
+ **SEND_EMAIL** - Send email:
529
+ \`\`\`json
530
+ {
531
+ "code": "SEND_EMAIL",
532
+ "operator": { "value": "send_email" },
533
+ "values": [{
534
+ "value": { "email": { "to": [""], "cc": [], "bcc": [], "subject": "", "body": "", "inbox_uuid": "inbox-uuid" } },
535
+ "source": "internal"
536
+ }],
537
+ "template": "send email {value}",
538
+ "changeable": true
539
+ }
540
+ \`\`\`
541
+
542
+ **POST_NOTICE** - Post user notice:
543
+ \`\`\`json
544
+ {
545
+ "code": "POST_NOTICE",
546
+ "operator": { "value": "post_notice" },
547
+ "values": [{ "value": { "body": "Document requires attention", "is_error": false }, "source": "internal" }],
548
+ "template": "post notice {value}",
549
+ "changeable": true
550
+ }
551
+ \`\`\`
552
+
553
+ **COMPLETE** - Complete document processing:
554
+ \`\`\`json
555
+ { "code": "COMPLETE", "operator": { "value": "complete_document" }, "values": [], "template": "complete processing", "changeable": true }
556
+ \`\`\`
557
+
558
+ ### Condition Structure
559
+ All conditions follow this structure:
560
+ \`\`\`json
561
+ {
562
+ "code": "CONDITION_CODE",
563
+ "operator": { "value": "==", "use": "key|uuid|null" },
564
+ "field": { "value": "field_path", "meta": {...} },
565
+ "values": [{ "value": ..., "source": "internal" }],
566
+ "template": "human readable template",
567
+ "changeable": true
568
+ }
569
+ \`\`\`
570
+ - **changeable: true** = REQUIRED - allows the condition to be edited/deleted in the UI
571
+
572
+ ### Condition Examples
573
+
574
+ **CUSTOM_CONDITION** - Field comparison (most common):
575
+ \`\`\`json
576
+ // Equals (use for relations like document_type)
577
+ { "code": "CUSTOM_CONDITION", "operator": { "value": "==", "use": "property" },
578
+ "field": { "value": "document_type", "meta": { "path": "document_type", "type": "Relation" } },
579
+ "values": [{ "value": { "property": "EXPENSE" }, "source": "internal" }],
580
+ "template": "{field} {operator} {value}", "changeable": true }
581
+
582
+ // In array (multiple values)
583
+ { "code": "CUSTOM_CONDITION", "operator": { "value": "in", "use": "uuid" },
584
+ "field": { "value": "lines[*].account", "meta": { "path": "lines__account", "sentence_path": "lines[*].account" } },
585
+ "values": [{ "value": [{ "uuid": "account-uuid-1" }, { "uuid": "account-uuid-2" }], "source": "internal" }],
586
+ "template": "{field} {operator} {value}", "changeable": true }
587
+
588
+ // Not equals
589
+ { "code": "CUSTOM_CONDITION", "operator": { "value": "!="},
590
+ "field": { "value": "allocation_status_json.purchasing_order" },
591
+ "values": [{ "value": "FULL", "source": "internal" }],
592
+ "template": "{field} {operator} {value}", "changeable": true }
593
+
594
+ // Numeric comparisons (<, >, >=)
595
+ { "code": "CUSTOM_CONDITION", "operator": { "value": ">="},
596
+ "field": { "value": "total", "meta": { "path": "total", "type": "Number" } },
597
+ "values": [{ "value": 1000, "source": "internal" }],
598
+ "template": "{field} {operator} {value}", "changeable": true }
599
+
600
+ // Any (check if array has any value)
601
+ { "code": "CUSTOM_CONDITION", "operator": { "value": "any", "use": "uuid" },
602
+ "field": { "value": "lines[*].subsidiary", "meta": { "path": "lines__subsidiary", "sentence_path": "lines[*].subsidiary", "type": "Relation" } },
603
+ "values": [], "template": "{field} {operator} {value}", "changeable": true }
604
+
605
+ // Is not empty
606
+ { "code": "CUSTOM_CONDITION", "operator": { "value": "is_not_empty", "use": "uuid" },
607
+ "field": { "value": "assignees" }, "values": [],
608
+ "template": "{field} {operator} {value}", "changeable": true }
609
+ \`\`\`
610
+
611
+ **ALLOCATION_PO** - PO allocation status (FULL, PARTIAL, NONE):
612
+ \`\`\`json
613
+ { "code": "ALLOCATION_PO", "operator": { "value": "==" },
614
+ "field": { "value": "allocation_status_json.purchasing_order" },
615
+ "values": [{ "value": "FULL", "source": "internal" }],
616
+ "template": "Allocation Status - Purchase Order {operator} {value}", "changeable": true }
617
+ \`\`\`
618
+
619
+ **ALLOCATION_RECEIPT** - Receipt allocation status:
620
+ \`\`\`json
621
+ { "code": "ALLOCATION_RECEIPT", "operator": { "value": "==" },
622
+ "field": { "value": "allocation_status_json.inventory_receipt" },
623
+ "values": [{ "value": "PARTIAL", "source": "internal" }],
624
+ "template": "Allocation Status - Receipt {operator} {value}", "changeable": true }
625
+ \`\`\`
626
+
627
+ **VARIANCE_AMOUNT** - Variance amount threshold:
628
+ \`\`\`json
629
+ { "code": "VARIANCE_AMOUNT", "operator": { "value": ">=" },
630
+ "field": { "value": "variance_amount_local_json.purchasing_order" },
631
+ "values": [{ "value": 10, "source": "internal" }],
632
+ "template": "Variance Amount {operator} {value}", "changeable": true }
633
+ \`\`\`
634
+
635
+ **VARIANCE_PERC** - Variance percentage threshold:
636
+ \`\`\`json
637
+ { "code": "VARIANCE_PERC", "operator": { "value": ">=" },
638
+ "field": { "value": "variance_percentage_json.purchasing_order" },
639
+ "values": [{ "value": 5, "source": "internal" }],
640
+ "template": "Variance Percentage {operator}{value}%", "changeable": true }
641
+ \`\`\`
642
+
643
+ **APPROVED_TRUE** / **APPROVED_FALSE** - Approval status:
644
+ \`\`\`json
645
+ { "code": "APPROVED_TRUE", "operator": { "value": "==" },
646
+ "field": { "value": "is_approved" },
647
+ "values": [{ "value": true, "source": "internal" }],
648
+ "template": "has been approved", "changeable": true }
649
+
650
+ { "code": "APPROVED_FALSE", "operator": { "value": "==" },
651
+ "field": { "value": "is_approved" },
652
+ "values": [{ "value": false, "source": "internal" }],
653
+ "template": "has not been approved", "changeable": true }
654
+ \`\`\`
655
+
656
+ ### Common Field Paths for Conditions
657
+ - \`document_type\` - Form/document type (use \`property\` for comparison)
658
+ - \`allocation_status_json.purchasing_order\` / \`.inventory_receipt\` - Allocation status
659
+ - \`variance_amount_local_json.purchasing_order\` - Variance amount
660
+ - \`variance_percentage_json.purchasing_order\` - Variance percentage
661
+ - \`is_approved\` - Approval status boolean
662
+ - \`validation_level\` - Document validation level
663
+ - \`total\` / \`total_exclusive\` - Document totals
664
+ - \`supplier\` / \`customer\` - Business partner relations
665
+ - \`lines[*].item\` / \`lines[*].account\` / \`lines[*].subsidiary\` - Line item fields
666
+ - \`status\` - Document status
667
+ - \`assignees\` - Assigned users
668
+
669
+ ### Property Reference
670
+
671
+ #### Discovering Valid Values with Tools
672
+ **IMPORTANT**: Always use tools to fetch real values from the current team rather than hardcoding UUIDs or keys.
673
+
674
+ **Field Paths (for CUSTOM_CONDITION)**:
675
+ - Use \`zudelloGetModelSchema\` to discover available fields and their types
676
+ - Use \`zudelloGetFieldMetadata\` for detailed field definitions
677
+ - Use \`zudelloListSentenceResources\` with \`CONDITION_TEMPLATE\` for condition structures
678
+ - Field \`meta.type\` determines valid operators (Relation, String, Number, Boolean, Date)
679
+
680
+ **Status Keys (for SET_STATUS)**:
681
+ - Use \`zudelloListConfigs\` with \`configType: 'document_status'\` and appropriate module/submodule
682
+ - Each team may have custom statuses beyond standard ones
683
+ - Common standard statuses: REVIEW, APPROVAL, COMPLETE, REJECT, DRAFT, ACTIVE
684
+
685
+ **User UUIDs (for ASSIGN, approval steps)**:
686
+ - Use \`zudelloSearch\` with model \`User\` to find users
687
+ - Required for \`users[]\` arrays in approval steps
688
+ - Required for \`fallback_settings_json.approver_users\`
689
+
690
+ **User Group UUIDs (for approval steps)**:
691
+ - Use \`zudelloListConfigs\` with \`configType: 'user_group'\`
692
+ - Required for \`user_groups[]\` arrays in \`user_group\` approval type
693
+ - Required for \`fallback_settings_json.approver_groups\`
694
+
695
+ **Dataset UUIDs (for DOA/Management approvals)**:
696
+ - Use \`zudelloListConfigs\` with appropriate config types:
697
+ - \`approval_doa_group\` / \`approval_doa\` for DOA datasets
698
+ - \`approval_management_tree\` for manager hierarchy
699
+ - \`user_limit_dataset\` for user limits
700
+
701
+ #### Approval Action Combinations
702
+ **Action Code → Valid approval_type**:
703
+ - \`APPROVAL_DOA\`: Only \`doa\` (uses DOA datasets with delegation limits)
704
+ - \`GET_APPROVAL\`: \`user_group\`, \`assignees\`, \`user\`, \`procurement_owner\`, \`budget\`
705
+ - \`APPROVAL_MANAGER_TREE\`: Only \`management\` (uses manager hierarchy)
706
+
707
+ **approval_type → Required Properties**:
708
+ - \`doa\`: Requires \`start_from\` (bottom_of_tree | start_with_user_with_sufficient_limit | submitter), uses \`datasets\`
709
+ - \`management\`: Requires \`start_from\` (always \`submitter\`), optionally uses \`datasets\`
710
+ - \`user_group\`: Requires \`user_groups[]\` array of group UUIDs
711
+ - \`user\`: Requires \`users[]\` array of user UUIDs
712
+ - \`assignees\`: Uses \`approver_selection\` to specify source of assignees
713
+ - \`procurement_owner\`: Uses \`approver_selection\`
714
+ - \`budget\`: Uses \`approver_selection\` (can be string \`"budget_owner"\`)
715
+
716
+ #### Step Properties (all approval types)
717
+ **Required**: \`approval_type\`, \`criteria_pass\`, \`criteria_fail\`
718
+ **Boolean Options**:
719
+ - \`notify\` (default: true) - Send notifications
720
+ - \`include_submitter\` - Include submitter in chain
721
+ - \`include_attachment\` - Attach document to notification
722
+ - \`approval_external\` - Allow external approvers
723
+ - \`apply_previous\` - Apply previous approvals
724
+ - \`auto_approve_submitter\` - Auto-approve if submitter is approver
725
+
726
+ **Advanced**:
727
+ - \`escalate\`: \`{ unit: "WORKING_DAY"|"DAY"|"HOUR"|"MINUTE", quantity: number }\`
728
+ - \`reminders\`: \`[{ name: string, unit: "...", quantity: number }]\`
729
+ - \`fallback_settings_json\`: \`{ fallback_type: "SPECIFIED_APPROVERS", approver_users: [], approver_groups: [] }\`
730
+
731
+ #### operator.use Selection (CUSTOM_CONDITION)
732
+ The \`operator.use\` value depends on field type and operator:
733
+ - \`"property"\` - For document_type comparisons: \`{ "property": "EXPENSE" }\`
734
+ - \`"uuid"\` - For relation comparisons: \`{ "uuid": "..." }\` or \`[{ "uuid": "..." }]\`
735
+ - \`"key"\` - For status comparisons: \`{ "key": "REVIEW" }\`
736
+ - \`null\` or omit - For primitive values (strings, numbers, booleans)
737
+
738
+ **By Operator**:
739
+ - \`==\` with Relation: use \`property\`, \`uuid\`, or \`key\` based on field
740
+ - \`in\`, \`!in\`: use \`property\`, \`uuid\`, or \`key\` (array values)
741
+ - \`any\`, \`is_not_empty\`, \`is_empty\`: use \`uuid\` (for relation arrays)
742
+ - \`<\`, \`>\`, \`>=\`, \`<=\`, \`!=\`: omit \`use\` (primitive comparisons)
743
+ - \`contains~\`, \`startsWith~\`, \`endsWith~\`: omit \`use\` (string operations)
744
+
745
+ ### Creating/Updating Sentences Workflow
746
+ 1. **List existing sentences**: \`zudelloListSentences\` for module
747
+ 2. **Get templates**: \`zudelloListSentenceResources\` for ACTION_TEMPLATE and CONDITION_TEMPLATE
748
+ 3. **Create sentence**: \`zudelloCreateSentence\` with recipe
749
+ 4. **Update existing**: \`zudelloGetSentence\` first, then \`zudelloUpdateSentence\` with complete payload
750
+ 5. **Reorder**: \`zudelloUpdateSentencesOrder\` - include ALL module sentences, not just submodule
751
+
752
+ ### Important Notes
753
+ - **Execution scope**: Sentences run top-to-bottom, filtered by \`event_type\`. If \`submodule\` is set, only that submodule's events trigger it; if \`submodule\` is not set, the sentence runs for ALL submodules in that module.
754
+ - **CANCEL_PROCESSING stops all**: When \`CANCEL_PROCESSING\` runs, no further sentences execute for that event - use it as an early exit or fallback.
755
+ - When reordering, you must include ALL sentences for the entire MODULE
756
+ - Use \`zudelloListSentenceResources\` to get the exact field structure for each action/condition
757
+ - Version auto-increments on update (e.g., 1.0.0 → 1.0.1)
758
+
759
+ #### CRITICAL: Lookup Requirements
760
+ - **Field paths & sentence paths**: ALWAYS look up using \`zudelloGetFieldMetadata\` - never guess or hardcode paths
761
+ - **Status values**: ALWAYS look up valid statuses using \`zudelloListStatuses\` with the appropriate module/submodule before using in SET_STATUS or conditions
762
+ - **Document types**: ALWAYS look up valid document types using \`zudelloListDocumentTypes\` before referencing in conditions (e.g., CUSTOM_CONDITION on document_type field)
763
+
764
+ #### CRITICAL: Approval Actions Must Have Otherwise
765
+ Approval actions (\`APPROVAL_DOA\`, \`GET_APPROVAL\`, \`APPROVAL_MANAGER_TREE\`) should ALWAYS be followed by an \`otherwise\` action to handle rejection/failure. Typically use \`CANCEL_PROCESSING\` with \`"otherwise": true\`:
766
+ \`\`\`json
767
+ // Approval action
768
+ { "code": "GET_APPROVAL", "operator": { "value": "approve_document" }, "values": [...], "template": "get approval {value}", "changeable": true },
769
+ // Fallback when approval fails/rejected
770
+ { "code": "CANCEL_PROCESSING", "operator": { "value": "cancel" }, "values": [], "template": "stop processing", "otherwise": true, "changeable": true }
771
+ \`\`\`
772
+
773
+ #### evalOrder Must Be Integer
774
+ \`evalOrder\` determines sentence execution order and **must be an integer** (not a float).
775
+ - To append a new sentence: use \`existingSentences.length\` or max evalOrder + 1
776
+ - To insert between sentences: create with any valid integer, then use \`zudelloUpdateSentencesOrder\` to reposition
777
+ - **Invalid**: \`evalOrder: 9.5\` (will error: "Input should be a valid integer")
778
+ - **Valid**: \`evalOrder: 10\`, then reorder if needed
779
+
780
+ #### field.meta Requires Both path and sentence_path
781
+ For nested/array fields, \`meta\` requires TWO path formats:
782
+ - \`path\` - Underscore notation for API queries: \`lines__account\`, \`lines__subsidiary\`
783
+ - \`sentence_path\` - Bracket notation for evaluation: \`lines[*].account\`, \`lines[*].subsidiary\`
784
+
785
+ For top-level fields, both can be the same:
786
+ \`\`\`json
787
+ // Top-level field (same path)
788
+ { "value": "status", "meta": { "path": "status", "type": "Relation" } }
789
+
790
+ // Nested/array field (different paths - BOTH required)
791
+ { "value": "lines[*].account", "meta": { "path": "lines__account", "sentence_path": "lines[*].account", "type": "Relation" } }
792
+ \`\`\`
793
+ **Missing \`sentence_path\` will cause error**: \`"DEBUG: 'sentence_path'"\`
794
+
795
+ ### Valid Templates Reference
796
+ These are the ONLY valid template values. Use exactly as shown:
797
+
798
+ **Action Templates:**
799
+ - \`CANCEL_PROCESSING\`: \`"stop processing"\`
800
+ - \`SET_STATUS\`: \`"set status to {value}"\`
801
+ - \`RUN_INTEGRATION_API_TRIGGER\`: \`"run {value}"\`
802
+ - \`ASSIGN\`: \`"assign {value}"\`
803
+ - \`UNASSIGN\`: \`"unassign {value}"\`
804
+ - \`UNASSIGN_ALL\`: \`"unassign all assignees"\`
805
+ - \`APPROVAL_DOA\`: \`"get approval {value}"\`
806
+ - \`GET_APPROVAL\`: \`"get approval {value}"\`
807
+ - \`APPROVAL_MANAGER\`: \`"get approval {value}"\`
808
+ - \`RESTART_FLOW\`: \`"restart approval flow"\`
809
+ - \`APPROVAL_SET_LIMIT\`: \`"set approval limit {value}"\`
810
+ - \`MARK_AS_APPROVED\`: \`"mark as approved"\`
811
+ - \`SET_FIELD\`: \`"set {field} to {value}"\`
812
+ - \`COMPUTE_FIELD\`: \`"generate {value}"\`
813
+ - \`GENERATE_PDF\`: \`"generate PDF"\`
814
+ - \`CONVERT\`: \`"convert to {value}"\`
815
+ - \`SEND_EMAIL\`: \`"send email {value}"\`
816
+ - \`POST_NOTICE\`: \`"post notice {value}"\`
817
+ - \`COMPLETE\`: \`"complete processing"\`
818
+ - \`CONSOLIDATE_LINES\`: \`"consolidate lines {value}"\`
819
+ - \`REMOVE_MATCHED_LINES\`: \`"remove matched lines"\`
820
+ - \`START_WORKFLOW\`: \`"start workflow {value}"\`
821
+
822
+ **Condition Templates:**
823
+ - \`ALLOCATION_PO\`: \`"Allocation Status - Purchase Order {operator} {value}"\`
824
+ - \`ALLOCATION_RECEIPT\`: \`"Allocation Status - Receipt {operator} {value}"\`
825
+ - \`VARIANCE_AMOUNT\`: \`"Variance Amount {operator} {value}"\`
826
+ - \`VARIANCE_PERC\`: \`"Variance Percentage {operator}{value}%"\`
827
+ - \`APPROVED_TRUE\`: \`"has been approved"\`
828
+ - \`APPROVED_FALSE\`: \`"has not been approved"\`
829
+
830
+ ## Dataset Management Reference
831
+
832
+ Datasets are virtual tables that store structured data for lookups, mappings, and approval workflows. Use \`zudelloListDatasets\`, \`zudelloGetDataset\`, \`zudelloCreateDataset\`, and \`zudelloUpdateDataset\` for dataset operations.
833
+
834
+ ### Dataset Types (datasetType)
835
+ - \`""\` (empty): Generic lookup/mapping tables (most common)
836
+ - \`approval_doa\`: Delegation of Authority with user + limit columns
837
+ - \`approval_doa_group\`: DOA using user groups instead of individual users
838
+ - \`approval_management_tree\`: Manager hierarchy (user → manager relationships)
839
+ - \`approval_user_limit\`: User-specific approval limits
840
+
841
+ ### Editor Types
842
+ - \`TEXT\`: Free text input
843
+ - \`NUMERIC\`: Number input
844
+ - \`DD_SINGLE\`: Single-select dropdown (requires select config)
845
+ - \`DD_MULTIPLE\`: Multi-select dropdown (requires select config)
846
+ - \`DATE\`: Date picker
847
+
848
+ ### Field to Storage Getter Mapping
849
+ When creating dimension columns, use the getter that matches the document field:
850
+ - \`department\` → \`departmentList\` (label: \`{code} - {name}\`)
851
+ - \`location\` → \`getLocations\` (label: \`{code} - {name}\` or \`name\`)
852
+ - \`subsidiary\` → \`getSubsidiaries\` (label: \`{code} - {name}\` or \`name\`)
853
+ - \`supplier\` → \`supplierList\` (label: \`{code} - {trading_name}\`)
854
+ - \`project\` → \`projectList\` (label: \`{code} - {name}\`)
855
+ - \`account\` → \`glAccountList\` (label: \`{code} - {name}\`)
856
+ - \`cost_centre\` → \`costCentreList\` (label: \`{code} - {name}\`)
857
+ - \`account.account_group\` → \`AccountGroup\` (label: \`{code} - {name}\`)
858
+ - \`user\` / \`manager\` → \`activeTeamUsers\` (label: \`{first_name} {last_name}\`)
859
+ - \`user_group\` → \`UserGroup\` (label: \`name\`)
860
+ - Others: \`customerList\`, \`itemsList\`, \`costTypesList\`, \`taxRateList\`, \`PaymentMethod\`
861
+
862
+ ### Approval Fields (approvalField)
863
+ Link columns to approval workflow logic:
864
+ - \`""\` (empty): No approval significance (for mapping/lookup columns)
865
+ - \`step_name\`: Step identifier in approval chain
866
+ - \`user\`: Approver user selection (DOA)
867
+ - \`user_group\`: Approver group selection (DOA group)
868
+ - \`limit\`: Approval limit threshold
869
+ - \`manager\`: Manager in hierarchy (management tree)
870
+ - \`dimension\`: **Dimensional filter** - matches document field to dataset row
871
+
872
+ ### Dimensions in Datasets
873
+ Dimension columns filter which dataset rows apply to each document line during approval.
874
+
875
+ **How Dimensions Work**:
876
+ 1. Dataset has columns with \`approvalField: "dimension"\` (e.g., department, subsidiary)
877
+ 2. Each row specifies a dimension value (e.g., "Finance Department") + approver + limit
878
+ 3. During approval, system matches document line's dimension field to dataset rows
879
+ 4. Only matching rows' approvers are considered for that line
880
+
881
+ **Multi-Dimension Datasets**: A single dataset can have MULTIPLE dimension columns:
882
+ \`\`\`json
883
+ // Dataset with department AND subsidiary dimensions
884
+ // Row applies only when BOTH dimensions match the document line
885
+ { "field": "department", "approvalField": "dimension", "rootPath": "lines" },
886
+ { "field": "subsidiary", "approvalField": "dimension", "rootPath": "lines" }
887
+ \`\`\`
888
+
889
+ **rootPath** - Where to look for the dimension value on the document:
890
+ - \`"lines"\` (most common): Match against document line items (\`lines[].department\`)
891
+ - \`"supplier"\`: Match against document's supplier relationship
892
+ - \`""\` (empty): Match against document root level field
893
+
894
+ ### Dimension Mismatch Handling (on_dimension_mismatch)
895
+ How approval handles lines without matching dimension in the dataset:
896
+ - \`fail_sentence\`: Stop entire sentence if no dimension match (default, strictest)
897
+ - \`skip_sentence\`: Skip this sentence, continue to next in chain
898
+ - \`skip_line\`: Skip non-matching lines only, process matching ones
899
+
900
+ ### Column Flags (IMPORTANT)
901
+ These flags control column behavior. **Explicitly set all four on every column** to prevent inconsistent behavior on updates:
902
+
903
+ - \`readonly\`: Set \`true\` for approval fields (step_name, user/user_group, limit, manager). Set \`false\` for dimension/custom columns.
904
+ - \`isDefaultLabel\`: Set \`true\` on exactly ONE column to define the row's display label (typically the identifying field like user or step_name).
905
+ - \`isDefaultTrackBy\`: Set \`true\` on exactly ONE column to define the row's unique identifier.
906
+ - \`checkboxSelection\`: Set \`true\` on the FIRST column only (typically step_name or primary identifier).
907
+
908
+ ### Dataset Examples
909
+
910
+ **DOA Group with Multiple Dimensions** (department + location):
911
+ \`\`\`json
912
+ {
913
+ "name": "Multi-Dimension DOA",
914
+ "settings": {
915
+ "datasetType": "approval_doa_group",
916
+ "on_dimension_mismatch": "fail_sentence",
917
+ "columnDefs": [
918
+ { "field": "step_name", "headerName": "Step Name", "editor": { "type": "TEXT" }, "approvalField": "step_name", "readonly": true, "isDefaultLabel": true, "isDefaultTrackBy": true, "checkboxSelection": true },
919
+ { "field": "user_group", "headerName": "User Group", "editor": { "type": "DD_SINGLE", "select": { "label": "name", "source": "STORAGE", "storage": { "getter": "UserGroup" }, "trackBy": "uuid" } }, "approvalField": "user_group", "readonly": true, "isDefaultLabel": false, "isDefaultTrackBy": false, "checkboxSelection": false },
920
+ { "field": "limit", "headerName": "Limit", "editor": { "type": "NUMERIC" }, "approvalField": "limit", "readonly": true, "isDefaultLabel": false, "isDefaultTrackBy": false, "checkboxSelection": false },
921
+ { "field": "department", "headerName": "Department", "rootPath": "lines", "editor": { "type": "DD_SINGLE", "select": { "label": "{code} - {name}", "source": "STORAGE", "storage": { "getter": "departmentList" }, "trackBy": "uuid" } }, "approvalField": "dimension", "readonly": false, "isDefaultLabel": false, "isDefaultTrackBy": false, "checkboxSelection": false },
922
+ { "field": "location", "headerName": "Location", "rootPath": "lines", "editor": { "type": "DD_SINGLE", "select": { "label": "name", "source": "STORAGE", "storage": { "getter": "getLocations" }, "trackBy": "uuid" } }, "approvalField": "dimension", "readonly": false, "isDefaultLabel": false, "isDefaultTrackBy": false, "checkboxSelection": false }
923
+ ]
924
+ }
925
+ }
926
+ \`\`\`
927
+
928
+ **Management Tree Dataset**:
929
+ \`\`\`json
930
+ {
931
+ "name": "Management Tree",
932
+ "settings": {
933
+ "datasetType": "approval_management_tree",
934
+ "on_dimension_mismatch": "fail_sentence",
935
+ "columnDefs": [
936
+ { "field": "step_name", "headerName": "Step Name", "editor": { "type": "TEXT" }, "approvalField": "step_name", "readonly": true, "isDefaultLabel": false, "isDefaultTrackBy": false, "checkboxSelection": true },
937
+ { "field": "user", "headerName": "User", "editor": { "type": "DD_SINGLE", "select": { "label": "{first_name} {last_name}", "source": "STORAGE", "storage": { "getter": "activeTeamUsers" }, "trackBy": "uuid" } }, "approvalField": "user", "readonly": true, "isDefaultLabel": true, "isDefaultTrackBy": true, "checkboxSelection": false },
938
+ { "field": "manager", "headerName": "Manager", "editor": { "type": "DD_SINGLE", "select": { "label": "{first_name} {last_name}", "source": "STORAGE", "storage": { "getter": "activeTeamUsers" }, "trackBy": "uuid" } }, "approvalField": "manager", "readonly": true, "isDefaultLabel": false, "isDefaultTrackBy": false, "checkboxSelection": false }
939
+ ]
940
+ }
941
+ }
942
+ \`\`\`
943
+
944
+ **Generic Lookup Dataset** (Supplier Keyword Map):
945
+ \`\`\`json
946
+ {
947
+ "name": "Supplier Keyword Map",
948
+ "settings": {
949
+ "datasetType": "",
950
+ "columnDefs": [
951
+ { "field": "tax_number", "headerName": "ABN", "editor": { "type": "TEXT" }, "readonly": false, "isDefaultTrackBy": true, "isDefaultLabel": false, "checkboxSelection": true },
952
+ { "field": "keyword", "headerName": "Keyword", "editor": { "type": "TEXT" }, "readonly": false, "isDefaultTrackBy": false, "isDefaultLabel": false, "checkboxSelection": false },
953
+ { "field": "supplier", "headerName": "Supplier", "editor": { "type": "DD_SINGLE", "select": { "label": "{code} - {trading_name}", "source": "STORAGE", "storage": { "getter": "supplierList" }, "trackBy": "uuid" } }, "readonly": false, "isDefaultTrackBy": false, "isDefaultLabel": true, "checkboxSelection": false }
954
+ ]
955
+ }
956
+ }
957
+ \`\`\`
958
+
959
+ ### Dataset-Sentence Integration
960
+
961
+ **Workflow**: Create dataset first → Reference in sentence action
962
+
963
+ **APPROVAL_SET_LIMIT** - Binds a dataset BEFORE approval actions:
964
+ \`\`\`json
965
+ {
966
+ "code": "APPROVAL_SET_LIMIT",
967
+ "operator": { "value": "set_approval_limit" },
968
+ "values": [{
969
+ "value": {
970
+ "dataset": { "name": "User Limit", "uuid": "dataset-uuid" },
971
+ "dataset_type": "approval_user_limit"
972
+ },
973
+ "source": "internal"
974
+ }]
975
+ }
976
+ \`\`\`
977
+
978
+ **APPROVAL_DOA** - References datasets directly:
979
+ \`\`\`json
980
+ {
981
+ "code": "APPROVAL_DOA",
982
+ "operator": { "value": "approve_document_doa" },
983
+ "values": [{
984
+ "value": {
985
+ "name": "Department Approval",
986
+ "datasets": [{ "name": "Department DOA", "uuid": "dataset-uuid", "dataset_type": "approval_doa_group" }],
987
+ "steps": [{ "approval_type": "doa", "start_from": "bottom_of_tree", "notify": true, "criteria_pass": 1, "criteria_fail": 1 }],
988
+ "resource_status": "APPROVAL",
989
+ "resource_editable": false
990
+ },
991
+ "source": "internal"
992
+ }]
993
+ }
994
+ \`\`\`
995
+
996
+ **APPROVAL_MANAGER_TREE** - Uses management tree dataset (bound via APPROVAL_SET_LIMIT or implicit):
997
+ \`\`\`json
998
+ {
999
+ "code": "APPROVAL_MANAGER_TREE",
1000
+ "operator": { "value": "approve_document_manager" },
1001
+ "values": [{
1002
+ "value": {
1003
+ "name": "Manager Approval",
1004
+ "datasets": [],
1005
+ "steps": [{ "approval_type": "management", "start_from": "submitter", "notify": true }],
1006
+ "resource_status": "APPROVAL"
1007
+ },
1008
+ "source": "internal"
1009
+ }]
1010
+ }
1011
+ \`\`\`
1012
+
1013
+ **Key Points**:
1014
+ - DOA/management tree approvals can reference **existing datasets** or you can **create new ones**
1015
+ - Use \`zudelloListDatasets\` to find existing datasets of the right type
1016
+ - Dimension columns (\`approvalField: "dimension"\`) filter which rows apply based on document field values
1017
+ - Multiple dimension columns create AND logic (all must match)
1018
+
1019
+ ## Custom Field Management
1020
+
1021
+ Use field settings to customize system fields or add custom fields to forms.
1022
+
1023
+ ### Field Tools
1024
+ - **zudelloListFields** - List all field settings (use fullObject=true for complete config)
1025
+ - **zudelloGetField** - Get full details of a field setting by UUID
1026
+ - **zudelloCreateField** - Create a new custom field or override system field behavior
1027
+ - **zudelloUpdateField** - Update an existing field setting
1028
+
1029
+ ### Path Naming Conventions
1030
+ - **System field override**: Use existing path (e.g., \`document_number\`, \`payment_method\`, \`code\`)
1031
+ - **Custom header field**: \`custom__fieldname\` (e.g., \`custom__employer_name\`, \`custom__bank_account\`)
1032
+ - **Custom line field**: \`lines__custom__fieldname\` (e.g., \`lines__custom__vehicleRegistrationNumber\`)
1033
+
1034
+ ### Editor Types
1035
+ - **TEXT**: Simple text input. Optional \`mask\` for formatting (e.g., "XXX-XX-XXXX", "######")
1036
+ - **NUMERIC**: Number input with \`numeric.precision\` (0, 2, or 4)
1037
+ - **BOOLEAN**: Checkbox with optional \`default\` value
1038
+ - **DATE**: Date picker
1039
+ - **DD_SINGLE**: Single-select dropdown (requires \`select\` config)
1040
+ - **DD_MULTIPLE**: Multi-select dropdown (requires \`select\` config)
1041
+
1042
+ ### Dropdown Configuration
1043
+ **STORAGE source** (system data):
1044
+ \`\`\`json
1045
+ { "source": "STORAGE", "storage": { "getter": "activeTeamUsers" }, "label": "{first_name} {last_name}", "trackBy": "uuid" }
1046
+ \`\`\`
1047
+
1048
+ **DATASET source** (custom dataset):
1049
+ \`\`\`json
1050
+ { "source": "DATASET", "dataset": { "uuid": "dataset-uuid" }, "label": "label", "trackBy": "value" }
1051
+ \`\`\`
1052
+
1053
+ **Common Storage Getters**: activeTeamUsers, departmentList, getLocations, getSubsidiaries, glAccountList, costCentreList, taxRateList, projectList, projectTaskList, supplierList, customerList, PaymentMethod, ExpenseCategory, currencyList, unitOfMeasureList
1054
+
1055
+ **Dropdown Filters**: Restrict dropdown options using filters:
1056
+ \`\`\`json
1057
+ {
1058
+ "select": {
1059
+ "source": "STORAGE",
1060
+ "storage": { "getter": "glAccountList" },
1061
+ "filters": [{ "field": "name", "value": ["Office Supplies", "Travel"], "operator": "EQUAL" }],
1062
+ "trackBy": "uuid"
1063
+ }
1064
+ }
1065
+ \`\`\`
1066
+ **Filter Operators**: \`EQUAL\` (exact match), \`CONTAINS\` (substring match)
1067
+
1068
+ ### Validations
1069
+ - **required**: \`{ "key": "required", "level": "error", "params": {} }\`
1070
+ - **requiredIf**: Conditionally required based on another field:
1071
+ - Static value: \`{ "key": "requiredIf", "level": "error", "params": { "path": "expense_type", "value": "CARD", "condition": "==", "category": "field", "subcategory": "static" } }\`
1072
+ - Object value: \`{ "key": "requiredIf", "level": "error", "params": { "path": "lines.zone", "value": { "code": "G/L Account", "name": "G/L Account", "uuid": "...", "status": "ACTIVE" }, ... } }\`
1073
+ - Any value: \`{ "params": { "path": "lines.sku", "value": null, "condition": "any", ... } }\`
1074
+ - Undefined check: \`{ "params": { "path": "lines.sku", "value": "", "condition": "undefined", ... } }\`
1075
+ - **number**: \`{ "key": "number", "level": "error", "params": {} }\`
1076
+ - **maxLength**: \`{ "key": "maxLength", "level": "error", "params": { "value": 100 } }\`
1077
+ - **minLength**: \`{ "key": "minLength", "level": "error", "params": { "value": 6 } }\`
1078
+ - **date**: \`{ "key": "date", "level": "error", "params": { "format": "YYYY-MM-DD" } }\`
1079
+ - **email**: \`{ "key": "email", "level": "error", "params": {} }\`
1080
+
1081
+ **Levels**: \`error\` (blocks save), \`warning\` (allows save with warning), \`info\` (informational)
1082
+
1083
+ ### Rules
1084
+ **visibleIf** - Show field conditionally:
1085
+ \`\`\`json
1086
+ { "name": "visibleIf", "params": { "path": "expense_type", "value": "CARD", "condition": "==", "category": "field", "subcategory": "static" } }
1087
+ \`\`\`
1088
+
1089
+ **computeField** - Auto-generate value (e.g., document numbers):
1090
+ \`\`\`json
1091
+ { "name": "computeField", "params": { "template": "PO-{{ \\"%05d\\" % counter }}", "counterKey": "{{ module }}-{{ submodule }}" } }
1092
+ \`\`\`
1093
+ **Template Patterns**:
1094
+ - Standard prefix: \`PO-{{ "%05d" % counter }}\` → PO-00001
1095
+ - Different padding: \`RC-{{ '%02d' % counter }}\` (2-digit), \`{{ "%04d" % counter }}\` (4-digit), \`EPO{{ "%06d" % counter }}\` (6-digit)
1096
+ - Counter offset: \`PO-{{ "%05d" % (counter + 1030) }}\` → starts from 1030
1097
+ - No prefix: \`{{ "%05d" % counter }}\` → 00001
1098
+ - Dynamic prefix from field: \`{{ transaction.custom.po_prefix.value }}-{{ "%05d" % counter }}\` → uses another field's value as prefix
1099
+
1100
+ **editableIf** - Control editability conditionally:
1101
+ \`\`\`json
1102
+ { "name": "editableIf", "params": { "path": "status", "value": "DRAFT", "condition": "==", "category": "field", "subcategory": "static" } }
1103
+ \`\`\`
1104
+
1105
+ ### Context Scoping
1106
+ - **Global**: \`{}\` - Applies to all modules/submodules
1107
+ - **All submodules in module**: \`{ "PURCHASING": [] }\`
1108
+ - **Specific submodule**: \`{ "PURCHASING": ["INVOICE"] }\`
1109
+ - **Multiple modules**: \`{ "SALES": ["INVOICE"], "PURCHASING": ["INVOICE"] }\`
1110
+
1111
+ ### Example: Conditional Payment Method Field
1112
+ \`\`\`json
1113
+ {
1114
+ "modelName": "Transaction",
1115
+ "path": "payment_method",
1116
+ "label": "Payment Method",
1117
+ "context": { "EXPENSES": ["EXPENSE", "CLAIM"] },
1118
+ "formData": {
1119
+ "editor": {
1120
+ "type": "DD_SINGLE",
1121
+ "placeholder": "Select a value",
1122
+ "select": { "label": "name", "source": "STORAGE", "storage": { "getter": "PaymentMethod" }, "trackBy": "uuid" }
1123
+ },
1124
+ "tooltip": "",
1125
+ "validations": [{ "key": "requiredIf", "level": "warning", "params": { "path": "expense_type", "value": "CARD", "condition": "==", "category": "field", "subcategory": "static" } }],
1126
+ "rules": [{ "name": "visibleIf", "params": { "path": "expense_type", "value": "CARD", "condition": "==", "category": "field", "subcategory": "static" } }]
1127
+ }
1128
+ }
1129
+ \`\`\`
1130
+
1131
+ ### Example: Auto-Numbering Document Field
1132
+ \`\`\`json
1133
+ {
1134
+ "modelName": "Transaction",
1135
+ "path": "document_number",
1136
+ "label": "PO Number",
1137
+ "context": { "PURCHASING": ["PURCHASE_ORDER"] },
1138
+ "formData": {
1139
+ "editor": { "type": "TEXT", "placeholder": "Auto-Generated" },
1140
+ "tooltip": "",
1141
+ "validations": [],
1142
+ "rules": [{ "name": "computeField", "params": { "template": "PO-{{ \\"%05d\\" % counter }}", "counterKey": "{{ module }}-{{ submodule }}" } }]
1143
+ }
1144
+ }
1145
+ \`\`\`
1146
+
1147
+ ## Document Status Management
1148
+
1149
+ Document statuses define the lifecycle stages of documents in Zudello. Each document type (module/submodule) has its own set of statuses.
1150
+
1151
+ ### Status Tools
1152
+ - **zudelloListStatuses** - List statuses, optionally filtered by module/submodule
1153
+ - **zudelloGetStatus** - Get full details of a status by UUID
1154
+ - **zudelloCreateStatus** - Create a new status for a document type
1155
+ - **zudelloUpdateStatus** - Update an existing status
1156
+ - **zudelloReorderStatuses** - Set the display order of statuses
1157
+
1158
+ ### Status Payload Structure
1159
+ \`\`\`json
1160
+ {
1161
+ "key": "REVIEW", // Unique key for API filtering (UPPER_SNAKE_CASE)
1162
+ "name": "User Review", // Display name shown in UI
1163
+ "type": "REVIEW", // Status category (see types below)
1164
+ "color": "#fdae61", // Hex color for UI display
1165
+ "isEnabled": true, // Whether status is active
1166
+ "isSelected": true, // Default selection in UI filters
1167
+ "canSetManually": true, // Whether users can manually set this status
1168
+ "order": 1 // Display order (0 = first)
1169
+ }
1170
+ \`\`\`
1171
+
1172
+ ### Status Types (enum - 12 values)
1173
+ | Type | Default Color | Description | Flags (enabled/selected/manual) |
1174
+ |------|---------------|-------------|--------------------------------|
1175
+ | ACTIVE | #3288bd (blue) | Active/enabled state | true/true/true |
1176
+ | APPROVE | #8b3694 (purple) | Awaiting approval | true/true/false |
1177
+ | REVIEW | #fdae61 (orange) | User review required | true/true/true |
1178
+ | COMPLETE | #5cb85c (green) | Successfully completed | true/false/false |
1179
+ | CLOSED | #d9534f (red) | Closed/archived | true/false/true |
1180
+ | REJECTED | #d53e4f (red) | Rejected/declined | true/false/true |
1181
+ | DELETED | #d9534f (red) | Soft deleted | true/false/false |
1182
+ | PROCESSING | #b4b4b4 (gray) | System processing | true/true/false |
1183
+ | SCANNING | #b4b4b4 (gray) | OCR/document scanning | true/true/false |
1184
+ | UNSUPPORTED | #b4b4b4 (gray) | Unsupported format | true/true/false |
1185
+ | FLAGGED | #f0ad4e (amber) | AI/system flagged | true/true/false |
1186
+ | PENDING | #326cbd (blue) | Pending action | true/true/false |
1187
+
1188
+ ### Context (REQUIRED)
1189
+ Every status MUST have a context specifying module and submodule:
1190
+ \`\`\`json
1191
+ { "PURCHASING": ["INVOICE"] } // For purchasing invoices
1192
+ { "EXPENSES": ["CLAIM"] } // For expense claims
1193
+ { "DIMENSIONS": ["ACCOUNT"] } // For GL accounts
1194
+ \`\`\`
1195
+
1196
+ ### Common Status Keys
1197
+ | Key | Typical Type | Color | Notes |
1198
+ |-----|-------------|-------|-------|
1199
+ | ACTIVE | ACTIVE | #3288bd | Active/enabled records |
1200
+ | APPROVAL | APPROVE | #8b3694 | Awaiting approval |
1201
+ | REVIEW | REVIEW | #fdae61 | User review needed |
1202
+ | READY | REVIEW | #3288bd | Ready for next step |
1203
+ | DRAFT | REVIEW | #b4b4b4 | Work in progress |
1204
+ | COMPLETE | COMPLETE | #5cb85c | Finished |
1205
+ | ARCHIVED | CLOSED | #d9534f | Archived |
1206
+ | REJECTED | REJECTED | #d53e4f | Rejected |
1207
+ | DELETED | DELETED | #d9534f | Soft deleted |
1208
+ | DUPLICATE | REJECTED | #777777 | Duplicate record |
1209
+ | INACTIVE | COMPLETE | #d53e4f | Deactivated |
1210
+ | PROCESSING | PROCESSING | #b4b4b4 | System processing |
1211
+ | SCANNING | SCANNING | #b4b4b4 | OCR scanning |
1212
+ | FLAGGED | FLAGGED | #f0ad4e | AI flagged |
1213
+ | UNABLE | REVIEW | #e74c3c | Unable to process |
1214
+
1215
+ ### Workflow: Create a Custom Status
1216
+ 1. List existing statuses: \`zudelloListStatuses\` with module/submodule
1217
+ 2. Create new status: \`zudelloCreateStatus\` with key, name, type, module, submodule
1218
+ 3. Optionally reorder: \`zudelloReorderStatuses\` to position the new status
1219
+
1220
+ ### Example: Create a "Property Required" Status
1221
+ \`\`\`json
1222
+ {
1223
+ "key": "PROPERTY_REQUIRED",
1224
+ "name": "Property Required",
1225
+ "type": "FLAGGED",
1226
+ "module": "PURCHASING",
1227
+ "submodule": "INVOICE",
1228
+ "color": "#32B2BD" // Optional, defaults to #f0ad4e for FLAGGED
1229
+ }
1230
+ \`\`\`
1231
+
1232
+ ## Quick Action Management
1233
+
1234
+ Quick actions are buttons displayed on documents that fire events for sentence automation. They can be system-wide or scoped to specific module/submodule contexts.
1235
+
1236
+ ### Quick Action Tools
1237
+ - **zudelloListQuickActions** - List all quick actions
1238
+ - **zudelloGetQuickAction** - Get details of a quick action by UUID
1239
+ - **zudelloCreateQuickAction** - Create a new quick action button
1240
+ - **zudelloUpdateQuickAction** - Update an existing quick action
1241
+ - **zudelloTriggerQuickAction** - Fire a quick action on documents (triggers sentence automation)
1242
+
1243
+ ### Quick Action Payload Structure
1244
+ \`\`\`json
1245
+ {
1246
+ "key": "SEND_TO_APPROVAL", // Unique key (becomes button event identifier)
1247
+ "name": "Send to Approval", // Display label on button
1248
+ "hotkey": "", // Optional keyboard shortcut
1249
+ "status": "APPROVAL", // Optional: status to set on document when clicked
1250
+ "context": { // Optional scoping (inside payload, not separate)
1251
+ "PURCHASING": ["INVOICE", "ORDER"]
1252
+ },
1253
+ "isInternal": false // If true, hidden from UI (programmatic only)
1254
+ }
1255
+ \`\`\`
1256
+
1257
+ ### Context Scoping
1258
+ - **System-wide**: Omit \`context\` or use empty object \`{}\` - appears on ALL documents
1259
+ - **Scoped**: Provide module/submodule mapping - appears only on matching documents
1260
+ \`\`\`json
1261
+ {"PURCHASING": ["INVOICE"]} // Only on purchasing invoices
1262
+ {"EXPENSES": ["CLAIM", "REPORT"]} // Only on expense claims and reports
1263
+ \`\`\`
1264
+
1265
+ ### Event Integration with Sentences
1266
+ When a quick action is triggered:
1267
+ 1. System fires a "button + key" event (e.g., button with key "SEND_TO_APPROVAL" fires "button SEND_TO_APPROVAL")
1268
+ 2. Sentences listening for that button event execute their automation logic
1269
+ 3. If \`status\` is set, document status changes automatically
1270
+
1271
+ ### Workflow: Create and Use a Quick Action
1272
+ 1. **Create quick action**: \`zudelloCreateQuickAction\` with key, name, optional context
1273
+ 2. **Create sentence**: Use \`zudelloCreateSentence\` with trigger "button YOUR_KEY"
1274
+ 3. **Use**: Users click button → event fires → sentence runs
1275
+
1276
+ ### Example: Create an "Escalate" Quick Action for Purchasing
1277
+ \`\`\`json
1278
+ {
1279
+ "key": "ESCALATE_FOR_REVIEW",
1280
+ "name": "Escalate for Review",
1281
+ "status": "REVIEW",
1282
+ "context": {"PURCHASING": ["INVOICE", "ORDER", "CREDIT"]}
1283
+ }
1284
+ \`\`\`
1285
+
1286
+ ### Triggering Quick Actions Programmatically
1287
+ Use \`zudelloTriggerQuickAction\` to fire a quick action on documents:
1288
+ \`\`\`json
1289
+ {
1290
+ "key": "ESCALATE_FOR_REVIEW",
1291
+ "documentUuids": ["doc-uuid-1", "doc-uuid-2"]
1292
+ }
1293
+ \`\`\`
1294
+ Response includes \`succeeded\` and \`failed\` arrays of document UUIDs.
1295
+
1296
+ ## Export Template Management
1297
+
1298
+ Export templates define reusable CSV export configurations for exporting data from any module/submodule.
1299
+
1300
+ ### Export Template Tools
1301
+ - **zudelloListExportTemplates** - List all export templates
1302
+ - **zudelloGetExportTemplate** - Get a template by UUID
1303
+ - **zudelloCreateExportTemplate** - Create a new export template
1304
+ - **zudelloUpdateExportTemplate** - Update an existing template
1305
+ - **zudelloRunExport** - Run an export using a template
1306
+ - **zudelloListExports** - List exports that have been run
1307
+ - **zudelloGetExportDownloadUrl** - Get presigned S3 download URL
1308
+
1309
+ ### IMPORTANT: Field Discovery
1310
+ Before creating or updating an export template, you MUST call \`zudelloGetFieldMetadata\` to discover valid field paths:
1311
+ \`\`\`json
1312
+ {
1313
+ "modelName": "Transaction",
1314
+ "section": "filters",
1315
+ "module": "PURCHASING",
1316
+ "submodule": "INVOICE"
1317
+ }
1318
+ \`\`\`
1319
+ Use the \`path\` values from the response for \`selected_fields\`.
1320
+
1321
+ ### Export Template Payload
1322
+ \`\`\`json
1323
+ {
1324
+ "name": "Monthly Invoice Export",
1325
+ "export_type": "csv", // "csv" for data, "originals" for file attachments
1326
+ "model_name": "Transaction", // Model to export from
1327
+ "module": "PURCHASING",
1328
+ "submodule": "INVOICE",
1329
+ "selected_fields": [ // Get valid paths from zudelloGetFieldMetadata
1330
+ "document_number",
1331
+ "date_issued",
1332
+ "supplier__trading_name",
1333
+ "lines__account__code",
1334
+ "total"
1335
+ ],
1336
+ "raw_filter": [] // Optional filters
1337
+ }
1338
+ \`\`\`
1339
+
1340
+ ### Model Names by Module
1341
+ - PURCHASING/SALES/EXPENSES/LEDGER: Transaction
1342
+ - INVENTORY/CATALOGUE: Item
1343
+ - DIMENSIONS/ACCOUNT: Account
1344
+ - DIMENSIONS/LOCATION: Location
1345
+ - DIMENSIONS/COST_CENTRE: CostCentre
1346
+ - DIMENSIONS/PROJECT: Project
1347
+ - RELATIONSHIPS/SUPPLIER: Supplier
1348
+ - RELATIONSHIPS/CUSTOMER: Customer
1349
+
1350
+ ### Filter Operators
1351
+ | Operator | Description | Example |
1352
+ |----------|-------------|----------|
1353
+ | exact | Exact match | {"field": "status", "value": "COMPLETE", "operator": "exact"} |
1354
+ | !exact | Not equal | {"field": "status", "value": "DELETED", "operator": "!exact"} |
1355
+ | in | Value in list | {"field": "status", "value": ["REVIEW", "APPROVAL"], "operator": "in"} |
1356
+ | range | Between values | {"field": "date_issued", "value": ["2025-01-01", "2025-12-31"], "operator": "range"} |
1357
+ | gt/lt/gte/lte | Comparisons | {"field": "total", "value": 1000, "operator": "gt"} |
1358
+ | icontains | Case-insensitive contains | {"field": "supplier__legal_name", "value": "acme", "operator": "icontains"} |
1359
+ | isnull | Null check | {"field": "po_number", "value": true, "operator": "isnull"} |
1360
+ | date_on | Exact date | {"field": "created_at", "value": "2025-01-15", "operator": "date_on"} |
1361
+
1362
+ ### Workflow: Create and Run an Export
1363
+ 1. **Discover fields**: \`zudelloGetFieldMetadata\` with section="filters", module, submodule
1364
+ 2. **Create template**: \`zudelloCreateExportTemplate\` with fields from step 1
1365
+ 3. **Run export**: \`zudelloRunExport\` with template name and user UUID
1366
+ 4. **Check status**: \`zudelloListExports\` to find the new export
1367
+ 5. **Download**: \`zudelloGetExportDownloadUrl\` with the export UUID
1368
+
1369
+ ### Example: Create Invoice Export with Date Filter
1370
+ \`\`\`json
1371
+ {
1372
+ "name": "Completed Invoices Jan 2025",
1373
+ "export_type": "csv",
1374
+ "model_name": "Transaction",
1375
+ "module": "PURCHASING",
1376
+ "submodule": "INVOICE",
1377
+ "selected_fields": [
1378
+ "document_number",
1379
+ "date_issued",
1380
+ "supplier__trading_name",
1381
+ "total",
1382
+ "status"
1383
+ ],
1384
+ "raw_filter": [
1385
+ {
1386
+ "field": "date_issued",
1387
+ "fieldType": "Date",
1388
+ "operator": "range",
1389
+ "value": ["2025-01-01", "2025-01-31"]
1390
+ },
1391
+ {
1392
+ "field": "status",
1393
+ "fieldType": "Relation",
1394
+ "operator": "exact",
1395
+ "value": "COMPLETE"
1396
+ }
1397
+ ]
1398
+ }
1399
+ \`\`\`
1400
+
1401
+ ## Document Type Management
1402
+
1403
+ Document types define form layouts for documents like Purchase Orders, Invoices, Expenses, etc. Each document type belongs to a single module/submodule and contains fields, sections, and extensions that control form behavior.
1404
+
1405
+ **CRITICAL**: Field metadata from the Field Manager serves as the BASE for all field objects. Custom fields MUST first be created in Field Manager before they can be used in document types. Document types only OVERRIDE the base field settings (label, visibility, position, validations).
1406
+
1407
+ ### Document Type Tools
1408
+ - **zudelloListDocumentTypes** - List document types, optionally filtered by module/submodule
1409
+ - **zudelloGetDocumentType** - Get full details of a document type by UUID (raw/editable version)
1410
+ - **zudelloGetMergedFormMetadata** - Get rendered form with merged field metadata (end-user view)
1411
+ - **zudelloCreateDocumentType** - Create a new document type
1412
+ - **zudelloUpdateDocumentType** - Update an existing document type
1413
+
1414
+ ### Two Ways to Fetch Document Types
1415
+ 1. **Raw/Editable** (\`zudelloGetDocumentType\`): Returns the document type as stored, for editing. Contains only OVERRIDES.
1416
+ 2. **Merged/Rendered** (\`zudelloGetMergedFormMetadata\`): Returns with field metadata merged from field_settings, showing what users actually see. This is what the form renders.
1417
+
1418
+ ### Common Modules and Submodules
1419
+ - **PURCHASING**: INVOICE, ORDER, CREDIT, QUOTE, REQUISITION
1420
+ - **SALES**: INVOICE, ORDER, CREDIT, QUOTE, RETURN, REMITTANCE
1421
+ - **EXPENSES**: EXPENSE, CLAIM, PAYMENT
1422
+ - **INVENTORY**: RECEIPT, CATALOGUE, PRICE_BOOK, TRANSFER, ADJUSTMENT
1423
+ - **DIMENSIONS**: ACCOUNT, DEPARTMENT, LOCATION, PROJECT, COST_CENTRE, COST_TYPE, TAX_RATE, CURRENCY, SUBSIDIARY, EMPLOYEE, CUSTOMER, SUPPLIER, FIXED_ASSET, BATCH, BIN
1424
+ - **BUDGETS**: BUDGET
1425
+ - **RELATIONSHIPS**: SUPPLIER, CUSTOMER, EMPLOYEE
1426
+
1427
+ ### Document Type Payload Structure
1428
+ \`\`\`json
1429
+ {
1430
+ "display": "Purchase Order", // User-friendly name
1431
+ "type": "PURCHASE_ORDER", // Internal identifier (UPPER_SNAKE_CASE)
1432
+ "property": "PURCHASE_ORDER", // Usually matches type
1433
+ "module": "PURCHASING",
1434
+ "submodule": "ORDER",
1435
+ "icon": { "name": "shopping-cart", "color": "black" },
1436
+ "isHidden": false, // Hide from document type selector
1437
+ "isDefaultCreate": true, // Default when creating new documents
1438
+ "isDefaultPipeline": true, // Default in processing pipeline
1439
+ "isDefaultSales": false, // Default for sales module
1440
+ "isDefaultPurchasing": false, // Default for purchasing module
1441
+ "global_resource": false, // Available across all teams
1442
+ "isTemplate": false, // Is this a template
1443
+ "settings": {
1444
+ "fields": [...], // Field definitions (OVERRIDES only)
1445
+ "sections": [...], // Section definitions
1446
+ "extensions": [...], // Enabled form extensions
1447
+ "statuses": { "create": "REVIEW", "revert": "READY" },
1448
+ "toolbar": { "showSaveAndSubmitButton": false },
1449
+ "validation": { "tolerance": 0.02 }
1450
+ }
1451
+ }
1452
+ \`\`\`
1453
+
1454
+ ### Settings: Fields
1455
+ Each field defines OVERRIDES to the base field metadata from Field Manager:
1456
+ \`\`\`json
1457
+ {
1458
+ "path": "document_number", // Field path - must exist in Field Manager
1459
+ "label": "Invoice Number", // OVERRIDE: Custom label for this doc type
1460
+ "editor": { // OVERRIDE: Custom editor configuration
1461
+ "type": "TEXT", // TEXT, NUMERIC, DATE, BOOLEAN, DD_SINGLE, DD_MULTIPLE
1462
+ "placeholder": "Enter number",
1463
+ "numeric": { "precision": 2 }, // For NUMERIC type
1464
+ "default": { "code": "AUD", "name": "Australian Dollar", "uuid": "..." },
1465
+ "select": { // For dropdown types
1466
+ "label": "{code} - {name}", // Template for display
1467
+ "source": "STORAGE",
1468
+ "storage": { "getter": "currencyList" },
1469
+ "trackBy": "uuid",
1470
+ "filters": [{ "field": "status", "value": ["ACTIVE"], "operator": "EQUAL" }]
1471
+ }
1472
+ },
1473
+ "section": { "key": "HEADER", "cols": 4, "order": 1 },
1474
+ "visible": true, // OVERRIDE: Show on form
1475
+ "editable": true, // OVERRIDE: Allow editing
1476
+ "renderer": {
1477
+ "width": 200, // Column width in pixels for line items
1478
+ "align": "right", // For totals section
1479
+ "horizontal": true, // Horizontal layout
1480
+ "break": { "after": true, "before": false } // Line breaks
1481
+ },
1482
+ "validations": [ // OVERRIDE: Document-specific validations
1483
+ { "key": "required", "level": "error", "params": {} },
1484
+ { "key": "maxLength", "level": "error", "params": { "value": 100 } },
1485
+ { "key": "requiredIf", "level": "error", "params": {
1486
+ "path": "lines.account",
1487
+ "value": { "uuid": "...", "code": "42000" },
1488
+ "category": "field",
1489
+ "condition": "==",
1490
+ "subcategory": "static"
1491
+ }}
1492
+ ]
1493
+ }
1494
+ \`\`\`
1495
+
1496
+ ### Common Field Paths by Form Type
1497
+ **Transactional Documents (Invoices, Orders, Credits):**
1498
+ - Header: document_type, document_number, date_issued, date_due, date_posted, po_number, reference, currency, external_id
1499
+ - Contact: company_name, company_tax, company_email, company_phone, company_code
1500
+ - Address: addressee, attention, address_line_1/2/3, city, state, postcode, country
1501
+ - Lines: lines.sku, lines.description, lines.quantity, lines.unit_price, lines.total, lines.tax_rate, lines.tax_amount, lines.note
1502
+ - Lines (Dimensions): lines.account, lines.department, lines.location, lines.subsidiary, lines.project, lines.cost_centre, lines.cost_type, lines.customer
1503
+ - Landed Costs: lcLines.sku, lcLines.description, lcLines.quantity, lcLines.unit_price, lcLines.total
1504
+ - Totals: tax_included, subtotal, tax, total, freight
1505
+ - Custom: custom.date_received, custom.spendType, custom.billable
1506
+
1507
+ **Dimension Documents (Accounts, Departments, etc.):**
1508
+ - Header: document_type, code, name, external_id
1509
+
1510
+ **Relationship Documents (Suppliers, Customers, Employees):**
1511
+ - Header: document_type, first_name, last_name, user, locations
1512
+ - Tabular: emails.email (with rootPath: "emails")
1513
+
1514
+ ### Settings: Sections
1515
+ Sections group fields on the form. Use the 12-column grid (cols: 4 = 1/3 width, cols: 8 = 2/3, cols: 12 = full):
1516
+ \`\`\`json
1517
+ {
1518
+ "key": "HEADER", // System section keys below
1519
+ "label": "Header",
1520
+ "order": 0, // Display order
1521
+ "visible": true,
1522
+ "collapse": false, // Default collapsed state
1523
+ "expandable": false, // Can user collapse/expand (true for detail sections)
1524
+ "editable": true,
1525
+ "system": true // System-defined vs custom section
1526
+ }
1527
+ \`\`\`
1528
+
1529
+ **Standard System Sections (order matters):**
1530
+ - HEADER (order: 0): Main document fields, expandable: false
1531
+ - CONTACT (order: 1): Company/contact info, expandable: true
1532
+ - ADDRESS_DELIVERY (order: 2): Delivery address, expandable: true, collapse: true
1533
+ - LINES (order: 3): Line items, expandable: true
1534
+ - LCS (order: 4): Landed costs (optional), expandable: true
1535
+ - TOTALS (order: 5): Totals section, expandable: true/false
1536
+ - NOTES (order: 6): Notes section, expandable: true, collapse: true
1537
+ - BUDGET (order: varies): Budget section for budget module
1538
+
1539
+ **Custom Tabular Sections** (for arrays like emails, addresses):
1540
+ \`\`\`json
1541
+ {
1542
+ "key": "SECTION_unique_id", // Custom key format
1543
+ "label": "Emails",
1544
+ "order": 1,
1545
+ "system": false,
1546
+ "tabular": true, // Renders as a table
1547
+ "rootPath": "emails", // Array path in document
1548
+ "tooltip": "",
1549
+ "visible": true,
1550
+ "collapse": false,
1551
+ "editable": true,
1552
+ "expandable": true
1553
+ }
1554
+ \`\`\`
1555
+
1556
+ ### Settings: Extensions - Complete Reference
1557
+
1558
+ **Contact & Supplier Extensions:**
1559
+ - \`contact_select\`: Supplier/customer selection and auto-fill
1560
+ - \`contact_abn\`: ABN/tax number validation (Australia)
1561
+ - \`contact_bank_details\`: Bank details validation
1562
+ - \`confirm_contact_creation\`: Confirmation dialog for new contacts
1563
+ - \`validate_no_new_contact\`: Block creation of new contacts
1564
+
1565
+ **Item Matching Extensions:**
1566
+ - \`match_item\`: Item/SKU matching with catalog
1567
+ - \`confirm_item_creation\`: Confirmation dialog for new items
1568
+ - \`validate_no_new_line_item\`: Block creation of new items (requiredIf param for conditional)
1569
+ - \`hide_line_columns_with_empty_select\`: Hide dropdown columns with no options
1570
+
1571
+ **Line Calculation Extensions:**
1572
+ - \`line_creation\`: Allow adding new line items
1573
+ - \`calculate_line\`: Auto-calculate line totals
1574
+ - formulaKey: \`purchase_total_equal_to_price_x_qty\`, \`purchase_total_considered_with_tax_treatment\`
1575
+ - \`calculate_line_tax\`: Auto-calculate line tax
1576
+ - formulaKey: \`tax_from_total_by_tax_rate\`, \`tax_from_total_by_tax_rate_with_tax_treatment\`
1577
+
1578
+ **Document Calculation Extensions:**
1579
+ - \`calculate_document_total\`: Auto-calculate document total
1580
+ - formulaKey: \`total_equal_to_subtotal_considered_with_tax_treatment\`
1581
+ - \`calculate_document_subtotal\`: Auto-sum line totals
1582
+ - \`calculate_document_tax\`: Auto-calculate document tax (viewOnly: true for display-only)
1583
+ - formulaKey: \`tax_equal_lines_tax_sum\`, \`tax_equal_lines_tax_sum_based_on_tax_rate\`
1584
+ - \`currency_conversion\`: Multi-currency support with exchange rates
1585
+
1586
+ **Validation Extensions:**
1587
+ - \`validate_purchase_line_total\`: Validate line totals (qty × price = total)
1588
+ - \`validate_purchase_total\`: Validate document total matches sum
1589
+ - \`validate_purchase_total_as_sum_by_lines\`: Strict line sum validation
1590
+ - \`validate_lines_total\`: Validate line totals sum correctly
1591
+ - \`validate_document_tax\`: Validate tax calculations
1592
+ - \`validate_document_due_date\`: Validate due date is after issue date
1593
+
1594
+ **Allocation & Matching Extensions:**
1595
+ - \`allocations_matching\`: Match to POs, receipts, or other documents
1596
+ - resourceListParams: Array of matching configurations
1597
+ - autofill: ALWAYS, NEVER, ONCE
1598
+ - matchLinesBy: { sku: true, description: true }
1599
+ - checkRemaining: "quantity" or "total"
1600
+ - allLinesShouldBeMatched: true/false
1601
+
1602
+ **UI Extensions:**
1603
+ - \`close_modal\`: Close form on status change
1604
+ - statusChangedTo: ["PROCESSING", "COMPLETE", "APPROVAL", "REJECTED"]
1605
+ - \`address_select\`: Address selection from saved addresses
1606
+ - model: "TeamAddress" or "ContactAddress"
1607
+ - \`locations\`: Location handling
1608
+ - locationRequiredForEachLine: true/false
1609
+
1610
+ ### Extension Examples from Production
1611
+
1612
+ **Standard Purchasing Invoice Extensions:**
1613
+ \`\`\`json
1614
+ [
1615
+ { "name": "currency_conversion" },
1616
+ { "name": "contact_select", "params": {
1617
+ "allowCreation": false,
1618
+ "override": {
1619
+ "contact": { "force": true, "confirm": false, "enabled": true },
1620
+ "lines": { "force": true, "confirm": false, "enabled": true },
1621
+ "dueDate": { "force": false }
1622
+ }
1623
+ }},
1624
+ { "name": "contact_abn" },
1625
+ { "name": "contact_bank_details" },
1626
+ { "name": "line_creation" },
1627
+ { "name": "validate_no_new_contact" },
1628
+ { "name": "hide_line_columns_with_empty_select" },
1629
+ { "name": "calculate_line", "params": { "formulaKey": "purchase_total_equal_to_price_x_qty" }},
1630
+ { "name": "calculate_line_tax", "params": { "formulaKey": "tax_from_total_by_tax_rate_with_tax_treatment" }},
1631
+ { "name": "validate_purchase_line_total" },
1632
+ { "name": "calculate_document_tax", "params": { "viewOnly": true, "formulaKey": "tax_equal_lines_tax_sum_based_on_tax_rate" }},
1633
+ { "name": "validate_purchase_total" },
1634
+ { "name": "validate_purchase_total_as_sum_by_lines" },
1635
+ { "name": "close_modal", "params": { "statusChangedTo": ["APPROVAL", "READY_TO_POST", "COMPLETE", "REJECTED"] }}
1636
+ ]
1637
+ \`\`\`
1638
+
1639
+ **Invoice with PO Matching Extensions:**
1640
+ \`\`\`json
1641
+ [
1642
+ { "name": "match_item", "params": {
1643
+ "override": { "force": false, "confirm": false, "enabled": true },
1644
+ "overridePricing": { "force": false, "confirm": false, "enabled": false },
1645
+ "allowItemCreation": false,
1646
+ "allowItemAlternativeCreation": true
1647
+ }},
1648
+ { "name": "allocations_matching", "params": {
1649
+ "resourceListParams": [{
1650
+ "level": "LINES",
1651
+ "module": "PURCHASING",
1652
+ "submodule": "ORDER",
1653
+ "autofill": "ALWAYS",
1654
+ "required": true,
1655
+ "statuses": ["COMPLETE", "PLACED", "PARTIALLY_INVOICED"],
1656
+ "matchLinesBy": { "sku": true },
1657
+ "autofillFields": ["po_number", "lines.item", "lines.location", "lines.department", "lines.account", "lines.project", "lines.tax_rate", "lines.subsidiary"],
1658
+ "checkRemaining": "quantity",
1659
+ "skipLandedCostMatching": true,
1660
+ "allLinesShouldBeMatched": true
1661
+ }]
1662
+ }}
1663
+ ]
1664
+ \`\`\`
1665
+
1666
+ **Goods Receipt with PO and Invoice Matching:**
1667
+ \`\`\`json
1668
+ [
1669
+ { "name": "allocations_matching", "params": {
1670
+ "resourceListParams": [
1671
+ {
1672
+ "level": "LINES",
1673
+ "module": "PURCHASING",
1674
+ "submodule": "ORDER",
1675
+ "autofill": "ALWAYS",
1676
+ "required": false,
1677
+ "statuses": ["COMPLETE"],
1678
+ "matchLinesBy": { "sku": true, "description": true },
1679
+ "autofillFields": ["po_number"],
1680
+ "allLinesShouldBeMatched": false
1681
+ },
1682
+ {
1683
+ "level": "LINES",
1684
+ "module": "PURCHASING",
1685
+ "submodule": "INVOICE",
1686
+ "autofill": "NEVER",
1687
+ "required": false,
1688
+ "statuses": [],
1689
+ "matchLinesBy": { "sku": true, "description": true },
1690
+ "allLinesShouldBeMatched": false
1691
+ }
1692
+ ]
1693
+ }}
1694
+ ]
1695
+ \`\`\`
1696
+
1697
+ ### Context (REQUIRED)
1698
+ Every document type MUST have a context specifying module and submodule:
1699
+ \`\`\`json
1700
+ { "PURCHASING": ["INVOICE"] } // For purchasing invoices
1701
+ { "EXPENSES": ["EXPENSE"] } // For expenses
1702
+ { "SALES": ["ORDER"] } // For sales orders
1703
+ { "INVENTORY": ["RECEIPT"] } // For goods receipts
1704
+ { "DIMENSIONS": ["ACCOUNT"] } // For GL accounts
1705
+ { "RELATIONSHIPS": ["SUPPLIER"] } // For suppliers
1706
+ \`\`\`
1707
+
1708
+ ### Workflow: Create a Document Type
1709
+ 1. **Check Field Manager**: Ensure all required fields exist (use zudelloGetFieldMetadata)
1710
+ 2. **List existing**: \`zudelloListDocumentTypes\` with target module/submodule
1711
+ 3. **Get reference**: \`zudelloGetDocumentType\` on similar type to understand structure
1712
+ 4. **Create**: \`zudelloCreateDocumentType\` with fields, sections, and extensions
1713
+ 5. **Test merged**: \`zudelloGetMergedFormMetadata\` to verify field metadata merged correctly
1714
+
1715
+ ### Workflow: Update a Document Type
1716
+ 1. **Get current**: \`zudelloGetDocumentType(uuid)\` - get FULL current state
1717
+ 2. **Copy payload**: Start with complete existing configuration
1718
+ 3. **Modify**: Change only the specific fields/sections/extensions needed
1719
+ 4. **Update**: \`zudelloUpdateDocumentType\` with complete payload (partial updates NOT supported)
1720
+
1721
+ ### Example: Create a Full Invoice Document Type
1722
+ \`\`\`json
1723
+ {
1724
+ "display": "Service Invoice",
1725
+ "type": "SERVICE_INVOICE",
1726
+ "property": "SERVICE_INVOICE",
1727
+ "module": "PURCHASING",
1728
+ "submodule": "INVOICE",
1729
+ "icon": { "name": "file-text", "color": "black" },
1730
+ "isHidden": false,
1731
+ "isDefaultCreate": false,
1732
+ "isDefaultPipeline": false,
1733
+ "global_resource": false,
1734
+ "settings": {
1735
+ "fields": [
1736
+ { "path": "document_type", "label": "Type", "section": { "key": "HEADER", "cols": 4, "order": 0 }, "visible": true, "editable": true },
1737
+ { "path": "document_number", "section": { "key": "HEADER", "cols": 4, "order": 1 }, "visible": true, "editable": true, "renderer": { "break": { "after": true }}, "validations": [{ "key": "required", "level": "error", "params": {} }] },
1738
+ { "path": "date_issued", "section": { "key": "HEADER", "cols": 4, "order": 2 }, "visible": true, "editable": true },
1739
+ { "path": "date_due", "section": { "key": "HEADER", "cols": 4, "order": 3 }, "visible": true, "editable": true },
1740
+ { "path": "currency", "section": { "key": "HEADER", "cols": 4, "order": 4 }, "visible": true, "editable": true },
1741
+ { "path": "company_name", "section": { "key": "CONTACT", "cols": 12, "order": 0 }, "visible": true, "editable": true },
1742
+ { "path": "lines.description", "section": { "key": "LINES", "cols": 4, "order": 0 }, "visible": true, "editable": true, "renderer": { "width": 250 }, "validations": [{ "key": "required", "level": "error", "params": {} }] },
1743
+ { "path": "lines.account", "section": { "key": "LINES", "cols": 4, "order": 1 }, "visible": true, "editable": true, "renderer": { "width": 150 }, "validations": [{ "key": "required", "level": "error", "params": {} }] },
1744
+ { "path": "lines.quantity", "section": { "key": "LINES", "cols": 4, "order": 2 }, "visible": true, "editable": true, "renderer": { "width": 100 } },
1745
+ { "path": "lines.unit_price", "section": { "key": "LINES", "cols": 4, "order": 3 }, "visible": true, "editable": true, "renderer": { "width": 100 } },
1746
+ { "path": "lines.total", "section": { "key": "LINES", "cols": 4, "order": 4 }, "visible": true, "editable": true, "renderer": { "width": 100 } },
1747
+ { "path": "tax_included", "section": { "key": "TOTALS", "cols": 12, "order": 0 }, "visible": true, "editable": true, "renderer": { "align": "right", "width": 350 } },
1748
+ { "path": "subtotal", "section": { "key": "TOTALS", "cols": 12, "order": 1 }, "visible": true, "editable": true, "renderer": { "align": "right", "width": 300, "horizontal": true } },
1749
+ { "path": "tax", "section": { "key": "TOTALS", "cols": 12, "order": 2 }, "visible": true, "editable": true, "renderer": { "align": "right", "width": 300, "horizontal": true } },
1750
+ { "path": "total", "section": { "key": "TOTALS", "cols": 12, "order": 3 }, "visible": true, "editable": true, "renderer": { "align": "right", "width": 300, "horizontal": true } }
1751
+ ],
1752
+ "sections": [
1753
+ { "key": "HEADER", "label": "Header", "order": 0, "system": true, "visible": true, "collapse": false, "editable": true, "expandable": false },
1754
+ { "key": "CONTACT", "label": "Company", "order": 1, "system": true, "visible": true, "collapse": false, "editable": true, "expandable": true },
1755
+ { "key": "LINES", "label": "Items", "order": 2, "system": true, "visible": true, "collapse": false, "editable": true, "expandable": true },
1756
+ { "key": "TOTALS", "label": "Totals", "order": 3, "system": true, "visible": true, "collapse": false, "editable": true, "expandable": true }
1757
+ ],
1758
+ "extensions": [
1759
+ { "name": "currency_conversion" },
1760
+ { "name": "contact_select", "params": { "allowCreation": false, "override": { "contact": { "force": true, "confirm": false, "enabled": true }, "lines": { "force": true, "confirm": false, "enabled": true }}}},
1761
+ { "name": "line_creation" },
1762
+ { "name": "validate_no_new_contact" },
1763
+ { "name": "calculate_line", "params": { "formulaKey": "purchase_total_equal_to_price_x_qty" }},
1764
+ { "name": "validate_purchase_line_total" },
1765
+ { "name": "calculate_document_tax", "params": { "viewOnly": true, "formulaKey": "tax_equal_lines_tax_sum_based_on_tax_rate" }},
1766
+ { "name": "validate_purchase_total" },
1767
+ { "name": "close_modal", "params": { "statusChangedTo": ["PROCESSING", "COMPLETE"] }}
1768
+ ],
1769
+ "statuses": { "create": "REVIEW", "revert": "REVIEW" },
1770
+ "toolbar": {}
1771
+ }
1772
+ }
1773
+ \`\`\`
1774
+
1775
+ ### Example: Simple Dimension Document Type
1776
+ \`\`\`json
1777
+ {
1778
+ "display": "Cost Centre",
1779
+ "type": "COST_CENTRE",
1780
+ "property": "COST_CENTRE",
1781
+ "module": "DIMENSIONS",
1782
+ "submodule": "COST_CENTRE",
1783
+ "settings": {
1784
+ "fields": [
1785
+ { "path": "document_type", "section": { "key": "HEADER", "cols": 4, "order": -1 }, "visible": true, "editable": true },
1786
+ { "path": "code", "section": { "key": "HEADER", "cols": 4, "order": 1 }, "visible": true, "editable": true, "renderer": { "break": { "after": true }}},
1787
+ { "path": "name", "section": { "key": "HEADER", "cols": 8, "order": 2 }, "visible": true, "editable": true }
1788
+ ],
1789
+ "sections": [
1790
+ { "key": "HEADER", "label": "Header", "order": 1, "system": true, "visible": true, "collapse": false, "editable": true, "expandable": false }
1791
+ ],
1792
+ "extensions": []
1793
+ }
1794
+ }
1795
+ \`\`\`
1796
+
1797
+ ## Guidelines
1798
+
1799
+ - **Be Efficient**: Use batch operations when working with multiple resources
1800
+ - **Validate First**: Check model schemas before creating/updating data
1801
+ - **Explain Actions**: Briefly describe what you're doing before calling tools
1802
+ - **Handle Errors**: If a search returns no results, suggest alternative filters or models
1803
+
1804
+ ## IMPORTANT: Users vs Employees
1805
+ - When creating resources, sentences, or assigning documents, always use **Users** (not Employees)
1806
+ - **Employees** are ONLY used for the employee dimension field
1807
+ - This distinction is critical for proper system behavior
1808
+
1809
+ ## IMPORTANT: Voice Mode Support
1810
+ This conversation may be happening in voice mode. To avoid awkward silence:
1811
+ - **ALWAYS** say something brief BEFORE calling any tool, like "Let me search for that" or "Checking the system now"
1812
+ - Keep acknowledgments short (under 10 words)
1813
+ - After tool results, summarize findings conversationally
1814
+
1815
+ ## Current Context
1816
+ - Organization: [Organization]
1817
+ - Team: [Team]
1818
+ - User: [User]
1819
+ - User UUID: [USER_UUID]`;
1820
+ }
1821
+ //# sourceMappingURL=zudello-system.js.map