@aurorajs.dev/catalyst-cli 3.1.2 → 3.1.3

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 (234) hide show
  1. package/README.md +1 -1
  2. package/dist/ai/domain/skills-scanner.js +7 -2
  3. package/dist/deploy/domain/curl-config.js +1 -1
  4. package/dist/deploy/domain/playbook-vars.js +1 -1
  5. package/dist/generator/domain/frontend-composition.js +4 -4
  6. package/dist/generator/domain/property-filters.d.ts +8 -0
  7. package/dist/generator/domain/property-filters.js +17 -6
  8. package/dist/generator/handlers/front.handler.js +10 -1
  9. package/dist/sheets/domain/auth.js +10 -5
  10. package/dist/sheets/sync/sheet-to-yaml.d.ts +1 -0
  11. package/dist/sheets/sync/sheet-to-yaml.js +19 -3
  12. package/dist/templates/backend/application/.claude/skills/catalyst-tools/SKILL.md +5 -3
  13. package/dist/templates/backend/application/src/@aurora/modules/manual/application/manual-catalog-section-reader.spec.ts +4 -0
  14. package/dist/templates/backend/application/src/@aurora/modules/manual/application/manual-find-index.handler.spec.ts +2 -0
  15. package/dist/templates/backend/application/src/@aurora/modules/manual/application/manual-find-index.handler.ts +2 -1
  16. package/dist/templates/backend/application/src/@aurora/modules/manual/domain/manual-section-reader.port.ts +2 -0
  17. package/dist/templates/backend/application/src/@aurora/modules/manual/domain/manual.types.ts +2 -0
  18. package/dist/templates/backend/application/src/@aurora/modules/manual/graphql/manual-graphql-schema.spec.ts +10 -2
  19. package/dist/templates/backend/application/src/@aurora/modules/manual/graphql/manual.graphql +4 -0
  20. package/dist/templates/backend/business-rules/business-partner-portal/supplier-document.md +96 -6
  21. package/dist/templates/backend/business-rules/tools/assistant-usage.md +60 -0
  22. package/dist/templates/backend/manual/business-partner-portal/CONTEXT.md +5 -5
  23. package/dist/templates/backend/manual/business-partner-portal/en/purchase-invoice-header.md +5 -1
  24. package/dist/templates/backend/manual/business-partner-portal/es/purchase-invoice-header.md +5 -1
  25. package/dist/templates/backend/manual/production-planning/en/planner.md +1 -1
  26. package/dist/templates/backend/manual/production-planning/en/production-order-position-event.md +8 -5
  27. package/dist/templates/backend/manual/production-planning/es/planner.md +1 -1
  28. package/dist/templates/backend/manual/production-planning/es/production-order-position-event.md +8 -5
  29. package/dist/templates/backend/manual/reporting/en/report.md +40 -0
  30. package/dist/templates/backend/manual/reporting/es/report.md +40 -0
  31. package/dist/templates/backend/manual/tools/CONTEXT.md +1 -0
  32. package/dist/templates/backend/manual/tools/actions.yaml +11 -0
  33. package/dist/templates/backend/manual/tools/en/assistant-conversation.md +38 -0
  34. package/dist/templates/backend/manual/tools/en/assistant-usage-policy.md +46 -0
  35. package/dist/templates/backend/manual/tools/en/assistant-usage.md +28 -0
  36. package/dist/templates/backend/manual/tools/en/file-storage.md +83 -0
  37. package/dist/templates/backend/manual/tools/es/assistant-conversation.md +38 -0
  38. package/dist/templates/backend/manual/tools/es/assistant-usage-policy.md +46 -0
  39. package/dist/templates/backend/manual/tools/es/assistant-usage.md +28 -0
  40. package/dist/templates/backend/manual/tools/es/file-storage.md +83 -0
  41. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/infrastructure/business-partner-portal-anthropic-extraction-step-two.service.spec.ts +2 -1
  42. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-one-request.function.spec.ts +9 -2
  43. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-one-request.function.ts +6 -3
  44. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-two-request.function.spec.ts +19 -2
  45. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-two-request.function.ts +15 -2
  46. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-map-step-one-answer.function.ts +1 -1
  47. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/types/business-partner-portal-anthropic-step-one-answer.types.ts +1 -1
  48. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.spec.ts +63 -0
  49. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.ts +25 -3
  50. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-empty.service.spec.ts +1 -0
  51. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two.types.ts +5 -0
  52. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts +1 -1
  53. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.ts +1 -1
  54. package/dist/templates/backend/packages/production-planning/src/@app/production-planning/production-order-position/application/get-processes/production-planning-get-processes-production-order-position.handler.spec.ts +5 -2
  55. package/dist/templates/backend/packages/production-planning/src/@app/production-planning/production-order-position/application/get-processes/production-planning-get-processes-production-order-position.handler.ts +4 -0
  56. package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-create-report.dto.ts +0 -21
  57. package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-report.dto.ts +3 -3
  58. package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-update-report-by-id.dto.ts +0 -48
  59. package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-update-reports.dto.ts +0 -48
  60. package/dist/templates/backend/packages/reporting/src/@api/reporting/report/graphql/reporting-report.graphql +3 -20
  61. package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/create/reporting-create-report.service.ts +2 -2
  62. package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/reporting-report.payload-types.ts +33 -0
  63. package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update/reporting-update-report-by-id.handler.spec.ts +77 -0
  64. package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update/reporting-update-report-by-id.service.ts +2 -2
  65. package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update/reporting-update-reports.service.ts +2 -2
  66. package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update-execution-cache/reporting-update-report-execution-cache.handler.spec.ts +35 -0
  67. package/dist/templates/backend/packages/reporting/src/@app/reporting/report/domain/reporting-report.field-schema.ts +7 -0
  68. package/dist/templates/backend/packages/reporting/src/@app/reporting/report/index.ts +5 -0
  69. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/dto/tools-assistant-conversation.dto.ts +8 -1
  70. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/dto/tools-update-assistant-conversation-by-id.dto.ts +8 -1
  71. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/dto/tools-update-assistant-conversations.dto.ts +8 -1
  72. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/graphql/tools-assistant-conversation.graphql +8 -1
  73. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/controllers/tools-ask-assistant-assistant-usage.controller.ts +1 -0
  74. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-ask-assistant.dto.ts +47 -0
  75. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-assistant-answer.dto.ts +1 -0
  76. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-assistant-usage.dto.ts +8 -1
  77. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-update-assistant-usage-by-id.dto.ts +8 -1
  78. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-update-assistant-usages.dto.ts +8 -1
  79. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/graphql/tools-assistant-usage.graphql +45 -1
  80. package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/resolvers/tools-ask-assistant-assistant-usage.resolver.ts +1 -0
  81. package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/infrastructure/tools-anthropic-assistant-model.service.spec.ts +1 -0
  82. package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.spec.ts +145 -0
  83. package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.ts +44 -2
  84. package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/shared/types/tools-anthropic-assistant-answer.types.ts +3 -2
  85. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-conversation/domain/tools-assistant-conversation.field-schema.ts +6 -0
  86. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-conversation/infrastructure/drizzle/tools-drizzle-assistant-conversation.schema.ts +1 -0
  87. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-ask-assistant-assistant-usage.handler.spec.ts +105 -5
  88. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-ask-assistant-assistant-usage.handler.ts +40 -23
  89. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-errors.function.ts +8 -0
  90. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-read-screen.function.spec.ts +257 -0
  91. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-read-screen.function.ts +200 -0
  92. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/quota/tools-assistant-quota.service.spec.ts +7 -2
  93. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/quota/tools-assistant-quota.service.ts +7 -2
  94. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/domain/tools-assistant-model.port.ts +44 -0
  95. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/domain/tools-assistant-usage.field-schema.ts +6 -0
  96. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/infrastructure/drizzle/tools-drizzle-assistant-usage.repository.spec.ts +25 -0
  97. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/infrastructure/drizzle/tools-drizzle-assistant-usage.repository.ts +3 -0
  98. package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/infrastructure/drizzle/tools-drizzle-assistant-usage.schema.ts +1 -0
  99. package/dist/templates/backend/packages/tools/test/acceptance/tools/assistant-ask.e2e-spec.ts +16 -1
  100. package/dist/templates/backend/packages/tools/test/acceptance/tools/assistant-usage-increment.e2e-spec.ts +52 -5
  101. package/dist/templates/codegen/frontend/module/__module_name__/features/__module_name__-list.component.ts.eta +7 -1
  102. package/dist/templates/codegen/frontend/module/__module_name__/features/index.ts.eta +1 -1
  103. package/dist/templates/frontend/application/.claude/skills/catalyst-project-structure/SKILL.md +3 -0
  104. package/dist/templates/frontend/application/libs/ui/command/src/lib/hlm-command-item.ts +1 -1
  105. package/dist/templates/frontend/application/src/@aurora/modules/assisted-form/README.md +2 -0
  106. package/dist/templates/frontend/application/src/@aurora/modules/command-palette/command-palette-trigger.component.ts +1 -0
  107. package/dist/templates/frontend/application/src/@aurora/modules/guided-action/README.md +4 -0
  108. package/dist/templates/frontend/application/src/@aurora/modules/guided-action/guided-action-runner.service.spec.ts +69 -0
  109. package/dist/templates/frontend/application/src/@aurora/modules/guided-action/guided-action-runner.service.ts +13 -4
  110. package/dist/templates/frontend/application/src/@aurora/modules/index.ts +1 -0
  111. package/dist/templates/frontend/application/src/@aurora/modules/manual/manual.graphql.ts +1 -0
  112. package/dist/templates/frontend/application/src/@aurora/modules/screen-context/README.md +36 -0
  113. package/dist/templates/frontend/application/src/@aurora/modules/screen-context/index.ts +2 -0
  114. package/dist/templates/frontend/application/src/@aurora/modules/screen-context/screen-context.service.spec.ts +137 -0
  115. package/dist/templates/frontend/application/src/@aurora/modules/screen-context/screen-context.service.ts +60 -0
  116. package/dist/templates/frontend/application/src/@aurora/modules/screen-context/screen-context.types.ts +47 -0
  117. package/dist/templates/frontend/application/src/app/domains/admin/layout/site-header.ts +1 -1
  118. package/dist/templates/frontend/application/tsconfig.json +1 -0
  119. package/dist/templates/frontend/navigation-i18n/reporting/en.json +1 -1
  120. package/dist/templates/frontend/navigation-i18n/reporting/es.json +1 -1
  121. package/dist/templates/frontend/packages/automation/src/app/domains/admin/apps/automation/state-machine-history/features/index.ts +0 -1
  122. package/dist/templates/frontend/packages/automation/src/app/domains/admin/apps/automation/state-machine-history/features/state-machine-history-list.component.ts +0 -13
  123. package/dist/templates/frontend/packages/business-partner-portal/public/i18n/business-partner-portal/en.json +11 -0
  124. package/dist/templates/frontend/packages/business-partner-portal/public/i18n/business-partner-portal/es.json +11 -0
  125. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review-context.derive.spec.ts +420 -0
  126. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review-context.derive.ts +237 -0
  127. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review.derive.spec.ts +181 -26
  128. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review.derive.ts +143 -25
  129. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-detail.component.spec.ts +42 -0
  130. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-detail.component.ts +32 -8
  131. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-form.component.ts +32 -1
  132. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-list-actions-cell.component.ts +4 -1
  133. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/ui/purchase-invoice-breakdown.component.ts +7 -32
  134. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/ui/purchase-invoice-lines-grid.component.ts +12 -8
  135. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-trace/features/index.ts +0 -1
  136. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-trace/features/purchase-invoice-trace-list.component.ts +0 -13
  137. package/dist/templates/frontend/packages/identity/src/app/domains/admin/apps/iam/account/features/account-form.component.spec.ts +26 -1
  138. package/dist/templates/frontend/packages/identity/src/app/domains/admin/apps/iam/account/features/account-form.component.ts +45 -0
  139. package/dist/templates/frontend/packages/production-planning/public/i18n/production-planning/en.json +15 -4
  140. package/dist/templates/frontend/packages/production-planning/public/i18n/production-planning/es.json +15 -4
  141. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/index.ts +1 -0
  142. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner-process-weights.derive.spec.ts +57 -0
  143. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner-process-weights.derive.ts +39 -0
  144. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner.derive.spec.ts +15 -0
  145. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner.derive.ts +7 -3
  146. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner.graphql.ts +23 -0
  147. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/features/planner-process-weights-dialog.component.ts +137 -0
  148. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/features/planner.component.ts +41 -4
  149. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.derive.spec.ts +0 -30
  150. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.derive.ts +0 -21
  151. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.resolvers.spec.ts +24 -0
  152. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.resolvers.ts +3 -1
  153. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/batch-detail-sheet.component.ts +22 -10
  154. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/event-form-sheet.component.spec.ts +142 -0
  155. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/event-form-sheet.component.ts +95 -59
  156. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/event-list.component.ts +121 -123
  157. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/production-dashboard.component.ts +52 -19
  158. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-order-position/features/production-order-position-list.component.ts +8 -2
  159. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-order-position-event/features/production-order-position-event-list.component.ts +4 -0
  160. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-order-position-event/production-order-position-event.columns.spec.ts +104 -4
  161. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-order-position-event/production-order-position-event.columns.ts +121 -69
  162. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/shared/dialogs/finish-event-dialog.component.ts +3 -3
  163. package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/shared/dialogs/weight-input-dialog.component.ts +3 -3
  164. package/dist/templates/frontend/packages/reporting/public/i18n/reporting/en.json +1 -1
  165. package/dist/templates/frontend/packages/reporting/public/i18n/reporting/es.json +1 -1
  166. package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/data-access/report.detail-config.ts +1 -2
  167. package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/data-access/report.graphql.ts +0 -14
  168. package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/features/report-form.component.spec.ts +96 -0
  169. package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/features/report-form.component.ts +46 -69
  170. package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/features/report-list.component.ts +2 -22
  171. package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/report.columns.ts +0 -1
  172. package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/reporting-icons.providers.ts +2 -1
  173. package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/reporting.navigation.ts +7 -0
  174. package/dist/templates/frontend/packages/tools/public/i18n/tools/en.json +4 -2
  175. package/dist/templates/frontend/packages/tools/public/i18n/tools/es.json +4 -2
  176. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant/tools-assistant.service.spec.ts +82 -7
  177. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant/tools-assistant.service.ts +12 -2
  178. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/assistant-conversation.columns.ts +13 -0
  179. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/data-access/assistant-conversation.graphql.ts +1 -0
  180. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/assistant-conversation-form.component.ts +18 -0
  181. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/assistant-conversation-list.component.ts +0 -13
  182. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/index.ts +0 -1
  183. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/assistant-usage.columns.ts +13 -0
  184. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/data-access/assistant-usage.graphql.ts +2 -0
  185. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/assistant-usage-form.component.ts +18 -0
  186. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/assistant-usage-list.component.ts +0 -13
  187. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/index.ts +0 -1
  188. package/dist/templates/monorepo/.claude/commands/business-rules/promote.md +5 -1
  189. package/dist/templates/monorepo/.claude/hooks/__fixtures__/br-hr-regression-baseline.txt +2 -2
  190. package/dist/templates/monorepo/.claude/hooks/check-required-setup.ts +4 -4
  191. package/dist/templates/monorepo/.claude/hooks/inject-prompt-context.ts +1 -1
  192. package/dist/templates/monorepo/.claude/scripts/generate-skills-index.test.ts +29 -1
  193. package/dist/templates/monorepo/.claude/scripts/generate-skills-index.ts +7 -1
  194. package/dist/templates/monorepo/.claude/skills/REGISTRY.md +2 -2
  195. package/dist/templates/monorepo/.claude/skills/catalyst-backlog/SKILL.md +19 -4
  196. package/dist/templates/monorepo/.claude/skills/catalyst-backlog/frontier-worker-addendum.md +3 -3
  197. package/dist/templates/monorepo/.claude/skills/catalyst-business-rules-guard/SKILL.md +8 -5
  198. package/dist/templates/monorepo/.claude/skills/catalyst-business-rules-guard/references/workflow.md +10 -6
  199. package/dist/templates/monorepo/.claude/skills/catalyst-delegation/SKILL.md +1 -1
  200. package/dist/templates/monorepo/.claude/skills/catalyst-harness-rules-guard/SKILL.md +6 -6
  201. package/dist/templates/monorepo/.claude/skills/catalyst-harness-rules-guard/references/enforcement.md +3 -3
  202. package/dist/templates/monorepo/.claude/skills/catalyst-harness-rules-guard/references/format.md +3 -3
  203. package/dist/templates/monorepo/.claude/skills/catalyst-update-skill-registry/SKILL.md +4 -4
  204. package/dist/templates/monorepo/.claude/skills/catalyst-user-manual/SKILL.md +48 -2
  205. package/dist/templates/monorepo/.claude/skills/openspec-apply-change/SKILL.md +28 -10
  206. package/dist/templates/monorepo/.claude/skills/openspec-archive-change/SKILL.md +52 -13
  207. package/dist/templates/monorepo/.claude/skills/openspec-explore/SKILL.md +59 -14
  208. package/dist/templates/monorepo/.claude/skills/openspec-propose/SKILL.md +38 -12
  209. package/dist/templates/monorepo/.claude/skills/openspec-sync-specs/SKILL.md +31 -3
  210. package/dist/templates/monorepo/CLAUDE.md +14 -14
  211. package/dist/templates/monorepo/docs/business-rules/ARCHITECTURE.md +16 -13
  212. package/dist/templates/monorepo/docs/business-rules/MIGRATION.md +5 -5
  213. package/dist/templates/monorepo/docs/manual/en/04-asistente.md +71 -0
  214. package/dist/templates/monorepo/docs/manual/es/04-asistente.md +71 -0
  215. package/dist/templates/monorepo/openspec/config.yaml +25 -5
  216. package/dist/templates/monorepo/package.json +3 -1
  217. package/dist/templates/monorepo/scripts/backlog/prompt.test.ts +5 -5
  218. package/dist/templates/monorepo/scripts/backlog/prompt.ts +1 -1
  219. package/dist/templates/monorepo/scripts/business-rules/audit.ts +1 -1
  220. package/dist/templates/monorepo/scripts/manual/compile.test.ts +78 -0
  221. package/dist/templates/monorepo/scripts/manual/compile.ts +36 -9
  222. package/dist/templates/monorepo/scripts/worktree/prune.test.ts +517 -0
  223. package/dist/templates/monorepo/scripts/worktree/prune.ts +331 -0
  224. package/oclif.manifest.json +85 -85
  225. package/package.json +15 -17
  226. package/dist/templates/frontend/packages/automation/src/app/domains/admin/apps/automation/state-machine-history/features/state-machine-history-list-actions-cell.component.ts +0 -44
  227. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-trace/features/purchase-invoice-trace-list-actions-cell.component.ts +0 -44
  228. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/assistant-conversation-list-actions-cell.component.ts +0 -44
  229. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/assistant-usage-list-actions-cell.component.ts +0 -43
  230. package/dist/templates/monorepo/.claude/commands/opsx/apply.md +0 -184
  231. package/dist/templates/monorepo/.claude/commands/opsx/archive.md +0 -225
  232. package/dist/templates/monorepo/.claude/commands/opsx/explore.md +0 -196
  233. package/dist/templates/monorepo/.claude/commands/opsx/propose.md +0 -145
  234. package/dist/templates/monorepo/.claude/commands/opsx/sync.md +0 -258
