@endora-commerce/mod-tasks 0.110.0 → 0.111.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 (308) hide show
  1. package/dist/admin/components/TaskCustomFields.js +2 -13
  2. package/dist/backend/email-templates/digest-defaults.d.ts +14 -7
  3. package/dist/backend/email-templates/digest-defaults.js +39 -19
  4. package/dist/backend/email-templates/reminder-defaults.d.ts +7 -3
  5. package/dist/backend/email-templates/reminder-defaults.js +11 -3
  6. package/dist/backend/entities/task-value-change.entity.d.ts +27 -0
  7. package/dist/backend/entities/task-value-change.entity.js +62 -0
  8. package/dist/backend/index.d.ts +2 -1
  9. package/dist/backend/index.js +27 -3
  10. package/dist/backend/services/attachment-service.d.ts +5 -4
  11. package/dist/backend/services/attachment-service.js +25 -9
  12. package/dist/backend/services/digest-service.js +1 -0
  13. package/dist/backend/services/owner-read-permissions.d.ts +3 -0
  14. package/dist/backend/services/owner-read-permissions.js +3 -0
  15. package/dist/backend/services/reference-service.js +1 -13
  16. package/dist/backend/services/reminder-schedule.d.ts +2 -1
  17. package/dist/backend/services/reminder-schedule.js +7 -3
  18. package/dist/backend/services/task-access.js +8 -0
  19. package/dist/backend/services/task-audit-state.d.ts +42 -0
  20. package/dist/backend/services/task-audit-state.js +98 -0
  21. package/dist/backend/services/task-commands.d.ts +38 -2
  22. package/dist/backend/services/task-commands.js +70 -7
  23. package/dist/backend/services/task-email.d.ts +8 -0
  24. package/dist/backend/services/task-email.js +18 -2
  25. package/dist/backend/services/task-history-service.d.ts +37 -0
  26. package/dist/backend/services/task-history-service.js +82 -7
  27. package/dist/backend/services/time-zone-rederive-service.d.ts +57 -0
  28. package/dist/backend/services/time-zone-rederive-service.js +105 -0
  29. package/dist/backend/workers/tasks-reminders-worker.d.ts +12 -6
  30. package/dist/backend/workers/tasks-reminders-worker.js +13 -6
  31. package/dist/manifest.d.ts +25 -1
  32. package/dist/manifest.js +35 -1
  33. package/dist/migrations/20261110T054810_tasks_value_changes.d.ts +23 -0
  34. package/dist/migrations/20261110T054810_tasks_value_changes.js +39 -0
  35. package/dist/migrations/index.d.ts +2 -1
  36. package/dist/migrations/index.js +7 -2
  37. package/docs/tasks.md +37 -8
  38. package/i18n/en.json +1 -0
  39. package/i18n/pl.json +1 -0
  40. package/package.json +11 -10
  41. package/dist/admin/api.d.ts.map +0 -1
  42. package/dist/admin/api.js.map +0 -1
  43. package/dist/admin/components/AssigneePicker.d.ts.map +0 -1
  44. package/dist/admin/components/AssigneePicker.js.map +0 -1
  45. package/dist/admin/components/BoardCardFieldsEditor.d.ts.map +0 -1
  46. package/dist/admin/components/BoardCardFieldsEditor.js.map +0 -1
  47. package/dist/admin/components/ContextLabel.d.ts.map +0 -1
  48. package/dist/admin/components/ContextLabel.js.map +0 -1
  49. package/dist/admin/components/ContextSection.d.ts.map +0 -1
  50. package/dist/admin/components/ContextSection.js.map +0 -1
  51. package/dist/admin/components/DigestControl.d.ts.map +0 -1
  52. package/dist/admin/components/DigestControl.js.map +0 -1
  53. package/dist/admin/components/LinkedRecordsSection.d.ts.map +0 -1
  54. package/dist/admin/components/LinkedRecordsSection.js.map +0 -1
  55. package/dist/admin/components/LookupPicker.d.ts.map +0 -1
  56. package/dist/admin/components/LookupPicker.js.map +0 -1
  57. package/dist/admin/components/RelatedTasksSection.d.ts.map +0 -1
  58. package/dist/admin/components/RelatedTasksSection.js.map +0 -1
  59. package/dist/admin/components/RemindersSection.d.ts.map +0 -1
  60. package/dist/admin/components/RemindersSection.js.map +0 -1
  61. package/dist/admin/components/StatusBadge.d.ts.map +0 -1
  62. package/dist/admin/components/StatusBadge.js.map +0 -1
  63. package/dist/admin/components/SubtasksSection.d.ts.map +0 -1
  64. package/dist/admin/components/SubtasksSection.js.map +0 -1
  65. package/dist/admin/components/TaskAttachments.d.ts.map +0 -1
  66. package/dist/admin/components/TaskAttachments.js.map +0 -1
  67. package/dist/admin/components/TaskBoard.d.ts.map +0 -1
  68. package/dist/admin/components/TaskBoard.js.map +0 -1
  69. package/dist/admin/components/TaskCard.d.ts.map +0 -1
  70. package/dist/admin/components/TaskCard.js.map +0 -1
  71. package/dist/admin/components/TaskComments.d.ts.map +0 -1
  72. package/dist/admin/components/TaskComments.js.map +0 -1
  73. package/dist/admin/components/TaskCustomFields.d.ts.map +0 -1
  74. package/dist/admin/components/TaskCustomFields.js.map +0 -1
  75. package/dist/admin/components/TaskFieldInputs.d.ts.map +0 -1
  76. package/dist/admin/components/TaskFieldInputs.js.map +0 -1
  77. package/dist/admin/components/TaskFilters.d.ts.map +0 -1
  78. package/dist/admin/components/TaskFilters.js.map +0 -1
  79. package/dist/admin/components/TaskMarkers.d.ts.map +0 -1
  80. package/dist/admin/components/TaskMarkers.js.map +0 -1
  81. package/dist/admin/components/TaskPicker.d.ts.map +0 -1
  82. package/dist/admin/components/TaskPicker.js.map +0 -1
  83. package/dist/admin/components/ViewModeToggle.d.ts.map +0 -1
  84. package/dist/admin/components/ViewModeToggle.js.map +0 -1
  85. package/dist/admin/components/priorities/TaskPriorityDeleteDialog.d.ts.map +0 -1
  86. package/dist/admin/components/priorities/TaskPriorityDeleteDialog.js.map +0 -1
  87. package/dist/admin/components/priorities/TaskPriorityDialog.d.ts.map +0 -1
  88. package/dist/admin/components/priorities/TaskPriorityDialog.js.map +0 -1
  89. package/dist/admin/components/tags/TaskTagDeleteDialog.d.ts.map +0 -1
  90. package/dist/admin/components/tags/TaskTagDeleteDialog.js.map +0 -1
  91. package/dist/admin/components/tags/TaskTagDialog.d.ts.map +0 -1
  92. package/dist/admin/components/tags/TaskTagDialog.js.map +0 -1
  93. package/dist/admin/components/task-columns.d.ts.map +0 -1
  94. package/dist/admin/components/task-columns.js.map +0 -1
  95. package/dist/admin/components/workflow/TaskStatusDeleteDialog.d.ts.map +0 -1
  96. package/dist/admin/components/workflow/TaskStatusDeleteDialog.js.map +0 -1
  97. package/dist/admin/components/workflow/TaskStatusDialog.d.ts.map +0 -1
  98. package/dist/admin/components/workflow/TaskStatusDialog.js.map +0 -1
  99. package/dist/admin/components/workflow/TaskStatusesTable.d.ts.map +0 -1
  100. package/dist/admin/components/workflow/TaskStatusesTable.js.map +0 -1
  101. package/dist/admin/index.d.ts.map +0 -1
  102. package/dist/admin/index.js.map +0 -1
  103. package/dist/admin/lib/current-admin.d.ts.map +0 -1
  104. package/dist/admin/lib/current-admin.js.map +0 -1
  105. package/dist/admin/lib/labels.d.ts.map +0 -1
  106. package/dist/admin/lib/labels.js.map +0 -1
  107. package/dist/admin/lib/references.d.ts.map +0 -1
  108. package/dist/admin/lib/references.js.map +0 -1
  109. package/dist/admin/lib/settings-paths.d.ts.map +0 -1
  110. package/dist/admin/lib/settings-paths.js.map +0 -1
  111. package/dist/admin/lib/task-filters.d.ts.map +0 -1
  112. package/dist/admin/lib/task-filters.js.map +0 -1
  113. package/dist/admin/lib/use-editor-focus.d.ts.map +0 -1
  114. package/dist/admin/lib/use-editor-focus.js.map +0 -1
  115. package/dist/admin/lib/use-task-vocabulary.d.ts.map +0 -1
  116. package/dist/admin/lib/use-task-vocabulary.js.map +0 -1
  117. package/dist/admin/pages/MyTasksPage.d.ts.map +0 -1
  118. package/dist/admin/pages/MyTasksPage.js.map +0 -1
  119. package/dist/admin/pages/TaskCreate.d.ts.map +0 -1
  120. package/dist/admin/pages/TaskCreate.js.map +0 -1
  121. package/dist/admin/pages/TaskDetail.d.ts.map +0 -1
  122. package/dist/admin/pages/TaskDetail.js.map +0 -1
  123. package/dist/admin/pages/TasksPage.d.ts.map +0 -1
  124. package/dist/admin/pages/TasksPage.js.map +0 -1
  125. package/dist/admin/pages/settings/TaskGeneralSettingsPage.d.ts.map +0 -1
  126. package/dist/admin/pages/settings/TaskGeneralSettingsPage.js.map +0 -1
  127. package/dist/admin/pages/settings/TaskPrioritiesPage.d.ts.map +0 -1
  128. package/dist/admin/pages/settings/TaskPrioritiesPage.js.map +0 -1
  129. package/dist/admin/pages/settings/TaskTagsPage.d.ts.map +0 -1
  130. package/dist/admin/pages/settings/TaskTagsPage.js.map +0 -1
  131. package/dist/admin/pages/settings/TaskWorkflowPage.d.ts.map +0 -1
  132. package/dist/admin/pages/settings/TaskWorkflowPage.js.map +0 -1
  133. package/dist/admin/zones/OpportunityTasksPanel.d.ts.map +0 -1
  134. package/dist/admin/zones/OpportunityTasksPanel.js.map +0 -1
  135. package/dist/admin/zones/OrderTasksPanel.d.ts.map +0 -1
  136. package/dist/admin/zones/OrderTasksPanel.js.map +0 -1
  137. package/dist/admin/zones/QuoteRequestTasksPanel.d.ts.map +0 -1
  138. package/dist/admin/zones/QuoteRequestTasksPanel.js.map +0 -1
  139. package/dist/admin/zones/TasksPanel.d.ts.map +0 -1
  140. package/dist/admin/zones/TasksPanel.js.map +0 -1
  141. package/dist/backend/admin-search-provider.d.ts.map +0 -1
  142. package/dist/backend/admin-search-provider.js.map +0 -1
  143. package/dist/backend/domain/board-card-fields.d.ts.map +0 -1
  144. package/dist/backend/domain/board-card-fields.js.map +0 -1
  145. package/dist/backend/domain/due-moment.d.ts.map +0 -1
  146. package/dist/backend/domain/due-moment.js.map +0 -1
  147. package/dist/backend/domain/hierarchy.d.ts.map +0 -1
  148. package/dist/backend/domain/hierarchy.js.map +0 -1
  149. package/dist/backend/domain/list-cursor.d.ts.map +0 -1
  150. package/dist/backend/domain/list-cursor.js.map +0 -1
  151. package/dist/backend/domain/task-status-graph.d.ts.map +0 -1
  152. package/dist/backend/domain/task-status-graph.js.map +0 -1
  153. package/dist/backend/email-templates/digest-defaults.d.ts.map +0 -1
  154. package/dist/backend/email-templates/digest-defaults.js.map +0 -1
  155. package/dist/backend/email-templates/reminder-defaults.d.ts.map +0 -1
  156. package/dist/backend/email-templates/reminder-defaults.js.map +0 -1
  157. package/dist/backend/entities/task-assignee.entity.d.ts.map +0 -1
  158. package/dist/backend/entities/task-assignee.entity.js.map +0 -1
  159. package/dist/backend/entities/task-attachment.entity.d.ts.map +0 -1
  160. package/dist/backend/entities/task-attachment.entity.js.map +0 -1
  161. package/dist/backend/entities/task-comment.entity.d.ts.map +0 -1
  162. package/dist/backend/entities/task-comment.entity.js.map +0 -1
  163. package/dist/backend/entities/task-digest-subscription.entity.d.ts.map +0 -1
  164. package/dist/backend/entities/task-digest-subscription.entity.js.map +0 -1
  165. package/dist/backend/entities/task-list-saved-view.entity.d.ts.map +0 -1
  166. package/dist/backend/entities/task-list-saved-view.entity.js.map +0 -1
  167. package/dist/backend/entities/task-priority.entity.d.ts.map +0 -1
  168. package/dist/backend/entities/task-priority.entity.js.map +0 -1
  169. package/dist/backend/entities/task-record-link.entity.d.ts.map +0 -1
  170. package/dist/backend/entities/task-record-link.entity.js.map +0 -1
  171. package/dist/backend/entities/task-reference.entity.d.ts.map +0 -1
  172. package/dist/backend/entities/task-reference.entity.js.map +0 -1
  173. package/dist/backend/entities/task-relation.entity.d.ts.map +0 -1
  174. package/dist/backend/entities/task-relation.entity.js.map +0 -1
  175. package/dist/backend/entities/task-reminder-delivery.entity.d.ts.map +0 -1
  176. package/dist/backend/entities/task-reminder-delivery.entity.js.map +0 -1
  177. package/dist/backend/entities/task-reminder.entity.d.ts.map +0 -1
  178. package/dist/backend/entities/task-reminder.entity.js.map +0 -1
  179. package/dist/backend/entities/task-status-transition.entity.d.ts.map +0 -1
  180. package/dist/backend/entities/task-status-transition.entity.js.map +0 -1
  181. package/dist/backend/entities/task-status.entity.d.ts.map +0 -1
  182. package/dist/backend/entities/task-status.entity.js.map +0 -1
  183. package/dist/backend/entities/task-tag-assignment.entity.d.ts.map +0 -1
  184. package/dist/backend/entities/task-tag-assignment.entity.js.map +0 -1
  185. package/dist/backend/entities/task-tag.entity.d.ts.map +0 -1
  186. package/dist/backend/entities/task-tag.entity.js.map +0 -1
  187. package/dist/backend/entities/task.entity.d.ts.map +0 -1
  188. package/dist/backend/entities/task.entity.js.map +0 -1
  189. package/dist/backend/index.d.ts.map +0 -1
  190. package/dist/backend/index.js.map +0 -1
  191. package/dist/backend/routes/routes.board.d.ts.map +0 -1
  192. package/dist/backend/routes/routes.board.js.map +0 -1
  193. package/dist/backend/routes/routes.collaboration.d.ts.map +0 -1
  194. package/dist/backend/routes/routes.collaboration.js.map +0 -1
  195. package/dist/backend/routes/routes.priorities.d.ts.map +0 -1
  196. package/dist/backend/routes/routes.priorities.js.map +0 -1
  197. package/dist/backend/routes/routes.reminders.d.ts.map +0 -1
  198. package/dist/backend/routes/routes.reminders.js.map +0 -1
  199. package/dist/backend/routes/routes.settings.d.ts.map +0 -1
  200. package/dist/backend/routes/routes.settings.js.map +0 -1
  201. package/dist/backend/routes/routes.tags.d.ts.map +0 -1
  202. package/dist/backend/routes/routes.tags.js.map +0 -1
  203. package/dist/backend/routes/routes.tasks.d.ts.map +0 -1
  204. package/dist/backend/routes/routes.tasks.js.map +0 -1
  205. package/dist/backend/routes/routes.views.d.ts.map +0 -1
  206. package/dist/backend/routes/routes.views.js.map +0 -1
  207. package/dist/backend/routes/routes.workflow.d.ts.map +0 -1
  208. package/dist/backend/routes/routes.workflow.js.map +0 -1
  209. package/dist/backend/saved-view-actor.d.ts.map +0 -1
  210. package/dist/backend/saved-view-actor.js.map +0 -1
  211. package/dist/backend/services/attachment-active-content.d.ts.map +0 -1
  212. package/dist/backend/services/attachment-active-content.js.map +0 -1
  213. package/dist/backend/services/attachment-service.d.ts.map +0 -1
  214. package/dist/backend/services/attachment-service.js.map +0 -1
  215. package/dist/backend/services/board-card-field-service.d.ts.map +0 -1
  216. package/dist/backend/services/board-card-field-service.js.map +0 -1
  217. package/dist/backend/services/board-service.d.ts.map +0 -1
  218. package/dist/backend/services/board-service.js.map +0 -1
  219. package/dist/backend/services/comment-service.d.ts.map +0 -1
  220. package/dist/backend/services/comment-service.js.map +0 -1
  221. package/dist/backend/services/context-lookup.d.ts.map +0 -1
  222. package/dist/backend/services/context-lookup.js.map +0 -1
  223. package/dist/backend/services/digest-service.d.ts.map +0 -1
  224. package/dist/backend/services/digest-service.js.map +0 -1
  225. package/dist/backend/services/document-lookup-service.d.ts.map +0 -1
  226. package/dist/backend/services/document-lookup-service.js.map +0 -1
  227. package/dist/backend/services/hierarchy-service.d.ts.map +0 -1
  228. package/dist/backend/services/hierarchy-service.js.map +0 -1
  229. package/dist/backend/services/maintenance-service.d.ts.map +0 -1
  230. package/dist/backend/services/maintenance-service.js.map +0 -1
  231. package/dist/backend/services/mention-service.d.ts.map +0 -1
  232. package/dist/backend/services/mention-service.js.map +0 -1
  233. package/dist/backend/services/owner-read-permissions.d.ts.map +0 -1
  234. package/dist/backend/services/owner-read-permissions.js.map +0 -1
  235. package/dist/backend/services/priority-service.d.ts.map +0 -1
  236. package/dist/backend/services/priority-service.js.map +0 -1
  237. package/dist/backend/services/record-link-service.d.ts.map +0 -1
  238. package/dist/backend/services/record-link-service.js.map +0 -1
  239. package/dist/backend/services/record-owners.d.ts.map +0 -1
  240. package/dist/backend/services/record-owners.js.map +0 -1
  241. package/dist/backend/services/reference-service.d.ts.map +0 -1
  242. package/dist/backend/services/reference-service.js.map +0 -1
  243. package/dist/backend/services/relation-service.d.ts.map +0 -1
  244. package/dist/backend/services/relation-service.js.map +0 -1
  245. package/dist/backend/services/reminder-schedule.d.ts.map +0 -1
  246. package/dist/backend/services/reminder-schedule.js.map +0 -1
  247. package/dist/backend/services/reminder-service.d.ts.map +0 -1
  248. package/dist/backend/services/reminder-service.js.map +0 -1
  249. package/dist/backend/services/saved-view-service.d.ts.map +0 -1
  250. package/dist/backend/services/saved-view-service.js.map +0 -1
  251. package/dist/backend/services/scheduled-work-probe.d.ts.map +0 -1
  252. package/dist/backend/services/scheduled-work-probe.js.map +0 -1
  253. package/dist/backend/services/tag-service.d.ts.map +0 -1
  254. package/dist/backend/services/tag-service.js.map +0 -1
  255. package/dist/backend/services/task-access.d.ts.map +0 -1
  256. package/dist/backend/services/task-access.js.map +0 -1
  257. package/dist/backend/services/task-asset-references.d.ts.map +0 -1
  258. package/dist/backend/services/task-asset-references.js.map +0 -1
  259. package/dist/backend/services/task-audit-references.d.ts.map +0 -1
  260. package/dist/backend/services/task-audit-references.js.map +0 -1
  261. package/dist/backend/services/task-checks.d.ts.map +0 -1
  262. package/dist/backend/services/task-checks.js.map +0 -1
  263. package/dist/backend/services/task-commands.d.ts.map +0 -1
  264. package/dist/backend/services/task-commands.js.map +0 -1
  265. package/dist/backend/services/task-context-registry.d.ts.map +0 -1
  266. package/dist/backend/services/task-context-registry.js.map +0 -1
  267. package/dist/backend/services/task-custom-fields.d.ts.map +0 -1
  268. package/dist/backend/services/task-custom-fields.js.map +0 -1
  269. package/dist/backend/services/task-email.d.ts.map +0 -1
  270. package/dist/backend/services/task-email.js.map +0 -1
  271. package/dist/backend/services/task-errors.d.ts.map +0 -1
  272. package/dist/backend/services/task-errors.js.map +0 -1
  273. package/dist/backend/services/task-history-service.d.ts.map +0 -1
  274. package/dist/backend/services/task-history-service.js.map +0 -1
  275. package/dist/backend/services/task-notifier.d.ts.map +0 -1
  276. package/dist/backend/services/task-notifier.js.map +0 -1
  277. package/dist/backend/services/task-number.d.ts.map +0 -1
  278. package/dist/backend/services/task-number.js.map +0 -1
  279. package/dist/backend/services/task-read-port.d.ts.map +0 -1
  280. package/dist/backend/services/task-read-port.js.map +0 -1
  281. package/dist/backend/services/task-reassignment.d.ts.map +0 -1
  282. package/dist/backend/services/task-reassignment.js.map +0 -1
  283. package/dist/backend/services/task-service.d.ts.map +0 -1
  284. package/dist/backend/services/task-service.js.map +0 -1
  285. package/dist/backend/services/task-settings-service.d.ts.map +0 -1
  286. package/dist/backend/services/task-settings-service.js.map +0 -1
  287. package/dist/backend/services/task-transition-service.d.ts.map +0 -1
  288. package/dist/backend/services/task-transition-service.js.map +0 -1
  289. package/dist/backend/services/task-visibility.d.ts.map +0 -1
  290. package/dist/backend/services/task-visibility.js.map +0 -1
  291. package/dist/backend/services/task-workflow-read.d.ts.map +0 -1
  292. package/dist/backend/services/task-workflow-read.js.map +0 -1
  293. package/dist/backend/services/task-write-port.d.ts.map +0 -1
  294. package/dist/backend/services/task-write-port.js.map +0 -1
  295. package/dist/backend/services/time-zone-validator.d.ts.map +0 -1
  296. package/dist/backend/services/time-zone-validator.js.map +0 -1
  297. package/dist/backend/services/workflow-config-service.d.ts.map +0 -1
  298. package/dist/backend/services/workflow-config-service.js.map +0 -1
  299. package/dist/backend/workers/tasks-reminders-worker.d.ts.map +0 -1
  300. package/dist/backend/workers/tasks-reminders-worker.js.map +0 -1
  301. package/dist/manifest.d.ts.map +0 -1
  302. package/dist/manifest.js.map +0 -1
  303. package/dist/migrations/20261026T133731_tasks_init.d.ts.map +0 -1
  304. package/dist/migrations/20261026T133731_tasks_init.js.map +0 -1
  305. package/dist/migrations/20261028T140002_tasks_task_management.d.ts.map +0 -1
  306. package/dist/migrations/20261028T140002_tasks_task_management.js.map +0 -1
  307. package/dist/migrations/index.d.ts.map +0 -1
  308. package/dist/migrations/index.js.map +0 -1
