@aurorajs.dev/catalyst-cli 3.1.2 → 3.1.4
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.
- package/README.md +1 -1
- package/dist/ai/domain/skills-scanner.js +7 -2
- package/dist/deploy/domain/curl-config.js +1 -1
- package/dist/deploy/domain/playbook-vars.js +1 -1
- package/dist/generator/domain/frontend-composition.js +4 -4
- package/dist/generator/domain/property-filters.d.ts +8 -0
- package/dist/generator/domain/property-filters.js +17 -6
- package/dist/generator/handlers/front.handler.js +10 -1
- package/dist/sheets/domain/auth.js +10 -5
- package/dist/sheets/sync/sheet-to-yaml.d.ts +1 -0
- package/dist/sheets/sync/sheet-to-yaml.js +19 -3
- package/dist/templates/backend/application/.claude/skills/catalyst-tools/SKILL.md +5 -3
- package/dist/templates/backend/application/src/@aurora/modules/manual/application/manual-catalog-section-reader.spec.ts +4 -0
- package/dist/templates/backend/application/src/@aurora/modules/manual/application/manual-find-index.handler.spec.ts +2 -0
- package/dist/templates/backend/application/src/@aurora/modules/manual/application/manual-find-index.handler.ts +2 -1
- package/dist/templates/backend/application/src/@aurora/modules/manual/domain/manual-section-reader.port.ts +2 -0
- package/dist/templates/backend/application/src/@aurora/modules/manual/domain/manual.types.ts +2 -0
- package/dist/templates/backend/application/src/@aurora/modules/manual/graphql/manual-graphql-schema.spec.ts +10 -2
- package/dist/templates/backend/application/src/@aurora/modules/manual/graphql/manual.graphql +4 -0
- package/dist/templates/backend/business-rules/business-partner-portal/supplier-document.md +96 -6
- package/dist/templates/backend/business-rules/tools/assistant-usage.md +60 -0
- package/dist/templates/backend/manual/business-partner-portal/CONTEXT.md +5 -5
- package/dist/templates/backend/manual/business-partner-portal/en/purchase-invoice-header.md +5 -1
- package/dist/templates/backend/manual/business-partner-portal/es/purchase-invoice-header.md +5 -1
- package/dist/templates/backend/manual/production-planning/en/planner.md +1 -1
- package/dist/templates/backend/manual/production-planning/en/production-order-position-event.md +8 -5
- package/dist/templates/backend/manual/production-planning/es/planner.md +1 -1
- package/dist/templates/backend/manual/production-planning/es/production-order-position-event.md +8 -5
- package/dist/templates/backend/manual/reporting/en/report.md +40 -0
- package/dist/templates/backend/manual/reporting/es/report.md +40 -0
- package/dist/templates/backend/manual/tools/CONTEXT.md +1 -0
- package/dist/templates/backend/manual/tools/actions.yaml +11 -0
- package/dist/templates/backend/manual/tools/en/assistant-conversation.md +38 -0
- package/dist/templates/backend/manual/tools/en/assistant-usage-policy.md +46 -0
- package/dist/templates/backend/manual/tools/en/assistant-usage.md +28 -0
- package/dist/templates/backend/manual/tools/en/file-storage.md +83 -0
- package/dist/templates/backend/manual/tools/es/assistant-conversation.md +38 -0
- package/dist/templates/backend/manual/tools/es/assistant-usage-policy.md +46 -0
- package/dist/templates/backend/manual/tools/es/assistant-usage.md +28 -0
- package/dist/templates/backend/manual/tools/es/file-storage.md +83 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-create-report.dto.ts +0 -21
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-report.dto.ts +3 -3
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-update-report-by-id.dto.ts +0 -48
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-update-reports.dto.ts +0 -48
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/graphql/reporting-report.graphql +3 -20
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/create/reporting-create-report.service.ts +2 -2
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/reporting-report.payload-types.ts +33 -0
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update/reporting-update-report-by-id.handler.spec.ts +77 -0
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update/reporting-update-report-by-id.service.ts +2 -2
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update/reporting-update-reports.service.ts +2 -2
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update-execution-cache/reporting-update-report-execution-cache.handler.spec.ts +35 -0
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/domain/reporting-report.field-schema.ts +7 -0
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/index.ts +5 -0
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/dto/tools-assistant-conversation.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/dto/tools-update-assistant-conversation-by-id.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/dto/tools-update-assistant-conversations.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/graphql/tools-assistant-conversation.graphql +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/controllers/tools-ask-assistant-assistant-usage.controller.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-ask-assistant.dto.ts +47 -0
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-assistant-answer.dto.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-assistant-usage.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-update-assistant-usage-by-id.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-update-assistant-usages.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/graphql/tools-assistant-usage.graphql +45 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/resolvers/tools-ask-assistant-assistant-usage.resolver.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/infrastructure/tools-anthropic-assistant-model.service.spec.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.spec.ts +145 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.ts +44 -2
- package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/shared/types/tools-anthropic-assistant-answer.types.ts +3 -2
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-conversation/domain/tools-assistant-conversation.field-schema.ts +6 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-conversation/infrastructure/drizzle/tools-drizzle-assistant-conversation.schema.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-ask-assistant-assistant-usage.handler.spec.ts +105 -5
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-ask-assistant-assistant-usage.handler.ts +40 -23
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-errors.function.ts +8 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-read-screen.function.spec.ts +257 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-read-screen.function.ts +200 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/quota/tools-assistant-quota.service.spec.ts +7 -2
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/quota/tools-assistant-quota.service.ts +7 -2
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/domain/tools-assistant-model.port.ts +44 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/domain/tools-assistant-usage.field-schema.ts +6 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/infrastructure/drizzle/tools-drizzle-assistant-usage.repository.spec.ts +25 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/infrastructure/drizzle/tools-drizzle-assistant-usage.repository.ts +3 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/infrastructure/drizzle/tools-drizzle-assistant-usage.schema.ts +1 -0
- package/dist/templates/backend/packages/tools/test/acceptance/tools/assistant-ask.e2e-spec.ts +16 -1
- package/dist/templates/backend/packages/tools/test/acceptance/tools/assistant-usage-increment.e2e-spec.ts +52 -5
- package/dist/templates/codegen/frontend/module/__module_name__/features/__module_name__-list.component.ts.eta +7 -1
- package/dist/templates/codegen/frontend/module/__module_name__/features/index.ts.eta +1 -1
- package/dist/templates/frontend/application/.claude/skills/catalyst-project-structure/SKILL.md +3 -0
- package/dist/templates/frontend/application/angular.json +2 -0
- package/dist/templates/frontend/application/libs/ui/command/src/lib/hlm-command-item.ts +1 -1
- package/dist/templates/frontend/application/src/@aurora/modules/assisted-form/README.md +2 -0
- package/dist/templates/frontend/application/src/@aurora/modules/command-palette/command-palette-trigger.component.ts +1 -0
- package/dist/templates/frontend/application/src/@aurora/modules/guided-action/README.md +4 -0
- package/dist/templates/frontend/application/src/@aurora/modules/guided-action/guided-action-runner.service.spec.ts +69 -0
- package/dist/templates/frontend/application/src/@aurora/modules/guided-action/guided-action-runner.service.ts +13 -4
- package/dist/templates/frontend/application/src/@aurora/modules/index.ts +1 -0
- package/dist/templates/frontend/application/src/@aurora/modules/manual/manual.graphql.ts +1 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/README.md +36 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/index.ts +2 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/screen-context.service.spec.ts +137 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/screen-context.service.ts +60 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/screen-context.types.ts +47 -0
- package/dist/templates/frontend/application/src/app/domains/admin/layout/site-header.ts +1 -1
- package/dist/templates/frontend/application/tsconfig.json +1 -0
- package/dist/templates/frontend/navigation-i18n/reporting/en.json +1 -1
- package/dist/templates/frontend/navigation-i18n/reporting/es.json +1 -1
- package/dist/templates/frontend/packages/automation/src/app/domains/admin/apps/automation/state-machine-history/features/index.ts +0 -1
- package/dist/templates/frontend/packages/automation/src/app/domains/admin/apps/automation/state-machine-history/features/state-machine-history-list.component.ts +0 -13
- package/dist/templates/frontend/packages/business-partner-portal/public/i18n/business-partner-portal/en.json +11 -0
- package/dist/templates/frontend/packages/business-partner-portal/public/i18n/business-partner-portal/es.json +11 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-trace/features/index.ts +0 -1
- 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
- package/dist/templates/frontend/packages/identity/src/app/domains/admin/apps/iam/account/features/account-form.component.spec.ts +26 -1
- package/dist/templates/frontend/packages/identity/src/app/domains/admin/apps/iam/account/features/account-form.component.ts +45 -0
- package/dist/templates/frontend/packages/production-planning/public/i18n/production-planning/en.json +16 -4
- package/dist/templates/frontend/packages/production-planning/public/i18n/production-planning/es.json +16 -4
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/index.ts +1 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner-process-weights.derive.spec.ts +76 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner-process-weights.derive.ts +49 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner.derive.spec.ts +15 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner.derive.ts +7 -3
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner.graphql.ts +23 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/features/planner-process-weights-dialog.component.ts +139 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/features/planner.component.ts +41 -4
- 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
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.derive.ts +0 -21
- 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
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.resolvers.ts +3 -1
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/batch-detail-sheet.component.ts +22 -10
- 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
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/event-form-sheet.component.ts +95 -59
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/event-list.component.ts +121 -123
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/production-dashboard.component.ts +52 -19
- 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
- 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
- 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
- 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
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/shared/dialogs/finish-event-dialog.component.ts +3 -3
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/shared/dialogs/weight-input-dialog.component.ts +3 -3
- package/dist/templates/frontend/packages/reporting/public/i18n/reporting/en.json +1 -1
- package/dist/templates/frontend/packages/reporting/public/i18n/reporting/es.json +1 -1
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/data-access/report.detail-config.ts +1 -2
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/data-access/report.graphql.ts +0 -14
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/features/report-form.component.spec.ts +96 -0
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/features/report-form.component.ts +46 -69
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/features/report-list.component.ts +2 -22
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/report.columns.ts +0 -1
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/reporting-icons.providers.ts +2 -1
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/reporting.navigation.ts +7 -0
- package/dist/templates/frontend/packages/tools/public/i18n/tools/en.json +4 -2
- package/dist/templates/frontend/packages/tools/public/i18n/tools/es.json +4 -2
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant/tools-assistant.service.spec.ts +82 -7
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant/tools-assistant.service.ts +12 -2
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/assistant-conversation.columns.ts +13 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/data-access/assistant-conversation.graphql.ts +1 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/assistant-conversation-form.component.ts +18 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/assistant-conversation-list.component.ts +0 -13
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/index.ts +0 -1
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/assistant-usage.columns.ts +13 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/data-access/assistant-usage.graphql.ts +2 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/assistant-usage-form.component.ts +18 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/assistant-usage-list.component.ts +0 -13
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/index.ts +0 -1
- package/dist/templates/monorepo/.claude/commands/business-rules/promote.md +5 -1
- package/dist/templates/monorepo/.claude/hooks/__fixtures__/br-hr-regression-baseline.txt +2 -2
- package/dist/templates/monorepo/.claude/hooks/check-required-setup.ts +4 -4
- package/dist/templates/monorepo/.claude/hooks/inject-prompt-context.ts +1 -1
- package/dist/templates/monorepo/.claude/scripts/generate-skills-index.test.ts +29 -1
- package/dist/templates/monorepo/.claude/scripts/generate-skills-index.ts +7 -1
- package/dist/templates/monorepo/.claude/skills/REGISTRY.md +2 -2
- package/dist/templates/monorepo/.claude/skills/catalyst-backlog/SKILL.md +19 -4
- package/dist/templates/monorepo/.claude/skills/catalyst-backlog/frontier-worker-addendum.md +3 -3
- package/dist/templates/monorepo/.claude/skills/catalyst-business-rules-guard/SKILL.md +8 -5
- package/dist/templates/monorepo/.claude/skills/catalyst-business-rules-guard/references/workflow.md +10 -6
- package/dist/templates/monorepo/.claude/skills/catalyst-delegation/SKILL.md +1 -1
- package/dist/templates/monorepo/.claude/skills/catalyst-harness-rules-guard/SKILL.md +6 -6
- package/dist/templates/monorepo/.claude/skills/catalyst-harness-rules-guard/references/enforcement.md +3 -3
- package/dist/templates/monorepo/.claude/skills/catalyst-harness-rules-guard/references/format.md +3 -3
- package/dist/templates/monorepo/.claude/skills/catalyst-update-skill-registry/SKILL.md +4 -4
- package/dist/templates/monorepo/.claude/skills/catalyst-user-manual/SKILL.md +48 -2
- package/dist/templates/monorepo/.claude/skills/openspec-apply-change/SKILL.md +28 -10
- package/dist/templates/monorepo/.claude/skills/openspec-archive-change/SKILL.md +52 -13
- package/dist/templates/monorepo/.claude/skills/openspec-explore/SKILL.md +59 -14
- package/dist/templates/monorepo/.claude/skills/openspec-propose/SKILL.md +38 -12
- package/dist/templates/monorepo/.claude/skills/openspec-sync-specs/SKILL.md +31 -3
- package/dist/templates/monorepo/CLAUDE.md +14 -14
- package/dist/templates/monorepo/docs/business-rules/ARCHITECTURE.md +16 -13
- package/dist/templates/monorepo/docs/business-rules/MIGRATION.md +5 -5
- package/dist/templates/monorepo/docs/manual/en/04-asistente.md +71 -0
- package/dist/templates/monorepo/docs/manual/es/04-asistente.md +71 -0
- package/dist/templates/monorepo/openspec/config.yaml +25 -5
- package/dist/templates/monorepo/package.json +3 -1
- package/dist/templates/monorepo/scripts/backlog/prompt.test.ts +5 -5
- package/dist/templates/monorepo/scripts/backlog/prompt.ts +1 -1
- package/dist/templates/monorepo/scripts/business-rules/audit.ts +1 -1
- package/dist/templates/monorepo/scripts/manual/compile.test.ts +78 -0
- package/dist/templates/monorepo/scripts/manual/compile.ts +36 -9
- package/dist/templates/monorepo/scripts/worktree/prune.test.ts +517 -0
- package/dist/templates/monorepo/scripts/worktree/prune.ts +331 -0
- package/oclif.manifest.json +408 -408
- package/package.json +15 -17
- 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
- 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
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/assistant-conversation-list-actions-cell.component.ts +0 -44
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/assistant-usage-list-actions-cell.component.ts +0 -43
- package/dist/templates/monorepo/.claude/commands/opsx/apply.md +0 -184
- package/dist/templates/monorepo/.claude/commands/opsx/archive.md +0 -225
- package/dist/templates/monorepo/.claude/commands/opsx/explore.md +0 -196
- package/dist/templates/monorepo/.claude/commands/opsx/propose.md +0 -145
- package/dist/templates/monorepo/.claude/commands/opsx/sync.md +0 -258
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
route: /tools/file-storage
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Almacenamientos de ficheros
|
|
6
|
+
|
|
7
|
+
Esta pantalla reúne los destinos remotos en los que la plataforma escribe ficheros. Cada almacenamiento tiene su proveedor, su secreto y su estado de conexión. Otras partes de la plataforma lo eligen por su nombre cuando necesitan guardar un fichero: la plataforma solo escribe en él, nunca lee.
|
|
8
|
+
|
|
9
|
+
## Consultar los almacenamientos
|
|
10
|
+
|
|
11
|
+
Abre **Almacenamiento** en el menú **Herramientas**. Para buscar, filtrar, ordenar, elegir columnas y exportar, consulta [Listados](/manual/general.02-listados).
|
|
12
|
+
|
|
13
|
+
La lista muestra, para cada almacenamiento, su **ID de fila**, su **Nombre**, su **Proveedor** y su **Estado**. Si no hay resultados, aparece el mensaje «No se encontraron almacenamientos de ficheros.»
|
|
14
|
+
|
|
15
|
+
## Crear un almacenamiento
|
|
16
|
+
|
|
17
|
+
Para abrir el formulario y guardarlo, consulta [Formularios](/manual/general.03-formularios). Estos son los campos de esta pantalla:
|
|
18
|
+
|
|
19
|
+
1. Pulsa **Nuevo Almacenamiento de ficheros**.
|
|
20
|
+
2. Rellena **Nombre**: dile a los demás administradores para qué sirve (por ejemplo, «Archivo de facturas de compra»). Máximo 128 caracteres.
|
|
21
|
+
3. Elige el **Proveedor**. Hoy la lista ofrece **SFTP**.
|
|
22
|
+
4. Al elegir el proveedor, el campo **Secreto (JSON)** se rellena con una plantilla. Sustituye sus valores por los de tu servidor. Si cambias de idea y quieres volver a la plantilla, pulsa **Recargar plantilla**.
|
|
23
|
+
5. Pulsa **Crear**.
|
|
24
|
+
|
|
25
|
+
El almacenamiento aparece en la lista con el estado **Configurado**.
|
|
26
|
+
|
|
27
|
+
Ten en cuenta:
|
|
28
|
+
|
|
29
|
+
- El secreto se comprueba con el formato que exige el proveedor. Si no es válido, la pantalla te avisa de qué falla y no se guarda nada.
|
|
30
|
+
- El secreto se guarda cifrado y no vuelve a mostrarse nunca, ni aquí ni en ninguna otra pantalla.
|
|
31
|
+
- Las credenciales van siempre dentro del secreto: la plataforma no usa ninguna otra credencial de su entorno.
|
|
32
|
+
|
|
33
|
+
## Entender los estados
|
|
34
|
+
|
|
35
|
+
El estado lo mantiene la plataforma; no se puede editar.
|
|
36
|
+
|
|
37
|
+
| Estado | Significa |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| **Configurado** | Hay un secreto guardado válido, pero aún no se ha probado la conexión. |
|
|
40
|
+
| **Verificado** | La última prueba de conexión funcionó. |
|
|
41
|
+
| **Error de conexión** | La última prueba de conexión falló. |
|
|
42
|
+
|
|
43
|
+
Solo una prueba de conexión cambia el estado. Si más adelante falla la escritura de un fichero real, el estado no cambia: vuelve a probar la conexión para comprobarlo. Al guardar un secreto nuevo, el estado vuelve a **Configurado**.
|
|
44
|
+
|
|
45
|
+
## Probar la conexión
|
|
46
|
+
|
|
47
|
+
La prueba escribe un fichero de prueba en el destino. Puedes lanzarla de dos formas:
|
|
48
|
+
|
|
49
|
+
1. En la lista, abre el menú de los tres puntos del almacenamiento y elige **Probar conexión**.
|
|
50
|
+
2. O bien abre el almacenamiento, o el formulario de uno nuevo, y pulsa **Probar conexión** en su barra de herramientas.
|
|
51
|
+
|
|
52
|
+
En el formulario, la prueba usa el secreto que has escrito si lo has modificado, y no necesitas guardar antes. Al crear un almacenamiento solo se activa cuando has elegido un proveedor y has escrito el secreto. Si en un almacenamiento existente no tocas el secreto, prueba el que está guardado.
|
|
53
|
+
|
|
54
|
+
Aparece un aviso con el resultado:
|
|
55
|
+
|
|
56
|
+
- Si funciona, verás «Se escribió correctamente un fichero de prueba.» y el almacenamiento guardado queda en **Verificado**.
|
|
57
|
+
- Si falla, verás «La prueba ha fallado:» seguido del motivo, y el almacenamiento guardado queda en **Error de conexión**.
|
|
58
|
+
|
|
59
|
+
| Motivo | Significa |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| el secreto guardado no es válido | El secreto no tiene el formato del proveedor. |
|
|
62
|
+
| se rechazaron las credenciales | El servidor no acepta el usuario o la clave del secreto. |
|
|
63
|
+
| la clave del servidor no coincide con la huella guardada | El servidor presenta una clave distinta de la que indica el secreto. |
|
|
64
|
+
| no se pudo alcanzar el servidor | No hay conexión con el servidor. |
|
|
65
|
+
| no se pudo escribir el fichero de prueba | El servidor responde, pero no permite escribir. |
|
|
66
|
+
|
|
67
|
+
Probar un secreto que aún no has guardado no crea ni modifica ningún almacenamiento y no cambia ningún estado: solo te dice si funcionaría.
|
|
68
|
+
|
|
69
|
+
## Editar un almacenamiento y cambiar el secreto
|
|
70
|
+
|
|
71
|
+
Para abrir el formulario de un almacenamiento existente, consulta [Formularios](/manual/general.03-formularios). Junto al **Proveedor** ves el estado actual.
|
|
72
|
+
|
|
73
|
+
El campo **Secreto (JSON)** aparece vacío, con el aviso «El secreto guardado nunca se muestra. Déjalo vacío para conservarlo o pega uno nuevo.»
|
|
74
|
+
|
|
75
|
+
1. Para conservar el secreto, déjalo vacío.
|
|
76
|
+
2. Para cambiarlo, pega el secreto nuevo en su campo.
|
|
77
|
+
3. Pulsa **Guardar**.
|
|
78
|
+
|
|
79
|
+
Si cambias el **Proveedor**, el secreto se rellena con la plantilla del nuevo proveedor: sustituye sus valores antes de guardar.
|
|
80
|
+
|
|
81
|
+
## Eliminar un almacenamiento
|
|
82
|
+
|
|
83
|
+
Para eliminar un almacenamiento, consulta [Listados](/manual/general.02-listados). Si otra parte de la plataforma lo está usando, la pantalla no permite eliminarlo y te avisa; primero hay que dejar de usarlo allí.
|
|
@@ -34,7 +34,7 @@ const ANSWER = {
|
|
|
34
34
|
header: [{ code: 'agencyCode', value: 'MAD01' }],
|
|
35
35
|
lines: [{ positionNumber: 1, fields: [{ code: 'locator', value: 'XK29QZ' }] }],
|
|
36
36
|
};
|
|
37
|
-
const PROMPT_VERSION = 'step-two-
|
|
37
|
+
const PROMPT_VERSION = 'step-two-v5';
|
|
38
38
|
const MAPPED_ANSWER = {
|
|
39
39
|
status: 'completed',
|
|
40
40
|
reading: { model: MODEL, promptVersion: PROMPT_VERSION },
|
|
@@ -84,6 +84,7 @@ const request = (): BusinessPartnerPortalExtractionStepTwoRequest => ({
|
|
|
84
84
|
{ positionNumber: 1, description: 'Flight', quantity: 1, unitPrice: 80, positionTotal: 80 },
|
|
85
85
|
],
|
|
86
86
|
doubtReview: null,
|
|
87
|
+
legalEntityTin: null,
|
|
87
88
|
});
|
|
88
89
|
|
|
89
90
|
describe('BusinessPartnerPortalAnthropicExtractionStepTwoService', () => {
|
|
@@ -88,6 +88,13 @@ describe('businessPartnerPortalAnthropicBuildStepOneRequest', () => {
|
|
|
88
88
|
expect(system).toMatch(/commission/i);
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
it('asks for a deducted advance or deposit as one more negative line, never to leave it out', () => {
|
|
92
|
+
const system = String(build().system);
|
|
93
|
+
|
|
94
|
+
expect(system).toMatch(/advance or deposit[^.]*one more entry of lines[^.]*NEGATIVE/);
|
|
95
|
+
expect(system).not.toMatch(/leave it out of lines/i);
|
|
96
|
+
});
|
|
97
|
+
|
|
91
98
|
it('keeps the system prompt fixed whatever the document, so it can be cached', () => {
|
|
92
99
|
expect(build({ extraFieldNames: ['locator'], legalEntityTin: 'B1' }).system).toBe(
|
|
93
100
|
build().system,
|
|
@@ -120,8 +127,8 @@ describe('businessPartnerPortalAnthropicBuildStepOneRequest', () => {
|
|
|
120
127
|
);
|
|
121
128
|
});
|
|
122
129
|
|
|
123
|
-
it('bumps the prompt version when the
|
|
124
|
-
expect(BUSINESS_PARTNER_PORTAL_ANTHROPIC_STEP_ONE_PROMPT_VERSION).toBe('step-one-
|
|
130
|
+
it('bumps the prompt version when the advance becomes a negative line', () => {
|
|
131
|
+
expect(BUSINESS_PARTNER_PORTAL_ANTHROPIC_STEP_ONE_PROMPT_VERSION).toBe('step-one-v6');
|
|
125
132
|
});
|
|
126
133
|
|
|
127
134
|
// The API rejects a schema with more than 16 parameters that use anyOf or a type array (400).
|
|
@@ -9,9 +9,12 @@ import { businessPartnerPortalAnthropicBuildDocumentBlock } from './business-par
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Identifies the prompt and the schema of step 1. Every reading records it, so a change of either
|
|
12
|
-
* one MUST bump it (BR-BPP-PURCHASE-INVOICE-HEADER-069).
|
|
12
|
+
* one MUST bump it (BR-BPP-PURCHASE-INVOICE-HEADER-069). The prompt reads a deducted advance as a
|
|
13
|
+
* negative line (BR-BPP-SUPPLIER-DOCUMENT-030).
|
|
14
|
+
*
|
|
15
|
+
* @rule BR-BPP-SUPPLIER-DOCUMENT-030
|
|
13
16
|
*/
|
|
14
|
-
export const BUSINESS_PARTNER_PORTAL_ANTHROPIC_STEP_ONE_PROMPT_VERSION = 'step-one-
|
|
17
|
+
export const BUSINESS_PARTNER_PORTAL_ANTHROPIC_STEP_ONE_PROMPT_VERSION = 'step-one-v6';
|
|
15
18
|
|
|
16
19
|
// Fixed and first in the request, so every document shares the same cacheable prefix.
|
|
17
20
|
const SYSTEM_PROMPT = [
|
|
@@ -23,7 +26,7 @@ const SYSTEM_PROMPT = [
|
|
|
23
26
|
'subtotal is the taxable base of the invoice after any discount or commission, totalTax the total tax and total the amount the invoice charges, after any discount or commission.',
|
|
24
27
|
'A printed label can be wrong: a box called "Total" may show the amount before a discount, or the sum of the bases. Derive each value from what the document means, not from the label alone.',
|
|
25
28
|
'The total equals what the invoice charges even when the document says it was already collected, paid by card, settled by a third party or has a balance of 0.',
|
|
26
|
-
'An advance or deposit already invoiced and deducted on this invoice is
|
|
29
|
+
'An advance or deposit already invoiced and deducted on this invoice is one more entry of lines: its description as printed, a NEGATIVE amount and unitPrice, quantity 1 and the tax rate that applies to it.',
|
|
27
30
|
'taxes has one entry per row of the printed tax summary, including 0%, exempt and non-taxable rows, as printed. Give each row its kind: TAX for VAT, IGIC or IPSI (also 0%, exempt and non-taxable rows), WITHHOLDING for a withholding such as IRPF, EQUIVALENCE_SURCHARGE for the recargo de equivalencia. A WITHHOLDING or EQUIVALENCE_SURCHARGE row repeats the base of the tax it applies to: copy it as printed.',
|
|
28
31
|
'totalTax is the sum of the tax amounts of all the tax summary rows with their sign, a withholding being negative, so that subtotal plus totalTax equals total.',
|
|
29
32
|
'supplierTaxId is the tax id of the legal issuer of the invoice, not of a company the credit is assigned to.',
|
|
@@ -60,6 +60,7 @@ const request = (
|
|
|
60
60
|
{ positionNumber: 2, description: 'Hotel', quantity: 1, unitPrice: 120, positionTotal: 120 },
|
|
61
61
|
],
|
|
62
62
|
doubtReview: null,
|
|
63
|
+
legalEntityTin: null,
|
|
63
64
|
...overrides,
|
|
64
65
|
});
|
|
65
66
|
|
|
@@ -283,6 +284,22 @@ describe('businessPartnerPortalAnthropicBuildStepTwoRequest', () => {
|
|
|
283
284
|
);
|
|
284
285
|
});
|
|
285
286
|
|
|
287
|
+
it('gives the tax id of our own company in the user text so it is never read as the supplier', () => {
|
|
288
|
+
const built = build({ legalEntityTin: 'ESA84523505' });
|
|
289
|
+
|
|
290
|
+
expect(userText(built)).toContain(
|
|
291
|
+
'The tax id of our company is ESA84523505: it is the customer, never the supplier.',
|
|
292
|
+
);
|
|
293
|
+
expect(userText(built).indexOf('ESA84523505')).toBeGreaterThan(
|
|
294
|
+
userText(built).indexOf('Requested fields:'),
|
|
295
|
+
);
|
|
296
|
+
expect(String(built.system)).not.toContain('ESA84523505');
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
it('writes no sentence about our company without a tax id', () => {
|
|
300
|
+
expect(userText(build({ legalEntityTin: null }))).not.toMatch(/our company/i);
|
|
301
|
+
});
|
|
302
|
+
|
|
286
303
|
it('lists the stored positions as locators for the LINE fields', () => {
|
|
287
304
|
const text = userText(build());
|
|
288
305
|
|
|
@@ -432,8 +449,8 @@ describe('businessPartnerPortalAnthropicBuildStepTwoRequest', () => {
|
|
|
432
449
|
expect(schema).not.toContain('none: no arithmetic');
|
|
433
450
|
});
|
|
434
451
|
|
|
435
|
-
it('bumps the prompt version when the
|
|
436
|
-
expect(BUSINESS_PARTNER_PORTAL_ANTHROPIC_STEP_TWO_PROMPT_VERSION).toBe('step-two-
|
|
452
|
+
it('bumps the prompt version when the request carries the tax id of our company', () => {
|
|
453
|
+
expect(BUSINESS_PARTNER_PORTAL_ANTHROPIC_STEP_TWO_PROMPT_VERSION).toBe('step-two-v5');
|
|
437
454
|
});
|
|
438
455
|
|
|
439
456
|
it('carries a versioned prompt identifier', () => {
|
|
@@ -17,8 +17,9 @@ import { businessPartnerPortalAnthropicBuildDocumentBlock } from './business-par
|
|
|
17
17
|
* BR-BPP-PURCHASE-INVOICE-HEADER-071.
|
|
18
18
|
*
|
|
19
19
|
* @rule BR-BPP-PURCHASE-INVOICE-HEADER-071
|
|
20
|
+
* @rule BR-BPP-SUPPLIER-DOCUMENT-031
|
|
20
21
|
*/
|
|
21
|
-
export const BUSINESS_PARTNER_PORTAL_ANTHROPIC_STEP_TWO_PROMPT_VERSION = 'step-two-
|
|
22
|
+
export const BUSINESS_PARTNER_PORTAL_ANTHROPIC_STEP_TWO_PROMPT_VERSION = 'step-two-v5';
|
|
22
23
|
|
|
23
24
|
const VALUE_TYPE_LABEL: Record<BusinessPartnerPortalExtractionStepTwoValueType, string> = {
|
|
24
25
|
TEXT: 'text',
|
|
@@ -69,7 +70,12 @@ const DOUBT_REVIEW_PROMPT = [
|
|
|
69
70
|
'- If the figures cannot reconcile with printed figures and a documented reason, set reconciled to false and explain in humanReviewReason what is missing. Never force the result.',
|
|
70
71
|
].join('\n');
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
/**
|
|
74
|
+
* One request shape for both modes: the direct call and the single request of a batch. The tax id
|
|
75
|
+
* of our company goes in the user text, not in the system prompt, which is the cacheable prefix.
|
|
76
|
+
*
|
|
77
|
+
* @rule BR-BPP-SUPPLIER-DOCUMENT-031
|
|
78
|
+
*/
|
|
73
79
|
export function businessPartnerPortalAnthropicBuildStepTwoRequest(
|
|
74
80
|
request: BusinessPartnerPortalExtractionStepTwoRequest,
|
|
75
81
|
model: string,
|
|
@@ -108,12 +114,19 @@ function userText({
|
|
|
108
114
|
requestedFields,
|
|
109
115
|
positions,
|
|
110
116
|
doubtReview,
|
|
117
|
+
legalEntityTin,
|
|
111
118
|
}: BusinessPartnerPortalExtractionStepTwoRequest): string {
|
|
112
119
|
return [
|
|
113
120
|
'Read the attached invoice and answer the fields below.',
|
|
114
121
|
'',
|
|
115
122
|
'Requested fields:',
|
|
116
123
|
...(requestedFields.length === 0 ? ['- none'] : requestedFields.flatMap(fieldLines)),
|
|
124
|
+
...(legalEntityTin
|
|
125
|
+
? [
|
|
126
|
+
'',
|
|
127
|
+
`The tax id of our company is ${legalEntityTin}: it is the customer, never the supplier.`,
|
|
128
|
+
]
|
|
129
|
+
: []),
|
|
117
130
|
'',
|
|
118
131
|
'Positions already stored for this invoice (use positionNumber to answer the LINE fields):',
|
|
119
132
|
...(positions.length === 0 ? ['- none'] : positions.map(positionLine)),
|
|
@@ -22,7 +22,7 @@ type StepOneMapped = Omit<BusinessPartnerPortalInvoiceOcrResult, 'reading'>;
|
|
|
22
22
|
* cast (HR-ACL-001). Nulls stay null, a negative line stays a line, an extra field the model did
|
|
23
23
|
* not find is dropped, and the parsed answer is the raw response.
|
|
24
24
|
*
|
|
25
|
-
* @rule BR-BPP-SUPPLIER-DOCUMENT-
|
|
25
|
+
* @rule BR-BPP-SUPPLIER-DOCUMENT-030
|
|
26
26
|
*/
|
|
27
27
|
export function businessPartnerPortalAnthropicMapStepOneAnswer(text: string): StepOneMapped {
|
|
28
28
|
let json: unknown;
|
|
@@ -18,7 +18,7 @@ function objectOf(properties: Record<string, unknown>): Record<string, unknown>
|
|
|
18
18
|
// The answer the model must return for step 1. A plain JSON schema, not a validator: the text that
|
|
19
19
|
// comes back is narrowed by the answer mapper with type guards. Structured output rejects
|
|
20
20
|
// `minimum` and friends, so nothing here constrains ranges. A global discount or commission is one
|
|
21
|
-
// more entry of `lines`, with a negative amount and its own tax rate (BR-BPP-SUPPLIER-DOCUMENT-
|
|
21
|
+
// more entry of `lines`, with a negative amount and its own tax rate (BR-BPP-SUPPLIER-DOCUMENT-030).
|
|
22
22
|
export const BUSINESS_PARTNER_PORTAL_ANTHROPIC_STEP_ONE_ANSWER_JSON_SCHEMA: Record<
|
|
23
23
|
string,
|
|
24
24
|
unknown
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BusinessPartnerPortalExtractionFieldOriginEnum as Origin,
|
|
4
4
|
BusinessPartnerPortalExtractionFieldScopeEnum as Scope,
|
|
5
5
|
} from '@api/graphql.js';
|
|
6
|
+
import { BusinessPartnerPortalFindLegalEntityByIdService } from '@app/business-partner-portal/legal-entity/application/find/business-partner-portal-find-legal-entity-by-id.service.js';
|
|
6
7
|
import { BusinessPartnerPortalGetSupplierDocumentsService } from '@app/business-partner-portal/supplier-document/application/get/business-partner-portal-get-supplier-documents.service.js';
|
|
7
8
|
import { STORAGE_ACCOUNT_FILE_MANAGER } from '@bridges/storage-account/file-manager/index.js';
|
|
8
9
|
import { TOOLS_CUSTOM_FIELD_DEFINITION_READER } from '@bridges/tools/custom-field/index.js';
|
|
@@ -16,6 +17,7 @@ describe('BusinessPartnerPortalExtractionStepTwoContextService', () => {
|
|
|
16
17
|
const decisionService = { main: vi.fn() };
|
|
17
18
|
const currentValuesService = { main: vi.fn() };
|
|
18
19
|
const getDocumentsService = { main: vi.fn() };
|
|
20
|
+
const findLegalEntityService = { main: vi.fn() };
|
|
19
21
|
const fileManager = { readFile: vi.fn() };
|
|
20
22
|
const definitionReader = { listActiveDefinitions: vi.fn(), listActiveOptions: vi.fn() };
|
|
21
23
|
let service: BusinessPartnerPortalExtractionStepTwoContextService;
|
|
@@ -74,9 +76,11 @@ describe('BusinessPartnerPortalExtractionStepTwoContextService', () => {
|
|
|
74
76
|
},
|
|
75
77
|
],
|
|
76
78
|
});
|
|
79
|
+
findLegalEntityService.main.mockResolvedValue({ id: 'le-1', tin: 'ESA84523505' });
|
|
77
80
|
getDocumentsService.main.mockResolvedValue([
|
|
78
81
|
{
|
|
79
82
|
id: 'doc-1',
|
|
83
|
+
legalEntityId: 'le-1',
|
|
80
84
|
file: {
|
|
81
85
|
filename: 'f.pdf',
|
|
82
86
|
mimetype: 'application/pdf',
|
|
@@ -119,6 +123,10 @@ describe('BusinessPartnerPortalExtractionStepTwoContextService', () => {
|
|
|
119
123
|
provide: BusinessPartnerPortalGetSupplierDocumentsService,
|
|
120
124
|
useValue: getDocumentsService,
|
|
121
125
|
},
|
|
126
|
+
{
|
|
127
|
+
provide: BusinessPartnerPortalFindLegalEntityByIdService,
|
|
128
|
+
useValue: findLegalEntityService,
|
|
129
|
+
},
|
|
122
130
|
{ provide: STORAGE_ACCOUNT_FILE_MANAGER, useValue: fileManager },
|
|
123
131
|
{ provide: TOOLS_CUSTOM_FIELD_DEFINITION_READER, useValue: definitionReader },
|
|
124
132
|
],
|
|
@@ -197,6 +205,61 @@ describe('BusinessPartnerPortalExtractionStepTwoContextService', () => {
|
|
|
197
205
|
).toBe('DATE');
|
|
198
206
|
});
|
|
199
207
|
|
|
208
|
+
describe('tax id of our company (BR-BPP-SUPPLIER-DOCUMENT-031)', () => {
|
|
209
|
+
it('hands the tin of the legal entity master of the document, not the one stored on the header', async () => {
|
|
210
|
+
currentValuesService.main.mockResolvedValue({
|
|
211
|
+
header: {
|
|
212
|
+
fixed: { invoiceDate: '2026-10-01', legalEntityTin: 'A78914223' },
|
|
213
|
+
custom: {},
|
|
214
|
+
},
|
|
215
|
+
positions: [],
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
const { request } = await service.main('inv-1');
|
|
219
|
+
|
|
220
|
+
expect(findLegalEntityService.main).toHaveBeenCalledWith('le-1');
|
|
221
|
+
expect(request.legalEntityTin).toBe('ESA84523505');
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it('hands null when the document has no legal entity, without reading any master', async () => {
|
|
225
|
+
getDocumentsService.main.mockResolvedValue([
|
|
226
|
+
{
|
|
227
|
+
id: 'doc-1',
|
|
228
|
+
legalEntityId: null,
|
|
229
|
+
file: { filename: 'f.pdf', mimetype: 'application/pdf', relativePathSegments: ['a'] },
|
|
230
|
+
},
|
|
231
|
+
]);
|
|
232
|
+
|
|
233
|
+
const { request } = await service.main('inv-1');
|
|
234
|
+
|
|
235
|
+
expect(request.legalEntityTin).toBeNull();
|
|
236
|
+
expect(findLegalEntityService.main).not.toHaveBeenCalled();
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it('hands null when the legal entity no longer exists', async () => {
|
|
240
|
+
findLegalEntityService.main.mockResolvedValue(null);
|
|
241
|
+
|
|
242
|
+
expect((await service.main('inv-1')).request.legalEntityTin).toBeNull();
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('hands null when there is nothing to ask, without reading the document', async () => {
|
|
246
|
+
decisionService.main.mockResolvedValue({
|
|
247
|
+
decision: {
|
|
248
|
+
isNeeded: false,
|
|
249
|
+
requestedFields: [],
|
|
250
|
+
reasons: [],
|
|
251
|
+
isDoubtUnresolved: false,
|
|
252
|
+
doubtReview: null,
|
|
253
|
+
},
|
|
254
|
+
snapshot,
|
|
255
|
+
stepTwoDiscrepancies: [],
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
expect((await service.main('inv-1')).request.legalEntityTin).toBeNull();
|
|
259
|
+
expect(findLegalEntityService.main).not.toHaveBeenCalled();
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
|
|
200
263
|
it('resolves the value type of a custom field from its definition', async () => {
|
|
201
264
|
const { request } = await service.main('inv-1');
|
|
202
265
|
const typeOf = (code: string) =>
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from '@api/graphql.js';
|
|
6
6
|
// Leaf paths, like the other invoice services the identification pipeline reaches: a barrel import
|
|
7
7
|
// would close the require cycle documented in shared/purchase-invoice-extraction/index.ts.
|
|
8
|
+
import { BusinessPartnerPortalFindLegalEntityByIdService } from '@app/business-partner-portal/legal-entity/application/find/business-partner-portal-find-legal-entity-by-id.service.js';
|
|
8
9
|
import type { BusinessPartnerPortalPurchaseInvoiceStepTwoDiscrepancy } from '@app/business-partner-portal/purchase-invoice-header/shared/services/business-partner-portal-purchase-invoice-header-step-two-discrepancy.types.js';
|
|
9
10
|
import { BusinessPartnerPortalGetSupplierDocumentsService } from '@app/business-partner-portal/supplier-document/application/get/business-partner-portal-get-supplier-documents.service.js';
|
|
10
11
|
import type { HandlerMeta } from '@aurorajs.dev/core-back';
|
|
@@ -78,6 +79,7 @@ export interface BusinessPartnerPortalExtractionStepTwoContext {
|
|
|
78
79
|
*
|
|
79
80
|
* @rule BR-BPP-PARTNER-EXTRACTION-FIELD-001
|
|
80
81
|
* @rule BR-BPP-PURCHASE-INVOICE-HEADER-070
|
|
82
|
+
* @rule BR-BPP-SUPPLIER-DOCUMENT-031
|
|
81
83
|
*/
|
|
82
84
|
@Injectable()
|
|
83
85
|
export class BusinessPartnerPortalExtractionStepTwoContextService {
|
|
@@ -85,6 +87,7 @@ export class BusinessPartnerPortalExtractionStepTwoContextService {
|
|
|
85
87
|
private readonly decisionService: BusinessPartnerPortalExtractionStepTwoDecisionService,
|
|
86
88
|
private readonly currentValuesService: BusinessPartnerPortalExtractionStepTwoCurrentValuesService,
|
|
87
89
|
private readonly getSupplierDocumentsService: BusinessPartnerPortalGetSupplierDocumentsService,
|
|
90
|
+
private readonly findLegalEntityService: BusinessPartnerPortalFindLegalEntityByIdService,
|
|
88
91
|
@Inject(STORAGE_ACCOUNT_FILE_MANAGER) private readonly fileManager: IStorageAccountFileManager,
|
|
89
92
|
@Inject(TOOLS_CUSTOM_FIELD_DEFINITION_READER)
|
|
90
93
|
private readonly definitionReader: IToolsCustomFieldDefinitionReader,
|
|
@@ -108,6 +111,7 @@ export class BusinessPartnerPortalExtractionStepTwoContextService {
|
|
|
108
111
|
requestedFields: [],
|
|
109
112
|
positions: [],
|
|
110
113
|
doubtReview: null,
|
|
114
|
+
legalEntityTin: null,
|
|
111
115
|
},
|
|
112
116
|
requestedFields: [],
|
|
113
117
|
current,
|
|
@@ -125,9 +129,14 @@ export class BusinessPartnerPortalExtractionStepTwoContextService {
|
|
|
125
129
|
valueType: this.valueTypeOf(field, customFields),
|
|
126
130
|
}));
|
|
127
131
|
|
|
132
|
+
const { document, legalEntityTin } = await this.readDocumentAndLegalEntityTin(
|
|
133
|
+
invoiceId,
|
|
134
|
+
handlerMeta,
|
|
135
|
+
);
|
|
136
|
+
|
|
128
137
|
return {
|
|
129
138
|
request: {
|
|
130
|
-
document
|
|
139
|
+
document,
|
|
131
140
|
requestedFields,
|
|
132
141
|
positions: current.positions.map(
|
|
133
142
|
(position): BusinessPartnerPortalExtractionStepTwoPosition => ({
|
|
@@ -139,6 +148,7 @@ export class BusinessPartnerPortalExtractionStepTwoContextService {
|
|
|
139
148
|
}),
|
|
140
149
|
),
|
|
141
150
|
doubtReview,
|
|
151
|
+
legalEntityTin,
|
|
142
152
|
},
|
|
143
153
|
requestedFields,
|
|
144
154
|
current,
|
|
@@ -149,7 +159,7 @@ export class BusinessPartnerPortalExtractionStepTwoContextService {
|
|
|
149
159
|
};
|
|
150
160
|
}
|
|
151
161
|
|
|
152
|
-
private async
|
|
162
|
+
private async readDocumentAndLegalEntityTin(invoiceId: string, handlerMeta?: HandlerMeta) {
|
|
153
163
|
const [document] = await this.getSupplierDocumentsService.main(
|
|
154
164
|
{ where: { purchaseInvoiceHeaderId: { eq: invoiceId } }, limit: 1 },
|
|
155
165
|
undefined,
|
|
@@ -177,7 +187,19 @@ export class BusinessPartnerPortalExtractionStepTwoContextService {
|
|
|
177
187
|
visibility: file.visibility,
|
|
178
188
|
});
|
|
179
189
|
|
|
180
|
-
return {
|
|
190
|
+
return {
|
|
191
|
+
document: { content, mediaType: file.mimetype },
|
|
192
|
+
legalEntityTin: await this.readLegalEntityTin(document?.legalEntityId),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** The master's tin, never the header's OCR-read one: that value may be the wrong one. */
|
|
197
|
+
private async readLegalEntityTin(
|
|
198
|
+
legalEntityId: string | null | undefined,
|
|
199
|
+
): Promise<string | null> {
|
|
200
|
+
if (!legalEntityId) return null;
|
|
201
|
+
|
|
202
|
+
return (await this.findLegalEntityService.main(legalEntityId))?.tin ?? null;
|
|
181
203
|
}
|
|
182
204
|
|
|
183
205
|
/** The active definitions of the header and of the positions, with the options of the choice ones. */
|
|
@@ -57,6 +57,11 @@ export interface BusinessPartnerPortalExtractionStepTwoRequest {
|
|
|
57
57
|
positions: BusinessPartnerPortalExtractionStepTwoPosition[];
|
|
58
58
|
/** Set when the invoice is doubtful and its doubt was not reviewed yet; the same call reads the fields. */
|
|
59
59
|
doubtReview: BusinessPartnerPortalDoubtReviewRequest | null;
|
|
60
|
+
/**
|
|
61
|
+
* The tax id of our company, from the legal entity MASTER data (never the OCR-read value of the
|
|
62
|
+
* header). The model must treat it as the customer, never the supplier. Null without a legal entity.
|
|
63
|
+
*/
|
|
64
|
+
legalEntityTin: string | null;
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
/**
|
|
@@ -700,7 +700,7 @@ describe('businessPartnerPortalMapInvoiceOcrResultToPurchaseInvoice', () => {
|
|
|
700
700
|
});
|
|
701
701
|
});
|
|
702
702
|
|
|
703
|
-
describe('a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-
|
|
703
|
+
describe('a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-030)', () => {
|
|
704
704
|
// Tax-inclusive lines: 290 - 29 = 261 (the total). The commission is a line of its own, with
|
|
705
705
|
// its tax, and the header carries no discount.
|
|
706
706
|
const withCommission = () =>
|
|
@@ -175,7 +175,7 @@ export const businessPartnerPortalToCountryCode = (
|
|
|
175
175
|
*
|
|
176
176
|
* @rule BR-BPP-SUPPLIER-DOCUMENT-023
|
|
177
177
|
* @rule BR-BPP-SUPPLIER-DOCUMENT-016
|
|
178
|
-
* @rule BR-BPP-SUPPLIER-DOCUMENT-
|
|
178
|
+
* @rule BR-BPP-SUPPLIER-DOCUMENT-030
|
|
179
179
|
* @rule BR-BPP-PURCHASE-INVOICE-HEADER-017
|
|
180
180
|
* @rule BR-BPP-PURCHASE-INVOICE-HEADER-018
|
|
181
181
|
* @rule BR-BPP-PURCHASE-INVOICE-HEADER-068
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Test } from '@nestjs/testing';
|
|
2
1
|
import { ProductionPlanningGetProcessesService } from '@app/production-planning/process/index.js';
|
|
3
|
-
import { ProductionPlanningFindProductionOrderPositionByIdService } from '@app/production-planning/production-order-position/index.js';
|
|
4
2
|
import { ProductionPlanningGetProductionOrderPositionEventsService } from '@app/production-planning/production-order-position-event/index.js';
|
|
3
|
+
import { ProductionPlanningFindProductionOrderPositionByIdService } from '@app/production-planning/production-order-position/index.js';
|
|
4
|
+
import { Test } from '@nestjs/testing';
|
|
5
5
|
import { ProductionPlanningGetProcessesProductionOrderPositionHandler } from './production-planning-get-processes-production-order-position.handler.js';
|
|
6
6
|
|
|
7
7
|
describe('ProductionPlanningGetProcessesProductionOrderPositionHandler', () => {
|
|
@@ -46,6 +46,7 @@ describe('ProductionPlanningGetProcessesProductionOrderPositionHandler', () => {
|
|
|
46
46
|
],
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
|
+
order: [{ field: 'name', dir: 'asc' }],
|
|
49
50
|
});
|
|
50
51
|
expect(findPositionByIdService.main).not.toHaveBeenCalled();
|
|
51
52
|
expect(result).toEqual([{ id: '25ba9fdc-f748-4e03-bbb8-8d9596a6e2be' }]);
|
|
@@ -73,6 +74,7 @@ describe('ProductionPlanningGetProcessesProductionOrderPositionHandler', () => {
|
|
|
73
74
|
{ isEquipmentRequired: { eq: false } },
|
|
74
75
|
],
|
|
75
76
|
},
|
|
77
|
+
order: [{ field: 'name', dir: 'asc' }],
|
|
76
78
|
});
|
|
77
79
|
});
|
|
78
80
|
|
|
@@ -112,6 +114,7 @@ describe('ProductionPlanningGetProcessesProductionOrderPositionHandler', () => {
|
|
|
112
114
|
{ isEquipmentRequired: { eq: false } },
|
|
113
115
|
],
|
|
114
116
|
},
|
|
117
|
+
order: [{ field: 'name', dir: 'asc' }],
|
|
115
118
|
});
|
|
116
119
|
});
|
|
117
120
|
});
|
|
@@ -62,6 +62,8 @@ export class ProductionPlanningGetProcessesProductionOrderPositionHandler {
|
|
|
62
62
|
* 2. Previous events exist and `position.equipments` is null/[]/absent → returns P ∪ N.
|
|
63
63
|
* 3. Previous events exist and `position.equipments` has ≥1 equipment → returns P ∪ N ∪ E.
|
|
64
64
|
*
|
|
65
|
+
* Every branch asks the database for the processes ordered by `name` ascending.
|
|
66
|
+
*
|
|
65
67
|
* @rule BR-PROD-POSITION-006 — Composition of available processes for creating an event,
|
|
66
68
|
* filtered by equipment assigned to the position (successor of derogated BR-PROD-POSITION-002).
|
|
67
69
|
*/
|
|
@@ -82,6 +84,7 @@ export class ProductionPlanningGetProcessesProductionOrderPositionHandler {
|
|
|
82
84
|
if (previousEvents.length === 0) {
|
|
83
85
|
return await this.getProcessesService.main({
|
|
84
86
|
where: { id: { in: PROCESSES_NOT_REQUIRING_PRECEDING_PROCESS } },
|
|
87
|
+
order: [{ field: 'name', dir: 'asc' }],
|
|
85
88
|
});
|
|
86
89
|
}
|
|
87
90
|
|
|
@@ -104,6 +107,7 @@ export class ProductionPlanningGetProcessesProductionOrderPositionHandler {
|
|
|
104
107
|
where: {
|
|
105
108
|
or: [{ id: { in: idUnion } }, { isEquipmentRequired: { eq: false } }],
|
|
106
109
|
},
|
|
110
|
+
order: [{ field: 'name', dir: 'asc' }],
|
|
107
111
|
});
|
|
108
112
|
}
|
|
109
113
|
}
|
|
@@ -73,13 +73,6 @@ export class ReportingCreateReportDto {
|
|
|
73
73
|
})
|
|
74
74
|
accountId?: string;
|
|
75
75
|
|
|
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
76
|
@ApiProperty({
|
|
84
77
|
type: String,
|
|
85
78
|
description:
|
|
@@ -87,20 +80,6 @@ export class ReportingCreateReportDto {
|
|
|
87
80
|
})
|
|
88
81
|
tenantId?: string;
|
|
89
82
|
|
|
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
83
|
@ApiProperty({
|
|
105
84
|
type: [String],
|
|
106
85
|
description:
|
|
@@ -91,7 +91,7 @@ export class ReportingReportDto {
|
|
|
91
91
|
@ApiProperty({
|
|
92
92
|
type: String,
|
|
93
93
|
description:
|
|
94
|
-
"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.",
|
|
94
|
+
"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.",
|
|
95
95
|
})
|
|
96
96
|
visibility: string;
|
|
97
97
|
|
|
@@ -105,14 +105,14 @@ export class ReportingReportDto {
|
|
|
105
105
|
@ApiProperty({
|
|
106
106
|
type: String,
|
|
107
107
|
description:
|
|
108
|
-
'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.',
|
|
108
|
+
'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.',
|
|
109
109
|
})
|
|
110
110
|
lastRunAt?: string;
|
|
111
111
|
|
|
112
112
|
@ApiProperty({
|
|
113
113
|
type: Number,
|
|
114
114
|
description:
|
|
115
|
-
'Cached count of rows returned by the most recent successful execution. Updatedasynchronously alongside lastRunAt. Used for the catalog badge.MUST NOT block the response.',
|
|
115
|
+
'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.',
|
|
116
116
|
})
|
|
117
117
|
lastRowCount?: number;
|
|
118
118
|
|