@@ -11,19 +11,6 @@ export class ReportingUpdateReportByIdDto {
11
11
  })
12
12
  id: string;
13
13
 
14
- @ApiProperty({
15
- type: String,
16
- description:
17
- 'Key that matches a registered ReportCube (e.g. "reporting.pilot").The engine looks up the cube by this key at execution time. Must matcha cube registered via provideReport() in the module\'s DI container.',
18
- })
19
- definitionKey?: string;
20
-
21
- @ApiProperty({
22
- type: String,
23
- description: 'Human-readable display name for the report (shown in the catalog card).',
24
- })
25
- name?: string;
26
-
27
14
  @ApiProperty({
28
15
  type: String,
29
16
  description:
@@ -52,20 +39,6 @@ export class ReportingUpdateReportByIdDto {
52
39
  })
53
40
  updateFrequency?: string;
54
41
 
55
- @ApiProperty({
56
- type: Object,
57
- description:
58
- "The cube instance (ReportSelection jsonb): which dimensions, measures, defaultfilters and default sort to apply. Validated against the cube's whitelist atexecution time (BR-REPORT / selection-whitelist). Stored as JSONB.",
59
- })
60
- selection?: any;
61
-
62
- @ApiProperty({
63
- type: Boolean,
64
- description:
65
- 'When true, this is a seeded system report visible to all accounts with thereporting-read permission, regardless of accountId. When false, visibilityis controlled by the `visibility` field.',
66
- })
67
- isSystem?: boolean;
68
-
69
42
  @ApiProperty({
70
43
  type: String,
71
44
  description:
@@ -73,13 +46,6 @@ export class ReportingUpdateReportByIdDto {
73
46
  })
74
47
  accountId?: string;
75
48
 
76
- @ApiProperty({
77
- type: String,
78
- description:
79
- "Controls who can see this report in the catalog: 'public' - visible to any account with reporting permission (subject to tenant scope). 'account' - visible only to the owning accountId.System reports (isSystem=true) ignore this field and are always visible.",
80
- })
81
- visibility?: string;
82
-
83
49
  @ApiProperty({
84
50
  type: String,
85
51
  description:
@@ -87,20 +53,6 @@ export class ReportingUpdateReportByIdDto {
87
53
  })
88
54
  tenantId?: string;
89
55
 
90
- @ApiProperty({
91
- type: String,
92
- description:
93
- 'Cached timestamp of the most recent successful execution. Updated asynchronouslyafter each successful executeReport call (fire-and-forget). Used for the catalogbadge. MUST NOT block the response.',
94
- })
95
- lastRunAt?: string;
96
-
97
- @ApiProperty({
98
- type: Number,
99
- description:
100
- 'Cached count of rows returned by the most recent successful execution. Updatedasynchronously alongside lastRunAt. Used for the catalog badge.MUST NOT block the response.',
101
- })
102
- lastRowCount?: number;
103
-
104
56
  @ApiProperty({
105
57
  type: [String],
106
58
  description:
@@ -11,19 +11,6 @@ export class ReportingUpdateReportsDto {
11
11
  })
12
12
  id?: string;
13
13
 
14
- @ApiProperty({
15
- type: String,
16
- description:
17
- 'Key that matches a registered ReportCube (e.g. "reporting.pilot").The engine looks up the cube by this key at execution time. Must matcha cube registered via provideReport() in the module\'s DI container.',
18
- })
19
- definitionKey?: string;
20
-
21
- @ApiProperty({
22
- type: String,
23
- description: 'Human-readable display name for the report (shown in the catalog card).',
24
- })
25
- name?: string;
26
-
27
14
  @ApiProperty({
28
15
  type: String,
29
16
  description:
@@ -52,20 +39,6 @@ export class ReportingUpdateReportsDto {
52
39
  })
53
40
  updateFrequency?: string;
54
41
 
55
- @ApiProperty({
56
- type: Object,
57
- description:
58
- "The cube instance (ReportSelection jsonb): which dimensions, measures, defaultfilters and default sort to apply. Validated against the cube's whitelist atexecution time (BR-REPORT / selection-whitelist). Stored as JSONB.",
59
- })
60
- selection?: any;
61
-
62
- @ApiProperty({
63
- type: Boolean,
64
- description:
65
- 'When true, this is a seeded system report visible to all accounts with thereporting-read permission, regardless of accountId. When false, visibilityis controlled by the `visibility` field.',
66
- })
67
- isSystem?: boolean;
68
-
69
42
  @ApiProperty({
70
43
  type: String,
71
44
  description:
@@ -73,13 +46,6 @@ export class ReportingUpdateReportsDto {
73
46
  })
74
47
  accountId?: string;
75
48
 
76
- @ApiProperty({
77
- type: String,
78
- description:
79
- "Controls who can see this report in the catalog: 'public' - visible to any account with reporting permission (subject to tenant scope). 'account' - visible only to the owning accountId.System reports (isSystem=true) ignore this field and are always visible.",
80
- })
81
- visibility?: string;
82
-
83
49
  @ApiProperty({
84
50
  type: String,
85
51
  description:
@@ -87,20 +53,6 @@ export class ReportingUpdateReportsDto {
87
53
  })
88
54
  tenantId?: string;
89
55
 
90
- @ApiProperty({
91
- type: String,
92
- description:
93
- 'Cached timestamp of the most recent successful execution. Updated asynchronouslyafter each successful executeReport call (fire-and-forget). Used for the catalogbadge. MUST NOT block the response.',
94
- })
95
- lastRunAt?: string;
96
-
97
- @ApiProperty({
98
- type: Number,
99
- description:
100
- 'Cached count of rows returned by the most recent successful execution. Updatedasynchronously alongside lastRunAt. Used for the catalog badge.MUST NOT block the response.',
101
- })
102
- lastRowCount?: number;
103
-
104
56
  @ApiProperty({
105
57
  type: [String],
106
58
  description:
@@ -48,7 +48,7 @@ type ReportingReport {
48
48
  """
49
49
  accountId: ID
50
50
  """
51
- Controls who can see this report in the catalog: 'public' - visible to any account with reporting permission (subject to tenant scope). 'account' - visible only to the owning accountId.System reports (isSystem=true) ignore this field and are always visible.
51
+ Controls who can see this report in the catalog: 'public' - visible to any account with reporting permission (subject to tenant scope). 'account' - visible only to the owning accountId.System reports (isSystem=true) ignore this field and are always visible.Written only by the system-report loader; no visibility rule reads it today.
52
52
  """
53
53
  visibility: GraphQLString!
54
54
  """
@@ -56,11 +56,11 @@ type ReportingReport {
56
56
  """
57
57
  tenantId: ID
58
58
  """
59
- Cached timestamp of the most recent successful execution. Updated asynchronouslyafter each successful executeReport call (fire-and-forget). Used for the catalogbadge. MUST NOT block the response.
59
+ Cached timestamp of the most recent successful execution. Updated asynchronouslyafter each successful executeReport call (fire-and-forget). Used for the catalogbadge. MUST NOT block the response. Written only by the execution-cache handler.
60
60
  """
61
61
  lastRunAt: GraphQLISODateTime
62
62
  """
63
- Cached count of rows returned by the most recent successful execution. Updatedasynchronously alongside lastRunAt. Used for the catalog badge.MUST NOT block the response.
63
+ Cached count of rows returned by the most recent successful execution. Updatedasynchronously alongside lastRunAt. Used for the catalog badge.MUST NOT block the response. Written only by the execution-cache handler.
64
64
  """
65
65
  lastRowCount: GraphQLInt
66
66
  """
@@ -129,46 +129,29 @@ input ReportingCreateReportInput {
129
129
  selection: JSON!
130
130
  isSystem: GraphQLBoolean!
131
131
  accountId: ID
132
- visibility: GraphQLString!
133
132
  tenantId: ID
134
- lastRunAt: GraphQLISODateTime
135
- lastRowCount: GraphQLInt
136
133
  favoriteIds: [ID!]
137
134
  }
138
135
 
139
136
  input ReportingUpdateReportByIdInput {
140
137
  id: ID!
141
- definitionKey: GraphQLString
142
- name: GraphQLString
143
138
  description: GraphQLString
144
139
  categoryId: ID
145
140
  owner: GraphQLString
146
141
  updateFrequency: GraphQLString
147
- selection: JSON
148
- isSystem: GraphQLBoolean
149
142
  accountId: ID
150
- visibility: GraphQLString
151
143
  tenantId: ID
152
- lastRunAt: GraphQLISODateTime
153
- lastRowCount: GraphQLInt
154
144
  favoriteIds: [ID!]
155
145
  }
156
146
 
157
147
  input ReportingUpdateReportsInput {
158
148
  id: ID
159
- definitionKey: GraphQLString
160
- name: GraphQLString
161
149
  description: GraphQLString
162
150
  categoryId: ID
163
151
  owner: GraphQLString
164
152
  updateFrequency: GraphQLString
165
- selection: JSON
166
- isSystem: GraphQLBoolean
167
153
  accountId: ID
168
- visibility: GraphQLString
169
154
  tenantId: ID
170
- lastRunAt: GraphQLISODateTime
171
- lastRowCount: GraphQLInt
172
155
  favoriteIds: [ID!]
173
156
  }
174
157
 
@@ -2,16 +2,16 @@
2
2
  * @aurora-catalyst-generated
3
3
  * @source cliter/reporting/report.module.yaml
4
4
  */
5
- import { ReportingCreateReportInput } from '@api/graphql.js';
6
5
  import { ReportingDrizzleReportRepository } from '@app/reporting/report/infrastructure/drizzle/reporting-drizzle-report.repository.js';
7
6
  import { HandlerMeta } from '@aurorajs.dev/core-back';
8
7
  import { Injectable } from '@nestjs/common';
8
+ import { ReportingCreateReportPayload } from '../reporting-report.payload-types.js';
9
9
 
10
10
  @Injectable()
11
11
  export class ReportingCreateReportService {
12
12
  constructor(private readonly repository: ReportingDrizzleReportRepository) {}
13
13
 
14
- async main(payload: ReportingCreateReportInput, handlerMeta?: HandlerMeta): Promise<void> {
14
+ async main(payload: ReportingCreateReportPayload, handlerMeta?: HandlerMeta): Promise<void> {
15
15
  await this.repository.create(payload, {
16
16
  createOptions: handlerMeta?.repositoryOptions,
17
17
  });
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @aurora-catalyst-generated
3
+ * @source cliter/reporting/report.module.yaml
4
+ */
5
+ import {
6
+ ReportingCreateReportInput,
7
+ ReportingUpdateReportByIdInput,
8
+ ReportingUpdateReportsInput,
9
+ } from '@api/graphql.js';
10
+
11
+ /**
12
+ * Internal service payload types for ReportingReport — the public
13
+ * write input intersected with its readonly properties as optional members.
14
+ * Only the generated write SERVICES type their payload with these; handlers,
15
+ * resolvers and controllers keep the narrower public input (design.md D8).
16
+ */
17
+ export type ReportingCreateReportPayload = ReportingCreateReportInput & {
18
+ visibility?: string;
19
+ lastRunAt?: string;
20
+ lastRowCount?: number;
21
+ };
22
+
23
+ export type ReportingUpdateReportByIdPayload = ReportingUpdateReportByIdInput & {
24
+ visibility?: string;
25
+ lastRunAt?: string;
26
+ lastRowCount?: number;
27
+ };
28
+
29
+ export type ReportingUpdateReportsPayload = ReportingUpdateReportsInput & {
30
+ visibility?: string;
31
+ lastRunAt?: string;
32
+ lastRowCount?: number;
33
+ };
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Write-contract of the report update-by-id handler: the schema decorators run for real
3
+ * (real `ReportingReportFieldSchema`), so removing a `createOnly` / `readOnly` flag from
4
+ * `cliter/reporting/report.module.yaml` makes these cases fail.
5
+ */
6
+ import { BadRequestException } from '@nestjs/common';
7
+ import { EventEmitter2 } from '@nestjs/event-emitter';
8
+ import { Test } from '@nestjs/testing';
9
+
10
+ import { ReportingFindReportByIdService } from '@app/reporting/report/application/find/reporting-find-report-by-id.service.js';
11
+ import { ReportingUpdateReportByIdService } from '@app/reporting/report/application/update/reporting-update-report-by-id.service.js';
12
+
13
+ import { ReportingUpdateReportByIdHandler } from './reporting-update-report-by-id.handler.js';
14
+
15
+ const REPORT_ID = 'f47ac10b-58cc-4372-a567-0e02b2c3d479';
16
+ const handlerMeta = { timezone: 'UTC', repositoryOptions: { auditing: null } };
17
+
18
+ describe('ReportingUpdateReportByIdHandler — write contract', () => {
19
+ let handler: ReportingUpdateReportByIdHandler;
20
+
21
+ const updateByIdService = { main: vi.fn() };
22
+ const findByIdService = { main: vi.fn() };
23
+ const eventEmitter = { emit: vi.fn() };
24
+
25
+ beforeEach(async () => {
26
+ vi.clearAllMocks();
27
+ findByIdService.main.mockResolvedValue({ id: REPORT_ID, description: 'old' });
28
+
29
+ const moduleRef = await Test.createTestingModule({
30
+ providers: [
31
+ ReportingUpdateReportByIdHandler,
32
+ { provide: EventEmitter2, useValue: eventEmitter },
33
+ { provide: ReportingUpdateReportByIdService, useValue: updateByIdService },
34
+ { provide: ReportingFindReportByIdService, useValue: findByIdService },
35
+ ],
36
+ }).compile();
37
+
38
+ handler = moduleRef.get(ReportingUpdateReportByIdHandler);
39
+ });
40
+
41
+ it('accepts an editable field and delegates to the update service', async () => {
42
+ await handler.main({ id: REPORT_ID, description: 'new' } as any, undefined, handlerMeta as any);
43
+
44
+ expect(updateByIdService.main).toHaveBeenCalledWith(
45
+ expect.objectContaining({ id: REPORT_ID, description: 'new' }),
46
+ undefined,
47
+ handlerMeta,
48
+ );
49
+ });
50
+
51
+ describe.each([
52
+ ['name', 'Renamed'],
53
+ ['definitionKey', 'reporting.other'],
54
+ ['isSystem', false],
55
+ ['selection', { dimensions: [] }],
56
+ ])('createOnly field %s', (field, value) => {
57
+ it('is rejected on update with 400', async () => {
58
+ await expect(
59
+ handler.main({ id: REPORT_ID, [field]: value } as any, undefined, handlerMeta as any),
60
+ ).rejects.toBeInstanceOf(BadRequestException);
61
+ expect(updateByIdService.main).not.toHaveBeenCalled();
62
+ });
63
+ });
64
+
65
+ describe.each([
66
+ ['visibility', 'account'],
67
+ ['lastRunAt', '2026-01-01T00:00:00.000Z'],
68
+ ['lastRowCount', 7],
69
+ ])('readOnly field %s', (field, value) => {
70
+ it('is rejected on update with 400', async () => {
71
+ await expect(
72
+ handler.main({ id: REPORT_ID, [field]: value } as any, undefined, handlerMeta as any),
73
+ ).rejects.toBeInstanceOf(BadRequestException);
74
+ expect(updateByIdService.main).not.toHaveBeenCalled();
75
+ });
76
+ });
77
+ });
@@ -2,17 +2,17 @@
2
2
  * @aurora-catalyst-generated
3
3
  * @source cliter/reporting/report.module.yaml
4
4
  */
5
- import { ReportingUpdateReportByIdInput } from '@api/graphql.js';
6
5
  import { ReportingDrizzleReportRepository } from '@app/reporting/report/infrastructure/drizzle/reporting-drizzle-report.repository.js';
7
6
  import { HandlerMeta, QueryStatement } from '@aurorajs.dev/core-back';
8
7
  import { Injectable } from '@nestjs/common';
8
+ import { ReportingUpdateReportByIdPayload } from '../reporting-report.payload-types.js';
9
9
 
10
10
  @Injectable()
11
11
  export class ReportingUpdateReportByIdService {
12
12
  constructor(private readonly repository: ReportingDrizzleReportRepository) {}
13
13
 
14
14
  async main(
15
- payload: ReportingUpdateReportByIdInput,
15
+ payload: ReportingUpdateReportByIdPayload,
16
16
  constraint?: QueryStatement,
17
17
  handlerMeta?: HandlerMeta,
18
18
  ): Promise<void> {
@@ -2,17 +2,17 @@
2
2
  * @aurora-catalyst-generated
3
3
  * @source cliter/reporting/report.module.yaml
4
4
  */
5
- import { ReportingUpdateReportsInput } from '@api/graphql.js';
6
5
  import { ReportingDrizzleReportRepository } from '@app/reporting/report/infrastructure/drizzle/reporting-drizzle-report.repository.js';
7
6
  import { HandlerMeta, QueryStatement } from '@aurorajs.dev/core-back';
8
7
  import { Injectable } from '@nestjs/common';
8
+ import { ReportingUpdateReportsPayload } from '../reporting-report.payload-types.js';
9
9
 
10
10
  @Injectable()
11
11
  export class ReportingUpdateReportsService {
12
12
  constructor(private readonly repository: ReportingDrizzleReportRepository) {}
13
13
 
14
14
  async main(
15
- payload: ReportingUpdateReportsInput,
15
+ payload: ReportingUpdateReportsPayload,
16
16
  queryStatement?: QueryStatement,
17
17
  constraint?: QueryStatement,
18
18
  handlerMeta?: HandlerMeta,
@@ -11,8 +11,12 @@
11
11
  * - Updates lastRunAt and lastRowCount on the row identified by reportId.
12
12
  * - Errors are logged and swallowed, never propagated (fire-and-forget).
13
13
  */
14
+ import { Logger } from '@nestjs/common';
14
15
  import { Test } from '@nestjs/testing';
15
16
 
17
+ import { ReportingUpdateReportByIdService } from '@app/reporting/report/application/update/reporting-update-report-by-id.service.js';
18
+ import { ReportingDrizzleReportRepository } from '@app/reporting/report/infrastructure/drizzle/reporting-drizzle-report.repository.js';
19
+
16
20
  import { ReportingUpdateReportExecutionCacheHandler } from './reporting-update-report-execution-cache.handler.js';
17
21
 
18
22
  describe('ReportingUpdateReportExecutionCacheHandler', () => {
@@ -58,4 +62,35 @@ describe('ReportingUpdateReportExecutionCacheHandler', () => {
58
62
  const [, constraint] = mockUpdateService.main.mock.calls[0];
59
63
  expect(constraint).not.toHaveProperty('where.definitionKey');
60
64
  });
65
+
66
+ describe('against the real update service (readOnly fields must not be rejected)', () => {
67
+ it('writes lastRunAt and lastRowCount through ReportingUpdateReportByIdService without a 400', async () => {
68
+ const repository = { updateById: vi.fn().mockResolvedValue(undefined) };
69
+ const moduleRef = await Test.createTestingModule({
70
+ providers: [
71
+ ReportingUpdateReportExecutionCacheHandler,
72
+ ReportingUpdateReportByIdService,
73
+ { provide: ReportingDrizzleReportRepository, useValue: repository },
74
+ {
75
+ provide: 'REPORTING_UPDATE_REPORT_BY_ID_SERVICE',
76
+ useExisting: ReportingUpdateReportByIdService,
77
+ },
78
+ ],
79
+ }).compile();
80
+ const realHandler = moduleRef.get(ReportingUpdateReportExecutionCacheHandler);
81
+ const errorSpy = vi.spyOn(Logger.prototype, 'error').mockImplementation(() => undefined);
82
+
83
+ await realHandler.main({ reportId: 'report-uuid-1', rowCount: 42 });
84
+
85
+ expect(errorSpy).not.toHaveBeenCalled();
86
+ expect(repository.updateById).toHaveBeenCalledWith(
87
+ expect.objectContaining({
88
+ id: 'report-uuid-1',
89
+ lastRowCount: 42,
90
+ lastRunAt: expect.any(String),
91
+ }),
92
+ expect.anything(),
93
+ );
94
+ });
95
+ });
61
96
  });
@@ -23,6 +23,7 @@ export const ReportingReportFieldSchema: FieldSchema[] = [
23
23
  nullable: false,
24
24
  maxLength: 128,
25
25
  rules: { minLength: 1 },
26
+ createOnly: true,
26
27
  },
27
28
  {
28
29
  name: 'name',
@@ -30,6 +31,7 @@ export const ReportingReportFieldSchema: FieldSchema[] = [
30
31
  nullable: false,
31
32
  maxLength: 256,
32
33
  rules: { minLength: 1 },
34
+ createOnly: true,
33
35
  },
34
36
  {
35
37
  name: 'description',
@@ -64,11 +66,13 @@ export const ReportingReportFieldSchema: FieldSchema[] = [
64
66
  name: 'selection',
65
67
  type: 'json',
66
68
  nullable: false,
69
+ createOnly: true,
67
70
  },
68
71
  {
69
72
  name: 'isSystem',
70
73
  type: 'boolean',
71
74
  nullable: false,
75
+ createOnly: true,
72
76
  },
73
77
  {
74
78
  name: 'accountId',
@@ -82,6 +86,7 @@ export const ReportingReportFieldSchema: FieldSchema[] = [
82
86
  nullable: false,
83
87
  maxLength: 16,
84
88
  rules: { minLength: 1 },
89
+ readOnly: true,
85
90
  },
86
91
  {
87
92
  name: 'tenantId',
@@ -93,11 +98,13 @@ export const ReportingReportFieldSchema: FieldSchema[] = [
93
98
  name: 'lastRunAt',
94
99
  type: 'dateTime',
95
100
  nullable: true,
101
+ readOnly: true,
96
102
  },
97
103
  {
98
104
  name: 'lastRowCount',
99
105
  type: 'int',
100
106
  nullable: true,
107
+ readOnly: true,
101
108
  },
102
109
  {
103
110
  name: 'createdAt',
@@ -6,6 +6,11 @@
6
6
  export * from './domain/index.js';
7
7
 
8
8
  // 2 - export infrastructure
9
+ export type {
10
+ ReportingCreateReportPayload,
11
+ ReportingUpdateReportByIdPayload,
12
+ ReportingUpdateReportsPayload,
13
+ } from './application/reporting-report.payload-types.js';
9
14
  export { ReportingDrizzleReportRepository } from './infrastructure/drizzle/reporting-drizzle-report.repository.js';
10
15
  export { reportingReportTable } from './infrastructure/drizzle/reporting-drizzle-report.schema.js';
11
16
 
@@ -27,10 +27,17 @@ export class ToolsAssistantConversationDto {
27
27
  @ApiProperty({
28
28
  type: String,
29
29
  description:
30
- 'Account that asked the question. A plain identifier with no relationship on purpose, like the usage ledger: `tools` takes no coupling to the `iam` account table. It is taken from the token, never from a client payload, and it scopes the turn updates: a turn of another account is treated as not found.',
30
+ 'Account that asked the question. A plain identifier with no relationship on purpose, like the usage ledger: `tools` takes no coupling to the `iam` account table. It is taken from the token, never from a client payload, and it scopes the turn updates: a turn of another account is treated as not found. The human-readable label lives in accountUsername.',
31
31
  })
32
32
  accountId: string;
33
33
 
34
+ @ApiProperty({
35
+ type: String,
36
+ description:
37
+ "Snapshot of the username of the token's account, frozen when the turn is stored: a later rename does not change old turns, so a turn records who asked as they were called then. Username is the one human-readable value of an account that is never null (a SERVICE account has no email and no user). It is a copy, not a relationship, so `tools` reads nothing from `iam` and the label survives the deletion of the account. Turns stored before this property existed stay empty. Length matches `iam/account.username`.",
38
+ })
39
+ accountUsername?: string;
40
+
34
41
  @ApiProperty({
35
42
  type: String,
36
43
  description:
@@ -20,10 +20,17 @@ export class ToolsUpdateAssistantConversationByIdDto {
20
20
  @ApiProperty({
21
21
  type: String,
22
22
  description:
23
- 'Account that asked the question. A plain identifier with no relationship on purpose, like the usage ledger: `tools` takes no coupling to the `iam` account table. It is taken from the token, never from a client payload, and it scopes the turn updates: a turn of another account is treated as not found.',
23
+ 'Account that asked the question. A plain identifier with no relationship on purpose, like the usage ledger: `tools` takes no coupling to the `iam` account table. It is taken from the token, never from a client payload, and it scopes the turn updates: a turn of another account is treated as not found. The human-readable label lives in accountUsername.',
24
24
  })
25
25
  accountId?: string;
26
26
 
27
+ @ApiProperty({
28
+ type: String,
29
+ description:
30
+ "Snapshot of the username of the token's account, frozen when the turn is stored: a later rename does not change old turns, so a turn records who asked as they were called then. Username is the one human-readable value of an account that is never null (a SERVICE account has no email and no user). It is a copy, not a relationship, so `tools` reads nothing from `iam` and the label survives the deletion of the account. Turns stored before this property existed stay empty. Length matches `iam/account.username`.",
31
+ })
32
+ accountUsername?: string;
33
+
27
34
  @ApiProperty({
28
35
  type: String,
29
36
  description:
@@ -20,10 +20,17 @@ export class ToolsUpdateAssistantConversationsDto {
20
20
  @ApiProperty({
21
21
  type: String,
22
22
  description:
23
- 'Account that asked the question. A plain identifier with no relationship on purpose, like the usage ledger: `tools` takes no coupling to the `iam` account table. It is taken from the token, never from a client payload, and it scopes the turn updates: a turn of another account is treated as not found.',
23
+ 'Account that asked the question. A plain identifier with no relationship on purpose, like the usage ledger: `tools` takes no coupling to the `iam` account table. It is taken from the token, never from a client payload, and it scopes the turn updates: a turn of another account is treated as not found. The human-readable label lives in accountUsername.',
24
24
  })
25
25
  accountId?: string;
26
26
 
27
+ @ApiProperty({
28
+ type: String,
29
+ description:
30
+ "Snapshot of the username of the token's account, frozen when the turn is stored: a later rename does not change old turns, so a turn records who asked as they were called then. Username is the one human-readable value of an account that is never null (a SERVICE account has no email and no user). It is a copy, not a relationship, so `tools` reads nothing from `iam` and the label survives the deletion of the account. Turns stored before this property existed stay empty. Length matches `iam/account.username`.",
31
+ })
32
+ accountUsername?: string;
33
+
27
34
  @ApiProperty({
28
35
  type: String,
29
36
  description:
@@ -27,10 +27,14 @@ type ToolsAssistantConversation {
27
27
  """
28
28
  rowId: GraphQLInt!
29
29
  """
30
- Account that asked the question. A plain identifier with no relationship on purpose, like the usage ledger: `tools` takes no coupling to the `iam` account table. It is taken from the token, never from a client payload, and it scopes the turn updates: a turn of another account is treated as not found.
30
+ Account that asked the question. A plain identifier with no relationship on purpose, like the usage ledger: `tools` takes no coupling to the `iam` account table. It is taken from the token, never from a client payload, and it scopes the turn updates: a turn of another account is treated as not found. The human-readable label lives in accountUsername.
31
31
  """
32
32
  accountId: ID!
33
33
  """
34
+ Snapshot of the username of the token's account, frozen when the turn is stored: a later rename does not change old turns, so a turn records who asked as they were called then. Username is the one human-readable value of an account that is never null (a SERVICE account has no email and no user). It is a copy, not a relationship, so `tools` reads nothing from `iam` and the label survives the deletion of the account. Turns stored before this property existed stay empty. Length matches `iam/account.username`.
35
+ """
36
+ accountUsername: GraphQLString
37
+ """
34
38
  Groups the turns of the same chat conversation. Generated by the assistant flow, not a reference to any table, so it has no relationship.
35
39
  """
36
40
  conversationId: ID!
@@ -103,6 +107,7 @@ type ToolsAssistantConversation {
103
107
  input ToolsCreateAssistantConversationInput {
104
108
  id: ID!
105
109
  accountId: ID!
110
+ accountUsername: GraphQLString
106
111
  conversationId: ID!
107
112
  lang: GraphQLString!
108
113
  question: GraphQLString!
@@ -122,6 +127,7 @@ input ToolsCreateAssistantConversationInput {
122
127
  input ToolsUpdateAssistantConversationByIdInput {
123
128
  id: ID!
124
129
  accountId: ID
130
+ accountUsername: GraphQLString
125
131
  conversationId: ID
126
132
  lang: GraphQLString
127
133
  question: GraphQLString
@@ -154,6 +160,7 @@ input ToolsReportAssistantActionInput {
154
160
  input ToolsUpdateAssistantConversationsInput {
155
161
  id: ID
156
162
  accountId: ID
163
+ accountUsername: GraphQLString
157
164
  conversationId: ID
158
165
  lang: GraphQLString
159
166
  question: GraphQLString
@@ -32,6 +32,7 @@ export class ToolsAskAssistantAssistantUsageController {
32
32
  payload,
33
33
  {
34
34
  accountId: currentAccount.id,
35
+ accountUsername: currentAccount.username,
35
36
  roleIds: currentAccount.roles.map((role) => role.id),
36
37
  permissions: currentAccount.dPermissions.all,
37
38
  },