@@ -0,0 +1,57 @@
1
+ import type { EntityManager } from '@mikro-orm/postgresql';
2
+ import type { CommandBus } from '@endora-commerce/platform/commands';
3
+ import type { AuditPort } from '@endora-commerce/platform/kernel';
4
+ /**
5
+ * The time-zone pass — what Tasks counted in `tasks.time_zone` follows a
6
+ * change of it (issue #505; `specs/165-task-management/` data-model §5,
7
+ * research R-17).
8
+ *
9
+ * Two things are derived in the zone when a due date or time is written, and
10
+ * are re-derived here once the zone has changed:
11
+ *
12
+ * - `due_on` of a Task with a due time — that time's date in the zone;
13
+ * - `remind_at` of a relative reminder on a date-only Task — 09:00 of its due
14
+ * date in the zone, less the offset.
15
+ *
16
+ * **A pass of the `tasks-reminders` tick, not an event handler** (Constitution
17
+ * X, the module's own rule that BullMQ is the clock and the tables are the
18
+ * schedule): the probe asks whether anything is out of step with the zone as
19
+ * it is now, so a change by any path — the Tasks screen, the generic settings
20
+ * write — is caught, and so is one made while Tasks was off, or a Task written
21
+ * with the old zone in the instant the setting changed. It runs first on every
22
+ * tick, so a reminder the zone moved is not sent at its old moment.
23
+ *
24
+ * **The zone arithmetic of the pass is Postgres's**, as the overdue filter's
25
+ * is (`task-service.ts`), so the probe and the pass answer the same question
26
+ * and a pass leaves nothing for the next probe to find.
27
+ *
28
+ * Tasks are walked by id, {@link REDERIVE_BATCH} at a time; each is one
29
+ * `tasks.task.update` Command, as the system, `reason: 'time_zone_changed'`,
30
+ * which re-reads the Task under its lock and leaves one that moved meanwhile.
31
+ */
32
+ /** Tasks re-derived per read. */
33
+ export declare const REDERIVE_BATCH = 500;
34
+ export interface TaskTimeZoneRederiveServiceDeps {
35
+ emFactory: () => EntityManager;
36
+ commandBus: CommandBus;
37
+ /** The kernel's audit port — handed to {@link rederiveTaskDueCommand} with the reminders. */
38
+ auditLog: AuditPort;
39
+ /** `tasks.time_zone`, read per pass. */
40
+ timeZone: () => Promise<string>;
41
+ }
42
+ export interface TaskTimeZoneRederivePassSummary {
43
+ rederived: number;
44
+ }
45
+ export declare class TaskTimeZoneRederiveService {
46
+ #private;
47
+ private readonly deps;
48
+ constructor(deps: TaskTimeZoneRederiveServiceDeps);
49
+ /**
50
+ * Whether a pass would have anything to do — yes or no, outside any scope
51
+ * (issue #120): a Task or a relative reminder out of step with the zone.
52
+ */
53
+ hasWork(): Promise<boolean>;
54
+ /** One pass, in the system scope. */
55
+ pass(): Promise<TaskTimeZoneRederivePassSummary>;
56
+ }
57
+ //# sourceMappingURL=time-zone-rederive-service.d.ts.map
@@ -0,0 +1,105 @@
1
+ import { anyRowExists } from './scheduled-work-probe.js';
2
+ import { rederiveTaskDueCommand } from './task-commands.js';
3
+ /**
4
+ * The time-zone pass — what Tasks counted in `tasks.time_zone` follows a
5
+ * change of it (issue #505; `specs/165-task-management/` data-model §5,
6
+ * research R-17).
7
+ *
8
+ * Two things are derived in the zone when a due date or time is written, and
9
+ * are re-derived here once the zone has changed:
10
+ *
11
+ * - `due_on` of a Task with a due time — that time's date in the zone;
12
+ * - `remind_at` of a relative reminder on a date-only Task — 09:00 of its due
13
+ * date in the zone, less the offset.
14
+ *
15
+ * **A pass of the `tasks-reminders` tick, not an event handler** (Constitution
16
+ * X, the module's own rule that BullMQ is the clock and the tables are the
17
+ * schedule): the probe asks whether anything is out of step with the zone as
18
+ * it is now, so a change by any path — the Tasks screen, the generic settings
19
+ * write — is caught, and so is one made while Tasks was off, or a Task written
20
+ * with the old zone in the instant the setting changed. It runs first on every
21
+ * tick, so a reminder the zone moved is not sent at its old moment.
22
+ *
23
+ * **The zone arithmetic of the pass is Postgres's**, as the overdue filter's
24
+ * is (`task-service.ts`), so the probe and the pass answer the same question
25
+ * and a pass leaves nothing for the next probe to find.
26
+ *
27
+ * Tasks are walked by id, {@link REDERIVE_BATCH} at a time; each is one
28
+ * `tasks.task.update` Command, as the system, `reason: 'time_zone_changed'`,
29
+ * which re-reads the Task under its lock and leaves one that moved meanwhile.
30
+ */
31
+ /** Tasks re-derived per read. */
32
+ export const REDERIVE_BATCH = 500;
33
+ /** 09:00 of `t."due_on"` in the zone (the zone is the parameter). */
34
+ const DATE_ONLY_MOMENT = `(("t"."due_on" + time '09:00') at time zone ?)`;
35
+ /** `t."due_at"`'s date in the zone (the zone is the parameter). */
36
+ const DUE_ON_OF_MOMENT = `("t"."due_at" at time zone ?)::date`;
37
+ /** A Task with a due time whose `due_on` is not that time's date in `timeZone`. */
38
+ function driftedDueOn(timeZone) {
39
+ return {
40
+ from: `from "tasks" "t" where "t"."due_at" is not null and "t"."due_on" is distinct from ${DUE_ON_OF_MOMENT}`,
41
+ params: [timeZone],
42
+ };
43
+ }
44
+ /** A relative reminder on a date-only Task that does not count from 09:00 of its due date in `timeZone`. */
45
+ function driftedReminders(timeZone) {
46
+ return {
47
+ from: `from "task_reminders" "r" join "tasks" "t" on "t"."id" = "r"."task_id"
48
+ where "r"."mode" = 'relative' and "t"."due_at" is null and "t"."due_on" is not null
49
+ and "r"."remind_at" <> ${DATE_ONLY_MOMENT} - make_interval(mins => "r"."offset_minutes")`,
50
+ params: [timeZone],
51
+ };
52
+ }
53
+ export class TaskTimeZoneRederiveService {
54
+ deps;
55
+ constructor(deps) {
56
+ this.deps = deps;
57
+ }
58
+ /**
59
+ * Whether a pass would have anything to do — yes or no, outside any scope
60
+ * (issue #120): a Task or a relative reminder out of step with the zone.
61
+ */
62
+ async hasWork() {
63
+ const timeZone = await this.deps.timeZone();
64
+ return anyRowExists(this.deps.emFactory(), [driftedDueOn(timeZone), driftedReminders(timeZone)]);
65
+ }
66
+ /** One pass, in the system scope. */
67
+ async pass() {
68
+ const timeZone = await this.deps.timeZone();
69
+ const summary = { rederived: 0 };
70
+ let after = null;
71
+ for (;;) {
72
+ const rows = await this.#drifted(timeZone, after);
73
+ if (rows.length === 0)
74
+ break;
75
+ after = rows[rows.length - 1].id;
76
+ for (const row of rows) {
77
+ const changed = await this.deps.commandBus.run(rederiveTaskDueCommand(row.id, {
78
+ seen: { dueOn: row.due_on, dueAt: row.due_at === null ? null : new Date(row.due_at).toISOString() },
79
+ dueOn: row.derived_due_on,
80
+ moment: row.moment === null ? null : new Date(row.moment),
81
+ }, this.deps.auditLog));
82
+ if (changed)
83
+ summary.rederived += 1;
84
+ }
85
+ if (rows.length < REDERIVE_BATCH)
86
+ break;
87
+ }
88
+ return summary;
89
+ }
90
+ /** The next batch of Tasks out of step with `timeZone`, in id order, after `after`, with what the zone makes of them. */
91
+ async #drifted(timeZone, after) {
92
+ return (await this.deps.emFactory().execute(`select "t"."id", to_char("t"."due_on", 'YYYY-MM-DD') as "due_on", "t"."due_at",
93
+ case when "t"."due_at" is not null then to_char(${DUE_ON_OF_MOMENT}, 'YYYY-MM-DD') end as "derived_due_on",
94
+ case when "t"."due_at" is null and "t"."due_on" is not null then ${DATE_ONLY_MOMENT} end as "moment"
95
+ from "tasks" "t"
96
+ where (("t"."due_at" is not null and "t"."due_on" is distinct from ${DUE_ON_OF_MOMENT})
97
+ or ("t"."due_at" is null and "t"."due_on" is not null and exists (
98
+ select 1 from "task_reminders" "r"
99
+ where "r"."task_id" = "t"."id" and "r"."mode" = 'relative'
100
+ and "r"."remind_at" <> ${DATE_ONLY_MOMENT} - make_interval(mins => "r"."offset_minutes"))))
101
+ ${after === null ? '' : 'and "t"."id" > ?'}
102
+ order by "t"."id" limit ?`, [timeZone, timeZone, timeZone, timeZone, ...(after === null ? [] : [after]), REDERIVE_BATCH]));
103
+ }
104
+ }
105
+ //# sourceMappingURL=time-zone-rederive-service.js.map
@@ -12,11 +12,13 @@ import type { Redis } from 'ioredis';
12
12
  * reminder, and a moved due date has no queue to keep in step. A reminder goes
13
13
  * out within a minute or two of its moment (SC-004).
14
14
  *
15
- * **One tick, up to three passes.** The reminders on every tick; the digest
16
- * and the maintenance pass (`#450`, User Story 10 — Tasks whose context's
17
- * record is gone) each when fifteen minutes have passed since its last run in
18
- * this process — an in-memory stamp per pass, so a restart only makes it run
19
- * sooner, and a clock that went back runs it at once.
15
+ * **One tick, up to four passes.** The time-zone pass (`#505` — due dates and
16
+ * relative reminders re-derived once `tasks.time_zone` has changed) and then
17
+ * the reminders on every tick; the digest and the maintenance pass (`#450`,
18
+ * User Story 10 — Tasks whose context's record is gone) each when fifteen
19
+ * minutes have passed since its last run in this process — an in-memory stamp
20
+ * per pass, so a restart only makes it run sooner, and a clock that went back
21
+ * runs it at once.
20
22
  *
21
23
  * **More than one consumer is fine.** A reminder is claimed per recipient by
22
24
  * its delivery row, a digest per person and day by its subscription row, so
@@ -33,6 +35,7 @@ export declare const TASKS_MAINTENANCE_EVERY_MS: number;
33
35
  export declare const TASKS_REMINDERS_SCOPE_REASON = "tasks: deliver due reminders";
34
36
  export declare const TASKS_DIGEST_SCOPE_REASON = "tasks: send the daily digests";
35
37
  export declare const TASKS_MAINTENANCE_SCOPE_REASON = "tasks: clean up Tasks whose context is gone";
38
+ export declare const TASKS_REDERIVE_SCOPE_REASON = "tasks: re-derive due dates and reminders in the Tasks time zone";
36
39
  export type TasksRemindersJobData = Record<string, never>;
37
40
  /** One pass of a tick: a yes-or-no probe outside any scope, and the work inside the system scope. */
38
41
  export interface TaskSweepPass {
@@ -47,6 +50,8 @@ export interface TasksRemindersJobDeps {
47
50
  readonly reminders: TaskSweepPass;
48
51
  readonly digest: TaskSweepPass;
49
52
  readonly maintenance: TaskSweepPass;
53
+ /** Issue #505 — what was counted in an earlier `tasks.time_zone`, re-derived in the current one. */
54
+ readonly rederive: TaskSweepPass;
50
55
  readonly log: {
51
56
  warn(context: Record<string, unknown>, message: string): void;
52
57
  };
@@ -71,7 +76,8 @@ export declare function createTasksRemindersJob(deps: TasksRemindersJobDeps): Ta
71
76
  * whose entry writes the `tenant.escape_hatch` audit row (issue #120): 1 440
72
77
  * idle ticks a day write none.
73
78
  *
74
- * The reminders run every tick; the digest when {@link TASKS_DIGEST_EVERY_MS}
79
+ * The time-zone pass and then the reminders run every tick — in that order, so
80
+ * a reminder the zone moved is not sent at its old moment; the digest when {@link TASKS_DIGEST_EVERY_MS}
75
81
  * and the maintenance pass when {@link TASKS_MAINTENANCE_EVERY_MS} have passed
76
82
  * since each last ran (a clock that went back runs it at once). A
77
83
  * failed pass is logged and not re-thrown: the next tick is the retry. A
@@ -12,11 +12,13 @@ import { enterSystemScope, rethrowIfModuleDisabled } from '@endora-commerce/plat
12
12
  * reminder, and a moved due date has no queue to keep in step. A reminder goes
13
13
  * out within a minute or two of its moment (SC-004).
14
14
  *
15
- * **One tick, up to three passes.** The reminders on every tick; the digest
16
- * and the maintenance pass (`#450`, User Story 10 — Tasks whose context's
17
- * record is gone) each when fifteen minutes have passed since its last run in
18
- * this process — an in-memory stamp per pass, so a restart only makes it run
19
- * sooner, and a clock that went back runs it at once.
15
+ * **One tick, up to four passes.** The time-zone pass (`#505` — due dates and
16
+ * relative reminders re-derived once `tasks.time_zone` has changed) and then
17
+ * the reminders on every tick; the digest and the maintenance pass (`#450`,
18
+ * User Story 10 — Tasks whose context's record is gone) each when fifteen
19
+ * minutes have passed since its last run in this process — an in-memory stamp
20
+ * per pass, so a restart only makes it run sooner, and a clock that went back
21
+ * runs it at once.
20
22
  *
21
23
  * **More than one consumer is fine.** A reminder is claimed per recipient by
22
24
  * its delivery row, a digest per person and day by its subscription row, so
@@ -33,6 +35,7 @@ export const TASKS_MAINTENANCE_EVERY_MS = 15 * 60_000;
33
35
  export const TASKS_REMINDERS_SCOPE_REASON = 'tasks: deliver due reminders';
34
36
  export const TASKS_DIGEST_SCOPE_REASON = 'tasks: send the daily digests';
35
37
  export const TASKS_MAINTENANCE_SCOPE_REASON = 'tasks: clean up Tasks whose context is gone';
38
+ export const TASKS_REDERIVE_SCOPE_REASON = 'tasks: re-derive due dates and reminders in the Tasks time zone';
36
39
  export function createTasksRemindersJob(deps) {
37
40
  return { deps, cadence: { digestRanAt: null, maintenanceRanAt: null } };
38
41
  }
@@ -46,7 +49,8 @@ export function createTasksRemindersJob(deps) {
46
49
  * whose entry writes the `tenant.escape_hatch` audit row (issue #120): 1 440
47
50
  * idle ticks a day write none.
48
51
  *
49
- * The reminders run every tick; the digest when {@link TASKS_DIGEST_EVERY_MS}
52
+ * The time-zone pass and then the reminders run every tick — in that order, so
53
+ * a reminder the zone moved is not sent at its old moment; the digest when {@link TASKS_DIGEST_EVERY_MS}
50
54
  * and the maintenance pass when {@link TASKS_MAINTENANCE_EVERY_MS} have passed
51
55
  * since each last ran (a clock that went back runs it at once). A
52
56
  * failed pass is logged and not re-thrown: the next tick is the retry. A
@@ -76,6 +80,9 @@ export async function runTasksRemindersJob(job, now = new Date()) {
76
80
  };
77
81
  const at = now.getTime();
78
82
  const due = (last, every) => last === null || at < last || at - last >= every;
83
+ if (!deps.isPresent())
84
+ return;
85
+ await run(deps.rederive);
79
86
  if (!deps.isPresent())
80
87
  return;
81
88
  await run(deps.reminders);
@@ -1,3 +1,21 @@
1
+ /**
2
+ * Feature 175 (`specs/175-buyer-input-custom-fields/` research R-11) — the
3
+ * admin writes of this module's custom-field host, for `check:custom-field-writes`.
4
+ * Read as a literal by the check: keep every entry a literal object.
5
+ */
6
+ export declare const customFieldWrites: ({
7
+ entityType: "task";
8
+ kind: "create";
9
+ method: "POST";
10
+ path: string;
11
+ body: string;
12
+ } | {
13
+ entityType: "task";
14
+ kind: "update";
15
+ method: "PATCH";
16
+ path: string;
17
+ body: string;
18
+ })[];
1
19
  export declare const manifest: {
2
20
  id: string;
3
21
  name: string;
@@ -68,6 +86,7 @@ export declare const manifest: {
68
86
  weight: number;
69
87
  descriptionKey?: string | undefined;
70
88
  requiredPermission?: string | undefined;
89
+ entryApiRoute?: string | undefined;
71
90
  keywordsKey?: string | undefined;
72
91
  }[] | undefined;
73
92
  permissions?: {
@@ -111,7 +130,7 @@ export declare const manifest: {
111
130
  category: string;
112
131
  contexts: ("email" | "document" | "cms" | "invoice" | "newsletter")[];
113
132
  fields: Record<string, {
114
- type: "number" | "object" | "array" | "text" | "external" | "select" | "uuid" | "textarea" | "radio" | "richtext";
133
+ type: "number" | "object" | "array" | "text" | "select" | "external" | "uuid" | "textarea" | "radio" | "richtext";
115
134
  label?: string | undefined;
116
135
  required?: boolean | undefined;
117
136
  options?: {
@@ -170,5 +189,10 @@ export declare const manifest: {
170
189
  consumers: ("admin" | "backend" | "storefront")[];
171
190
  addressOf: "admin" | "backend" | "storefront" | null;
172
191
  }[] | undefined;
192
+ hookableActions?: {
193
+ action: string;
194
+ objectType: string;
195
+ phases: ("beforeCommit" | "afterCommit")[];
196
+ }[] | undefined;
173
197
  };
174
198
  //# sourceMappingURL=manifest.d.ts.map
package/dist/manifest.js CHANGED
@@ -51,6 +51,27 @@ const settings = defineModuleSettingsManifest({
51
51
  },
52
52
  ],
53
53
  });
54
+ /**
55
+ * Feature 175 (`specs/175-buyer-input-custom-fields/` research R-11) — the
56
+ * admin writes of this module's custom-field host, for `check:custom-field-writes`.
57
+ * Read as a literal by the check: keep every entry a literal object.
58
+ */
59
+ export const customFieldWrites = [
60
+ {
61
+ entityType: 'task',
62
+ kind: 'create',
63
+ method: 'POST',
64
+ path: '/api/v1/admin/tasks',
65
+ body: 'CreateTaskBodySchema',
66
+ },
67
+ {
68
+ entityType: 'task',
69
+ kind: 'update',
70
+ method: 'PATCH',
71
+ path: '/api/v1/admin/tasks/:id',
72
+ body: 'UpdateTaskBodySchema',
73
+ },
74
+ ];
54
75
  export const manifest = defineModuleManifest({
55
76
  id: 'tasks',
56
77
  name: 'Tasks',
@@ -229,7 +250,10 @@ export const manifest = defineModuleManifest({
229
250
  { code: 'TASK_PRIORITY_UNKNOWN' },
230
251
  { code: 'TASK_TAG_UNKNOWN' },
231
252
  { code: 'TASK_TAG_NAME_TAKEN' },
232
- { code: 'TASK_ATTACHMENT_REFUSED' },
253
+ // Issue #642 (#86) — a public file is refused under the same code, with
254
+ // `not_private` as the refusal token choosing its own sentence; the size
255
+ // and active-content refusals carry none and keep the code's sentence.
256
+ { code: 'TASK_ATTACHMENT_REFUSED', tokens: ['not_private'] },
233
257
  { code: 'TASK_VIEW_NAME_TAKEN' },
234
258
  { code: 'TASK_PARENT_CYCLE' },
235
259
  { code: 'TASK_HIERARCHY_TOO_DEEP' },
@@ -344,6 +368,11 @@ export const manifest = defineModuleManifest({
344
368
  { key: 'task.number', label: 'Task number', sampleValue: 'TSK-000042' },
345
369
  { key: 'task.title', label: 'Task title', sampleValue: 'Measure the showroom' },
346
370
  { key: 'task.due', label: 'Task due date', sampleValue: 'October 30, 2026 14:00' },
371
+ {
372
+ key: 'task.adminUrl',
373
+ label: 'Link to the task in the admin panel (empty when ADMIN_BASE_URL is not set)',
374
+ sampleValue: 'https://admin.example.com/tasks/00000000-0000-4000-8000-000000000042',
375
+ },
347
376
  ],
348
377
  },
349
378
  {
@@ -359,6 +388,11 @@ export const manifest = defineModuleManifest({
359
388
  label: 'The tasks, one per line',
360
389
  sampleValue: 'TSK-000042 Measure the showroom — overdue since October 28\nTSK-000051 Call the installer — due today',
361
390
  },
391
+ {
392
+ key: 'digest.adminUrl',
393
+ label: 'Link to My tasks in the admin panel (empty when ADMIN_BASE_URL is not set)',
394
+ sampleValue: 'https://admin.example.com/tasks/mine',
395
+ },
362
396
  ],
363
397
  },
364
398
  ],
@@ -0,0 +1,23 @@
1
+ import { Migration } from '@mikro-orm/migrations';
2
+ /**
3
+ * A Task's own record of the values its writes changed (issue #470, D-288;
4
+ * `specs/conventions/audit-state.md` §3).
5
+ *
6
+ * The platform audit log is not tenant-scoped, so from this release a
7
+ * `tasks.*` audit entry names the fields a write changed and never their
8
+ * values: the title (owner ruling O-1, 2026-11-10), the context note, the
9
+ * custom-field values and an attachment's file name. The Task's history still
10
+ * shows them, from here. One row per Command that changed one of them, written
11
+ * in that Command's transaction; the audit entry points at it by
12
+ * `valueChangeId`.
13
+ *
14
+ * `before` is `null` for something that only arrived and `after` for something
15
+ * that went; each side holds only the keys that changed. The rows go with the
16
+ * Task (`on delete cascade`). Audit entries written before this migration are
17
+ * not touched (owner ruling O-4): they keep the values they were written with.
18
+ */
19
+ export declare class Migration20261110T054810TasksValueChanges extends Migration {
20
+ up(): Promise<void>;
21
+ down(): Promise<void>;
22
+ }
23
+ //# sourceMappingURL=20261110T054810_tasks_value_changes.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { Migration } from '@mikro-orm/migrations';
2
+ /**
3
+ * A Task's own record of the values its writes changed (issue #470, D-288;
4
+ * `specs/conventions/audit-state.md` §3).
5
+ *
6
+ * The platform audit log is not tenant-scoped, so from this release a
7
+ * `tasks.*` audit entry names the fields a write changed and never their
8
+ * values: the title (owner ruling O-1, 2026-11-10), the context note, the
9
+ * custom-field values and an attachment's file name. The Task's history still
10
+ * shows them, from here. One row per Command that changed one of them, written
11
+ * in that Command's transaction; the audit entry points at it by
12
+ * `valueChangeId`.
13
+ *
14
+ * `before` is `null` for something that only arrived and `after` for something
15
+ * that went; each side holds only the keys that changed. The rows go with the
16
+ * Task (`on delete cascade`). Audit entries written before this migration are
17
+ * not touched (owner ruling O-4): they keep the values they were written with.
18
+ */
19
+ export class Migration20261110T054810TasksValueChanges extends Migration {
20
+ async up() {
21
+ this.addSql(`
22
+ create table "task_value_changes" (
23
+ "id" uuid not null default gen_random_uuid(),
24
+ "task_id" uuid not null,
25
+ "before" jsonb null,
26
+ "after" jsonb null,
27
+ "at" timestamptz not null default now(),
28
+ constraint "task_value_changes_pkey" primary key ("id"),
29
+ constraint "task_value_changes_task_fk" foreign key ("task_id")
30
+ references "tasks" ("id") on delete cascade
31
+ );
32
+ `);
33
+ this.addSql(`create index "task_value_changes_task_id_index" on "task_value_changes" ("task_id");`);
34
+ }
35
+ async down() {
36
+ this.addSql('drop table if exists "task_value_changes" cascade;');
37
+ }
38
+ }
39
+ //# sourceMappingURL=20261110T054810_tasks_value_changes.js.map
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { Migration20261026T133731TasksInit } from './20261026T133731_tasks_init.js';
13
13
  import { Migration20261028T140002TasksTaskManagement } from './20261028T140002_tasks_task_management.js';
14
+ import { Migration20261110T054810TasksValueChanges } from './20261110T054810_tasks_value_changes.js';
14
15
  export declare const migrations: (typeof Migration20261026T133731TasksInit)[];
15
- export { Migration20261026T133731TasksInit, Migration20261028T140002TasksTaskManagement };
16
+ export { Migration20261026T133731TasksInit, Migration20261028T140002TasksTaskManagement, Migration20261110T054810TasksValueChanges, };
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -11,6 +11,11 @@
11
11
  */
12
12
  import { Migration20261026T133731TasksInit } from './20261026T133731_tasks_init.js';
13
13
  import { Migration20261028T140002TasksTaskManagement } from './20261028T140002_tasks_task_management.js';
14
- export const migrations = [Migration20261026T133731TasksInit, Migration20261028T140002TasksTaskManagement];
15
- export { Migration20261026T133731TasksInit, Migration20261028T140002TasksTaskManagement };
14
+ import { Migration20261110T054810TasksValueChanges } from './20261110T054810_tasks_value_changes.js';
15
+ export const migrations = [
16
+ Migration20261026T133731TasksInit,
17
+ Migration20261028T140002TasksTaskManagement,
18
+ Migration20261110T054810TasksValueChanges,
19
+ ];
20
+ export { Migration20261026T133731TasksInit, Migration20261028T140002TasksTaskManagement, Migration20261110T054810TasksValueChanges, };
16
21
  //# sourceMappingURL=index.js.map
package/docs/tasks.md CHANGED
@@ -219,8 +219,8 @@ filter the list and the board when marked as list filters, and can be shown on
219
219
  a board card.
220
220
 
221
221
  **Attachments.** A file of up to 25 MB can be attached to a task — uploaded, or
222
- chosen from the media library by somebody who may read it. HTML, SVG, XML and
223
- JavaScript files are refused. Each attachment shows its name, size, who
222
+ chosen from the media library by somebody who may read it; a file chosen from
223
+ the library must be private. HTML, SVG, XML and JavaScript files are refused. Each attachment shows its name, size, who
224
224
  attached it and when, and can be downloaded by anybody who may see the task and
225
225
  removed by somebody who may change it. The file stays in the media library, and
226
226
  the library refuses to delete a file a task uses — also while Tasks is
@@ -253,8 +253,8 @@ module is back.
253
253
  **Reminders.** Somebody who may change a task can add up to ten reminders to
254
254
  it, each **at a date and time** or **before the due date** — 15 minutes, an
255
255
  hour, a day, two days or a week before — for themselves and any of the task's
256
- assignees. At that moment each recipient gets one notification in the bell and
257
- one e-mail naming the task, with a link. A reminder before the due date moves
256
+ assignees. At that moment each recipient gets one notification in the bell, with
257
+ a link, and one e-mail naming the task (see *Links in the e-mails*). A reminder before the due date moves
258
258
  with the due date, and fires again at the new moment; when the due date is
259
259
  removed, the reminder is removed too and the task's history says so. Nothing is
260
260
  sent to a recipient who may no longer see the task, who has been deactivated,
@@ -270,6 +270,16 @@ listing your open tasks due that day and those overdue. On a day with none,
270
270
  nothing is sent; a task that becomes due later that day is in the next day's
271
271
  digest. The digest is off until you turn it on.
272
272
 
273
+ **Links in the e-mails.** When the admin panel's address (`ADMIN_BASE_URL`) is
274
+ set, the reminder e-mail has an **Open the task** button. In the digest each
275
+ listed task links to its screen, and an **Open My tasks** button opens *My
276
+ tasks*. Without that address the e-mails carry no links and no buttons, and they
277
+ name each task by its number and title. A relative or guessed address is never
278
+ sent. On the **Transactional emails** screen the variables are `task.adminUrl`
279
+ (reminder) and `digest.adminUrl` (digest), plus `adminUrl` on each item of
280
+ `digest.tasks`. A template edited before the links existed does not name them
281
+ and renders as before.
282
+
273
283
  **Drafts and private tasks.** *Save as draft* keeps a new task to yourself:
274
284
  nobody is told about it, no reminder of it fires, and nobody else finds it
275
285
  anywhere — not even a holder of *See private tasks*. *Publish* makes it a normal
@@ -293,6 +303,18 @@ history lists them, newest first. The history records the length of a
293
303
  description, never its text. A project the task has left, and you may not see,
294
304
  is not named in it.
295
305
 
306
+ The values the history shows — a task's title, its note from the record it was
307
+ created for, its custom field values and an attachment's file name — are kept
308
+ beside the task and shown only to somebody who may see it. The platform-wide
309
+ audit log, which everybody holding `audit_log:read` reads whatever they may
310
+ see, names what changed (`changedFields`, `changedCustomFields`) and holds none
311
+ of those values. Entries recorded before this change keep their values and are
312
+ shown as they were recorded.
313
+
314
+ Custom field values — and which custom fields a change touched — are shown in the
315
+ history only to somebody who also holds `custom_fields:read`, as on opportunities
316
+ and projects; for anybody else they are left out of every entry.
317
+
296
318
  ## Configuring Tasks
297
319
 
298
320
  Holders of *Configure tasks* reach these screens from **Task settings** in the
@@ -324,6 +346,12 @@ recorded once, on the tag, with how many tasks carried it.
324
346
  **General settings** (`/tasks/settings/general`). The **time zone** in which
325
347
  Tasks counts "today": when a task with a due date alone becomes overdue, when a
326
348
  reminder before such a date fires, and the hour of the daily digest.
349
+ Changing it moves what was counted in the old zone within a minute or two: a
350
+ reminder before a due date alone now counts from 09:00 of that date in the new
351
+ zone, and fires again there even if it was already sent; a task with a due time
352
+ gets that time's date in the new zone as its due date. Each task changed is
353
+ recorded in its history. Reminders at a chosen moment, and reminders before a
354
+ due time, do not depend on the zone and stay as they are.
327
355
 
328
356
  ## Settings
329
357
 
@@ -410,7 +438,7 @@ does not exist.
410
438
  | `DELETE /:id` | `tasks:write`, or `tasks:read` with `tasks:see_private` for a private task | `200` `{ data: { subtasksDetached } }` — the former sub-tasks the caller may see. |
411
439
  | `GET /:id/history` | `tasks:read` | The task's audit trail, newest first (`RecordHistoryPage`). |
412
440
  | `GET`, `POST /:id/comments`; `PATCH`, `DELETE /:id/comments/:commentId` | `tasks:read` | Comments, oldest first, references resolved; somebody else's comment is `403` `FORBIDDEN`. |
413
- | `GET`, `POST /:id/attachments`; `POST /:id/attachments/upload`; `DELETE /:id/attachments/:attachmentId` | `tasks:read` to list, `tasks:write` to change | `{ assetId }` attaches a library file (with the library's read permission); `upload` takes a multipart file; `413` / `415` `TASK_ATTACHMENT_REFUSED`. |
441
+ | `GET`, `POST /:id/attachments`; `POST /:id/attachments/upload`; `DELETE /:id/attachments/:attachmentId` | `tasks:read` to list, `tasks:write` to change | `{ assetId }` attaches a library file (with the library's read permission); `upload` takes a multipart file; `413` / `415` `TASK_ATTACHMENT_REFUSED`, and `422` `TASK_ATTACHMENT_REFUSED` with `details.code` `not_private` (and `assetId`, `visibility`) for a library file that is not private — `VALIDATION_FAILED` until issue #642. A file that is not in the library stays `422` `VALIDATION_FAILED`. |
414
442
  | `PUT`, `DELETE /:id/relations/:otherId` | `tasks:write` on both | `204`, idempotent both ways. |
415
443
  | `POST /:id/links`; `DELETE /:id/links/:linkId` | `tasks:write` | `{ kind, id }` → `201` a new link, `200` the existing one; `422` `TASK_LINK_INVALID`. |
416
444
  | `GET`, `POST /:id/reminders`; `DELETE /:id/reminders/:reminderId` | `tasks:read` to list, `tasks:write` to add | `{ remindAt }` or `{ offsetMinutes }`, and `recipientIds`; `422` `TASK_REMINDER_INVALID`. Its creator, or a holder of `tasks:write`, removes one. |
@@ -512,7 +540,7 @@ The contract a descriptor keeps:
512
540
 
513
541
  **The maintenance pass.** A context owner deletes the tasks of a record it
514
542
  deletes through `taskWritePort.deleteInContext` — but only while Tasks is on.
515
- What was deleted while Tasks was off is found by the third pass of the
543
+ What was deleted while Tasks was off is found by the last pass of the
516
544
  `tasks-reminders` worker, which runs at most every **fifteen minutes**: for each
517
545
  **present** owner that implements `existingContexts`, it reads the distinct
518
546
  contexts its tasks name, 500 at a time, and asks the owner about them. Each
@@ -572,8 +600,9 @@ late is recorded as `expired`, one for a recipient who may no longer be told as
572
600
  `skipped`, and neither sends anything. The digest claims each subscriber's day
573
601
  before it sends (`tasks_daily_digest`), so it is sent at most once a day.
574
602
 
575
- All three passes — reminders every minute, the digest and the maintenance pass
576
- at most every fifteen minutes — run in the one BullMQ Job Scheduler
603
+ All four passes — the time-zone pass (see *General settings*) and then the
604
+ reminders every minute, the digest and the maintenance pass at most every
605
+ fifteen minutes — run in the one BullMQ Job Scheduler
577
606
  `tasks-reminders`, attached through `ctx.worker` only in a process that runs
578
607
  workers. A tick decides the module's presence first, then asks each pass's
579
608
  one-bit probe outside any tenant scope, and enters a system scope only for a
package/i18n/en.json CHANGED
@@ -15,6 +15,7 @@
15
15
  "errors.TASK_TAG_UNKNOWN": "One of these tags does not exist.",
16
16
  "errors.TASK_TAG_NAME_TAKEN": "A tag with this name already exists.",
17
17
  "errors.TASK_ATTACHMENT_REFUSED": "This file cannot be attached: it is too large, or it is a file a browser would run (HTML, SVG, XML, JavaScript).",
18
+ "errors.TASK_ATTACHMENT_REFUSED.not_private": "An attachment must be a private file. Upload it to the media library as private.",
18
19
  "errors.TASK_VIEW_NAME_TAKEN": "You already have a saved view with this name on the task list. Choose a different name.",
19
20
  "errors.TASK_PARENT_CYCLE": "A task cannot be a sub-task of itself or of one of its own sub-tasks.",
20
21
  "errors.TASK_HIERARCHY_TOO_DEEP": "Sub-tasks can be nested at most 5 levels deep. Choose a parent higher up.",
package/i18n/pl.json CHANGED
@@ -15,6 +15,7 @@
15
15
  "errors.TASK_TAG_UNKNOWN": "Jedna z tych etykiet nie istnieje.",
16
16
  "errors.TASK_TAG_NAME_TAKEN": "Etykieta o tej nazwie już istnieje.",
17
17
  "errors.TASK_ATTACHMENT_REFUSED": "Tego pliku nie można załączyć: jest za duży albo przeglądarka by go uruchomiła (HTML, SVG, XML, JavaScript).",
18
+ "errors.TASK_ATTACHMENT_REFUSED.not_private": "Załącznik musi być plikiem prywatnym. Prześlij go do biblioteki mediów jako prywatny.",
18
19
  "errors.TASK_VIEW_NAME_TAKEN": "Masz już zapisany widok o tej nazwie na liście zadań. Wybierz inną nazwę.",
19
20
  "errors.TASK_PARENT_CYCLE": "Zadanie nie może być podzadaniem samego siebie ani żadnego ze swoich podzadań.",
20
21
  "errors.TASK_HIERARCHY_TOO_DEEP": "Podzadania można zagnieżdżać najwyżej na 5 poziomach. Wybierz zadanie nadrzędne wyżej w hierarchii.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@endora-commerce/mod-tasks",
3
- "version": "0.110.0",
3
+ "version": "0.111.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Tasks assigned to admin users, with a due date and a status, which any module can own through an opaque context.",
@@ -41,7 +41,8 @@
41
41
  "dist",
42
42
  "i18n",
43
43
  "docs",
44
- "tailwind.css"
44
+ "tailwind.css",
45
+ "!dist/**/*.map"
45
46
  ],
46
47
  "engines": {
47
48
  "node": ">=22.18.0"
@@ -57,10 +58,10 @@
57
58
  "lucide-react": "^1",
58
59
  "react": "^19",
59
60
  "react-router-dom": "^7",
60
- "@endora-commerce/admin-kit": "0.110.0",
61
- "@endora-commerce/contracts": "0.110.0",
62
- "@endora-commerce/email-components": "0.110.0",
63
- "@endora-commerce/platform": "0.110.0"
61
+ "@endora-commerce/admin-kit": "0.111.0",
62
+ "@endora-commerce/contracts": "0.111.0",
63
+ "@endora-commerce/email-components": "0.111.0",
64
+ "@endora-commerce/platform": "0.111.0"
64
65
  },
65
66
  "peerDependenciesMeta": {
66
67
  "@endora-commerce/admin-kit": {
@@ -91,10 +92,10 @@
91
92
  "react-router-dom": "^7.18.2",
92
93
  "typescript": "^5.9.3",
93
94
  "vitest": "^4.1.12",
94
- "@endora-commerce/admin-kit": "0.110.0",
95
- "@endora-commerce/contracts": "0.110.0",
96
- "@endora-commerce/email-components": "0.110.0",
97
- "@endora-commerce/platform": "0.110.0"
95
+ "@endora-commerce/contracts": "0.111.0",
96
+ "@endora-commerce/admin-kit": "0.111.0",
97
+ "@endora-commerce/platform": "0.111.0",
98
+ "@endora-commerce/email-components": "0.111.0"
98
99
  },
99
100
  "scripts": {
100
101
  "build": "node ../../../scripts/clean-package-dist.mjs --src src --out dist && tsc -p tsconfig.build.json && tsc -p tsconfig.ui.build.json",
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/admin/api.ts"],"names":[],"mappings":"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"}