@open-mercato/core 0.8.1-develop.7296.1.2111d779db → 0.8.1-develop.7441.1.b42958b98c
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/.turbo/turbo-build.log +2 -2
- package/AGENTS.md +4 -5
- package/dist/generated/entities/availability_policy/index.js +41 -0
- package/dist/generated/entities/availability_policy/index.js.map +7 -0
- package/dist/generated/entities/communication_channel/index.js +3 -1
- package/dist/generated/entities/communication_channel/index.js.map +2 -2
- package/dist/generated/entities/customer_email_conversation_share/index.js +21 -0
- package/dist/generated/entities/customer_email_conversation_share/index.js.map +7 -0
- package/dist/generated/entities/customer_group/index.js +33 -0
- package/dist/generated/entities/customer_group/index.js.map +7 -0
- package/dist/generated/entities/customer_group_membership/index.js +29 -0
- package/dist/generated/entities/customer_group_membership/index.js.map +7 -0
- package/dist/generated/entities/customer_group_terms/index.js +33 -0
- package/dist/generated/entities/customer_group_terms/index.js.map +7 -0
- package/dist/generated/entities/customer_interaction/index.js +2 -0
- package/dist/generated/entities/customer_interaction/index.js.map +2 -2
- package/dist/generated/entities/form/index.js +35 -0
- package/dist/generated/entities/form/index.js.map +7 -0
- package/dist/generated/entities/form_access_audit/index.js +21 -0
- package/dist/generated/entities/form_access_audit/index.js.map +7 -0
- package/dist/generated/entities/form_attachment/index.js +29 -0
- package/dist/generated/entities/form_attachment/index.js.map +7 -0
- package/dist/generated/entities/form_consent_record/index.js +37 -0
- package/dist/generated/entities/form_consent_record/index.js.map +7 -0
- package/dist/generated/entities/form_distribution/index.js +47 -0
- package/dist/generated/entities/form_distribution/index.js.map +7 -0
- package/dist/generated/entities/form_invitation/index.js +49 -0
- package/dist/generated/entities/form_invitation/index.js.map +7 -0
- package/dist/generated/entities/form_submission/index.js +39 -0
- package/dist/generated/entities/form_submission/index.js.map +7 -0
- package/dist/generated/entities/form_submission_actor/index.js +23 -0
- package/dist/generated/entities/form_submission_actor/index.js.map +7 -0
- package/dist/generated/entities/form_submission_revision/index.js +29 -0
- package/dist/generated/entities/form_submission_revision/index.js.map +7 -0
- package/dist/generated/entities/form_version/index.js +37 -0
- package/dist/generated/entities/form_version/index.js.map +7 -0
- package/dist/generated/entities/forms_encryption_key/index.js +15 -0
- package/dist/generated/entities/forms_encryption_key/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +27 -2
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +269 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/communicationChannelsFixtures.js +16 -0
- package/dist/helpers/integration/communicationChannelsFixtures.js.map +2 -2
- package/dist/helpers/integration/customerGroupsFixtures.js +88 -0
- package/dist/helpers/integration/customerGroupsFixtures.js.map +7 -0
- package/dist/helpers/integration/formsFixtures.js +448 -0
- package/dist/helpers/integration/formsFixtures.js.map +7 -0
- package/dist/modules/api_docs/api/get/version.js +19 -7
- package/dist/modules/api_docs/api/get/version.js.map +2 -2
- package/dist/modules/api_keys/api/keys/route.js +74 -169
- package/dist/modules/api_keys/api/keys/route.js.map +2 -2
- package/dist/modules/api_keys/backend/api-keys/create/page.js +1 -1
- package/dist/modules/api_keys/backend/api-keys/create/page.js.map +2 -2
- package/dist/modules/api_keys/commands/keys.js +140 -0
- package/dist/modules/api_keys/commands/keys.js.map +7 -0
- package/dist/modules/api_keys/services/apiKeyService.js +72 -43
- package/dist/modules/api_keys/services/apiKeyService.js.map +2 -2
- package/dist/modules/attachments/api/file/[id]/route.js +9 -2
- package/dist/modules/attachments/api/file/[id]/route.js.map +2 -2
- package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js +6 -2
- package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js.map +2 -2
- package/dist/modules/attachments/api/route.js +10 -4
- package/dist/modules/attachments/api/route.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentLibrary.js +16 -6
- package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
- package/dist/modules/attachments/lib/access.js +1 -3
- package/dist/modules/attachments/lib/access.js.map +2 -2
- package/dist/modules/attachments/lib/requestScope.js +13 -4
- package/dist/modules/attachments/lib/requestScope.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js +6 -1
- package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/redo/route.js +36 -6
- package/dist/modules/audit_logs/api/audit-logs/actions/redo/route.js.map +3 -3
- package/dist/modules/audit_logs/api/audit-logs/actions/route.js +6 -1
- package/dist/modules/audit_logs/api/audit-logs/actions/route.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/undo/route.js +34 -4
- package/dist/modules/audit_logs/api/audit-logs/actions/undo/route.js.map +2 -2
- package/dist/modules/audit_logs/data/validators.js +1 -0
- package/dist/modules/audit_logs/data/validators.js.map +2 -2
- package/dist/modules/audit_logs/lib/actorSubject.js +65 -0
- package/dist/modules/audit_logs/lib/actorSubject.js.map +7 -0
- package/dist/modules/audit_logs/lib/replayAuthorization.js +41 -0
- package/dist/modules/audit_logs/lib/replayAuthorization.js.map +7 -0
- package/dist/modules/audit_logs/services/actionLogService.js +162 -39
- package/dist/modules/audit_logs/services/actionLogService.js.map +3 -3
- package/dist/modules/auth/api/features.js +1 -1
- package/dist/modules/auth/api/features.js.map +2 -2
- package/dist/modules/auth/cli.js +29 -17
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/commands/acl.js +25 -36
- package/dist/modules/auth/commands/acl.js.map +2 -2
- package/dist/modules/auth/commands/interceptors.js +22 -0
- package/dist/modules/auth/commands/interceptors.js.map +7 -0
- package/dist/modules/auth/commands/roles.js +421 -147
- package/dist/modules/auth/commands/roles.js.map +2 -2
- package/dist/modules/auth/commands/users.js +543 -69
- package/dist/modules/auth/commands/users.js.map +2 -2
- package/dist/modules/auth/lib/authorizationStateLocks.js +249 -0
- package/dist/modules/auth/lib/authorizationStateLocks.js.map +7 -0
- package/dist/modules/auth/lib/commandReplay.js +144 -0
- package/dist/modules/auth/lib/commandReplay.js.map +7 -0
- package/dist/modules/auth/lib/executionPrincipal.js +32 -25
- package/dist/modules/auth/lib/executionPrincipal.js.map +2 -2
- package/dist/modules/auth/lib/grantChecks.js +7 -2
- package/dist/modules/auth/lib/grantChecks.js.map +2 -2
- package/dist/modules/auth/lib/setup-app.js +85 -49
- package/dist/modules/auth/lib/setup-app.js.map +2 -2
- package/dist/modules/auth/lib/tokenHash.js +13 -1
- package/dist/modules/auth/lib/tokenHash.js.map +2 -2
- package/dist/modules/auth/services/rbacService.js +386 -5
- package/dist/modules/auth/services/rbacService.js.map +3 -3
- package/dist/modules/availability/acl.js +16 -0
- package/dist/modules/availability/acl.js.map +7 -0
- package/dist/modules/availability/api/check/route.js +115 -0
- package/dist/modules/availability/api/check/route.js.map +7 -0
- package/dist/modules/availability/api/openapi.js +27 -0
- package/dist/modules/availability/api/openapi.js.map +7 -0
- package/dist/modules/availability/api/policies/resolve-preview/route.js +72 -0
- package/dist/modules/availability/api/policies/resolve-preview/route.js.map +7 -0
- package/dist/modules/availability/api/policies/route.js +203 -0
- package/dist/modules/availability/api/policies/route.js.map +7 -0
- package/dist/modules/availability/backend/availability/check/page.js +185 -0
- package/dist/modules/availability/backend/availability/check/page.js.map +7 -0
- package/dist/modules/availability/backend/availability/check/page.meta.js +16 -0
- package/dist/modules/availability/backend/availability/check/page.meta.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/ResolutionPreviewPanel.js +83 -0
- package/dist/modules/availability/backend/availability/policies/ResolutionPreviewPanel.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/ScopeFields.js +53 -0
- package/dist/modules/availability/backend/availability/policies/ScopeFields.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/StockManagedField.js +32 -0
- package/dist/modules/availability/backend/availability/policies/StockManagedField.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/[id]/page.js +168 -0
- package/dist/modules/availability/backend/availability/policies/[id]/page.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/[id]/page.meta.js +12 -0
- package/dist/modules/availability/backend/availability/policies/[id]/page.meta.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/create/page.js +119 -0
- package/dist/modules/availability/backend/availability/policies/create/page.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/create/page.meta.js +12 -0
- package/dist/modules/availability/backend/availability/policies/create/page.meta.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/formGroups.js +77 -0
- package/dist/modules/availability/backend/availability/policies/formGroups.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/page.js +207 -0
- package/dist/modules/availability/backend/availability/policies/page.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/page.meta.js +16 -0
- package/dist/modules/availability/backend/availability/policies/page.meta.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/policyPayload.js +28 -0
- package/dist/modules/availability/backend/availability/policies/policyPayload.js.map +7 -0
- package/dist/modules/availability/commands/policies.js +364 -0
- package/dist/modules/availability/commands/policies.js.map +7 -0
- package/dist/modules/availability/commands/scope.js +19 -0
- package/dist/modules/availability/commands/scope.js.map +7 -0
- package/dist/modules/availability/data/entities.js +94 -0
- package/dist/modules/availability/data/entities.js.map +7 -0
- package/dist/modules/availability/data/validators.js +59 -0
- package/dist/modules/availability/data/validators.js.map +7 -0
- package/dist/modules/availability/di.js +50 -0
- package/dist/modules/availability/di.js.map +7 -0
- package/dist/modules/availability/events.js +18 -0
- package/dist/modules/availability/events.js.map +7 -0
- package/dist/modules/availability/index.js +15 -0
- package/dist/modules/availability/index.js.map +7 -0
- package/dist/modules/availability/lib/catalogTarget.js +42 -0
- package/dist/modules/availability/lib/catalogTarget.js.map +7 -0
- package/dist/modules/availability/lib/organizationScope.js +10 -0
- package/dist/modules/availability/lib/organizationScope.js.map +7 -0
- package/dist/modules/availability/lib/policyResolution.js +150 -0
- package/dist/modules/availability/lib/policyResolution.js.map +7 -0
- package/dist/modules/availability/lib/tryResolve.js +11 -0
- package/dist/modules/availability/lib/tryResolve.js.map +7 -0
- package/dist/modules/availability/migrations/Migration20260922095844_availability.js +16 -0
- package/dist/modules/availability/migrations/Migration20260922095844_availability.js.map +7 -0
- package/dist/modules/availability/migrations/Migration20260930120000_availability.js +20 -0
- package/dist/modules/availability/migrations/Migration20260930120000_availability.js.map +7 -0
- package/dist/modules/availability/setup.js +12 -0
- package/dist/modules/availability/setup.js.map +7 -0
- package/dist/modules/catalog/api/categories/bulk-create/route.js +110 -0
- package/dist/modules/catalog/api/categories/bulk-create/route.js.map +7 -0
- package/dist/modules/catalog/api/categories/route.js +56 -8
- package/dist/modules/catalog/api/categories/route.js.map +2 -2
- package/dist/modules/catalog/api/products/bulk-create/route.js +110 -0
- package/dist/modules/catalog/api/products/bulk-create/route.js.map +7 -0
- package/dist/modules/catalog/api/products/route.js +55 -31
- package/dist/modules/catalog/api/products/route.js.map +3 -3
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +2 -6
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +12 -4
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/commands/categories.js +1 -0
- package/dist/modules/catalog/commands/categories.js.map +2 -2
- package/dist/modules/catalog/commands/productDeleteChildren.js +389 -0
- package/dist/modules/catalog/commands/productDeleteChildren.js.map +7 -0
- package/dist/modules/catalog/commands/products.js +57 -19
- package/dist/modules/catalog/commands/products.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +5 -19
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductUomSection.js +26 -29
- package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
- package/dist/modules/catalog/components/products/productForm.js +3 -2
- package/dist/modules/catalog/components/products/productForm.js.map +2 -2
- package/dist/modules/catalog/data/validators.js +15 -0
- package/dist/modules/catalog/data/validators.js.map +2 -2
- package/dist/modules/catalog/di.js +3 -2
- package/dist/modules/catalog/di.js.map +2 -2
- package/dist/modules/catalog/events.js +9 -3
- package/dist/modules/catalog/events.js.map +2 -2
- package/dist/modules/catalog/lib/bulkCreateCategories.js +237 -0
- package/dist/modules/catalog/lib/bulkCreateCategories.js.map +7 -0
- package/dist/modules/catalog/lib/bulkCreateCheckpoint.js +82 -0
- package/dist/modules/catalog/lib/bulkCreateCheckpoint.js.map +7 -0
- package/dist/modules/catalog/lib/bulkCreateMutationGuards.js +39 -0
- package/dist/modules/catalog/lib/bulkCreateMutationGuards.js.map +7 -0
- package/dist/modules/catalog/lib/bulkCreateProducts.js +241 -0
- package/dist/modules/catalog/lib/bulkCreateProducts.js.map +7 -0
- package/dist/modules/catalog/lib/bulkDelete.js +10 -11
- package/dist/modules/catalog/lib/bulkDelete.js.map +2 -2
- package/dist/modules/catalog/lib/catalogQueue.js +14 -0
- package/dist/modules/catalog/lib/catalogQueue.js.map +7 -0
- package/dist/modules/catalog/lib/currencyOptions.js +25 -0
- package/dist/modules/catalog/lib/currencyOptions.js.map +7 -0
- package/dist/modules/catalog/lib/productSearch.js +8 -0
- package/dist/modules/catalog/lib/productSearch.js.map +7 -0
- package/dist/modules/catalog/lib/seeds.js +2 -42
- package/dist/modules/catalog/lib/seeds.js.map +2 -2
- package/dist/modules/catalog/lib/unitLabels.js +53 -0
- package/dist/modules/catalog/lib/unitLabels.js.map +7 -0
- package/dist/modules/catalog/migrations/Migration20260914120000.js +29 -0
- package/dist/modules/catalog/migrations/Migration20260914120000.js.map +7 -0
- package/dist/modules/catalog/migrations/Migration20260914120100.js +28 -0
- package/dist/modules/catalog/migrations/Migration20260914120100.js.map +7 -0
- package/dist/modules/catalog/workers/catalog-category-bulk-create.js +40 -0
- package/dist/modules/catalog/workers/catalog-category-bulk-create.js.map +7 -0
- package/dist/modules/catalog/workers/catalog-product-bulk-create.js +40 -0
- package/dist/modules/catalog/workers/catalog-product-bulk-create.js.map +7 -0
- package/dist/modules/communication_channels/acl.js +8 -0
- package/dist/modules/communication_channels/acl.js.map +2 -2
- package/dist/modules/communication_channels/api/get/me/channels/route.js +4 -0
- package/dist/modules/communication_channels/api/get/me/channels/route.js.map +2 -2
- package/dist/modules/communication_channels/api/get/oauth/[provider]/callback/route.js +22 -0
- package/dist/modules/communication_channels/api/get/oauth/[provider]/callback/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/import-history/route.js +4 -4
- package/dist/modules/communication_channels/api/post/channels/[id]/import-history/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js +2 -1
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/connect/credentials/route.js +4 -6
- package/dist/modules/communication_channels/api/post/channels/connect/credentials/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/connect/tenant-credentials/route.js +4 -6
- package/dist/modules/communication_channels/api/post/channels/connect/tenant-credentials/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/test-seed/route.js +90 -20
- package/dist/modules/communication_channels/api/post/test-seed/route.js.map +3 -3
- package/dist/modules/communication_channels/api/put/channels/[id]/visibility/route.js +137 -0
- package/dist/modules/communication_channels/api/put/channels/[id]/visibility/route.js.map +7 -0
- package/dist/modules/communication_channels/backend/profile/communication-channels/page.js +175 -107
- package/dist/modules/communication_channels/backend/profile/communication-channels/page.js.map +2 -2
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js +2 -1
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js.map +2 -2
- package/dist/modules/communication_channels/commands/set-channel-visibility.js +88 -0
- package/dist/modules/communication_channels/commands/set-channel-visibility.js.map +7 -0
- package/dist/modules/communication_channels/data/enrichers.js +18 -9
- package/dist/modules/communication_channels/data/enrichers.js.map +2 -2
- package/dist/modules/communication_channels/data/entities.js +4 -0
- package/dist/modules/communication_channels/data/entities.js.map +2 -2
- package/dist/modules/communication_channels/di.js +9 -1
- package/dist/modules/communication_channels/di.js.map +2 -2
- package/dist/modules/communication_channels/events.js +7 -0
- package/dist/modules/communication_channels/events.js.map +2 -2
- package/dist/modules/communication_channels/index.js +1 -1
- package/dist/modules/communication_channels/index.js.map +1 -1
- package/dist/modules/communication_channels/lib/access-control.js +2 -1
- package/dist/modules/communication_channels/lib/access-control.js.map +2 -2
- package/dist/modules/communication_channels/lib/channel-thread-access.js +60 -0
- package/dist/modules/communication_channels/lib/channel-thread-access.js.map +7 -0
- package/dist/modules/communication_channels/lib/credential-refresh.js +11 -2
- package/dist/modules/communication_channels/lib/credential-refresh.js.map +2 -2
- package/dist/modules/communication_channels/lib/inbound-message-origin.js +18 -0
- package/dist/modules/communication_channels/lib/inbound-message-origin.js.map +7 -0
- package/dist/modules/communication_channels/lib/oauth-state.js +37 -0
- package/dist/modules/communication_channels/lib/oauth-state.js.map +2 -2
- package/dist/modules/communication_channels/lib/outbound-delivery-intent.js +12 -0
- package/dist/modules/communication_channels/lib/outbound-delivery-intent.js.map +7 -0
- package/dist/modules/communication_channels/lib/send-as-user.js +1 -1
- package/dist/modules/communication_channels/lib/send-as-user.js.map +2 -2
- package/dist/modules/communication_channels/migrations/Migration20260825141000_communication_channels.js +14 -0
- package/dist/modules/communication_channels/migrations/Migration20260825141000_communication_channels.js.map +7 -0
- package/dist/modules/communication_channels/setup.js +6 -2
- package/dist/modules/communication_channels/setup.js.map +2 -2
- package/dist/modules/communication_channels/subscribers/outbound-bridge.js +8 -2
- package/dist/modules/communication_channels/subscribers/outbound-bridge.js.map +2 -2
- package/dist/modules/communication_channels/workers/gmail-history-sync.js +1 -1
- package/dist/modules/communication_channels/workers/gmail-history-sync.js.map +2 -2
- package/dist/modules/communication_channels/workers/poll-channel.js +1 -1
- package/dist/modules/communication_channels/workers/poll-channel.js.map +2 -2
- package/dist/modules/communication_channels/workers/reaction-processor.js +2 -2
- package/dist/modules/communication_channels/workers/reaction-processor.js.map +2 -2
- package/dist/modules/configs/api/upgrade-actions/route.js +2 -1
- package/dist/modules/configs/api/upgrade-actions/route.js.map +2 -2
- package/dist/modules/configs/cli.js +2 -2
- package/dist/modules/configs/cli.js.map +2 -2
- package/dist/modules/configs/lib/upgrade-actions.js +28 -6
- package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
- package/dist/modules/configs/services/upgradeActionsService.js +44 -30
- package/dist/modules/configs/services/upgradeActionsService.js.map +2 -2
- package/dist/modules/currencies/api/currencies/route.js +11 -5
- package/dist/modules/currencies/api/currencies/route.js.map +2 -2
- package/dist/modules/currencies/api/exchange-rates/route.js +11 -5
- package/dist/modules/currencies/api/exchange-rates/route.js.map +2 -2
- package/dist/modules/customer_groups/acl.js +14 -0
- package/dist/modules/customer_groups/acl.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/[id]/terms/route.js +266 -0
- package/dist/modules/customer_groups/api/customer-groups/[id]/terms/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/crud.js +473 -0
- package/dist/modules/customer_groups/api/customer-groups/crud.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/explain-terms/route.js +143 -0
- package/dist/modules/customer_groups/api/customer-groups/explain-terms/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/memberships/crud.js +383 -0
- package/dist/modules/customer_groups/api/customer-groups/memberships/crud.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/memberships/route.js +66 -0
- package/dist/modules/customer_groups/api/customer-groups/memberships/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/reconcile/adopt/route.js +133 -0
- package/dist/modules/customer_groups/api/customer-groups/reconcile/adopt/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/reconcile/route.js +80 -0
- package/dist/modules/customer_groups/api/customer-groups/reconcile/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/reorder/route.js +127 -0
- package/dist/modules/customer_groups/api/customer-groups/reorder/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/route.js +62 -0
- package/dist/modules/customer_groups/api/customer-groups/route.js.map +7 -0
- package/dist/modules/customer_groups/api/openapi.js +27 -0
- package/dist/modules/customer_groups/api/openapi.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/[id]/edit/page.js +328 -0
- package/dist/modules/customer_groups/backend/customer-groups/[id]/edit/page.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/[id]/edit/page.meta.js +16 -0
- package/dist/modules/customer_groups/backend/customer-groups/[id]/edit/page.meta.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/create/page.js +249 -0
- package/dist/modules/customer_groups/backend/customer-groups/create/page.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/create/page.meta.js +27 -0
- package/dist/modules/customer_groups/backend/customer-groups/create/page.meta.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/orphans/page.js +139 -0
- package/dist/modules/customer_groups/backend/customer-groups/orphans/page.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/orphans/page.meta.js +16 -0
- package/dist/modules/customer_groups/backend/customer-groups/orphans/page.meta.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/page.js +364 -0
- package/dist/modules/customer_groups/backend/customer-groups/page.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/page.meta.js +15 -0
- package/dist/modules/customer_groups/backend/customer-groups/page.meta.js.map +7 -0
- package/dist/modules/customer_groups/cli.js +72 -0
- package/dist/modules/customer_groups/cli.js.map +7 -0
- package/dist/modules/customer_groups/commands/reorderGroups.js +96 -0
- package/dist/modules/customer_groups/commands/reorderGroups.js.map +7 -0
- package/dist/modules/customer_groups/components/CustomerGroupDefaultField.js +41 -0
- package/dist/modules/customer_groups/components/CustomerGroupDefaultField.js.map +7 -0
- package/dist/modules/customer_groups/components/CustomerGroupParentField.js +156 -0
- package/dist/modules/customer_groups/components/CustomerGroupParentField.js.map +7 -0
- package/dist/modules/customer_groups/components/CustomerGroupTermsPriceKindField.js +94 -0
- package/dist/modules/customer_groups/components/CustomerGroupTermsPriceKindField.js.map +7 -0
- package/dist/modules/customer_groups/components/CustomerGroupTermsSection.js +197 -0
- package/dist/modules/customer_groups/components/CustomerGroupTermsSection.js.map +7 -0
- package/dist/modules/customer_groups/components/GroupPickerField.js +116 -0
- package/dist/modules/customer_groups/components/GroupPickerField.js.map +7 -0
- package/dist/modules/customer_groups/components/OrphanBanner.js +75 -0
- package/dist/modules/customer_groups/components/OrphanBanner.js.map +7 -0
- package/dist/modules/customer_groups/components/customerGroupTree.js +57 -0
- package/dist/modules/customer_groups/components/customerGroupTree.js.map +7 -0
- package/dist/modules/customer_groups/data/entities.js +226 -0
- package/dist/modules/customer_groups/data/entities.js.map +7 -0
- package/dist/modules/customer_groups/data/validators.js +153 -0
- package/dist/modules/customer_groups/data/validators.js.map +7 -0
- package/dist/modules/customer_groups/di.js +20 -0
- package/dist/modules/customer_groups/di.js.map +7 -0
- package/dist/modules/customer_groups/events.js +22 -0
- package/dist/modules/customer_groups/events.js.map +7 -0
- package/dist/modules/customer_groups/index.js +15 -0
- package/dist/modules/customer_groups/index.js.map +7 -0
- package/dist/modules/customer_groups/lib/createConflictRecheck.js +29 -0
- package/dist/modules/customer_groups/lib/createConflictRecheck.js.map +7 -0
- package/dist/modules/customer_groups/lib/customerScope.js +81 -0
- package/dist/modules/customer_groups/lib/customerScope.js.map +7 -0
- package/dist/modules/customer_groups/lib/groupEvents.js +31 -0
- package/dist/modules/customer_groups/lib/groupEvents.js.map +7 -0
- package/dist/modules/customer_groups/lib/priceKindScope.js +16 -0
- package/dist/modules/customer_groups/lib/priceKindScope.js.map +7 -0
- package/dist/modules/customer_groups/lib/reconcile.js +161 -0
- package/dist/modules/customer_groups/lib/reconcile.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260922095316_customer_groups.js +27 -0
- package/dist/modules/customer_groups/migrations/Migration20260922095316_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260922103033_customer_groups.js +19 -0
- package/dist/modules/customer_groups/migrations/Migration20260922103033_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260922105444_customer_groups.js +19 -0
- package/dist/modules/customer_groups/migrations/Migration20260922105444_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260923193330_customer_groups.js +19 -0
- package/dist/modules/customer_groups/migrations/Migration20260923193330_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260929083000_customer_groups.js +20 -0
- package/dist/modules/customer_groups/migrations/Migration20260929083000_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/services/customerGroupsService.js +190 -0
- package/dist/modules/customer_groups/services/customerGroupsService.js.map +7 -0
- package/dist/modules/customer_groups/setup.js +13 -0
- package/dist/modules/customer_groups/setup.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection/group-picker-field/widget.js +31 -0
- package/dist/modules/customer_groups/widgets/injection/group-picker-field/widget.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-explain-terms.js +166 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-explain-terms.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-tab/widget.js +17 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-tab/widget.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-tab.js +457 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-tab.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection-table.js +33 -0
- package/dist/modules/customer_groups/widgets/injection-table.js.map +7 -0
- package/dist/modules/customers/acl.js +13 -0
- package/dist/modules/customers/acl.js.map +2 -2
- package/dist/modules/customers/api/activities/route.js +9 -1
- package/dist/modules/customers/api/activities/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/people/route.js +2 -1
- package/dist/modules/customers/api/companies/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/route.js +19 -7
- package/dist/modules/customers/api/companies/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/companies/route.js +2 -1
- package/dist/modules/customers/api/deals/[id]/companies/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/people/route.js +60 -6
- package/dist/modules/customers/api/deals/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/deals/map/route.js +7 -2
- package/dist/modules/customers/api/deals/map/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/context.js +2 -1
- package/dist/modules/customers/api/dictionaries/context.js.map +2 -2
- package/dist/modules/customers/api/entity-roles-factory.js +3 -2
- package/dist/modules/customers/api/entity-roles-factory.js.map +2 -2
- package/dist/modules/customers/api/interactions/[id]/visibility/route.js +2 -1
- package/dist/modules/customers/api/interactions/[id]/visibility/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/cancel/route.js +2 -1
- package/dist/modules/customers/api/interactions/cancel/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/complete/route.js +2 -1
- package/dist/modules/customers/api/interactions/complete/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/conflicts/route.js +10 -6
- package/dist/modules/customers/api/interactions/conflicts/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/counts/route.js +24 -4
- package/dist/modules/customers/api/interactions/counts/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/route.js +31 -8
- package/dist/modules/customers/api/interactions/route.js.map +2 -2
- package/dist/modules/customers/api/labels/assign/route.js +2 -1
- package/dist/modules/customers/api/labels/assign/route.js.map +2 -2
- package/dist/modules/customers/api/labels/route.js +3 -2
- package/dist/modules/customers/api/labels/route.js.map +2 -2
- package/dist/modules/customers/api/labels/unassign/route.js +2 -1
- package/dist/modules/customers/api/labels/unassign/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/context.js +7 -2
- package/dist/modules/customers/api/people/[id]/companies/context.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/email-share/route.js +218 -0
- package/dist/modules/customers/api/people/[id]/email-share/route.js.map +7 -0
- package/dist/modules/customers/api/people/[id]/email-threads/route.js +11 -2
- package/dist/modules/customers/api/people/[id]/email-threads/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/emails/route.js +2 -1
- package/dist/modules/customers/api/people/[id]/emails/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/route.js +20 -19
- package/dist/modules/customers/api/people/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/people/check-phone/route.js +2 -1
- package/dist/modules/customers/api/people/check-phone/route.js.map +2 -2
- package/dist/modules/customers/api/pipeline-stages/reorder/route.js +3 -2
- package/dist/modules/customers/api/pipeline-stages/reorder/route.js.map +2 -2
- package/dist/modules/customers/api/pipeline-stages/route.js +3 -3
- package/dist/modules/customers/api/pipeline-stages/route.js.map +2 -2
- package/dist/modules/customers/api/pipelines/route.js +3 -3
- package/dist/modules/customers/api/pipelines/route.js.map +2 -2
- package/dist/modules/customers/api/settings/address-format/route.js +2 -1
- package/dist/modules/customers/api/settings/address-format/route.js.map +2 -2
- package/dist/modules/customers/api/settings/dictionary-sort-modes/route.js +2 -1
- package/dist/modules/customers/api/settings/dictionary-sort-modes/route.js.map +2 -2
- package/dist/modules/customers/api/settings/stuck-threshold/route.js +2 -1
- package/dist/modules/customers/api/settings/stuck-threshold/route.js.map +2 -2
- package/dist/modules/customers/api/tags/assign/route.js +2 -1
- package/dist/modules/customers/api/tags/assign/route.js.map +2 -2
- package/dist/modules/customers/api/tags/unassign/route.js +2 -1
- package/dist/modules/customers/api/tags/unassign/route.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/[id]/page.js +4 -2
- package/dist/modules/customers/backend/customers/companies/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.js +6 -25
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/page.js +21 -18
- package/dist/modules/customers/backend/customers/deals/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/components/ReassignOwnerDialog.js +93 -0
- package/dist/modules/customers/backend/customers/deals/components/ReassignOwnerDialog.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/page.js +111 -1
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/[id]/page.js +4 -2
- package/dist/modules/customers/backend/customers/people/[id]/page.js.map +2 -2
- package/dist/modules/customers/commands/addresses.js +83 -15
- package/dist/modules/customers/commands/addresses.js.map +2 -2
- package/dist/modules/customers/commands/companies.js +10 -4
- package/dist/modules/customers/commands/companies.js.map +2 -2
- package/dist/modules/customers/commands/emailConversationShares.js +177 -0
- package/dist/modules/customers/commands/emailConversationShares.js.map +7 -0
- package/dist/modules/customers/commands/index.js +1 -0
- package/dist/modules/customers/commands/index.js.map +2 -2
- package/dist/modules/customers/commands/interactions.js +48 -23
- package/dist/modules/customers/commands/interactions.js.map +3 -3
- package/dist/modules/customers/commands/people.js +3 -2
- package/dist/modules/customers/commands/people.js.map +2 -2
- package/dist/modules/customers/commands/shared.js +4 -0
- package/dist/modules/customers/commands/shared.js.map +2 -2
- package/dist/modules/customers/components/calendar/types.js.map +1 -1
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js +81 -354
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js.map +2 -2
- package/dist/modules/customers/components/detail/CreatePersonDialog.js +12 -11
- package/dist/modules/customers/components/detail/CreatePersonDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +73 -5
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/detail/DealOwnerSelect.js +96 -0
- package/dist/modules/customers/components/detail/DealOwnerSelect.js.map +7 -0
- package/dist/modules/customers/components/detail/DealPeopleSection.js +206 -0
- package/dist/modules/customers/components/detail/DealPeopleSection.js.map +7 -0
- package/dist/modules/customers/components/detail/DealsSection.js +8 -14
- package/dist/modules/customers/components/detail/DealsSection.js.map +2 -2
- package/dist/modules/customers/components/detail/LinkedPeopleSection.js +342 -0
- package/dist/modules/customers/components/detail/LinkedPeopleSection.js.map +7 -0
- package/dist/modules/customers/components/detail/PersonCard.js +5 -2
- package/dist/modules/customers/components/detail/PersonCard.js.map +2 -2
- package/dist/modules/customers/components/detail/PersonEmailShareControl.js +190 -0
- package/dist/modules/customers/components/detail/PersonEmailShareControl.js.map +7 -0
- package/dist/modules/customers/components/detail/PersonEmailThreadsTab.js +17 -0
- package/dist/modules/customers/components/detail/PersonEmailThreadsTab.js.map +2 -2
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js +5 -2
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/create/CreateDealForm.js +19 -0
- package/dist/modules/customers/components/detail/create/CreateDealForm.js.map +2 -2
- package/dist/modules/customers/components/detail/create/DealDetailsFields.js +11 -0
- package/dist/modules/customers/components/detail/create/DealDetailsFields.js.map +2 -2
- package/dist/modules/customers/components/detail/create/DealSectionCard.js +2 -2
- package/dist/modules/customers/components/detail/create/DealSectionCard.js.map +2 -2
- package/dist/modules/customers/components/detail/create/dealFormTypes.js +1 -0
- package/dist/modules/customers/components/detail/create/dealFormTypes.js.map +2 -2
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js +1 -1
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +2 -0
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/components/linking/LinkEntityDialog.js +8 -0
- package/dist/modules/customers/components/linking/LinkEntityDialog.js.map +2 -2
- package/dist/modules/customers/components/linking/adapters/personAdapter.js +3 -0
- package/dist/modules/customers/components/linking/adapters/personAdapter.js.map +2 -2
- package/dist/modules/customers/data/enrichers.js +40 -2
- package/dist/modules/customers/data/enrichers.js.map +2 -2
- package/dist/modules/customers/data/entities.js +56 -0
- package/dist/modules/customers/data/entities.js.map +2 -2
- package/dist/modules/customers/data/validators.js +11 -0
- package/dist/modules/customers/data/validators.js.map +2 -2
- package/dist/modules/customers/events.js +6 -1
- package/dist/modules/customers/events.js.map +2 -2
- package/dist/modules/customers/lib/assignableStaff.js +14 -0
- package/dist/modules/customers/lib/assignableStaff.js.map +2 -2
- package/dist/modules/customers/lib/calendar/editorPayload.js +17 -13
- package/dist/modules/customers/lib/calendar/editorPayload.js.map +2 -2
- package/dist/modules/customers/lib/calendar/mapItem.js +1 -0
- package/dist/modules/customers/lib/calendar/mapItem.js.map +2 -2
- package/dist/modules/customers/lib/conversationShares.js +126 -0
- package/dist/modules/customers/lib/conversationShares.js.map +7 -0
- package/dist/modules/customers/lib/dealsOrganizationScope.js +5 -3
- package/dist/modules/customers/lib/dealsOrganizationScope.js.map +2 -2
- package/dist/modules/customers/lib/interactionRequestContext.js +2 -1
- package/dist/modules/customers/lib/interactionRequestContext.js.map +2 -2
- package/dist/modules/customers/lib/link-channel-message-handler.js +19 -9
- package/dist/modules/customers/lib/link-channel-message-handler.js.map +2 -2
- package/dist/modules/customers/lib/personDetailCacheTags.js +32 -0
- package/dist/modules/customers/lib/personDetailCacheTags.js.map +7 -0
- package/dist/modules/customers/lib/personEmailThreads.js +26 -5
- package/dist/modules/customers/lib/personEmailThreads.js.map +2 -2
- package/dist/modules/customers/lib/reassignDealOwner.js +25 -0
- package/dist/modules/customers/lib/reassignDealOwner.js.map +7 -0
- package/dist/modules/customers/lib/userNames.js +26 -0
- package/dist/modules/customers/lib/userNames.js.map +7 -0
- package/dist/modules/customers/lib/visibilityFilter.js +70 -2
- package/dist/modules/customers/lib/visibilityFilter.js.map +2 -2
- package/dist/modules/customers/migrations/Migration20260825120000_customers.js +18 -0
- package/dist/modules/customers/migrations/Migration20260825120000_customers.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260825140000_customers.js +27 -0
- package/dist/modules/customers/migrations/Migration20260825140000_customers.js.map +7 -0
- package/dist/modules/customers/setup.js +1 -0
- package/dist/modules/customers/setup.js.map +2 -2
- package/dist/modules/customers/subscribers/channel-visibility-changed.js +16 -0
- package/dist/modules/customers/subscribers/channel-visibility-changed.js.map +7 -0
- package/dist/modules/dashboards/api/widgets/data/batch/route.js +3 -8
- package/dist/modules/dashboards/api/widgets/data/batch/route.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/route.js +10 -15
- package/dist/modules/dashboards/api/widgets/data/route.js.map +2 -2
- package/dist/modules/dashboards/lib/aggregations.js +1 -1
- package/dist/modules/dashboards/lib/aggregations.js.map +2 -2
- package/dist/modules/dashboards/lib/widgetScope.js +2 -7
- package/dist/modules/dashboards/lib/widgetScope.js.map +2 -2
- package/dist/modules/data_sync/api/runs/[id]/cancel.js +4 -1
- package/dist/modules/data_sync/api/runs/[id]/cancel.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +497 -329
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js +248 -113
- package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js.map +3 -3
- package/dist/modules/data_sync/components/useDataSyncRunAccess.js +17 -0
- package/dist/modules/data_sync/components/useDataSyncRunAccess.js.map +7 -0
- package/dist/modules/data_sync/lib/resume-point.js +21 -0
- package/dist/modules/data_sync/lib/resume-point.js.map +7 -0
- package/dist/modules/data_sync/lib/start-run.js +52 -2
- package/dist/modules/data_sync/lib/start-run.js.map +2 -2
- package/dist/modules/data_sync/lib/sync-run-service.js +22 -33
- package/dist/modules/data_sync/lib/sync-run-service.js.map +3 -3
- package/dist/modules/devices/api/[id]/route.js +3 -2
- package/dist/modules/devices/api/[id]/route.js.map +2 -2
- package/dist/modules/devices/api/admin/devices/route.js +2 -1
- package/dist/modules/devices/api/admin/devices/route.js.map +2 -2
- package/dist/modules/devices/api/route.js +2 -1
- package/dist/modules/devices/api/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/context.js +2 -1
- package/dist/modules/dictionaries/api/context.js.map +2 -2
- package/dist/modules/dictionaries/api/route.js +4 -0
- package/dist/modules/dictionaries/api/route.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionariesManager.js +4 -3
- package/dist/modules/dictionaries/components/DictionariesManager.js.map +2 -2
- package/dist/modules/dictionaries/data/validators.js +3 -1
- package/dist/modules/dictionaries/data/validators.js.map +2 -2
- package/dist/modules/directory/api/organization-branding/route.js +10 -1
- package/dist/modules/directory/api/organization-branding/route.js.map +2 -2
- package/dist/modules/directory/api/organizations/route.js +1 -1
- package/dist/modules/directory/api/organizations/route.js.map +1 -1
- package/dist/modules/directory/backend/directory/branding/page.js +17 -4
- package/dist/modules/directory/backend/directory/branding/page.js.map +3 -3
- package/dist/modules/directory/commands/organizations.js +136 -74
- package/dist/modules/directory/commands/organizations.js.map +2 -2
- package/dist/modules/directory/lib/hierarchy.js +19 -1
- package/dist/modules/directory/lib/hierarchy.js.map +2 -2
- package/dist/modules/directory/utils/organizationScope.js +66 -12
- package/dist/modules/directory/utils/organizationScope.js.map +2 -2
- package/dist/modules/directory/utils/organizationScopeFilter.js +7 -4
- package/dist/modules/directory/utils/organizationScopeFilter.js.map +2 -2
- package/dist/modules/directory/utils/organizationScopeGuard.js +6 -2
- package/dist/modules/directory/utils/organizationScopeGuard.js.map +2 -2
- package/dist/modules/entities/api/encryption.js +68 -25
- package/dist/modules/entities/api/encryption.js.map +2 -2
- package/dist/modules/entities/api/records.js +9 -8
- package/dist/modules/entities/api/records.js.map +2 -2
- package/dist/modules/entities/cli.js +33 -22
- package/dist/modules/entities/cli.js.map +2 -2
- package/dist/modules/entities/data/entities.js +8 -0
- package/dist/modules/entities/data/entities.js.map +2 -2
- package/dist/modules/entities/lib/definition-scope.js +3 -1
- package/dist/modules/entities/lib/definition-scope.js.map +2 -2
- package/dist/modules/entities/lib/encryption-maps.js +117 -0
- package/dist/modules/entities/lib/encryption-maps.js.map +7 -0
- package/dist/modules/entities/lib/helpers.js +30 -6
- package/dist/modules/entities/lib/helpers.js.map +2 -2
- package/dist/modules/entities/migrations/Migration20260910120000.js +17 -0
- package/dist/modules/entities/migrations/Migration20260910120000.js.map +7 -0
- package/dist/modules/entities/migrations/Migration20261004120000_encryption_map_scope_uniqueness.js +130 -0
- package/dist/modules/entities/migrations/Migration20261004120000_encryption_map_scope_uniqueness.js.map +7 -0
- package/dist/modules/eudr/api/dashboard/widgets/compliance-overview/route.js +2 -1
- package/dist/modules/eudr/api/dashboard/widgets/compliance-overview/route.js.map +2 -2
- package/dist/modules/eudr/api/plots/import/route.js +2 -1
- package/dist/modules/eudr/api/plots/import/route.js.map +2 -2
- package/dist/modules/eudr/api/product-mappings/suggestions/apply/route.js +2 -1
- package/dist/modules/eudr/api/product-mappings/suggestions/apply/route.js.map +2 -2
- package/dist/modules/eudr/api/product-mappings/suggestions/route.js +2 -1
- package/dist/modules/eudr/api/product-mappings/suggestions/route.js.map +2 -2
- package/dist/modules/eudr/api/reports/annual/route.js +2 -1
- package/dist/modules/eudr/api/reports/annual/route.js.map +2 -2
- package/dist/modules/eudr/api/statements/[id]/export/route.js +2 -1
- package/dist/modules/eudr/api/statements/[id]/export/route.js.map +2 -2
- package/dist/modules/eudr/api/statements/[id]/readiness/route.js +2 -1
- package/dist/modules/eudr/api/statements/[id]/readiness/route.js.map +2 -2
- package/dist/modules/eudr/api/suppliers/compliance/route.js +2 -1
- package/dist/modules/eudr/api/suppliers/compliance/route.js.map +2 -2
- package/dist/modules/feature_toggles/commands/global.js +13 -13
- package/dist/modules/feature_toggles/commands/global.js.map +2 -2
- package/dist/modules/feature_toggles/lib/feature-flag-check.js +8 -2
- package/dist/modules/feature_toggles/lib/feature-flag-check.js.map +2 -2
- package/dist/modules/forms/acl.js +14 -0
- package/dist/modules/forms/acl.js.map +7 -0
- package/dist/modules/forms/api/[id]/analytics/route.js +113 -0
- package/dist/modules/forms/api/[id]/analytics/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/distributions/route.js +176 -0
- package/dist/modules/forms/api/[id]/distributions/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/route.js +225 -0
- package/dist/modules/forms/api/[id]/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/run/context/route.js +115 -0
- package/dist/modules/forms/api/[id]/run/context/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/run/submissions/route.js +109 -0
- package/dist/modules/forms/api/[id]/run/submissions/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/submissions/route.js +83 -0
- package/dist/modules/forms/api/[id]/submissions/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/theme-logo/route.js +117 -0
- package/dist/modules/forms/api/[id]/theme-logo/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/diff/route.js +125 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/diff/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/publish/route.js +99 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/publish/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/route.js +176 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/versions/fork/route.js +92 -0
- package/dist/modules/forms/api/[id]/versions/fork/route.js.map +7 -0
- package/dist/modules/forms/api/attachment-helpers.js +111 -0
- package/dist/modules/forms/api/attachment-helpers.js.map +7 -0
- package/dist/modules/forms/api/by-key/[key]/active/route.js +140 -0
- package/dist/modules/forms/api/by-key/[key]/active/route.js.map +7 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/route.js +84 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/route.js.map +7 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/send/route.js +88 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/send/route.js.map +7 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/route.js +183 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/route.js.map +7 -0
- package/dist/modules/forms/api/distributions/[distributionId]/route.js +191 -0
- package/dist/modules/forms/api/distributions/[distributionId]/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/[id]/attachments/route.js +91 -0
- package/dist/modules/forms/api/form-submissions/[id]/attachments/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/[id]/resume-token/route.js +110 -0
- package/dist/modules/forms/api/form-submissions/[id]/resume-token/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/[id]/route.js +146 -0
- package/dist/modules/forms/api/form-submissions/[id]/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/[id]/submit/route.js +74 -0
- package/dist/modules/forms/api/form-submissions/[id]/submit/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/by-subject/[subject_type]/[subject_id]/route.js +76 -0
- package/dist/modules/forms/api/form-submissions/by-subject/[subject_type]/[subject_id]/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/route.js +113 -0
- package/dist/modules/forms/api/form-submissions/route.js.map +7 -0
- package/dist/modules/forms/api/helpers.js +124 -0
- package/dist/modules/forms/api/helpers.js.map +7 -0
- package/dist/modules/forms/api/public/distributions/[slug]/embed-policy/route.js +47 -0
- package/dist/modules/forms/api/public/distributions/[slug]/embed-policy/route.js.map +7 -0
- package/dist/modules/forms/api/public/distributions/[slug]/route.js +81 -0
- package/dist/modules/forms/api/public/distributions/[slug]/route.js.map +7 -0
- package/dist/modules/forms/api/public/embed-loader/route.js +116 -0
- package/dist/modules/forms/api/public/embed-loader/route.js.map +7 -0
- package/dist/modules/forms/api/public/invitations/[token]/route.js +87 -0
- package/dist/modules/forms/api/public/invitations/[token]/route.js.map +7 -0
- package/dist/modules/forms/api/public/rate-limit.js +54 -0
- package/dist/modules/forms/api/public/rate-limit.js.map +7 -0
- package/dist/modules/forms/api/public/start/route.js +142 -0
- package/dist/modules/forms/api/public/start/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/attachments/[attachmentId]/route.js +67 -0
- package/dist/modules/forms/api/public/submissions/[id]/attachments/[attachmentId]/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/attachments/route.js +85 -0
- package/dist/modules/forms/api/public/submissions/[id]/attachments/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/pdf/route.js +72 -0
- package/dist/modules/forms/api/public/submissions/[id]/pdf/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/route.js +154 -0
- package/dist/modules/forms/api/public/submissions/[id]/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/submit/route.js +127 -0
- package/dist/modules/forms/api/public/submissions/[id]/submit/route.js.map +7 -0
- package/dist/modules/forms/api/route.js +216 -0
- package/dist/modules/forms/api/route.js.map +7 -0
- package/dist/modules/forms/api/runtime-helpers.js +149 -0
- package/dist/modules/forms/api/runtime-helpers.js.map +7 -0
- package/dist/modules/forms/api/subjects/[subjectType]/[subjectId]/consents/route.js +137 -0
- package/dist/modules/forms/api/subjects/[subjectType]/[subjectId]/consents/route.js.map +7 -0
- package/dist/modules/forms/api/subjects/[subjectType]/[subjectId]/export/route.js +101 -0
- package/dist/modules/forms/api/subjects/[subjectType]/[subjectId]/export/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/access-audit/route.js +76 -0
- package/dist/modules/forms/api/submissions/[submissionId]/access-audit/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/actors/[actorId]/route.js +56 -0
- package/dist/modules/forms/api/submissions/[submissionId]/actors/[actorId]/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/actors/route.js +76 -0
- package/dist/modules/forms/api/submissions/[submissionId]/actors/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/anonymize/route.js +107 -0
- package/dist/modules/forms/api/submissions/[submissionId]/anonymize/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/attachments/[attachmentId]/route.js +73 -0
- package/dist/modules/forms/api/submissions/[submissionId]/attachments/[attachmentId]/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/export/route.js +90 -0
- package/dist/modules/forms/api/submissions/[submissionId]/export/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/pdf/route.js +91 -0
- package/dist/modules/forms/api/submissions/[submissionId]/pdf/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/reopen/route.js +55 -0
- package/dist/modules/forms/api/submissions/[submissionId]/reopen/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/revisions/route.js +61 -0
- package/dist/modules/forms/api/submissions/[submissionId]/revisions/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/route.js +75 -0
- package/dist/modules/forms/api/submissions/[submissionId]/route.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/FormStudio.js +2811 -0
- package/dist/modules/forms/backend/forms/[id]/FormStudio.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/analytics/page.js +214 -0
- package/dist/modules/forms/backend/forms/[id]/analytics/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/analytics/page.meta.js +19 -0
- package/dist/modules/forms/backend/forms/[id]/analytics/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/distributions/page.js +12 -0
- package/dist/modules/forms/backend/forms/[id]/distributions/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/distributions/page.meta.js +19 -0
- package/dist/modules/forms/backend/forms/[id]/distributions/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/history/page.js +152 -0
- package/dist/modules/forms/backend/forms/[id]/history/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/history/page.meta.js +15 -0
- package/dist/modules/forms/backend/forms/[id]/history/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/page.js +13 -0
- package/dist/modules/forms/backend/forms/[id]/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/page.meta.js +15 -0
- package/dist/modules/forms/backend/forms/[id]/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/YesNoRow.js +51 -0
- package/dist/modules/forms/backend/forms/[id]/studio/YesNoRow.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/autosave-guard.js +21 -0
- package/dist/modules/forms/backend/forms/[id]/studio/autosave-guard.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/DragOverlayCard.js +18 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/DragOverlayCard.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/DropIndicator.js +41 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/DropIndicator.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/FieldRow.js +277 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/FieldRow.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/FormCanvas.js +196 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/FormCanvas.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/GridSlot.js +151 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/GridSlot.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/SectionContainer.js +340 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/SectionContainer.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/grid-collision.js +24 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/grid-collision.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/keyboard-coordinates.js +91 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/keyboard-coordinates.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/overlay-size.js +11 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/overlay-size.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/resize-math.js +27 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/resize-math.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/row-layout.js +80 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/row-layout.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/ConditionBuilder.js +210 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/ConditionBuilder.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/HiddenFieldsPanel.js +91 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/HiddenFieldsPanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/JumpsEditor.js +201 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/JumpsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/RecallTokenPicker.js +66 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/RecallTokenPicker.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/VariablesPanel.js +223 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/VariablesPanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/condition-model.js +151 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/condition-model.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/lucide-icons.js +88 -0
- package/dist/modules/forms/backend/forms/[id]/studio/lucide-icons.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/FormAppearancePanel.js +493 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/FormAppearancePanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/FormPalettePanel.js +44 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/FormPalettePanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/InputParametersTab.js +350 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/InputParametersTab.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/PaletteCard.js +40 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/PaletteCard.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/RolesEditor.js +202 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/RolesEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/entries.js +66 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/entries.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/preview/PreviewSurface.js +1200 -0
- package/dist/modules/forms/backend/forms/[id]/studio/preview/PreviewSurface.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/preview/ViewportFrame.js +34 -0
- package/dist/modules/forms/backend/forms/[id]/studio/preview/ViewportFrame.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/recall.js +76 -0
- package/dist/modules/forms/backend/forms/[id]/studio/recall.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/schema-helpers.js +1693 -0
- package/dist/modules/forms/backend/forms/[id]/studio/schema-helpers.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/BackgroundControl.js +127 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/BackgroundControl.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/ColorControl.js +181 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/ColorControl.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/contrast.js +75 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/contrast.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/presets.js +91 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/presets.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/type-label.js +11 -0
- package/dist/modules/forms/backend/forms/[id]/studio/type-label.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/types.js +1 -0
- package/dist/modules/forms/backend/forms/[id]/studio/types.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/undo-controller.js +43 -0
- package/dist/modules/forms/backend/forms/[id]/studio/undo-controller.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/FileConstraintsEditor.js +74 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/FileConstraintsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/GroupConfigEditor.js +134 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/GroupConfigEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/LengthRangeEditor.js +61 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/LengthRangeEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MatrixColumnsEditor.js +149 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MatrixColumnsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MatrixRowsEditor.js +168 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MatrixRowsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MessageOverridesEditor.js +64 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MessageOverridesEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/NpsAnchorsEditor.js +52 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/NpsAnchorsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/NumberRangeEditor.js +59 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/NumberRangeEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/OpinionIconSelect.js +31 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/OpinionIconSelect.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/PatternEditor.js +105 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/PatternEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/RankingExhaustiveSwitch.js +15 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/RankingExhaustiveSwitch.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/SignatureConfigEditor.js +75 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/SignatureConfigEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/ValidationPanel.js +293 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/ValidationPanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/components/RowBadges.js +42 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/components/RowBadges.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/components/SubmissionDrawer.js +473 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/components/SubmissionDrawer.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/page.js +208 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/page.meta.js +12 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/create/page.js +101 -0
- package/dist/modules/forms/backend/forms/create/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/create/page.meta.js +15 -0
- package/dist/modules/forms/backend/forms/create/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/page.js +227 -0
- package/dist/modules/forms/backend/forms/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/page.meta.js +33 -0
- package/dist/modules/forms/backend/forms/page.meta.js.map +7 -0
- package/dist/modules/forms/commands/distribution.js +417 -0
- package/dist/modules/forms/commands/distribution.js.map +7 -0
- package/dist/modules/forms/commands/form-version.js +640 -0
- package/dist/modules/forms/commands/form-version.js.map +7 -0
- package/dist/modules/forms/commands/form.js +406 -0
- package/dist/modules/forms/commands/form.js.map +7 -0
- package/dist/modules/forms/commands/index.js +11 -0
- package/dist/modules/forms/commands/index.js.map +7 -0
- package/dist/modules/forms/commands/invitation.js +329 -0
- package/dist/modules/forms/commands/invitation.js.map +7 -0
- package/dist/modules/forms/commands/shared.js +151 -0
- package/dist/modules/forms/commands/shared.js.map +7 -0
- package/dist/modules/forms/commands/submission.js +132 -0
- package/dist/modules/forms/commands/submission.js.map +7 -0
- package/dist/modules/forms/data/entities.js +654 -0
- package/dist/modules/forms/data/entities.js.map +7 -0
- package/dist/modules/forms/data/validators.js +254 -0
- package/dist/modules/forms/data/validators.js.map +7 -0
- package/dist/modules/forms/di.js +199 -0
- package/dist/modules/forms/di.js.map +7 -0
- package/dist/modules/forms/encryption.js +15 -0
- package/dist/modules/forms/encryption.js.map +7 -0
- package/dist/modules/forms/events-payloads.js +81 -0
- package/dist/modules/forms/events-payloads.js.map +7 -0
- package/dist/modules/forms/events.js +33 -0
- package/dist/modules/forms/events.js.map +7 -0
- package/dist/modules/forms/extension-points.js +36 -0
- package/dist/modules/forms/extension-points.js.map +7 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.js +33 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.js.map +7 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.meta.js +11 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.js +41 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.js.map +7 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.meta.js +11 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/embed/[slug]/page.js +105 -0
- package/dist/modules/forms/frontend/embed/[slug]/page.js.map +7 -0
- package/dist/modules/forms/frontend/embed/[slug]/page.meta.js +11 -0
- package/dist/modules/forms/frontend/embed/[slug]/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/f/[slug]/page.js +12 -0
- package/dist/modules/forms/frontend/f/[slug]/page.js.map +7 -0
- package/dist/modules/forms/frontend/f/[slug]/page.meta.js +11 -0
- package/dist/modules/forms/frontend/f/[slug]/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/forms/[id]/run/page.js +62 -0
- package/dist/modules/forms/frontend/forms/[id]/run/page.js.map +7 -0
- package/dist/modules/forms/frontend/forms/[id]/run/page.meta.js +11 -0
- package/dist/modules/forms/frontend/forms/[id]/run/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/i/[token]/page.js +12 -0
- package/dist/modules/forms/frontend/i/[token]/page.js.map +7 -0
- package/dist/modules/forms/frontend/i/[token]/page.meta.js +11 -0
- package/dist/modules/forms/frontend/i/[token]/page.meta.js.map +7 -0
- package/dist/modules/forms/index.js +20 -0
- package/dist/modules/forms/index.js.map +7 -0
- package/dist/modules/forms/lib/embed-frame-policy.js +68 -0
- package/dist/modules/forms/lib/embed-frame-policy.js.map +7 -0
- package/dist/modules/forms/lib/form-definition-slicing.js +38 -0
- package/dist/modules/forms/lib/form-definition-slicing.js.map +7 -0
- package/dist/modules/forms/lib/log-redaction.js +38 -0
- package/dist/modules/forms/lib/log-redaction.js.map +7 -0
- package/dist/modules/forms/lib/navigable-url.js +24 -0
- package/dist/modules/forms/lib/navigable-url.js.map +7 -0
- package/dist/modules/forms/lib/retention.js +20 -0
- package/dist/modules/forms/lib/retention.js.map +7 -0
- package/dist/modules/forms/lib/runtime-principal.js +59 -0
- package/dist/modules/forms/lib/runtime-principal.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260508135459_forms.js +17 -0
- package/dist/modules/forms/migrations/Migration20260508135459_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260508140932_forms.js +23 -0
- package/dist/modules/forms/migrations/Migration20260508140932_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260508155737_forms.js +15 -0
- package/dist/modules/forms/migrations/Migration20260508155737_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260520120000_forms.js +23 -0
- package/dist/modules/forms/migrations/Migration20260520120000_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260521090000_forms.js +13 -0
- package/dist/modules/forms/migrations/Migration20260521090000_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260521120000_forms.js +17 -0
- package/dist/modules/forms/migrations/Migration20260521120000_forms.js.map +7 -0
- package/dist/modules/forms/runner/FormRunner.js +786 -0
- package/dist/modules/forms/runner/FormRunner.js.map +7 -0
- package/dist/modules/forms/runner/MatrixField.js +150 -0
- package/dist/modules/forms/runner/MatrixField.js.map +7 -0
- package/dist/modules/forms/runner/RankingField.js +131 -0
- package/dist/modules/forms/runner/RankingField.js.map +7 -0
- package/dist/modules/forms/runner/ScaleField.js +78 -0
- package/dist/modules/forms/runner/ScaleField.js.map +7 -0
- package/dist/modules/forms/runner/SignatureField.js +132 -0
- package/dist/modules/forms/runner/SignatureField.js.map +7 -0
- package/dist/modules/forms/runner/tamper-check.js +85 -0
- package/dist/modules/forms/runner/tamper-check.js.map +7 -0
- package/dist/modules/forms/schema/address-countries.js +43 -0
- package/dist/modules/forms/schema/address-countries.js.map +7 -0
- package/dist/modules/forms/schema/field-type-patterns.js +15 -0
- package/dist/modules/forms/schema/field-type-patterns.js.map +7 -0
- package/dist/modules/forms/schema/field-type-registry-advanced.js +32 -0
- package/dist/modules/forms/schema/field-type-registry-advanced.js.map +7 -0
- package/dist/modules/forms/schema/field-type-registry.js +625 -0
- package/dist/modules/forms/schema/field-type-registry.js.map +7 -0
- package/dist/modules/forms/schema/file-field.js +64 -0
- package/dist/modules/forms/schema/file-field.js.map +7 -0
- package/dist/modules/forms/schema/group-field.js +143 -0
- package/dist/modules/forms/schema/group-field.js.map +7 -0
- package/dist/modules/forms/schema/jsonlogic-grammar.js +66 -0
- package/dist/modules/forms/schema/jsonlogic-grammar.js.map +7 -0
- package/dist/modules/forms/schema/jsonschema-extensions.js +739 -0
- package/dist/modules/forms/schema/jsonschema-extensions.js.map +7 -0
- package/dist/modules/forms/schema/layout-catalog.js +38 -0
- package/dist/modules/forms/schema/layout-catalog.js.map +7 -0
- package/dist/modules/forms/schema/signature-field.js +67 -0
- package/dist/modules/forms/schema/signature-field.js.map +7 -0
- package/dist/modules/forms/schema/style-extensions.js +77 -0
- package/dist/modules/forms/schema/style-extensions.js.map +7 -0
- package/dist/modules/forms/schema/style-validators.js +181 -0
- package/dist/modules/forms/schema/style-validators.js.map +7 -0
- package/dist/modules/forms/services/access-audit-logger.js +179 -0
- package/dist/modules/forms/services/access-audit-logger.js.map +7 -0
- package/dist/modules/forms/services/analytics-service.js +306 -0
- package/dist/modules/forms/services/analytics-service.js.map +7 -0
- package/dist/modules/forms/services/anonymize-service.js +123 -0
- package/dist/modules/forms/services/anonymize-service.js.map +7 -0
- package/dist/modules/forms/services/attachment-service.js +123 -0
- package/dist/modules/forms/services/attachment-service.js.map +7 -0
- package/dist/modules/forms/services/captcha-verifier.js +76 -0
- package/dist/modules/forms/services/captcha-verifier.js.map +7 -0
- package/dist/modules/forms/services/consent-record-service.js +96 -0
- package/dist/modules/forms/services/consent-record-service.js.map +7 -0
- package/dist/modules/forms/services/distribution-service.js +366 -0
- package/dist/modules/forms/services/distribution-service.js.map +7 -0
- package/dist/modules/forms/services/distribution-token.js +93 -0
- package/dist/modules/forms/services/distribution-token.js.map +7 -0
- package/dist/modules/forms/services/encryption-service.js +328 -0
- package/dist/modules/forms/services/encryption-service.js.map +7 -0
- package/dist/modules/forms/services/export-service.js +210 -0
- package/dist/modules/forms/services/export-service.js.map +7 -0
- package/dist/modules/forms/services/field-validation-service.js +168 -0
- package/dist/modules/forms/services/field-validation-service.js.map +7 -0
- package/dist/modules/forms/services/form-logic-evaluator.js +517 -0
- package/dist/modules/forms/services/form-logic-evaluator.js.map +7 -0
- package/dist/modules/forms/services/form-version-compiler.js +518 -0
- package/dist/modules/forms/services/form-version-compiler.js.map +7 -0
- package/dist/modules/forms/services/form-version-differ.js +89 -0
- package/dist/modules/forms/services/form-version-differ.js.map +7 -0
- package/dist/modules/forms/services/jsonlogic-evaluator.js +171 -0
- package/dist/modules/forms/services/jsonlogic-evaluator.js.map +7 -0
- package/dist/modules/forms/services/pdf-snapshot-service.js +526 -0
- package/dist/modules/forms/services/pdf-snapshot-service.js.map +7 -0
- package/dist/modules/forms/services/prefill-resolver.js +53 -0
- package/dist/modules/forms/services/prefill-resolver.js.map +7 -0
- package/dist/modules/forms/services/role-policy-service.js +55 -0
- package/dist/modules/forms/services/role-policy-service.js.map +7 -0
- package/dist/modules/forms/services/style-compiler.js +234 -0
- package/dist/modules/forms/services/style-compiler.js.map +7 -0
- package/dist/modules/forms/services/submission-service.js +858 -0
- package/dist/modules/forms/services/submission-service.js.map +7 -0
- package/dist/modules/forms/services/upload-scanner.js +9 -0
- package/dist/modules/forms/services/upload-scanner.js.map +7 -0
- package/dist/modules/forms/services/upload-validation.js +54 -0
- package/dist/modules/forms/services/upload-validation.js.map +7 -0
- package/dist/modules/forms/services/visibility-resolver.js +30 -0
- package/dist/modules/forms/services/visibility-resolver.js.map +7 -0
- package/dist/modules/forms/setup.js +18 -0
- package/dist/modules/forms/setup.js.map +7 -0
- package/dist/modules/forms/subscribers/forms-consent-projector.js +58 -0
- package/dist/modules/forms/subscribers/forms-consent-projector.js.map +7 -0
- package/dist/modules/forms/subscribers/forms-pdf-snapshot.js +68 -0
- package/dist/modules/forms/subscribers/forms-pdf-snapshot.js.map +7 -0
- package/dist/modules/forms/subscribers/forms-webhook-bridge-anonymized.js +29 -0
- package/dist/modules/forms/subscribers/forms-webhook-bridge-anonymized.js.map +7 -0
- package/dist/modules/forms/subscribers/forms-webhook-bridge.js +35 -0
- package/dist/modules/forms/subscribers/forms-webhook-bridge.js.map +7 -0
- package/dist/modules/forms/subscribers/invitation-email.js +100 -0
- package/dist/modules/forms/subscribers/invitation-email.js.map +7 -0
- package/dist/modules/forms/translations.js +10 -0
- package/dist/modules/forms/translations.js.map +7 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/CreateDistributionDialog.js +376 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/CreateDistributionDialog.js.map +7 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/DistributionsPanel.js +313 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/DistributionsPanel.js.map +7 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/EmbedSettingsDialog.js +263 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/EmbedSettingsDialog.js.map +7 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/RecipientsTable.js +373 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/RecipientsTable.js.map +7 -0
- package/dist/modules/forms/ui/public/EmbeddedForm.js +166 -0
- package/dist/modules/forms/ui/public/EmbeddedForm.js.map +7 -0
- package/dist/modules/forms/ui/public/FormRunner.js +359 -0
- package/dist/modules/forms/ui/public/FormRunner.js.map +7 -0
- package/dist/modules/forms/ui/public/FormTrigger.js +45 -0
- package/dist/modules/forms/ui/public/FormTrigger.js.map +7 -0
- package/dist/modules/forms/ui/public/PublicFormRunnerPage.js +14 -0
- package/dist/modules/forms/ui/public/PublicFormRunnerPage.js.map +7 -0
- package/dist/modules/forms/ui/public/components/CompletionScreen.js +55 -0
- package/dist/modules/forms/ui/public/components/CompletionScreen.js.map +7 -0
- package/dist/modules/forms/ui/public/components/LocaleSwitch.js +28 -0
- package/dist/modules/forms/ui/public/components/LocaleSwitch.js.map +7 -0
- package/dist/modules/forms/ui/public/components/ResumeGate.js +52 -0
- package/dist/modules/forms/ui/public/components/ResumeGate.js.map +7 -0
- package/dist/modules/forms/ui/public/components/ReviewStep.js +90 -0
- package/dist/modules/forms/ui/public/components/ReviewStep.js.map +7 -0
- package/dist/modules/forms/ui/public/components/SaveIndicator.js +65 -0
- package/dist/modules/forms/ui/public/components/SaveIndicator.js.map +7 -0
- package/dist/modules/forms/ui/public/components/SectionStepper.js +52 -0
- package/dist/modules/forms/ui/public/components/SectionStepper.js.map +7 -0
- package/dist/modules/forms/ui/public/index.js +38 -0
- package/dist/modules/forms/ui/public/index.js.map +7 -0
- package/dist/modules/forms/ui/public/renderers/index.js +737 -0
- package/dist/modules/forms/ui/public/renderers/index.js.map +7 -0
- package/dist/modules/forms/ui/public/state/logic-derivation.js +42 -0
- package/dist/modules/forms/ui/public/state/logic-derivation.js.map +7 -0
- package/dist/modules/forms/ui/public/state/runtime-client.js +306 -0
- package/dist/modules/forms/ui/public/state/runtime-client.js.map +7 -0
- package/dist/modules/forms/ui/public/state/useAutosave.js +64 -0
- package/dist/modules/forms/ui/public/state/useAutosave.js.map +7 -0
- package/dist/modules/forms/ui/public/state/useFormRunner.js +394 -0
- package/dist/modules/forms/ui/public/state/useFormRunner.js.map +7 -0
- package/dist/modules/forms/ui/public/style/LogoHeader.js +33 -0
- package/dist/modules/forms/ui/public/style/LogoHeader.js.map +7 -0
- package/dist/modules/forms/ui/public/style/applyStyle.js +12 -0
- package/dist/modules/forms/ui/public/style/applyStyle.js.map +7 -0
- package/dist/modules/forms/ui/public/types.js +18 -0
- package/dist/modules/forms/ui/public/types.js.map +7 -0
- package/dist/modules/forms/widgets/injection/access-audit-panel/widget.js +100 -0
- package/dist/modules/forms/widgets/injection/access-audit-panel/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection/anonymize-button/widget.js +148 -0
- package/dist/modules/forms/widgets/injection/anonymize-button/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection/audit-format.js +33 -0
- package/dist/modules/forms/widgets/injection/audit-format.js.map +7 -0
- package/dist/modules/forms/widgets/injection/context.js +5 -0
- package/dist/modules/forms/widgets/injection/context.js.map +7 -0
- package/dist/modules/forms/widgets/injection/embedded-form/widget.js +52 -0
- package/dist/modules/forms/widgets/injection/embedded-form/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection/pdf-download-button/widget.js +83 -0
- package/dist/modules/forms/widgets/injection/pdf-download-button/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection/self-audit-footer/widget.js +38 -0
- package/dist/modules/forms/widgets/injection/self-audit-footer/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection-table.js +32 -0
- package/dist/modules/forms/widgets/injection-table.js.map +7 -0
- package/dist/modules/forms/workers/pdf-snapshot.js +60 -0
- package/dist/modules/forms/workers/pdf-snapshot.js.map +7 -0
- package/dist/modules/forms/workers/retention-purge.js +112 -0
- package/dist/modules/forms/workers/retention-purge.js.map +7 -0
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js +7 -1
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js.map +2 -2
- package/dist/modules/inbox_ops/data/validators.js +2 -2
- package/dist/modules/inbox_ops/data/validators.js.map +2 -2
- package/dist/modules/inbox_ops/lib/llmProvider.js +5 -1
- package/dist/modules/inbox_ops/lib/llmProvider.js.map +2 -2
- package/dist/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.js +2 -2
- package/dist/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.js.map +2 -2
- package/dist/modules/integrations/di.js +3 -1
- package/dist/modules/integrations/di.js.map +2 -2
- package/dist/modules/integrations/lib/credentials-service.js +29 -36
- package/dist/modules/integrations/lib/credentials-service.js.map +2 -2
- package/dist/modules/messages/api/[id]/attachments/route.js +7 -3
- package/dist/modules/messages/api/[id]/attachments/route.js.map +2 -2
- package/dist/modules/messages/api/[id]/forward-preview/route.js +4 -3
- package/dist/modules/messages/api/[id]/forward-preview/route.js.map +2 -2
- package/dist/modules/messages/api/[id]/route.js +29 -3
- package/dist/modules/messages/api/[id]/route.js.map +2 -2
- package/dist/modules/messages/api/route.js +91 -2
- package/dist/modules/messages/api/route.js.map +2 -2
- package/dist/modules/messages/commands/messages.js +40 -6
- package/dist/modules/messages/commands/messages.js.map +2 -2
- package/dist/modules/messages/components/ComposeMessagePageClient.js +24 -1
- package/dist/modules/messages/components/ComposeMessagePageClient.js.map +2 -2
- package/dist/modules/messages/data/validators.js +11 -1
- package/dist/modules/messages/data/validators.js.map +2 -2
- package/dist/modules/messages/lib/channelThreadAccess.js +30 -0
- package/dist/modules/messages/lib/channelThreadAccess.js.map +7 -0
- package/dist/modules/messages/lib/composeSenderDelegation.js +87 -0
- package/dist/modules/messages/lib/composeSenderDelegation.js.map +7 -0
- package/dist/modules/messages/lib/composeSenderOptions.js +24 -0
- package/dist/modules/messages/lib/composeSenderOptions.js.map +7 -0
- package/dist/modules/messages/lib/email-sender.js +1 -11
- package/dist/modules/messages/lib/email-sender.js.map +2 -2
- package/dist/modules/messages/lib/forwarding.js +4 -4
- package/dist/modules/messages/lib/forwarding.js.map +2 -2
- package/dist/modules/messages/lib/markdownEmailBody.js +15 -0
- package/dist/modules/messages/lib/markdownEmailBody.js.map +7 -0
- package/dist/modules/messages/lib/messageSourceEntityTypes.js +7 -0
- package/dist/modules/messages/lib/messageSourceEntityTypes.js.map +7 -0
- package/dist/modules/messages/lib/routeHelpers.js +43 -0
- package/dist/modules/messages/lib/routeHelpers.js.map +2 -2
- package/dist/modules/messages/subscribers/message-notification.js +30 -1
- package/dist/modules/messages/subscribers/message-notification.js.map +2 -2
- package/dist/modules/notifications/api/[id]/action/route.js +2 -1
- package/dist/modules/notifications/api/[id]/action/route.js.map +2 -2
- package/dist/modules/notifications/api/openapi.js +2 -1
- package/dist/modules/notifications/api/openapi.js.map +2 -2
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js +47 -28
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js.map +2 -2
- package/dist/modules/notifications/lib/deliveryConfig.js +27 -2
- package/dist/modules/notifications/lib/deliveryConfig.js.map +2 -2
- package/dist/modules/notifications/lib/notificationMapper.js +3 -1
- package/dist/modules/notifications/lib/notificationMapper.js.map +2 -2
- package/dist/modules/notifications/lib/safeHref.js +4 -0
- package/dist/modules/notifications/lib/safeHref.js.map +2 -2
- package/dist/modules/planner/api/availability-date-specific.js +2 -1
- package/dist/modules/planner/api/availability-date-specific.js.map +2 -2
- package/dist/modules/planner/api/availability-weekly.js +2 -1
- package/dist/modules/planner/api/availability-weekly.js.map +2 -2
- package/dist/modules/progress/api/active/route.js +14 -2
- package/dist/modules/progress/api/active/route.js.map +2 -2
- package/dist/modules/progress/api/jobs/[id]/route.js +38 -22
- package/dist/modules/progress/api/jobs/[id]/route.js.map +2 -2
- package/dist/modules/progress/api/jobs/route.js +20 -6
- package/dist/modules/progress/api/jobs/route.js.map +2 -2
- package/dist/modules/progress/api/requestScope.js +32 -0
- package/dist/modules/progress/api/requestScope.js.map +7 -0
- package/dist/modules/progress/lib/organizationScope.js +10 -0
- package/dist/modules/progress/lib/organizationScope.js.map +7 -0
- package/dist/modules/progress/lib/progressService.js.map +2 -2
- package/dist/modules/progress/lib/progressServiceImpl.js +48 -15
- package/dist/modules/progress/lib/progressServiceImpl.js.map +2 -2
- package/dist/modules/push_notifications/api/custom-send/route.js +4 -1
- package/dist/modules/push_notifications/api/custom-send/route.js.map +2 -2
- package/dist/modules/query_index/api/status.js +5 -3
- package/dist/modules/query_index/api/status.js.map +2 -2
- package/dist/modules/query_index/di.js +2 -1
- package/dist/modules/query_index/di.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +2 -1
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/query_index/lib/request-encryption.js +16 -0
- package/dist/modules/query_index/lib/request-encryption.js.map +7 -0
- package/dist/modules/query_index/lib/search-tokens.js +31 -1
- package/dist/modules/query_index/lib/search-tokens.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/assign/route.js +2 -1
- package/dist/modules/resources/api/resources/tags/assign/route.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/unassign/route.js +2 -1
- package/dist/modules/resources/api/resources/tags/unassign/route.js.map +2 -2
- package/dist/modules/resources/commands/activities.js +2 -2
- package/dist/modules/resources/commands/activities.js.map +2 -2
- package/dist/modules/sales/api/document-history/route.js +5 -1
- package/dist/modules/sales/api/document-history/route.js.map +2 -2
- package/dist/modules/sales/api/document-numbers/route.js +2 -1
- package/dist/modules/sales/api/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/convert/route.js +2 -1
- package/dist/modules/sales/api/quotes/convert/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/send/route.js +2 -1
- package/dist/modules/sales/api/quotes/send/route.js.map +2 -2
- package/dist/modules/sales/api/settings/document-numbers/route.js +7 -1
- package/dist/modules/sales/api/settings/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/settings/order-editing/route.js +7 -1
- package/dist/modules/sales/api/settings/order-editing/route.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +354 -138
- package/dist/modules/sales/commands/documents.js.map +3 -3
- package/dist/modules/sales/commands/payments.js +2 -1
- package/dist/modules/sales/commands/payments.js.map +2 -2
- package/dist/modules/sales/commands/settings.js +25 -5
- package/dist/modules/sales/commands/settings.js.map +2 -2
- package/dist/modules/sales/commands/shipments.js +2 -1
- package/dist/modules/sales/commands/shipments.js.map +2 -2
- package/dist/modules/sales/components/DocumentNumberSettings.js +32 -21
- package/dist/modules/sales/components/DocumentNumberSettings.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +49 -11
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +159 -81
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/lineItemUtils.js +7 -0
- package/dist/modules/sales/components/documents/lineItemUtils.js.map +2 -2
- package/dist/modules/sales/lib/lineSnapshots.js +19 -0
- package/dist/modules/sales/lib/lineSnapshots.js.map +2 -2
- package/dist/modules/sales/setup.js +4 -4
- package/dist/modules/sales/setup.js.map +2 -2
- package/dist/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.js +2 -2
- package/dist/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.js.map +2 -2
- package/dist/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.js +2 -2
- package/dist/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +2 -1
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +2 -1
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests.js +2 -1
- package/dist/modules/staff/api/leave-requests.js.map +2 -2
- package/dist/modules/staff/api/team-members/self/route.js +2 -1
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +2 -1
- package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/unassign/route.js +2 -1
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js +12 -11
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js +2 -1
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/route.js +2 -1
- package/dist/modules/staff/api/timesheets/my-projects/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-work/route.js +2 -1
- package/dist/modules/staff/api/timesheets/my-work/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js +2 -1
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js +2 -1
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js +3 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js +3 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js +3 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/preview/route.js +2 -1
- package/dist/modules/staff/api/timesheets/reports/preview/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/shared.js +2 -1
- package/dist/modules/staff/api/timesheets/reports/shared.js.map +2 -2
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js +2 -1
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js +2 -1
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js +2 -1
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js +2 -1
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js +2 -1
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js +3 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js +3 -2
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js +3 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js +3 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-projects/route.js.map +2 -2
- package/dist/modules/staff/commands/activities.js +2 -2
- package/dist/modules/staff/commands/activities.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-entries.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-reports.js +55 -14
- package/dist/modules/staff/commands/timesheets-reports.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js +2 -1
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js +32 -3
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-reports/reportPeriod.js +16 -0
- package/dist/modules/staff/lib/timesheets-reports/reportPeriod.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/CalendarPicker.js +15 -10
- package/dist/modules/staff/lib/timesheets-ui/CalendarPicker.js.map +2 -2
- package/dist/modules/sync_excel/api/import/route.js +35 -12
- package/dist/modules/sync_excel/api/import/route.js.map +2 -2
- package/dist/modules/sync_excel/api/upload/route.js +29 -4
- package/dist/modules/sync_excel/api/upload/route.js.map +2 -2
- package/dist/modules/translations/api/context.js +2 -1
- package/dist/modules/translations/api/context.js.map +2 -2
- package/dist/modules/warranty_claims/api/ai/assess/route.js +2 -1
- package/dist/modules/warranty_claims/api/ai/assess/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/ai/draft-reply/route.js +2 -1
- package/dist/modules/warranty_claims/api/ai/draft-reply/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/ai/suggest/route.js +2 -1
- package/dist/modules/warranty_claims/api/ai/suggest/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/assign/route.js +2 -1
- package/dist/modules/warranty_claims/api/assign/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/credit-memo/route.js +2 -1
- package/dist/modules/warranty_claims/api/credit-memo/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/entitlement/route.js +2 -1
- package/dist/modules/warranty_claims/api/entitlement/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/events/route.js +2 -1
- package/dist/modules/warranty_claims/api/events/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/external/claims/route.js +2 -1
- package/dist/modules/warranty_claims/api/external/claims/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/receiving/route.js +2 -1
- package/dist/modules/warranty_claims/api/receiving/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/replacement-order/route.js +2 -1
- package/dist/modules/warranty_claims/api/replacement-order/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/return-label/route.js +2 -1
- package/dist/modules/warranty_claims/api/return-label/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/risk/route.js +2 -1
- package/dist/modules/warranty_claims/api/risk/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/sales-return/route.js +2 -1
- package/dist/modules/warranty_claims/api/sales-return/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/settings-general/route.js +2 -1
- package/dist/modules/warranty_claims/api/settings-general/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/stats/route.js +9 -5
- package/dist/modules/warranty_claims/api/stats/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/submit/route.js +2 -1
- package/dist/modules/warranty_claims/api/submit/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/transition/route.js +2 -1
- package/dist/modules/warranty_claims/api/transition/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/vendor-recovery/route.js +2 -1
- package/dist/modules/warranty_claims/api/vendor-recovery/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/vendor-recovery-suggestions/route.js +2 -1
- package/dist/modules/warranty_claims/api/vendor-recovery-suggestions/route.js.map +2 -2
- package/dist/modules/warranty_claims/widgets/notifications/WarrantyClaimNotificationRenderer.js +1 -1
- package/dist/modules/warranty_claims/widgets/notifications/WarrantyClaimNotificationRenderer.js.map +2 -2
- package/dist/modules/wms/api/dashboard/operational/route.js +2 -1
- package/dist/modules/wms/api/dashboard/operational/route.js.map +2 -2
- package/dist/modules/wms/api/inventory/cycle-count/route.js +1 -0
- package/dist/modules/wms/api/inventory/cycle-count/route.js.map +2 -2
- package/dist/modules/wms/api/inventory/helpers.js +2 -1
- package/dist/modules/wms/api/inventory/helpers.js.map +2 -2
- package/dist/modules/wms/api/inventory/import/helpers.js +2 -1
- package/dist/modules/wms/api/inventory/import/helpers.js.map +2 -2
- package/dist/modules/wms/api/sales-orders/[salesOrderId]/warehouse-assignment/route.js +2 -1
- package/dist/modules/wms/api/sales-orders/[salesOrderId]/warehouse-assignment/route.js.map +2 -2
- package/dist/modules/wms/commands/inventory-actions.js +39 -1
- package/dist/modules/wms/commands/inventory-actions.js.map +2 -2
- package/dist/modules/wms/components/backend/CycleCountWizardDialog.js +14 -1
- package/dist/modules/wms/components/backend/CycleCountWizardDialog.js.map +2 -2
- package/dist/modules/wms/di.js +5 -0
- package/dist/modules/wms/di.js.map +2 -2
- package/dist/modules/wms/lib/availabilityCache.js +86 -0
- package/dist/modules/wms/lib/availabilityCache.js.map +7 -0
- package/dist/modules/wms/lib/availabilityCalculation.js +212 -0
- package/dist/modules/wms/lib/availabilityCalculation.js.map +7 -0
- package/dist/modules/wms/lib/availabilityProvider.js +24 -0
- package/dist/modules/wms/lib/availabilityProvider.js.map +7 -0
- package/dist/modules/wms/lib/loadOperationalDashboard.js +42 -5
- package/dist/modules/wms/lib/loadOperationalDashboard.js.map +2 -2
- package/dist/modules/wms/lib/lowStockBalanceFilter.js +23 -10
- package/dist/modules/wms/lib/lowStockBalanceFilter.js.map +2 -2
- package/dist/modules/wms/lib/sqlInClause.js +9 -0
- package/dist/modules/wms/lib/sqlInClause.js.map +7 -0
- package/dist/modules/wms/lib/tryResolve.js +11 -0
- package/dist/modules/wms/lib/tryResolve.js.map +7 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache-policy.js +14 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache-policy.js.map +7 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache-profile.js +14 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache-profile.js.map +7 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache.js +16 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache.js.map +7 -0
- package/dist/modules/wms/widgets/notifications/WmsLowStockRenderer.js +2 -2
- package/dist/modules/wms/widgets/notifications/WmsLowStockRenderer.js.map +2 -2
- package/dist/modules/wms/widgets/notifications/WmsReservationShortfallRenderer.js +4 -3
- package/dist/modules/wms/widgets/notifications/WmsReservationShortfallRenderer.js.map +2 -2
- package/dist/modules/workflows/api/commands/route.js +4 -1
- package/dist/modules/workflows/api/commands/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/callers/route.js +4 -1
- package/dist/modules/workflows/api/definitions/[id]/callers/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/context-schema/route.js +4 -2
- package/dist/modules/workflows/api/definitions/[id]/context-schema/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js +4 -1
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/draft/route.js +6 -1
- package/dist/modules/workflows/api/definitions/[id]/draft/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/publish/route.js +6 -1
- package/dist/modules/workflows/api/definitions/[id]/publish/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js +4 -1
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/route.js +5 -3
- package/dist/modules/workflows/api/definitions/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/test-step/route.js +4 -2
- package/dist/modules/workflows/api/definitions/[id]/test-step/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/generate/route.js +4 -1
- package/dist/modules/workflows/api/definitions/generate/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/route.js +4 -2
- package/dist/modules/workflows/api/definitions/route.js.map +2 -2
- package/dist/modules/workflows/api/endpoints/route.js +4 -1
- package/dist/modules/workflows/api/endpoints/route.js.map +2 -2
- package/dist/modules/workflows/api/functions/route.js +4 -1
- package/dist/modules/workflows/api/functions/route.js.map +2 -2
- package/dist/modules/workflows/api/grantable-features/route.js +2 -1
- package/dist/modules/workflows/api/grantable-features/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/advance/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/advance/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/cancel/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/cancel/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/context/route.js +2 -1
- package/dist/modules/workflows/api/instances/[id]/context/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/rerun-step/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/rerun-step/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/retry/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/retry/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/signal/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/signal/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/step-through/route.js +4 -2
- package/dist/modules/workflows/api/instances/[id]/step-through/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/route.js +4 -2
- package/dist/modules/workflows/api/instances/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/validate-start/route.js +4 -1
- package/dist/modules/workflows/api/instances/validate-start/route.js.map +2 -2
- package/dist/modules/workflows/api/rule-usage/route.js +4 -1
- package/dist/modules/workflows/api/rule-usage/route.js.map +2 -2
- package/dist/modules/workflows/api/signals/route.js +4 -1
- package/dist/modules/workflows/api/signals/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js +4 -1
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js +4 -1
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/reassign/route.js +2 -1
- package/dist/modules/workflows/api/tasks/[id]/reassign/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/unclaim/route.js +4 -1
- package/dist/modules/workflows/api/tasks/[id]/unclaim/route.js.map +2 -2
- package/dist/modules/workflows/api/templates/route.js +4 -1
- package/dist/modules/workflows/api/templates/route.js.map +2 -2
- package/dist/modules/workflows/api/work-inbox/next/route.js +4 -1
- package/dist/modules/workflows/api/work-inbox/next/route.js.map +2 -2
- package/dist/modules/workflows/lib/activity-executor.js +87 -20
- package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
- package/dist/modules/workflows/lib/activity-types.js +4 -4
- package/dist/modules/workflows/lib/activity-types.js.map +2 -2
- package/dist/modules/workflows/lib/activity-worker-handler.js +16 -11
- package/dist/modules/workflows/lib/activity-worker-handler.js.map +2 -2
- package/dist/modules/workflows/lib/event-trigger-service.js +8 -1
- package/dist/modules/workflows/lib/event-trigger-service.js.map +2 -2
- package/dist/modules/workflows/lib/step-handler.js +4 -4
- package/dist/modules/workflows/lib/step-handler.js.map +2 -2
- package/dist/test-utils/transactionalEntityManagerDouble.js +37 -0
- package/dist/test-utils/transactionalEntityManagerDouble.js.map +7 -0
- package/generated/entities/availability_policy/index.ts +19 -0
- package/generated/entities/communication_channel/index.ts +1 -0
- package/generated/entities/customer_email_conversation_share/index.ts +9 -0
- package/generated/entities/customer_group/index.ts +15 -0
- package/generated/entities/customer_group_membership/index.ts +13 -0
- package/generated/entities/customer_group_terms/index.ts +15 -0
- package/generated/entities/customer_interaction/index.ts +1 -0
- package/generated/entities/form/index.ts +16 -0
- package/generated/entities/form_access_audit/index.ts +9 -0
- package/generated/entities/form_attachment/index.ts +13 -0
- package/generated/entities/form_consent_record/index.ts +17 -0
- package/generated/entities/form_distribution/index.ts +22 -0
- package/generated/entities/form_invitation/index.ts +23 -0
- package/generated/entities/form_submission/index.ts +18 -0
- package/generated/entities/form_submission_actor/index.ts +10 -0
- package/generated/entities/form_submission_revision/index.ts +13 -0
- package/generated/entities/form_version/index.ts +17 -0
- package/generated/entities/forms_encryption_key/index.ts +6 -0
- package/generated/entities.ids.generated.ts +27 -2
- package/generated/entity-fields-registry.ts +269 -0
- package/package.json +18 -7
- package/src/helpers/integration/communicationChannelsFixtures.ts +43 -0
- package/src/helpers/integration/customerGroupsFixtures.ts +171 -0
- package/src/helpers/integration/formsFixtures.ts +757 -0
- package/src/modules/api_docs/api/get/version.ts +28 -11
- package/src/modules/api_keys/api/keys/route.ts +89 -199
- package/src/modules/api_keys/backend/api-keys/create/page.tsx +2 -2
- package/src/modules/api_keys/commands/keys.ts +172 -0
- package/src/modules/api_keys/i18n/de.json +1 -0
- package/src/modules/api_keys/i18n/en.json +1 -0
- package/src/modules/api_keys/i18n/es.json +1 -0
- package/src/modules/api_keys/i18n/ko.json +1 -0
- package/src/modules/api_keys/i18n/pl.json +1 -0
- package/src/modules/api_keys/services/apiKeyService.ts +82 -49
- package/src/modules/attachments/api/file/[id]/route.ts +9 -4
- package/src/modules/attachments/api/image/[id]/[[...slug]]/route.ts +6 -4
- package/src/modules/attachments/api/route.ts +10 -4
- package/src/modules/attachments/components/AttachmentLibrary.tsx +16 -5
- package/src/modules/attachments/lib/access.ts +1 -3
- package/src/modules/attachments/lib/requestScope.ts +35 -3
- package/src/modules/audit_logs/api/audit-logs/actions/export/route.ts +6 -1
- package/src/modules/audit_logs/api/audit-logs/actions/redo/route.ts +41 -6
- package/src/modules/audit_logs/api/audit-logs/actions/route.ts +6 -1
- package/src/modules/audit_logs/api/audit-logs/actions/undo/route.ts +39 -4
- package/src/modules/audit_logs/data/validators.ts +1 -0
- package/src/modules/audit_logs/lib/actorSubject.ts +82 -0
- package/src/modules/audit_logs/lib/replayAuthorization.ts +61 -0
- package/src/modules/audit_logs/services/actionLogService.ts +191 -47
- package/src/modules/auth/api/features.ts +1 -1
- package/src/modules/auth/cli.ts +31 -17
- package/src/modules/auth/commands/acl.ts +26 -36
- package/src/modules/auth/commands/interceptors.ts +23 -0
- package/src/modules/auth/commands/roles.ts +475 -148
- package/src/modules/auth/commands/users.ts +693 -81
- package/src/modules/auth/i18n/de.json +22 -0
- package/src/modules/auth/i18n/en.json +22 -0
- package/src/modules/auth/i18n/es.json +22 -0
- package/src/modules/auth/i18n/ko.json +22 -0
- package/src/modules/auth/i18n/pl.json +22 -0
- package/src/modules/auth/lib/authorizationStateLocks.ts +340 -0
- package/src/modules/auth/lib/commandReplay.ts +194 -0
- package/src/modules/auth/lib/executionPrincipal.ts +36 -28
- package/src/modules/auth/lib/grantChecks.ts +10 -2
- package/src/modules/auth/lib/setup-app.ts +97 -50
- package/src/modules/auth/lib/tokenHash.ts +16 -1
- package/src/modules/auth/services/rbacService.ts +578 -6
- package/src/modules/availability/acl.ts +12 -0
- package/src/modules/availability/api/check/route.ts +136 -0
- package/src/modules/availability/api/openapi.ts +28 -0
- package/src/modules/availability/api/policies/resolve-preview/route.ts +83 -0
- package/src/modules/availability/api/policies/route.ts +244 -0
- package/src/modules/availability/backend/availability/check/page.meta.ts +12 -0
- package/src/modules/availability/backend/availability/check/page.tsx +223 -0
- package/src/modules/availability/backend/availability/policies/ResolutionPreviewPanel.tsx +112 -0
- package/src/modules/availability/backend/availability/policies/ScopeFields.tsx +55 -0
- package/src/modules/availability/backend/availability/policies/StockManagedField.tsx +37 -0
- package/src/modules/availability/backend/availability/policies/[id]/page.meta.ts +8 -0
- package/src/modules/availability/backend/availability/policies/[id]/page.tsx +202 -0
- package/src/modules/availability/backend/availability/policies/create/page.meta.ts +8 -0
- package/src/modules/availability/backend/availability/policies/create/page.tsx +131 -0
- package/src/modules/availability/backend/availability/policies/formGroups.ts +83 -0
- package/src/modules/availability/backend/availability/policies/page.meta.ts +12 -0
- package/src/modules/availability/backend/availability/policies/page.tsx +232 -0
- package/src/modules/availability/backend/availability/policies/policyPayload.ts +29 -0
- package/src/modules/availability/commands/policies.ts +430 -0
- package/src/modules/availability/commands/scope.ts +26 -0
- package/src/modules/availability/data/entities.ts +93 -0
- package/src/modules/availability/data/validators.ts +87 -0
- package/src/modules/availability/di.ts +68 -0
- package/src/modules/availability/events.ts +17 -0
- package/src/modules/availability/i18n/de.json +92 -0
- package/src/modules/availability/i18n/en.json +92 -0
- package/src/modules/availability/i18n/es.json +92 -0
- package/src/modules/availability/i18n/ko.json +92 -0
- package/src/modules/availability/i18n/pl.json +92 -0
- package/src/modules/availability/index.ts +13 -0
- package/src/modules/availability/lib/catalogTarget.ts +72 -0
- package/src/modules/availability/lib/organizationScope.ts +18 -0
- package/src/modules/availability/lib/policyResolution.ts +289 -0
- package/src/modules/availability/lib/tryResolve.ts +8 -0
- package/src/modules/availability/migrations/.snapshot-open-mercato.json +375 -0
- package/src/modules/availability/migrations/Migration20260922095844_availability.ts +13 -0
- package/src/modules/availability/migrations/Migration20260930120000_availability.ts +22 -0
- package/src/modules/availability/setup.ts +10 -0
- package/src/modules/catalog/api/categories/bulk-create/route.ts +119 -0
- package/src/modules/catalog/api/categories/route.ts +70 -8
- package/src/modules/catalog/api/products/bulk-create/route.ts +119 -0
- package/src/modules/catalog/api/products/route.ts +55 -24
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +8 -16
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +16 -10
- package/src/modules/catalog/commands/categories.ts +1 -0
- package/src/modules/catalog/commands/productDeleteChildren.ts +557 -0
- package/src/modules/catalog/commands/products.ts +69 -24
- package/src/modules/catalog/components/PriceKindSettings.tsx +6 -20
- package/src/modules/catalog/components/products/ProductUomSection.tsx +26 -37
- package/src/modules/catalog/components/products/productForm.ts +6 -4
- package/src/modules/catalog/data/validators.ts +22 -0
- package/src/modules/catalog/di.ts +2 -1
- package/src/modules/catalog/events.ts +9 -3
- package/src/modules/catalog/i18n/de.json +40 -0
- package/src/modules/catalog/i18n/en.json +40 -0
- package/src/modules/catalog/i18n/es.json +40 -0
- package/src/modules/catalog/i18n/ko.json +40 -0
- package/src/modules/catalog/i18n/pl.json +40 -0
- package/src/modules/catalog/lib/bulkCreateCategories.ts +349 -0
- package/src/modules/catalog/lib/bulkCreateCheckpoint.ts +176 -0
- package/src/modules/catalog/lib/bulkCreateMutationGuards.ts +62 -0
- package/src/modules/catalog/lib/bulkCreateProducts.ts +340 -0
- package/src/modules/catalog/lib/bulkDelete.ts +10 -14
- package/src/modules/catalog/lib/catalogQueue.ts +14 -0
- package/src/modules/catalog/lib/currencyOptions.ts +28 -0
- package/src/modules/catalog/lib/productSearch.ts +16 -0
- package/src/modules/catalog/lib/seeds.ts +2 -43
- package/src/modules/catalog/lib/unitLabels.ts +52 -0
- package/src/modules/catalog/migrations/Migration20260914120000.ts +51 -0
- package/src/modules/catalog/migrations/Migration20260914120100.ts +50 -0
- package/src/modules/catalog/workers/catalog-category-bulk-create.ts +48 -0
- package/src/modules/catalog/workers/catalog-product-bulk-create.ts +48 -0
- package/src/modules/communication_channels/acl.ts +8 -0
- package/src/modules/communication_channels/api/get/me/channels/route.ts +4 -0
- package/src/modules/communication_channels/api/get/oauth/[provider]/callback/route.ts +23 -0
- package/src/modules/communication_channels/api/post/channels/[id]/import-history/route.ts +3 -4
- package/src/modules/communication_channels/api/post/channels/[id]/test-send/route.ts +9 -1
- package/src/modules/communication_channels/api/post/channels/connect/credentials/route.ts +4 -6
- package/src/modules/communication_channels/api/post/channels/connect/tenant-credentials/route.ts +4 -6
- package/src/modules/communication_channels/api/post/test-seed/route.ts +109 -24
- package/src/modules/communication_channels/api/put/channels/[id]/visibility/route.ts +165 -0
- package/src/modules/communication_channels/backend/profile/communication-channels/page.tsx +247 -129
- package/src/modules/communication_channels/commands/ingest-inbound-message.ts +2 -1
- package/src/modules/communication_channels/commands/set-channel-visibility.ts +138 -0
- package/src/modules/communication_channels/data/enrichers.ts +42 -19
- package/src/modules/communication_channels/data/entities.ts +21 -0
- package/src/modules/communication_channels/di.ts +9 -0
- package/src/modules/communication_channels/events.ts +7 -0
- package/src/modules/communication_channels/i18n/de.json +16 -3
- package/src/modules/communication_channels/i18n/en.json +16 -3
- package/src/modules/communication_channels/i18n/es.json +16 -3
- package/src/modules/communication_channels/i18n/ko.json +16 -3
- package/src/modules/communication_channels/i18n/pl.json +16 -3
- package/src/modules/communication_channels/index.ts +1 -1
- package/src/modules/communication_channels/lib/access-control.ts +4 -1
- package/src/modules/communication_channels/lib/adapter.ts +16 -6
- package/src/modules/communication_channels/lib/channel-thread-access.ts +133 -0
- package/src/modules/communication_channels/lib/credential-refresh.ts +27 -5
- package/src/modules/communication_channels/lib/inbound-message-origin.ts +62 -0
- package/src/modules/communication_channels/lib/oauth-state.ts +96 -1
- package/src/modules/communication_channels/lib/outbound-delivery-intent.ts +57 -0
- package/src/modules/communication_channels/lib/send-as-user.ts +2 -2
- package/src/modules/communication_channels/migrations/.snapshot-open-mercato.json +18 -1
- package/src/modules/communication_channels/migrations/Migration20260825141000_communication_channels.ts +22 -0
- package/src/modules/communication_channels/setup.ts +4 -0
- package/src/modules/communication_channels/subscribers/outbound-bridge.ts +34 -9
- package/src/modules/communication_channels/workers/gmail-history-sync.ts +1 -1
- package/src/modules/communication_channels/workers/poll-channel.ts +1 -1
- package/src/modules/communication_channels/workers/reaction-processor.ts +2 -2
- package/src/modules/configs/api/upgrade-actions/route.ts +2 -1
- package/src/modules/configs/cli.ts +2 -2
- package/src/modules/configs/i18n/de.json +2 -0
- package/src/modules/configs/i18n/en.json +2 -0
- package/src/modules/configs/i18n/es.json +2 -0
- package/src/modules/configs/i18n/ko.json +2 -0
- package/src/modules/configs/i18n/pl.json +2 -0
- package/src/modules/configs/lib/upgrade-actions.ts +29 -6
- package/src/modules/configs/services/upgradeActionsService.ts +45 -30
- package/src/modules/currencies/api/currencies/route.ts +11 -5
- package/src/modules/currencies/api/exchange-rates/route.ts +11 -5
- package/src/modules/customer_groups/acl.ts +10 -0
- package/src/modules/customer_groups/api/customer-groups/[id]/terms/route.ts +355 -0
- package/src/modules/customer_groups/api/customer-groups/crud.ts +627 -0
- package/src/modules/customer_groups/api/customer-groups/explain-terms/route.ts +195 -0
- package/src/modules/customer_groups/api/customer-groups/memberships/crud.ts +525 -0
- package/src/modules/customer_groups/api/customer-groups/memberships/route.ts +65 -0
- package/src/modules/customer_groups/api/customer-groups/reconcile/adopt/route.ts +150 -0
- package/src/modules/customer_groups/api/customer-groups/reconcile/route.ts +90 -0
- package/src/modules/customer_groups/api/customer-groups/reorder/route.ts +147 -0
- package/src/modules/customer_groups/api/customer-groups/route.ts +65 -0
- package/src/modules/customer_groups/api/openapi.ts +28 -0
- package/src/modules/customer_groups/backend/customer-groups/[id]/edit/page.meta.ts +12 -0
- package/src/modules/customer_groups/backend/customer-groups/[id]/edit/page.tsx +392 -0
- package/src/modules/customer_groups/backend/customer-groups/create/page.meta.ts +25 -0
- package/src/modules/customer_groups/backend/customer-groups/create/page.tsx +279 -0
- package/src/modules/customer_groups/backend/customer-groups/orphans/page.meta.ts +12 -0
- package/src/modules/customer_groups/backend/customer-groups/orphans/page.tsx +216 -0
- package/src/modules/customer_groups/backend/customer-groups/page.meta.ts +11 -0
- package/src/modules/customer_groups/backend/customer-groups/page.tsx +478 -0
- package/src/modules/customer_groups/cli.ts +87 -0
- package/src/modules/customer_groups/commands/reorderGroups.ts +163 -0
- package/src/modules/customer_groups/components/CustomerGroupDefaultField.tsx +55 -0
- package/src/modules/customer_groups/components/CustomerGroupParentField.tsx +194 -0
- package/src/modules/customer_groups/components/CustomerGroupTermsPriceKindField.tsx +111 -0
- package/src/modules/customer_groups/components/CustomerGroupTermsSection.tsx +273 -0
- package/src/modules/customer_groups/components/GroupPickerField.tsx +142 -0
- package/src/modules/customer_groups/components/OrphanBanner.tsx +92 -0
- package/src/modules/customer_groups/components/customerGroupTree.ts +84 -0
- package/src/modules/customer_groups/data/entities.ts +244 -0
- package/src/modules/customer_groups/data/validators.ts +232 -0
- package/src/modules/customer_groups/di.ts +25 -0
- package/src/modules/customer_groups/events.ts +22 -0
- package/src/modules/customer_groups/i18n/de.json +199 -0
- package/src/modules/customer_groups/i18n/en.json +199 -0
- package/src/modules/customer_groups/i18n/es.json +199 -0
- package/src/modules/customer_groups/i18n/ko.json +199 -0
- package/src/modules/customer_groups/i18n/pl.json +199 -0
- package/src/modules/customer_groups/index.ts +13 -0
- package/src/modules/customer_groups/lib/createConflictRecheck.ts +39 -0
- package/src/modules/customer_groups/lib/customerScope.ts +145 -0
- package/src/modules/customer_groups/lib/groupEvents.ts +50 -0
- package/src/modules/customer_groups/lib/priceKindScope.ts +22 -0
- package/src/modules/customer_groups/lib/reconcile.ts +299 -0
- package/src/modules/customer_groups/migrations/.snapshot-open-mercato.json +905 -0
- package/src/modules/customer_groups/migrations/Migration20260922095316_customer_groups.ts +26 -0
- package/src/modules/customer_groups/migrations/Migration20260922103033_customer_groups.ts +22 -0
- package/src/modules/customer_groups/migrations/Migration20260922105444_customer_groups.ts +17 -0
- package/src/modules/customer_groups/migrations/Migration20260923193330_customer_groups.ts +20 -0
- package/src/modules/customer_groups/migrations/Migration20260929083000_customer_groups.ts +21 -0
- package/src/modules/customer_groups/services/customerGroupsService.ts +358 -0
- package/src/modules/customer_groups/setup.ts +11 -0
- package/src/modules/customer_groups/widgets/injection/group-picker-field/widget.ts +41 -0
- package/src/modules/customer_groups/widgets/injection/person-groups-explain-terms.tsx +227 -0
- package/src/modules/customer_groups/widgets/injection/person-groups-tab/widget.ts +21 -0
- package/src/modules/customer_groups/widgets/injection/person-groups-tab.tsx +573 -0
- package/src/modules/customer_groups/widgets/injection-table.ts +35 -0
- package/src/modules/customers/acl.ts +13 -0
- package/src/modules/customers/api/activities/route.ts +10 -0
- package/src/modules/customers/api/companies/[id]/people/route.ts +2 -1
- package/src/modules/customers/api/companies/[id]/route.ts +20 -6
- package/src/modules/customers/api/deals/[id]/companies/route.ts +2 -1
- package/src/modules/customers/api/deals/[id]/people/route.ts +84 -4
- package/src/modules/customers/api/deals/map/route.ts +11 -10
- package/src/modules/customers/api/dictionaries/context.ts +2 -1
- package/src/modules/customers/api/entity-roles-factory.ts +3 -2
- package/src/modules/customers/api/interactions/[id]/visibility/route.ts +2 -1
- package/src/modules/customers/api/interactions/cancel/route.ts +2 -1
- package/src/modules/customers/api/interactions/complete/route.ts +2 -1
- package/src/modules/customers/api/interactions/conflicts/route.ts +10 -10
- package/src/modules/customers/api/interactions/counts/route.ts +25 -7
- package/src/modules/customers/api/interactions/route.ts +34 -10
- package/src/modules/customers/api/labels/assign/route.ts +2 -1
- package/src/modules/customers/api/labels/route.ts +3 -2
- package/src/modules/customers/api/labels/unassign/route.ts +2 -1
- package/src/modules/customers/api/people/[id]/companies/context.ts +11 -2
- package/src/modules/customers/api/people/[id]/email-share/route.ts +276 -0
- package/src/modules/customers/api/people/[id]/email-threads/route.ts +14 -1
- package/src/modules/customers/api/people/[id]/emails/route.ts +2 -1
- package/src/modules/customers/api/people/[id]/route.ts +31 -22
- package/src/modules/customers/api/people/check-phone/route.ts +2 -1
- package/src/modules/customers/api/pipeline-stages/reorder/route.ts +3 -2
- package/src/modules/customers/api/pipeline-stages/route.ts +3 -3
- package/src/modules/customers/api/pipelines/route.ts +3 -3
- package/src/modules/customers/api/settings/address-format/route.ts +2 -1
- package/src/modules/customers/api/settings/dictionary-sort-modes/route.ts +2 -1
- package/src/modules/customers/api/settings/stuck-threshold/route.ts +2 -1
- package/src/modules/customers/api/tags/assign/route.ts +2 -1
- package/src/modules/customers/api/tags/unassign/route.ts +2 -1
- package/src/modules/customers/backend/customers/companies/[id]/page.tsx +4 -2
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.ts +10 -35
- package/src/modules/customers/backend/customers/deals/[id]/page.tsx +21 -18
- package/src/modules/customers/backend/customers/deals/components/ReassignOwnerDialog.tsx +115 -0
- package/src/modules/customers/backend/customers/deals/page.tsx +121 -1
- package/src/modules/customers/backend/customers/people/[id]/page.tsx +4 -2
- package/src/modules/customers/commands/addresses.ts +117 -15
- package/src/modules/customers/commands/companies.ts +10 -4
- package/src/modules/customers/commands/emailConversationShares.ts +261 -0
- package/src/modules/customers/commands/index.ts +1 -0
- package/src/modules/customers/commands/interactions.ts +61 -21
- package/src/modules/customers/commands/people.ts +3 -2
- package/src/modules/customers/commands/shared.ts +4 -0
- package/src/modules/customers/components/calendar/types.ts +1 -1
- package/src/modules/customers/components/detail/CompanyPeopleSection.tsx +97 -399
- package/src/modules/customers/components/detail/CreatePersonDialog.tsx +39 -19
- package/src/modules/customers/components/detail/DealForm.tsx +118 -5
- package/src/modules/customers/components/detail/DealOwnerSelect.tsx +161 -0
- package/src/modules/customers/components/detail/DealPeopleSection.tsx +256 -0
- package/src/modules/customers/components/detail/DealsSection.tsx +8 -14
- package/src/modules/customers/components/detail/LinkedPeopleSection.tsx +474 -0
- package/src/modules/customers/components/detail/PersonCard.tsx +12 -4
- package/src/modules/customers/components/detail/PersonEmailShareControl.tsx +273 -0
- package/src/modules/customers/components/detail/PersonEmailThreadsTab.tsx +26 -0
- package/src/modules/customers/components/detail/ScheduleActivityDialog.tsx +10 -2
- package/src/modules/customers/components/detail/create/CreateDealForm.tsx +30 -0
- package/src/modules/customers/components/detail/create/DealDetailsFields.tsx +12 -0
- package/src/modules/customers/components/detail/create/DealSectionCard.tsx +7 -2
- package/src/modules/customers/components/detail/create/dealFormTypes.ts +3 -0
- package/src/modules/customers/components/detail/schedule/useScheduleFormState.ts +16 -4
- package/src/modules/customers/components/formConfig.tsx +3 -0
- package/src/modules/customers/components/linking/LinkEntityDialog.tsx +8 -0
- package/src/modules/customers/components/linking/adapters/personAdapter.tsx +4 -0
- package/src/modules/customers/data/enrichers.ts +64 -5
- package/src/modules/customers/data/entities.ts +105 -1
- package/src/modules/customers/data/validators.ts +22 -0
- package/src/modules/customers/events.ts +5 -0
- package/src/modules/customers/i18n/de.json +49 -13
- package/src/modules/customers/i18n/en.json +44 -8
- package/src/modules/customers/i18n/es.json +44 -8
- package/src/modules/customers/i18n/ko.json +44 -8
- package/src/modules/customers/i18n/pl.json +44 -8
- package/src/modules/customers/lib/assignableStaff.ts +17 -0
- package/src/modules/customers/lib/calendar/editorPayload.ts +20 -13
- package/src/modules/customers/lib/calendar/mapItem.ts +1 -0
- package/src/modules/customers/lib/conversationShares.ts +250 -0
- package/src/modules/customers/lib/dealsOrganizationScope.ts +5 -3
- package/src/modules/customers/lib/interactionRequestContext.ts +2 -1
- package/src/modules/customers/lib/link-channel-message-handler.ts +27 -4
- package/src/modules/customers/lib/personDetailCacheTags.ts +68 -0
- package/src/modules/customers/lib/personEmailThreads.ts +61 -6
- package/src/modules/customers/lib/reassignDealOwner.ts +51 -0
- package/src/modules/customers/lib/userNames.ts +39 -0
- package/src/modules/customers/lib/visibilityFilter.ts +170 -3
- package/src/modules/customers/migrations/.snapshot-open-mercato.json +240 -0
- package/src/modules/customers/migrations/Migration20260825120000_customers.ts +19 -0
- package/src/modules/customers/migrations/Migration20260825140000_customers.ts +41 -0
- package/src/modules/customers/setup.ts +1 -0
- package/src/modules/customers/subscribers/channel-visibility-changed.ts +50 -0
- package/src/modules/dashboards/api/widgets/data/batch/route.ts +3 -8
- package/src/modules/dashboards/api/widgets/data/route.ts +12 -18
- package/src/modules/dashboards/lib/aggregations.ts +1 -1
- package/src/modules/dashboards/lib/widgetScope.ts +2 -7
- package/src/modules/data_sync/AGENTS.md +35 -1
- package/src/modules/data_sync/api/runs/[id]/cancel.ts +5 -1
- package/src/modules/data_sync/backend/data-sync/page.tsx +292 -19
- package/src/modules/data_sync/backend/data-sync/runs/[id]/page.tsx +205 -21
- package/src/modules/data_sync/components/useDataSyncRunAccess.ts +27 -0
- package/src/modules/data_sync/i18n/de.json +24 -0
- package/src/modules/data_sync/i18n/en.json +24 -0
- package/src/modules/data_sync/i18n/es.json +24 -0
- package/src/modules/data_sync/i18n/ko.json +24 -0
- package/src/modules/data_sync/i18n/pl.json +24 -0
- package/src/modules/data_sync/lib/adapter.ts +37 -0
- package/src/modules/data_sync/lib/resume-point.ts +63 -0
- package/src/modules/data_sync/lib/start-run.ts +61 -2
- package/src/modules/data_sync/lib/sync-run-service.ts +27 -34
- package/src/modules/devices/api/[id]/route.ts +3 -2
- package/src/modules/devices/api/admin/devices/route.ts +2 -1
- package/src/modules/devices/api/route.ts +2 -1
- package/src/modules/dictionaries/api/[dictionaryId]/route.ts +3 -5
- package/src/modules/dictionaries/api/context.ts +2 -1
- package/src/modules/dictionaries/api/route.ts +4 -0
- package/src/modules/dictionaries/components/DictionariesManager.tsx +4 -3
- package/src/modules/dictionaries/data/validators.ts +9 -1
- package/src/modules/dictionaries/i18n/de.json +3 -3
- package/src/modules/dictionaries/i18n/en.json +3 -3
- package/src/modules/dictionaries/i18n/es.json +3 -3
- package/src/modules/dictionaries/i18n/ko.json +3 -3
- package/src/modules/dictionaries/i18n/pl.json +3 -3
- package/src/modules/directory/api/organization-branding/route.ts +10 -1
- package/src/modules/directory/api/organizations/route.ts +1 -1
- package/src/modules/directory/backend/directory/branding/page.tsx +24 -2
- package/src/modules/directory/commands/organizations.ts +173 -80
- package/src/modules/directory/i18n/de.json +1 -0
- package/src/modules/directory/i18n/en.json +1 -0
- package/src/modules/directory/i18n/es.json +1 -0
- package/src/modules/directory/i18n/ko.json +1 -0
- package/src/modules/directory/i18n/pl.json +1 -0
- package/src/modules/directory/lib/hierarchy.ts +22 -1
- package/src/modules/directory/utils/organizationScope.ts +102 -15
- package/src/modules/directory/utils/organizationScopeFilter.ts +6 -3
- package/src/modules/directory/utils/organizationScopeGuard.ts +9 -5
- package/src/modules/entities/api/encryption.ts +73 -27
- package/src/modules/entities/api/records.ts +9 -8
- package/src/modules/entities/cli.ts +46 -24
- package/src/modules/entities/data/entities.ts +15 -0
- package/src/modules/entities/lib/definition-scope.ts +5 -1
- package/src/modules/entities/lib/encryption-maps.ts +164 -0
- package/src/modules/entities/lib/helpers.ts +95 -8
- package/src/modules/entities/migrations/.snapshot-open-mercato.json +21 -0
- package/src/modules/entities/migrations/.snapshot-openmercato.json +12 -0
- package/src/modules/entities/migrations/Migration20260910120000.ts +42 -0
- package/src/modules/entities/migrations/Migration20261004120000_encryption_map_scope_uniqueness.ts +130 -0
- package/src/modules/eudr/api/dashboard/widgets/compliance-overview/route.ts +2 -1
- package/src/modules/eudr/api/plots/import/route.ts +2 -1
- package/src/modules/eudr/api/product-mappings/suggestions/apply/route.ts +2 -1
- package/src/modules/eudr/api/product-mappings/suggestions/route.ts +2 -1
- package/src/modules/eudr/api/reports/annual/route.ts +2 -1
- package/src/modules/eudr/api/statements/[id]/export/route.ts +2 -1
- package/src/modules/eudr/api/statements/[id]/readiness/route.ts +2 -1
- package/src/modules/eudr/api/suppliers/compliance/route.ts +2 -1
- package/src/modules/feature_toggles/commands/global.ts +18 -15
- package/src/modules/feature_toggles/lib/feature-flag-check.ts +8 -3
- package/src/modules/forms/acl.ts +10 -0
- package/src/modules/forms/api/[id]/analytics/route.ts +137 -0
- package/src/modules/forms/api/[id]/distributions/route.ts +192 -0
- package/src/modules/forms/api/[id]/route.ts +245 -0
- package/src/modules/forms/api/[id]/run/context/route.ts +142 -0
- package/src/modules/forms/api/[id]/run/submissions/route.ts +147 -0
- package/src/modules/forms/api/[id]/submissions/route.ts +100 -0
- package/src/modules/forms/api/[id]/theme-logo/route.ts +147 -0
- package/src/modules/forms/api/[id]/versions/[versionId]/diff/route.ts +137 -0
- package/src/modules/forms/api/[id]/versions/[versionId]/publish/route.ts +108 -0
- package/src/modules/forms/api/[id]/versions/[versionId]/route.ts +200 -0
- package/src/modules/forms/api/[id]/versions/fork/route.ts +98 -0
- package/src/modules/forms/api/attachment-helpers.ts +160 -0
- package/src/modules/forms/api/by-key/[key]/active/route.ts +165 -0
- package/src/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/route.ts +92 -0
- package/src/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/send/route.ts +96 -0
- package/src/modules/forms/api/distributions/[distributionId]/invitations/route.ts +207 -0
- package/src/modules/forms/api/distributions/[distributionId]/route.ts +213 -0
- package/src/modules/forms/api/form-submissions/[id]/attachments/route.ts +114 -0
- package/src/modules/forms/api/form-submissions/[id]/resume-token/route.ts +140 -0
- package/src/modules/forms/api/form-submissions/[id]/route.ts +176 -0
- package/src/modules/forms/api/form-submissions/[id]/submit/route.ts +91 -0
- package/src/modules/forms/api/form-submissions/by-subject/[subject_type]/[subject_id]/route.ts +93 -0
- package/src/modules/forms/api/form-submissions/route.ts +133 -0
- package/src/modules/forms/api/helpers.ts +175 -0
- package/src/modules/forms/api/public/distributions/[slug]/embed-policy/route.ts +74 -0
- package/src/modules/forms/api/public/distributions/[slug]/route.ts +101 -0
- package/src/modules/forms/api/public/embed-loader/route.ts +136 -0
- package/src/modules/forms/api/public/invitations/[token]/route.ts +107 -0
- package/src/modules/forms/api/public/rate-limit.ts +69 -0
- package/src/modules/forms/api/public/start/route.ts +195 -0
- package/src/modules/forms/api/public/submissions/[id]/attachments/[attachmentId]/route.ts +86 -0
- package/src/modules/forms/api/public/submissions/[id]/attachments/route.ts +108 -0
- package/src/modules/forms/api/public/submissions/[id]/pdf/route.ts +96 -0
- package/src/modules/forms/api/public/submissions/[id]/route.ts +189 -0
- package/src/modules/forms/api/public/submissions/[id]/submit/route.ts +159 -0
- package/src/modules/forms/api/route.ts +240 -0
- package/src/modules/forms/api/runtime-helpers.ts +208 -0
- package/src/modules/forms/api/subjects/[subjectType]/[subjectId]/consents/route.ts +178 -0
- package/src/modules/forms/api/subjects/[subjectType]/[subjectId]/export/route.ts +135 -0
- package/src/modules/forms/api/submissions/[submissionId]/access-audit/route.ts +100 -0
- package/src/modules/forms/api/submissions/[submissionId]/actors/[actorId]/route.ts +70 -0
- package/src/modules/forms/api/submissions/[submissionId]/actors/route.ts +92 -0
- package/src/modules/forms/api/submissions/[submissionId]/anonymize/route.ts +134 -0
- package/src/modules/forms/api/submissions/[submissionId]/attachments/[attachmentId]/route.ts +90 -0
- package/src/modules/forms/api/submissions/[submissionId]/export/route.ts +111 -0
- package/src/modules/forms/api/submissions/[submissionId]/pdf/route.ts +118 -0
- package/src/modules/forms/api/submissions/[submissionId]/reopen/route.ts +69 -0
- package/src/modules/forms/api/submissions/[submissionId]/revisions/route.ts +75 -0
- package/src/modules/forms/api/submissions/[submissionId]/route.ts +90 -0
- package/src/modules/forms/backend/forms/[id]/FormStudio.tsx +3269 -0
- package/src/modules/forms/backend/forms/[id]/analytics/page.meta.ts +15 -0
- package/src/modules/forms/backend/forms/[id]/analytics/page.tsx +289 -0
- package/src/modules/forms/backend/forms/[id]/distributions/page.meta.ts +15 -0
- package/src/modules/forms/backend/forms/[id]/distributions/page.tsx +16 -0
- package/src/modules/forms/backend/forms/[id]/history/page.meta.ts +11 -0
- package/src/modules/forms/backend/forms/[id]/history/page.tsx +229 -0
- package/src/modules/forms/backend/forms/[id]/page.meta.ts +11 -0
- package/src/modules/forms/backend/forms/[id]/page.tsx +17 -0
- package/src/modules/forms/backend/forms/[id]/studio/YesNoRow.tsx +65 -0
- package/src/modules/forms/backend/forms/[id]/studio/autosave-guard.ts +25 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/DragOverlayCard.tsx +24 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/DropIndicator.tsx +36 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/FieldRow.tsx +308 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/FormCanvas.tsx +265 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/GridSlot.tsx +176 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/SectionContainer.tsx +473 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/grid-collision.ts +25 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/keyboard-coordinates.ts +128 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/overlay-size.ts +15 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/resize-math.ts +36 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/row-layout.ts +110 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/ConditionBuilder.tsx +264 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/HiddenFieldsPanel.tsx +121 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/JumpsEditor.tsx +237 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/RecallTokenPicker.tsx +87 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/VariablesPanel.tsx +260 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/condition-model.ts +207 -0
- package/src/modules/forms/backend/forms/[id]/studio/lucide-icons.ts +87 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/FormAppearancePanel.tsx +561 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/FormPalettePanel.tsx +52 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/InputParametersTab.tsx +378 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/PaletteCard.tsx +40 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/RolesEditor.tsx +225 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/entries.ts +102 -0
- package/src/modules/forms/backend/forms/[id]/studio/preview/PreviewSurface.tsx +1459 -0
- package/src/modules/forms/backend/forms/[id]/studio/preview/ViewportFrame.tsx +49 -0
- package/src/modules/forms/backend/forms/[id]/studio/recall.ts +0 -0
- package/src/modules/forms/backend/forms/[id]/studio/schema-helpers.ts +2525 -0
- package/src/modules/forms/backend/forms/[id]/studio/style/BackgroundControl.tsx +137 -0
- package/src/modules/forms/backend/forms/[id]/studio/style/ColorControl.tsx +257 -0
- package/src/modules/forms/backend/forms/[id]/studio/style/contrast.ts +114 -0
- package/src/modules/forms/backend/forms/[id]/studio/style/presets.ts +104 -0
- package/src/modules/forms/backend/forms/[id]/studio/type-label.ts +13 -0
- package/src/modules/forms/backend/forms/[id]/studio/types.ts +31 -0
- package/src/modules/forms/backend/forms/[id]/studio/undo-controller.ts +52 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/FileConstraintsEditor.tsx +89 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/GroupConfigEditor.tsx +167 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/LengthRangeEditor.tsx +67 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/MatrixColumnsEditor.tsx +166 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/MatrixRowsEditor.tsx +184 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/MessageOverridesEditor.tsx +83 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/NpsAnchorsEditor.tsx +60 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/NumberRangeEditor.tsx +65 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/OpinionIconSelect.tsx +46 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/PatternEditor.tsx +122 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/RankingExhaustiveSwitch.tsx +28 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/SignatureConfigEditor.tsx +84 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/ValidationPanel.tsx +369 -0
- package/src/modules/forms/backend/forms/[id]/submissions/components/RowBadges.ts +56 -0
- package/src/modules/forms/backend/forms/[id]/submissions/components/SubmissionDrawer.tsx +604 -0
- package/src/modules/forms/backend/forms/[id]/submissions/page.meta.ts +10 -0
- package/src/modules/forms/backend/forms/[id]/submissions/page.tsx +264 -0
- package/src/modules/forms/backend/forms/create/page.meta.ts +11 -0
- package/src/modules/forms/backend/forms/create/page.tsx +113 -0
- package/src/modules/forms/backend/forms/page.meta.ts +31 -0
- package/src/modules/forms/backend/forms/page.tsx +269 -0
- package/src/modules/forms/commands/distribution.ts +502 -0
- package/src/modules/forms/commands/form-version.ts +806 -0
- package/src/modules/forms/commands/form.ts +472 -0
- package/src/modules/forms/commands/index.ts +18 -0
- package/src/modules/forms/commands/invitation.ts +424 -0
- package/src/modules/forms/commands/shared.ts +261 -0
- package/src/modules/forms/commands/submission.ts +209 -0
- package/src/modules/forms/data/entities.ts +686 -0
- package/src/modules/forms/data/validators.ts +483 -0
- package/src/modules/forms/di.ts +246 -0
- package/src/modules/forms/encryption.ts +31 -0
- package/src/modules/forms/events-payloads.ts +103 -0
- package/src/modules/forms/events.ts +50 -0
- package/src/modules/forms/extension-points.ts +41 -0
- package/src/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.meta.ts +9 -0
- package/src/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.tsx +45 -0
- package/src/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.meta.ts +9 -0
- package/src/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.tsx +56 -0
- package/src/modules/forms/frontend/embed/[slug]/page.meta.ts +42 -0
- package/src/modules/forms/frontend/embed/[slug]/page.tsx +171 -0
- package/src/modules/forms/frontend/f/[slug]/page.meta.ts +9 -0
- package/src/modules/forms/frontend/f/[slug]/page.tsx +10 -0
- package/src/modules/forms/frontend/forms/[id]/run/page.meta.ts +17 -0
- package/src/modules/forms/frontend/forms/[id]/run/page.tsx +83 -0
- package/src/modules/forms/frontend/i/[token]/page.meta.ts +9 -0
- package/src/modules/forms/frontend/i/[token]/page.tsx +10 -0
- package/src/modules/forms/i18n/de.json +800 -0
- package/src/modules/forms/i18n/en.json +800 -0
- package/src/modules/forms/i18n/es.json +800 -0
- package/src/modules/forms/i18n/ko.json +800 -0
- package/src/modules/forms/i18n/pl.json +800 -0
- package/src/modules/forms/index.ts +18 -0
- package/src/modules/forms/lib/embed-frame-policy.ts +144 -0
- package/src/modules/forms/lib/form-definition-slicing.ts +54 -0
- package/src/modules/forms/lib/log-redaction.ts +91 -0
- package/src/modules/forms/lib/navigable-url.ts +57 -0
- package/src/modules/forms/lib/retention.ts +73 -0
- package/src/modules/forms/lib/runtime-principal.ts +101 -0
- package/src/modules/forms/migrations/.snapshot-open-mercato.json +3185 -0
- package/src/modules/forms/migrations/Migration20260508135459_forms.ts +17 -0
- package/src/modules/forms/migrations/Migration20260508140932_forms.ts +26 -0
- package/src/modules/forms/migrations/Migration20260508155737_forms.ts +15 -0
- package/src/modules/forms/migrations/Migration20260520120000_forms.ts +26 -0
- package/src/modules/forms/migrations/Migration20260521090000_forms.ts +15 -0
- package/src/modules/forms/migrations/Migration20260521120000_forms.ts +21 -0
- package/src/modules/forms/runner/FormRunner.tsx +924 -0
- package/src/modules/forms/runner/MatrixField.tsx +210 -0
- package/src/modules/forms/runner/RankingField.tsx +207 -0
- package/src/modules/forms/runner/ScaleField.tsx +102 -0
- package/src/modules/forms/runner/SignatureField.tsx +158 -0
- package/src/modules/forms/runner/tamper-check.ts +131 -0
- package/src/modules/forms/schema/address-countries.ts +60 -0
- package/src/modules/forms/schema/field-type-patterns.ts +21 -0
- package/src/modules/forms/schema/field-type-registry-advanced.ts +58 -0
- package/src/modules/forms/schema/field-type-registry.ts +819 -0
- package/src/modules/forms/schema/file-field.ts +102 -0
- package/src/modules/forms/schema/group-field.ts +235 -0
- package/src/modules/forms/schema/jsonlogic-grammar.ts +95 -0
- package/src/modules/forms/schema/jsonschema-extensions.ts +1060 -0
- package/src/modules/forms/schema/layout-catalog.ts +68 -0
- package/src/modules/forms/schema/signature-field.ts +120 -0
- package/src/modules/forms/schema/style-extensions.ts +194 -0
- package/src/modules/forms/schema/style-validators.ts +252 -0
- package/src/modules/forms/services/access-audit-logger.ts +275 -0
- package/src/modules/forms/services/analytics-service.ts +498 -0
- package/src/modules/forms/services/anonymize-service.ts +177 -0
- package/src/modules/forms/services/attachment-service.ts +223 -0
- package/src/modules/forms/services/captcha-verifier.ts +156 -0
- package/src/modules/forms/services/consent-record-service.ts +162 -0
- package/src/modules/forms/services/distribution-service.ts +509 -0
- package/src/modules/forms/services/distribution-token.ts +153 -0
- package/src/modules/forms/services/encryption-service.ts +500 -0
- package/src/modules/forms/services/export-service.ts +360 -0
- package/src/modules/forms/services/field-validation-service.ts +300 -0
- package/src/modules/forms/services/form-logic-evaluator.ts +718 -0
- package/src/modules/forms/services/form-version-compiler.ts +829 -0
- package/src/modules/forms/services/form-version-differ.ts +143 -0
- package/src/modules/forms/services/jsonlogic-evaluator.ts +228 -0
- package/src/modules/forms/services/pdf-snapshot-service.ts +782 -0
- package/src/modules/forms/services/prefill-resolver.ts +125 -0
- package/src/modules/forms/services/role-policy-service.ts +90 -0
- package/src/modules/forms/services/style-compiler.ts +378 -0
- package/src/modules/forms/services/submission-service.ts +1259 -0
- package/src/modules/forms/services/upload-scanner.ts +36 -0
- package/src/modules/forms/services/upload-validation.ts +94 -0
- package/src/modules/forms/services/visibility-resolver.ts +63 -0
- package/src/modules/forms/setup.ts +16 -0
- package/src/modules/forms/subscribers/forms-consent-projector.ts +100 -0
- package/src/modules/forms/subscribers/forms-pdf-snapshot.ts +112 -0
- package/src/modules/forms/subscribers/forms-webhook-bridge-anonymized.ts +36 -0
- package/src/modules/forms/subscribers/forms-webhook-bridge.ts +56 -0
- package/src/modules/forms/subscribers/invitation-email.ts +180 -0
- package/src/modules/forms/translations.ts +14 -0
- package/src/modules/forms/ui/admin/forms/[id]/distributions/CreateDistributionDialog.tsx +401 -0
- package/src/modules/forms/ui/admin/forms/[id]/distributions/DistributionsPanel.tsx +381 -0
- package/src/modules/forms/ui/admin/forms/[id]/distributions/EmbedSettingsDialog.tsx +332 -0
- package/src/modules/forms/ui/admin/forms/[id]/distributions/RecipientsTable.tsx +460 -0
- package/src/modules/forms/ui/public/EmbeddedForm.tsx +248 -0
- package/src/modules/forms/ui/public/FormRunner.tsx +491 -0
- package/src/modules/forms/ui/public/FormTrigger.tsx +80 -0
- package/src/modules/forms/ui/public/PublicFormRunnerPage.tsx +34 -0
- package/src/modules/forms/ui/public/components/CompletionScreen.tsx +97 -0
- package/src/modules/forms/ui/public/components/LocaleSwitch.tsx +42 -0
- package/src/modules/forms/ui/public/components/ResumeGate.tsx +61 -0
- package/src/modules/forms/ui/public/components/ReviewStep.tsx +153 -0
- package/src/modules/forms/ui/public/components/SaveIndicator.tsx +69 -0
- package/src/modules/forms/ui/public/components/SectionStepper.tsx +60 -0
- package/src/modules/forms/ui/public/index.ts +48 -0
- package/src/modules/forms/ui/public/renderers/index.tsx +889 -0
- package/src/modules/forms/ui/public/state/logic-derivation.ts +91 -0
- package/src/modules/forms/ui/public/state/runtime-client.ts +495 -0
- package/src/modules/forms/ui/public/state/useAutosave.ts +97 -0
- package/src/modules/forms/ui/public/state/useFormRunner.ts +547 -0
- package/src/modules/forms/ui/public/style/LogoHeader.tsx +43 -0
- package/src/modules/forms/ui/public/style/applyStyle.ts +26 -0
- package/src/modules/forms/ui/public/types.ts +228 -0
- package/src/modules/forms/widgets/injection/access-audit-panel/widget.tsx +144 -0
- package/src/modules/forms/widgets/injection/anonymize-button/widget.tsx +177 -0
- package/src/modules/forms/widgets/injection/audit-format.ts +60 -0
- package/src/modules/forms/widgets/injection/context.ts +24 -0
- package/src/modules/forms/widgets/injection/embedded-form/widget.tsx +102 -0
- package/src/modules/forms/widgets/injection/pdf-download-button/widget.tsx +111 -0
- package/src/modules/forms/widgets/injection/self-audit-footer/widget.tsx +56 -0
- package/src/modules/forms/widgets/injection-table.ts +54 -0
- package/src/modules/forms/workers/pdf-snapshot.ts +110 -0
- package/src/modules/forms/workers/retention-purge.ts +169 -0
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.ts +7 -1
- package/src/modules/inbox_ops/data/validators.ts +2 -1
- package/src/modules/inbox_ops/lib/llmProvider.ts +11 -0
- package/src/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.tsx +2 -2
- package/src/modules/integrations/di.ts +5 -1
- package/src/modules/integrations/lib/credentials-service.ts +45 -36
- package/src/modules/messages/api/[id]/attachments/route.ts +12 -3
- package/src/modules/messages/api/[id]/forward-preview/route.ts +9 -3
- package/src/modules/messages/api/[id]/route.ts +83 -4
- package/src/modules/messages/api/route.ts +123 -2
- package/src/modules/messages/commands/messages.ts +81 -7
- package/src/modules/messages/components/ComposeMessagePageClient.tsx +29 -1
- package/src/modules/messages/data/validators.ts +10 -0
- package/src/modules/messages/i18n/de.json +8 -0
- package/src/modules/messages/i18n/en.json +8 -0
- package/src/modules/messages/i18n/es.json +8 -0
- package/src/modules/messages/i18n/ko.json +8 -0
- package/src/modules/messages/i18n/pl.json +8 -0
- package/src/modules/messages/lib/channelThreadAccess.ts +101 -0
- package/src/modules/messages/lib/composeSenderDelegation.ts +182 -0
- package/src/modules/messages/lib/composeSenderOptions.ts +56 -0
- package/src/modules/messages/lib/email-sender.ts +1 -17
- package/src/modules/messages/lib/forwarding.ts +17 -2
- package/src/modules/messages/lib/markdownEmailBody.ts +25 -0
- package/src/modules/messages/lib/messageSourceEntityTypes.ts +12 -0
- package/src/modules/messages/lib/routeHelpers.ts +92 -0
- package/src/modules/messages/subscribers/message-notification.ts +47 -1
- package/src/modules/notifications/api/[id]/action/route.ts +2 -1
- package/src/modules/notifications/api/openapi.ts +1 -0
- package/src/modules/notifications/frontend/NotificationSettingsPageClient.tsx +77 -48
- package/src/modules/notifications/i18n/de.json +1 -0
- package/src/modules/notifications/i18n/en.json +1 -0
- package/src/modules/notifications/i18n/es.json +1 -0
- package/src/modules/notifications/i18n/ko.json +1 -0
- package/src/modules/notifications/i18n/pl.json +1 -0
- package/src/modules/notifications/lib/deliveryConfig.ts +31 -2
- package/src/modules/notifications/lib/notificationMapper.ts +2 -0
- package/src/modules/notifications/lib/safeHref.ts +7 -0
- package/src/modules/planner/api/availability-date-specific.ts +2 -1
- package/src/modules/planner/api/availability-weekly.ts +2 -1
- package/src/modules/progress/AGENTS.md +2 -0
- package/src/modules/progress/api/active/route.ts +14 -2
- package/src/modules/progress/api/jobs/[id]/route.ts +44 -27
- package/src/modules/progress/api/jobs/route.ts +22 -8
- package/src/modules/progress/api/requestScope.ts +43 -0
- package/src/modules/progress/lib/organizationScope.ts +17 -0
- package/src/modules/progress/lib/progressService.ts +3 -2
- package/src/modules/progress/lib/progressServiceImpl.ts +63 -14
- package/src/modules/push_notifications/api/custom-send/route.ts +4 -1
- package/src/modules/query_index/api/status.ts +4 -9
- package/src/modules/query_index/di.ts +2 -1
- package/src/modules/query_index/lib/engine.ts +2 -0
- package/src/modules/query_index/lib/request-encryption.ts +31 -0
- package/src/modules/query_index/lib/search-tokens.ts +42 -1
- package/src/modules/resources/api/resources/tags/assign/route.ts +2 -1
- package/src/modules/resources/api/resources/tags/unassign/route.ts +2 -1
- package/src/modules/resources/commands/activities.ts +2 -2
- package/src/modules/sales/api/document-history/route.ts +5 -1
- package/src/modules/sales/api/document-numbers/route.ts +2 -1
- package/src/modules/sales/api/quotes/convert/route.ts +2 -1
- package/src/modules/sales/api/quotes/send/route.ts +2 -1
- package/src/modules/sales/api/settings/document-numbers/route.ts +7 -1
- package/src/modules/sales/api/settings/order-editing/route.ts +7 -1
- package/src/modules/sales/commands/documents.ts +451 -131
- package/src/modules/sales/commands/payments.ts +2 -1
- package/src/modules/sales/commands/settings.ts +34 -6
- package/src/modules/sales/commands/shipments.ts +2 -1
- package/src/modules/sales/components/DocumentNumberSettings.tsx +41 -28
- package/src/modules/sales/components/documents/ItemsSection.tsx +58 -13
- package/src/modules/sales/components/documents/LineItemDialog.tsx +194 -111
- package/src/modules/sales/components/documents/lineItemUtils.ts +18 -0
- package/src/modules/sales/i18n/de.json +2 -0
- package/src/modules/sales/i18n/en.json +2 -0
- package/src/modules/sales/i18n/es.json +2 -0
- package/src/modules/sales/i18n/ko.json +2 -0
- package/src/modules/sales/i18n/pl.json +2 -0
- package/src/modules/sales/lib/lineSnapshots.ts +36 -0
- package/src/modules/sales/setup.ts +4 -4
- package/src/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.tsx +2 -2
- package/src/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.tsx +2 -2
- package/src/modules/staff/api/leave-requests/accept/route.ts +2 -1
- package/src/modules/staff/api/leave-requests/reject/route.ts +2 -1
- package/src/modules/staff/api/leave-requests.ts +2 -1
- package/src/modules/staff/api/team-members/self/route.ts +2 -1
- package/src/modules/staff/api/team-members/tags/assign/route.ts +2 -1
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +2 -1
- package/src/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.ts +16 -16
- package/src/modules/staff/api/timesheets/my-projects/[projectId]/route.ts +2 -1
- package/src/modules/staff/api/timesheets/my-projects/route.ts +2 -1
- package/src/modules/staff/api/timesheets/my-work/route.ts +2 -1
- package/src/modules/staff/api/timesheets/projects/kpis/route.ts +2 -1
- package/src/modules/staff/api/timesheets/reports/[id]/close/route.ts +2 -1
- package/src/modules/staff/api/timesheets/reports/[id]/export/route.ts +3 -2
- package/src/modules/staff/api/timesheets/reports/[id]/sheet/route.ts +3 -2
- package/src/modules/staff/api/timesheets/reports/[id]/unlock/route.ts +3 -2
- package/src/modules/staff/api/timesheets/reports/preview/route.ts +2 -1
- package/src/modules/staff/api/timesheets/reports/shared.ts +2 -1
- package/src/modules/staff/api/timesheets/settings/reapply-rounding/route.ts +2 -1
- package/src/modules/staff/api/timesheets/tags/entry-assignments/route.ts +2 -1
- package/src/modules/staff/api/timesheets/tags/task-assignments/route.ts +2 -1
- package/src/modules/staff/api/timesheets/tasks/[id]/comments/route.ts +2 -1
- package/src/modules/staff/api/timesheets/tasks/[id]/status/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.ts +3 -2
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/bulk/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/copy-day/route.ts +3 -2
- package/src/modules/staff/api/timesheets/time-entries/overlaps/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/start-timer/route.ts +3 -2
- package/src/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.ts +3 -2
- package/src/modules/staff/api/timesheets/time-projects/route.ts +2 -1
- package/src/modules/staff/commands/activities.ts +2 -2
- package/src/modules/staff/commands/timesheets-entries.ts +3 -2
- package/src/modules/staff/commands/timesheets-reports.ts +88 -15
- package/src/modules/staff/lib/timesheets-reports/buildReportSheet.ts +1 -0
- package/src/modules/staff/lib/timesheets-reports/loadReportData.ts +69 -8
- package/src/modules/staff/lib/timesheets-reports/reportPeriod.ts +18 -0
- package/src/modules/staff/lib/timesheets-ui/CalendarPicker.tsx +21 -10
- package/src/modules/sync_excel/api/import/route.ts +40 -12
- package/src/modules/sync_excel/api/upload/route.ts +34 -4
- package/src/modules/translations/api/context.ts +2 -1
- package/src/modules/warranty_claims/api/ai/assess/route.ts +2 -1
- package/src/modules/warranty_claims/api/ai/draft-reply/route.ts +2 -1
- package/src/modules/warranty_claims/api/ai/suggest/route.ts +2 -1
- package/src/modules/warranty_claims/api/assign/route.ts +2 -1
- package/src/modules/warranty_claims/api/credit-memo/route.ts +2 -1
- package/src/modules/warranty_claims/api/entitlement/route.ts +2 -1
- package/src/modules/warranty_claims/api/events/route.ts +2 -1
- package/src/modules/warranty_claims/api/external/claims/route.ts +2 -1
- package/src/modules/warranty_claims/api/receiving/route.ts +2 -1
- package/src/modules/warranty_claims/api/replacement-order/route.ts +2 -1
- package/src/modules/warranty_claims/api/return-label/route.ts +2 -1
- package/src/modules/warranty_claims/api/risk/route.ts +2 -1
- package/src/modules/warranty_claims/api/sales-return/route.ts +2 -1
- package/src/modules/warranty_claims/api/settings-general/route.ts +2 -1
- package/src/modules/warranty_claims/api/stats/route.ts +11 -11
- package/src/modules/warranty_claims/api/submit/route.ts +2 -1
- package/src/modules/warranty_claims/api/transition/route.ts +2 -1
- package/src/modules/warranty_claims/api/vendor-recovery/route.ts +2 -1
- package/src/modules/warranty_claims/api/vendor-recovery-suggestions/route.ts +2 -1
- package/src/modules/warranty_claims/widgets/notifications/WarrantyClaimNotificationRenderer.tsx +1 -1
- package/src/modules/wms/api/dashboard/operational/route.ts +2 -1
- package/src/modules/wms/api/inventory/cycle-count/route.ts +1 -0
- package/src/modules/wms/api/inventory/helpers.ts +2 -1
- package/src/modules/wms/api/inventory/import/helpers.ts +2 -1
- package/src/modules/wms/api/sales-orders/[salesOrderId]/warehouse-assignment/route.ts +2 -1
- package/src/modules/wms/commands/inventory-actions.ts +45 -1
- package/src/modules/wms/components/backend/CycleCountWizardDialog.tsx +14 -1
- package/src/modules/wms/di.ts +6 -0
- package/src/modules/wms/i18n/de.json +1 -0
- package/src/modules/wms/i18n/en.json +1 -0
- package/src/modules/wms/i18n/es.json +1 -0
- package/src/modules/wms/i18n/ko.json +1 -0
- package/src/modules/wms/i18n/pl.json +1 -0
- package/src/modules/wms/lib/availabilityCache.ts +137 -0
- package/src/modules/wms/lib/availabilityCalculation.ts +351 -0
- package/src/modules/wms/lib/availabilityProvider.ts +47 -0
- package/src/modules/wms/lib/loadOperationalDashboard.ts +51 -3
- package/src/modules/wms/lib/lowStockBalanceFilter.ts +23 -10
- package/src/modules/wms/lib/sqlInClause.ts +21 -0
- package/src/modules/wms/lib/tryResolve.ts +8 -0
- package/src/modules/wms/subscribers/invalidate-availability-cache-policy.ts +18 -0
- package/src/modules/wms/subscribers/invalidate-availability-cache-profile.ts +18 -0
- package/src/modules/wms/subscribers/invalidate-availability-cache.ts +30 -0
- package/src/modules/wms/widgets/notifications/WmsLowStockRenderer.tsx +2 -2
- package/src/modules/wms/widgets/notifications/WmsReservationShortfallRenderer.tsx +4 -3
- package/src/modules/workflows/AGENTS.md +7 -5
- package/src/modules/workflows/api/commands/route.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/callers/route.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/context-schema/route.ts +4 -2
- package/src/modules/workflows/api/definitions/[id]/customize/route.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/draft/route.ts +6 -1
- package/src/modules/workflows/api/definitions/[id]/publish/route.ts +10 -1
- package/src/modules/workflows/api/definitions/[id]/reset-to-code/route.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/route.ts +5 -3
- package/src/modules/workflows/api/definitions/[id]/test-step/route.ts +4 -2
- package/src/modules/workflows/api/definitions/generate/route.ts +4 -1
- package/src/modules/workflows/api/definitions/route.ts +4 -2
- package/src/modules/workflows/api/endpoints/route.ts +4 -1
- package/src/modules/workflows/api/functions/route.ts +4 -1
- package/src/modules/workflows/api/grantable-features/route.ts +2 -1
- package/src/modules/workflows/api/instances/[id]/advance/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/cancel/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/context/route.ts +2 -1
- package/src/modules/workflows/api/instances/[id]/rerun-step/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/retry/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/signal/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/step-through/route.ts +4 -2
- package/src/modules/workflows/api/instances/route.ts +4 -2
- package/src/modules/workflows/api/instances/validate-start/route.ts +4 -1
- package/src/modules/workflows/api/rule-usage/route.ts +4 -1
- package/src/modules/workflows/api/signals/route.ts +4 -1
- package/src/modules/workflows/api/tasks/[id]/claim/route.ts +4 -1
- package/src/modules/workflows/api/tasks/[id]/complete/route.ts +4 -1
- package/src/modules/workflows/api/tasks/[id]/reassign/route.ts +2 -1
- package/src/modules/workflows/api/tasks/[id]/unclaim/route.ts +4 -1
- package/src/modules/workflows/api/templates/route.ts +4 -1
- package/src/modules/workflows/api/work-inbox/next/route.ts +4 -1
- package/src/modules/workflows/lib/activity-executor.ts +125 -28
- package/src/modules/workflows/lib/activity-types.ts +8 -4
- package/src/modules/workflows/lib/activity-worker-handler.ts +16 -12
- package/src/modules/workflows/lib/event-trigger-service.ts +18 -2
- package/src/modules/workflows/lib/step-handler.ts +13 -8
- package/src/test-utils/transactionalEntityManagerDouble.ts +51 -0
|
@@ -3,6 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
|
|
4
4
|
import { getAuthFromRequest } from "@open-mercato/shared/lib/auth/server";
|
|
5
5
|
import { resolveOrganizationScopeForRequest } from "@open-mercato/core/modules/directory/utils/organizationScope";
|
|
6
|
+
import { resolveSingleOrganizationIdOrDeny } from "@open-mercato/core/modules/directory/utils/organizationScopeFilter";
|
|
6
7
|
import { serializeOperationMetadata } from "@open-mercato/shared/lib/commands/operationMetadata";
|
|
7
8
|
import { tagAssignmentSchema } from "../../../data/validators.js";
|
|
8
9
|
import { CrudHttpError, isCrudHttpError } from "@open-mercato/shared/lib/crud/errors";
|
|
@@ -29,7 +30,7 @@ async function buildContext(req) {
|
|
|
29
30
|
container,
|
|
30
31
|
auth,
|
|
31
32
|
organizationScope: scope,
|
|
32
|
-
selectedOrganizationId: scope
|
|
33
|
+
selectedOrganizationId: resolveSingleOrganizationIdOrDeny(scope, auth) ?? null,
|
|
33
34
|
organizationIds: scope?.filterIds ?? (auth.orgId ? [auth.orgId] : null),
|
|
34
35
|
request: req
|
|
35
36
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/customers/api/tags/assign/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'\nimport { serializeOperationMetadata } from '@open-mercato/shared/lib/commands/operationMetadata'\nimport type { CommandRuntimeContext, CommandBus } from '@open-mercato/shared/lib/commands'\nimport { tagAssignmentSchema, type TagAssignmentInput } from '../../../data/validators'\nimport { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'\nimport { withScopedPayload } from '../../utils'\nimport {\n runCrudMutationGuardAfterSuccess,\n validateCrudMutationGuard,\n} from '@open-mercato/shared/lib/crud/mutation-guard'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { getCommandInterceptorHttpRejection } from '@open-mercato/shared/lib/commands/errors'\n\nconst logger = createLogger('customers')\n\nconst TAG_ASSIGNMENT_RESOURCE_KIND = 'customers.tagAssignment'\n\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['customers.activities.manage'] },\n}\n\nasync function buildContext(\n req: Request\n): Promise<{ ctx: CommandRuntimeContext; auth: Awaited<ReturnType<typeof getAuthFromRequest>>; translate: (key: string, fallback?: string) => string }> {\n const container = await createRequestContainer()\n const auth = await getAuthFromRequest(req)\n const { translate } = await resolveTranslations()\n if (!auth) throw new CrudHttpError(401, { error: translate('customers.errors.unauthorized', 'Unauthorized') })\n const scope = await resolveOrganizationScopeForRequest({ container, auth, request: req })\n const ctx: CommandRuntimeContext = {\n container,\n auth,\n organizationScope: scope,\n selectedOrganizationId: scope
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAClB,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AACnD,SAAS,kCAAkC;AAE3C,SAAS,2BAAoD;AAC7D,SAAS,eAAe,uBAAuB;AAC/C,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,0CAA0C;AAEnD,MAAM,SAAS,aAAa,WAAW;AAEvC,MAAM,+BAA+B;AAE9B,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,6BAA6B,EAAE;AAC9E;AAEA,eAAe,aACb,KACsJ;AACtJ,QAAM,YAAY,MAAM,uBAAuB;AAC/C,QAAM,OAAO,MAAM,mBAAmB,GAAG;AACzC,QAAM,EAAE,UAAU,IAAI,MAAM,oBAAoB;AAChD,MAAI,CAAC,KAAM,OAAM,IAAI,cAAc,KAAK,EAAE,OAAO,UAAU,iCAAiC,cAAc,EAAE,CAAC;AAC7G,QAAM,QAAQ,MAAM,mCAAmC,EAAE,WAAW,MAAM,SAAS,IAAI,CAAC;AACxF,QAAM,MAA6B;AAAA,IACjC;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB,wBAAwB,OAAO,
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'\nimport { resolveSingleOrganizationIdOrDeny } from '@open-mercato/core/modules/directory/utils/organizationScopeFilter'\nimport { serializeOperationMetadata } from '@open-mercato/shared/lib/commands/operationMetadata'\nimport type { CommandRuntimeContext, CommandBus } from '@open-mercato/shared/lib/commands'\nimport { tagAssignmentSchema, type TagAssignmentInput } from '../../../data/validators'\nimport { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'\nimport { withScopedPayload } from '../../utils'\nimport {\n runCrudMutationGuardAfterSuccess,\n validateCrudMutationGuard,\n} from '@open-mercato/shared/lib/crud/mutation-guard'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { getCommandInterceptorHttpRejection } from '@open-mercato/shared/lib/commands/errors'\n\nconst logger = createLogger('customers')\n\nconst TAG_ASSIGNMENT_RESOURCE_KIND = 'customers.tagAssignment'\n\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['customers.activities.manage'] },\n}\n\nasync function buildContext(\n req: Request\n): Promise<{ ctx: CommandRuntimeContext; auth: Awaited<ReturnType<typeof getAuthFromRequest>>; translate: (key: string, fallback?: string) => string }> {\n const container = await createRequestContainer()\n const auth = await getAuthFromRequest(req)\n const { translate } = await resolveTranslations()\n if (!auth) throw new CrudHttpError(401, { error: translate('customers.errors.unauthorized', 'Unauthorized') })\n const scope = await resolveOrganizationScopeForRequest({ container, auth, request: req })\n const ctx: CommandRuntimeContext = {\n container,\n auth,\n organizationScope: scope,\n selectedOrganizationId: resolveSingleOrganizationIdOrDeny(scope, auth) ?? null,\n organizationIds: scope?.filterIds ?? (auth.orgId ? [auth.orgId] : null),\n request: req,\n }\n return { ctx, auth, translate }\n}\n\nexport async function POST(req: Request) {\n try {\n const { ctx, auth, translate } = await buildContext(req)\n const tenantId = auth!.tenantId\n const organizationId = ctx.selectedOrganizationId\n if (!tenantId || !organizationId) {\n return NextResponse.json({ error: translate('customers.errors.context_required', 'Organization and tenant context required') }, { status: 400 })\n }\n const body = await req.json().catch(() => ({}))\n const scoped = withScopedPayload(body, ctx, translate)\n const input = tagAssignmentSchema.parse(scoped)\n\n const guardResult = await validateCrudMutationGuard(ctx.container, {\n tenantId,\n organizationId,\n userId: auth!.sub,\n resourceKind: TAG_ASSIGNMENT_RESOURCE_KIND,\n resourceId: input.entityId,\n operation: 'custom',\n requestMethod: req.method,\n requestHeaders: req.headers,\n mutationPayload: input,\n })\n if (guardResult && !guardResult.ok) {\n return NextResponse.json(guardResult.body, { status: guardResult.status })\n }\n\n const commandBus = (ctx.container.resolve('commandBus') as CommandBus)\n const { result, logEntry } = await commandBus.execute<TagAssignmentInput, { assignmentId: string }>(\n 'customers.tags.assign',\n { input, ctx },\n )\n if (guardResult?.ok && guardResult.shouldRunAfterSuccess) {\n await runCrudMutationGuardAfterSuccess(ctx.container, {\n tenantId,\n organizationId,\n userId: auth!.sub,\n resourceKind: TAG_ASSIGNMENT_RESOURCE_KIND,\n resourceId: input.entityId,\n operation: 'custom',\n requestMethod: req.method,\n requestHeaders: req.headers,\n metadata: guardResult.metadata ?? null,\n })\n }\n const response = NextResponse.json({ id: result?.assignmentId ?? null }, { status: 201 })\n if (logEntry?.undoToken && logEntry?.id && logEntry?.commandId) {\n response.headers.set(\n 'x-om-operation',\n serializeOperationMetadata({\n id: logEntry.id,\n undoToken: logEntry.undoToken,\n commandId: logEntry.commandId,\n actionLabel: logEntry.actionLabel ?? null,\n resourceKind: logEntry.resourceKind ?? 'customers.tagAssignment',\n resourceId: logEntry.resourceId ?? result?.assignmentId ?? null,\n executedAt: logEntry.createdAt instanceof Date ? logEntry.createdAt.toISOString() : undefined,\n })\n )\n }\n return response\n } catch (err) {\n if (isCrudHttpError(err)) {\n return NextResponse.json(err.body, { status: err.status })\n }\n const interceptorRejection = getCommandInterceptorHttpRejection(err)\n if (interceptorRejection) {\n return NextResponse.json(interceptorRejection.body, { status: interceptorRejection.status })\n }\n const { translate } = await resolveTranslations()\n logger.error('customers.tags.assign failed', { err })\n return NextResponse.json({ error: translate('customers.errors.assign_failed', 'Failed to assign tag') }, { status: 400 })\n }\n}\n\nconst tagAssignmentResponseSchema = z.object({\n id: z.string().uuid().nullable(),\n})\n\nconst tagAssignmentErrorSchema = z.object({\n error: z.string(),\n})\n\nexport const openApi: OpenApiRouteDoc = {\n tag: 'Customers',\n summary: 'Assign customer tag',\n methods: {\n POST: {\n summary: 'Assign tag to customer entity',\n description: 'Links a tag to a customer entity within the validated tenant / organization scope.',\n requestBody: {\n contentType: 'application/json',\n schema: tagAssignmentSchema,\n },\n responses: [\n { status: 201, description: 'Tag assigned to customer', schema: tagAssignmentResponseSchema },\n ],\n errors: [\n { status: 400, description: 'Validation or assignment failed', schema: tagAssignmentErrorSchema },\n { status: 401, description: 'Unauthorized', schema: tagAssignmentErrorSchema },\n { status: 403, description: 'Insufficient tenant/organization access', schema: tagAssignmentErrorSchema },\n ],\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAClB,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AACnD,SAAS,yCAAyC;AAClD,SAAS,kCAAkC;AAE3C,SAAS,2BAAoD;AAC7D,SAAS,eAAe,uBAAuB;AAC/C,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,0CAA0C;AAEnD,MAAM,SAAS,aAAa,WAAW;AAEvC,MAAM,+BAA+B;AAE9B,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,6BAA6B,EAAE;AAC9E;AAEA,eAAe,aACb,KACsJ;AACtJ,QAAM,YAAY,MAAM,uBAAuB;AAC/C,QAAM,OAAO,MAAM,mBAAmB,GAAG;AACzC,QAAM,EAAE,UAAU,IAAI,MAAM,oBAAoB;AAChD,MAAI,CAAC,KAAM,OAAM,IAAI,cAAc,KAAK,EAAE,OAAO,UAAU,iCAAiC,cAAc,EAAE,C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AE,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC1H;AACF;AAEA,MAAM,8BAA8B,EAAE,OAAO;AAAA,EAC3C,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AACjC,CAAC;AAED,MAAM,2BAA2B,EAAE,OAAO;AAAA,EACxC,OAAO,EAAE,OAAO;AAClB,CAAC;AAEM,MAAM,UAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,EACT,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,MACb,aAAa;AAAA,QACX,aAAa;AAAA,QACb,QAAQ;AAAA,MACV;AAAA,MACA,WAAW;AAAA,QACT,EAAE,QAAQ,KAAK,aAAa,4BAA4B,QAAQ,4BAA4B;AAAA,MAC9F;AAAA,MACA,QAAQ;AAAA,QACN,EAAE,QAAQ,KAAK,aAAa,mCAAmC,QAAQ,yBAAyB;AAAA,QAChG,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,yBAAyB;AAAA,QAC7E,EAAE,QAAQ,KAAK,aAAa,2CAA2C,QAAQ,yBAAyB;AAAA,MAC1G;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,6 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
|
|
4
4
|
import { getAuthFromRequest } from "@open-mercato/shared/lib/auth/server";
|
|
5
5
|
import { resolveOrganizationScopeForRequest } from "@open-mercato/core/modules/directory/utils/organizationScope";
|
|
6
|
+
import { resolveSingleOrganizationIdOrDeny } from "@open-mercato/core/modules/directory/utils/organizationScopeFilter";
|
|
6
7
|
import { serializeOperationMetadata } from "@open-mercato/shared/lib/commands/operationMetadata";
|
|
7
8
|
import { tagAssignmentSchema } from "../../../data/validators.js";
|
|
8
9
|
import { CrudHttpError, isCrudHttpError } from "@open-mercato/shared/lib/crud/errors";
|
|
@@ -29,7 +30,7 @@ async function buildContext(req) {
|
|
|
29
30
|
container,
|
|
30
31
|
auth,
|
|
31
32
|
organizationScope: scope,
|
|
32
|
-
selectedOrganizationId: scope
|
|
33
|
+
selectedOrganizationId: resolveSingleOrganizationIdOrDeny(scope, auth) ?? null,
|
|
33
34
|
organizationIds: scope?.filterIds ?? (auth.orgId ? [auth.orgId] : null),
|
|
34
35
|
request: req
|
|
35
36
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/customers/api/tags/unassign/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'\nimport { serializeOperationMetadata } from '@open-mercato/shared/lib/commands/operationMetadata'\nimport type { CommandRuntimeContext, CommandBus } from '@open-mercato/shared/lib/commands'\nimport { tagAssignmentSchema, type TagAssignmentInput } from '../../../data/validators'\nimport { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'\nimport { withScopedPayload } from '../../utils'\nimport {\n runCrudMutationGuardAfterSuccess,\n validateCrudMutationGuard,\n} from '@open-mercato/shared/lib/crud/mutation-guard'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { getCommandInterceptorHttpRejection } from '@open-mercato/shared/lib/commands/errors'\n\nconst logger = createLogger('customers')\n\nconst TAG_ASSIGNMENT_RESOURCE_KIND = 'customers.tagAssignment'\n\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['customers.activities.manage'] },\n}\n\nasync function buildContext(\n req: Request\n): Promise<{ ctx: CommandRuntimeContext; auth: Awaited<ReturnType<typeof getAuthFromRequest>>; translate: (key: string, fallback?: string) => string }> {\n const container = await createRequestContainer()\n const auth = await getAuthFromRequest(req)\n const { translate } = await resolveTranslations()\n if (!auth) throw new CrudHttpError(401, { error: translate('customers.errors.unauthorized', 'Unauthorized') })\n const scope = await resolveOrganizationScopeForRequest({ container, auth, request: req })\n const ctx: CommandRuntimeContext = {\n container,\n auth,\n organizationScope: scope,\n selectedOrganizationId: scope
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAClB,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AACnD,SAAS,kCAAkC;AAE3C,SAAS,2BAAoD;AAC7D,SAAS,eAAe,uBAAuB;AAC/C,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,0CAA0C;AAEnD,MAAM,SAAS,aAAa,WAAW;AAEvC,MAAM,+BAA+B;AAE9B,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,6BAA6B,EAAE;AAC9E;AAEA,eAAe,aACb,KACsJ;AACtJ,QAAM,YAAY,MAAM,uBAAuB;AAC/C,QAAM,OAAO,MAAM,mBAAmB,GAAG;AACzC,QAAM,EAAE,UAAU,IAAI,MAAM,oBAAoB;AAChD,MAAI,CAAC,KAAM,OAAM,IAAI,cAAc,KAAK,EAAE,OAAO,UAAU,iCAAiC,cAAc,EAAE,CAAC;AAC7G,QAAM,QAAQ,MAAM,mCAAmC,EAAE,WAAW,MAAM,SAAS,IAAI,CAAC;AACxF,QAAM,MAA6B;AAAA,IACjC;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB,wBAAwB,OAAO,
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'\nimport { resolveSingleOrganizationIdOrDeny } from '@open-mercato/core/modules/directory/utils/organizationScopeFilter'\nimport { serializeOperationMetadata } from '@open-mercato/shared/lib/commands/operationMetadata'\nimport type { CommandRuntimeContext, CommandBus } from '@open-mercato/shared/lib/commands'\nimport { tagAssignmentSchema, type TagAssignmentInput } from '../../../data/validators'\nimport { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'\nimport { withScopedPayload } from '../../utils'\nimport {\n runCrudMutationGuardAfterSuccess,\n validateCrudMutationGuard,\n} from '@open-mercato/shared/lib/crud/mutation-guard'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { getCommandInterceptorHttpRejection } from '@open-mercato/shared/lib/commands/errors'\n\nconst logger = createLogger('customers')\n\nconst TAG_ASSIGNMENT_RESOURCE_KIND = 'customers.tagAssignment'\n\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['customers.activities.manage'] },\n}\n\nasync function buildContext(\n req: Request\n): Promise<{ ctx: CommandRuntimeContext; auth: Awaited<ReturnType<typeof getAuthFromRequest>>; translate: (key: string, fallback?: string) => string }> {\n const container = await createRequestContainer()\n const auth = await getAuthFromRequest(req)\n const { translate } = await resolveTranslations()\n if (!auth) throw new CrudHttpError(401, { error: translate('customers.errors.unauthorized', 'Unauthorized') })\n const scope = await resolveOrganizationScopeForRequest({ container, auth, request: req })\n const ctx: CommandRuntimeContext = {\n container,\n auth,\n organizationScope: scope,\n selectedOrganizationId: resolveSingleOrganizationIdOrDeny(scope, auth) ?? null,\n organizationIds: scope?.filterIds ?? (auth.orgId ? [auth.orgId] : null),\n request: req,\n }\n return { ctx, auth, translate }\n}\n\nexport async function POST(req: Request) {\n try {\n const { ctx, auth, translate } = await buildContext(req)\n const tenantId = auth!.tenantId\n const organizationId = ctx.selectedOrganizationId\n if (!tenantId || !organizationId) {\n return NextResponse.json({ error: translate('customers.errors.context_required', 'Organization and tenant context required') }, { status: 400 })\n }\n const body = await req.json().catch(() => ({}))\n const scoped = withScopedPayload(body, ctx, translate)\n const input = tagAssignmentSchema.parse(scoped)\n\n const guardResult = await validateCrudMutationGuard(ctx.container, {\n tenantId,\n organizationId,\n userId: auth!.sub,\n resourceKind: TAG_ASSIGNMENT_RESOURCE_KIND,\n resourceId: input.entityId,\n operation: 'custom',\n requestMethod: req.method,\n requestHeaders: req.headers,\n mutationPayload: input,\n })\n if (guardResult && !guardResult.ok) {\n return NextResponse.json(guardResult.body, { status: guardResult.status })\n }\n\n const commandBus = (ctx.container.resolve('commandBus') as CommandBus)\n const { result, logEntry } = await commandBus.execute<TagAssignmentInput, { assignmentId: string | null }>(\n 'customers.tags.unassign',\n { input, ctx },\n )\n if (guardResult?.ok && guardResult.shouldRunAfterSuccess) {\n await runCrudMutationGuardAfterSuccess(ctx.container, {\n tenantId,\n organizationId,\n userId: auth!.sub,\n resourceKind: TAG_ASSIGNMENT_RESOURCE_KIND,\n resourceId: input.entityId,\n operation: 'custom',\n requestMethod: req.method,\n requestHeaders: req.headers,\n metadata: guardResult.metadata ?? null,\n })\n }\n const response = NextResponse.json({ id: result?.assignmentId ?? null })\n if (logEntry?.undoToken && logEntry?.id && logEntry?.commandId) {\n response.headers.set(\n 'x-om-operation',\n serializeOperationMetadata({\n id: logEntry.id,\n undoToken: logEntry.undoToken,\n commandId: logEntry.commandId,\n actionLabel: logEntry.actionLabel ?? null,\n resourceKind: logEntry.resourceKind ?? 'customers.tagAssignment',\n resourceId: logEntry.resourceId ?? result?.assignmentId ?? null,\n executedAt: logEntry.createdAt instanceof Date ? logEntry.createdAt.toISOString() : undefined,\n })\n )\n }\n return response\n } catch (err) {\n if (isCrudHttpError(err)) {\n return NextResponse.json(err.body, { status: err.status })\n }\n const interceptorRejection = getCommandInterceptorHttpRejection(err)\n if (interceptorRejection) {\n return NextResponse.json(interceptorRejection.body, { status: interceptorRejection.status })\n }\n const { translate } = await resolveTranslations()\n logger.error('customers.tags.unassign failed', { err })\n return NextResponse.json({ error: translate('customers.errors.unassign_failed', 'Failed to unassign tag') }, { status: 400 })\n }\n}\n\nconst tagUnassignResponseSchema = z.object({\n id: z.string().uuid().nullable(),\n})\n\nconst tagUnassignErrorSchema = z.object({\n error: z.string(),\n})\n\nexport const openApi: OpenApiRouteDoc = {\n tag: 'Customers',\n summary: 'Unassign customer tag',\n methods: {\n POST: {\n summary: 'Remove tag from customer entity',\n description: 'Detaches a tag from a customer entity within the validated tenant / organization scope.',\n requestBody: {\n contentType: 'application/json',\n schema: tagAssignmentSchema,\n },\n responses: [\n { status: 200, description: 'Tag unassigned from customer', schema: tagUnassignResponseSchema },\n ],\n errors: [\n { status: 400, description: 'Validation or unassignment failed', schema: tagUnassignErrorSchema },\n { status: 401, description: 'Unauthorized', schema: tagUnassignErrorSchema },\n { status: 403, description: 'Insufficient tenant/organization access', schema: tagUnassignErrorSchema },\n ],\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAClB,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AACnD,SAAS,yCAAyC;AAClD,SAAS,kCAAkC;AAE3C,SAAS,2BAAoD;AAC7D,SAAS,eAAe,uBAAuB;AAC/C,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,0CAA0C;AAEnD,MAAM,SAAS,aAAa,WAAW;AAEvC,MAAM,+BAA+B;AAE9B,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,6BAA6B,EAAE;AAC9E;AAEA,eAAe,aACb,KACsJ;AACtJ,QAAM,YAAY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AAAA,IAC7F;AACA,UAAM,EAAE,UAAU,IAAI,MAAM,oBAAoB;AAChD,WAAO,MAAM,kCAAkC,EAAE,IAAI,CAAC;AACtD,WAAO,aAAa,KAAK,EAAE,OAAO,UAAU,oCAAoC,wBAAwB,EAAE,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC9H;AACF;AAEA,MAAM,4BAA4B,EAAE,OAAO;AAAA,EACzC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AACjC,CAAC;AAED,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,OAAO,EAAE,OAAO;AAClB,CAAC;AAEM,MAAM,UAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,EACT,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,MACb,aAAa;AAAA,QACX,aAAa;AAAA,QACb,QAAQ;AAAA,MACV;AAAA,MACA,WAAW;AAAA,QACT,EAAE,QAAQ,KAAK,aAAa,gCAAgC,QAAQ,0BAA0B;AAAA,MAChG;AAAA,MACA,QAAQ;AAAA,QACN,EAAE,QAAQ,KAAK,aAAa,qCAAqC,QAAQ,uBAAuB;AAAA,QAChG,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,uBAAuB;AAAA,QAC3E,EAAE,QAAQ,KAAK,aAAa,2CAA2C,QAAQ,uBAAuB;AAAA,MACxG;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -125,8 +125,10 @@ function CustomerCompanyDetailPage({ params }) {
|
|
|
125
125
|
if (!sectionAction || sectionAction.disabled) return;
|
|
126
126
|
sectionAction.onClick();
|
|
127
127
|
}, [sectionAction]);
|
|
128
|
-
React.
|
|
128
|
+
const handleTabChange = React.useCallback((tab) => {
|
|
129
|
+
if (tab === activeTab) return;
|
|
129
130
|
setSectionAction(null);
|
|
131
|
+
setActiveTab(tab);
|
|
130
132
|
}, [activeTab]);
|
|
131
133
|
const validators = React.useMemo(() => ({
|
|
132
134
|
email: (value) => {
|
|
@@ -705,7 +707,7 @@ function CustomerCompanyDetailPage({ params }) {
|
|
|
705
707
|
className: "space-y-6",
|
|
706
708
|
tabs,
|
|
707
709
|
activeTab,
|
|
708
|
-
onTabChange:
|
|
710
|
+
onTabChange: handleTabChange,
|
|
709
711
|
sectionAction,
|
|
710
712
|
onSectionAction: handleSectionAction,
|
|
711
713
|
navAriaLabel: t("customers.companies.detail.tabs.label", "Company detail sections"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/modules/customers/backend/customers/companies/%5Bid%5D/page.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { extensionPoints } from '@open-mercato/core/modules/customers/extension-points'\nimport Link from 'next/link'\nimport { useRouter, useSearchParams } from 'next/navigation'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Separator } from '@open-mercato/ui/primitives/separator'\nimport { Spinner } from '@open-mercato/ui/primitives/spinner'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { apiCallOrThrow, readApiResultOrThrow, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'\nimport { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'\nimport { collectCustomFieldValues } from '@open-mercato/ui/backend/utils/customFieldValues'\nimport { mapCrudServerErrorToFormErrors } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { E } from '#generated/entities.ids.generated'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { RecordNotFoundState, ErrorMessage } from '@open-mercato/ui/backend/detail'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\nimport { DetailFieldsSection, type DetailFieldConfig } from '@open-mercato/ui/backend/detail'\nimport {\n ActivitiesSection,\n} from '../../../../components/detail/ActivitiesSection'\nimport {\n NotesSection,\n type CommentSummary,\n type SectionAction,\n} from '@open-mercato/ui/backend/detail'\nimport {\n TagsSection,\n type TagOption,\n} from '../../../../components/detail/TagsSection'\nimport { DealsSection } from '../../../../components/detail/DealsSection'\nimport { AddressesSection } from '../../../../components/detail/AddressesSection'\nimport { TasksSection } from '../../../../components/detail/TasksSection'\nimport { CustomDataSection } from '../../../../components/detail/CustomDataSection'\nimport { CompanyHighlights } from '../../../../components/detail/CompanyHighlights'\nimport { normalizeCustomFieldSubmitValue } from '../../../../components/detail/customFieldUtils'\nimport { InlineDictionaryEditor, renderMultilineMarkdownDisplay } from '../../../../components/detail/InlineEditors'\nimport { formatTemplate } from '../../../../components/detail/utils'\nimport { coerceDisplayName } from '../../../../lib/displayName'\nimport { isDetailNotFoundStatus } from '@open-mercato/core/modules/customers/lib/detailHelpers'\nimport { createTranslatorWithFallback } from '@open-mercato/shared/lib/i18n/translate'\nimport {\n CompanyPeopleSection,\n type CompanyPersonSummary,\n} from '../../../../components/detail/CompanyPeopleSection'\nimport { AnnualRevenueField } from '../../../../components/detail/AnnualRevenueField'\nimport type { ActivitySummary, DealSummary, TagSummary, TodoLinkSummary } from '../../../../components/detail/types'\nimport { renderDictionaryColor, renderDictionaryIcon } from '@open-mercato/core/modules/dictionaries/components/dictionaryAppearance'\nimport { ICON_SUGGESTIONS } from '../../../../lib/dictionaries'\nimport { createCustomerNotesAdapter } from '../../../../components/detail/notesAdapter'\nimport { readMarkdownPreferenceCookie, writeMarkdownPreferenceCookie } from '../../../../lib/markdownPreference'\nimport { InjectionSpot, useInjectionWidgets } from '@open-mercato/ui/backend/injection/InjectionSpot'\nimport { DetailTabsLayout } from '../../../../components/detail/DetailTabsLayout'\nimport { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'\nimport { SendObjectMessageDialog } from '@open-mercato/ui/backend/messages'\n\ntype CompanyOverview = {\n company: {\n id: string\n displayName: string\n description?: string | null\n ownerUserId?: string | null\n primaryEmail?: string | null\n primaryPhone?: string | null\n status?: string | null\n lifecycleStage?: string | null\n source?: string | null\n nextInteractionAt?: string | null\n nextInteractionName?: string | null\n nextInteractionRefId?: string | null\n nextInteractionIcon?: string | null\n nextInteractionColor?: string | null\n organizationId?: string | null\n updatedAt?: string | null\n }\n profile: {\n id: string\n legalName?: string | null\n brandName?: string | null\n domain?: string | null\n websiteUrl?: string | null\n industry?: string | null\n sizeBucket?: string | null\n annualRevenue?: string | null\n } | null\n customFields: Record<string, unknown>\n tags: TagSummary[]\n comments: CommentSummary[]\n activities: ActivitySummary[]\n deals: DealSummary[]\n todos: TodoLinkSummary[]\n people: CompanyPersonSummary[]\n viewer?: {\n userId: string | null\n name?: string | null\n email?: string | null\n } | null\n}\n\ntype SectionKey = 'notes' | 'activities' | 'deals' | 'people' | 'addresses' | 'tasks' | string\n\nexport default function CustomerCompanyDetailPage({ params }: { params?: { id?: string } }) {\n const id = params?.id\n const t = useT()\n const { confirm, ConfirmDialogElement } = useConfirmDialog()\n const detailTranslator = React.useMemo(() => createTranslatorWithFallback(t), [t])\n const notesAdapter = React.useMemo(() => createCustomerNotesAdapter(detailTranslator), [detailTranslator])\n const router = useRouter()\n const searchParams = useSearchParams()\n const initialTab = React.useMemo(() => {\n const raw = searchParams?.get('tab')\n if (raw === 'notes' || raw === 'activities' || raw === 'deals' || raw === 'people' || raw === 'addresses' || raw === 'tasks') {\n return raw\n }\n return 'notes'\n }, [searchParams])\n const [data, setData] = React.useState<CompanyOverview | null>(null)\n const [isLoading, setIsLoading] = React.useState(true)\n const [error, setError] = React.useState<string | null>(null)\n const [isNotFound, setIsNotFound] = React.useState(false)\n const [activeTab, setActiveTab] = React.useState<SectionKey>(initialTab)\n const [sectionAction, setSectionAction] = React.useState<SectionAction | null>(null)\n const [isDeleting, setIsDeleting] = React.useState(false)\n const currentCompanyId = data?.company?.id ?? null\n const companyDisplayName = coerceDisplayName(data?.company?.displayName)\n const companyName = companyDisplayName.trim().length\n ? companyDisplayName\n : t('customers.companies.list.deleteFallbackName', 'this company')\n const translateCompanyDetail = React.useCallback(\n (key: string, fallback?: string, params?: Record<string, string | number>) => {\n const mappedKey = key.startsWith('customers.people.detail.')\n ? key.replace('customers.people.detail.', 'customers.companies.detail.')\n : key\n const adjustedFallback =\n key.startsWith('customers.people.detail.') && fallback\n ? fallback\n .replace(/\\bPerson\\b/g, 'Company')\n .replace(/\\bperson\\b/g, 'company')\n .replace(/\\bPeople\\b/g, 'Companies')\n .replace(/\\bpeople\\b/g, 'companies')\n : fallback\n const translated = t(mappedKey, params)\n if (translated !== mappedKey || mappedKey === key) return translated\n const fallbackValue = t(key, params)\n if (fallbackValue !== key) return fallbackValue\n if (!adjustedFallback) return mappedKey\n return formatTemplate(adjustedFallback, params)\n },\n [t],\n )\n const sectionLoaderLabel =\n activeTab === 'activities'\n ? t('customers.companies.detail.activities.loading', 'Loading activities\u2026')\n : activeTab === 'deals'\n ? t('customers.companies.detail.deals.loading', 'Loading deals\u2026')\n : activeTab === 'people'\n ? t('customers.companies.detail.people.loading', 'Loading people\u2026')\n : t('customers.companies.detail.sectionLoading', 'Loading\u2026')\n const mutationContextId = React.useMemo(\n () => (currentCompanyId ? `customer-company:${currentCompanyId}` : `customer-company:${id ?? 'pending'}`),\n [currentCompanyId, id],\n )\n const { runMutation, retryLastMutation } = useGuardedMutation<{\n formId: string\n companyId?: string | null\n resourceKind: string\n resourceId?: string\n data: CompanyOverview | null\n retryLastMutation: () => Promise<boolean>\n }>({\n contextId: mutationContextId,\n blockedMessage: t('ui.forms.flash.saveBlocked', 'Save blocked by validation'),\n })\n const injectionContext = React.useMemo(\n () => ({\n formId: mutationContextId,\n companyId: currentCompanyId,\n resourceKind: 'customers.company',\n resourceId: currentCompanyId ?? (id ?? undefined),\n data,\n retryLastMutation,\n }),\n [currentCompanyId, data, id, mutationContextId, retryLastMutation],\n )\n const runMutationWithContext = React.useCallback(\n async <T,>(operation: () => Promise<T>, mutationPayload?: Record<string, unknown>): Promise<T> => {\n return runMutation({\n operation,\n mutationPayload,\n context: injectionContext,\n })\n },\n [injectionContext, runMutation],\n )\n\n const handleSectionActionChange = React.useCallback((action: SectionAction | null) => {\n setSectionAction(action)\n }, [])\n\n const handleSectionAction = React.useCallback(() => {\n if (!sectionAction || sectionAction.disabled) return\n sectionAction.onClick()\n }, [sectionAction])\n\n React.useEffect(() => {\n setSectionAction(null)\n }, [activeTab])\n\n const validators = React.useMemo(() => ({\n email: (value: string) => {\n if (!value) return null\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n return emailRegex.test(value) ? null : t('customers.companies.detail.inline.emailInvalid', 'Enter a valid email address.')\n },\n phone: (value: string) => {\n if (!value) return null\n return value.length >= 3 ? null : t('customers.companies.detail.inline.phoneInvalid', 'Phone number is too short.')\n },\n displayName: (value: string) => {\n const trimmed = value.trim()\n return trimmed.length ? null : t('customers.companies.form.displayName.error', 'Company name is required.')\n },\n website: (value: string) => {\n if (!value) return null\n try {\n const url = new URL(value.trim())\n return url.protocol === 'http:' || url.protocol === 'https:'\n ? null\n : t('customers.companies.detail.inline.websiteInvalid', 'Use a valid http(s) address.')\n } catch {\n return t('customers.companies.detail.inline.websiteInvalid', 'Use a valid http(s) address.')\n }\n },\n annualRevenue: (value: string) => {\n if (!value) return null\n const normalized = value.replace(/[, ]+/g, '')\n const amount = Number(normalized)\n if (Number.isNaN(amount) || amount < 0) {\n return t('customers.companies.detail.inline.annualRevenueInvalid', 'Enter a non-negative number.')\n }\n return null\n },\n }), [t])\n\n const { widgets: injectedTabWidgets } = useInjectionWidgets('customers.company.detail:tabs', {\n context: injectionContext,\n triggerOnLoad: true,\n })\n const injectedTabs = React.useMemo(\n () =>\n (injectedTabWidgets ?? [])\n .filter((widget) => (widget.placement?.kind ?? 'tab') === 'tab')\n .map((widget) => {\n const id = widget.placement?.groupId ?? widget.widgetId\n const label = widget.placement?.groupLabel ?? widget.module.metadata.title\n const priority = typeof widget.placement?.priority === 'number' ? widget.placement.priority : 0\n const render = () => (\n <widget.module.Widget\n context={injectionContext}\n data={data}\n onDataChange={(next) => setData(next as CompanyOverview)}\n />\n )\n return { id, label, priority, render }\n })\n .sort((a, b) => b.priority - a.priority),\n [data, injectedTabWidgets, injectionContext],\n )\n const injectedTabMap = React.useMemo(() => new Map(injectedTabs.map((tab) => [tab.id, tab.render])), [injectedTabs])\n\n const tabs = React.useMemo(\n () => [\n { id: 'notes' as const, label: t('customers.companies.detail.tabs.notes', 'Notes') },\n { id: 'activities' as const, label: t('customers.companies.detail.tabs.activities', 'Activities') },\n { id: 'deals' as const, label: t('customers.companies.detail.tabs.deals', 'Deals') },\n { id: 'people' as const, label: t('customers.companies.detail.tabs.people', 'People') },\n { id: 'addresses' as const, label: t('customers.companies.detail.tabs.addresses', 'Addresses') },\n { id: 'tasks' as const, label: t('customers.companies.detail.tabs.tasks', 'Tasks') },\n ...injectedTabs.map((tab) => ({ id: tab.id as SectionKey, label: tab.label })),\n ],\n [injectedTabs, t],\n )\n\n React.useEffect(() => {\n if (!id) {\n setIsNotFound(true)\n setIsLoading(false)\n return\n }\n const companyId = id\n let cancelled = false\n async function load() {\n setIsLoading(true)\n setError(null)\n try {\n const search = new URLSearchParams()\n search.append('include', 'todos')\n search.append('include', 'people')\n const payload = await readApiResultOrThrow<CompanyOverview>(\n `/api/customers/companies/${encodeURIComponent(companyId)}?${search.toString()}`,\n undefined,\n { errorMessage: t('customers.companies.detail.error.load', 'Failed to load company.') },\n )\n if (cancelled) return\n setData(payload as CompanyOverview)\n } catch (err) {\n if (cancelled) return\n if (isDetailNotFoundStatus((err as { status?: number }).status)) {\n setIsNotFound(true)\n } else {\n const message = err instanceof Error ? err.message : t('customers.companies.detail.error.load', 'Failed to load company.')\n setError(message)\n }\n setData(null)\n } finally {\n if (!cancelled) setIsLoading(false)\n }\n }\n load().catch(() => {})\n return () => {\n cancelled = true\n }\n }, [id, t])\n\n const saveCompany = React.useCallback(\n async (patch: Record<string, unknown>, apply: (prev: CompanyOverview) => CompanyOverview) => {\n if (!data) return\n const payload = { id: data.company.id, ...patch }\n const result = await runMutationWithContext(\n () => withScopedApiRequestHeaders(\n buildOptimisticLockHeader((data?.company as { updatedAt?: string } | undefined)?.updatedAt),\n () => apiCallOrThrow<{ ok?: boolean; updatedAt?: string | null }>(\n '/api/customers/companies',\n {\n method: 'PUT',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(payload),\n },\n { errorMessage: t('customers.companies.detail.inline.error', 'Unable to update company.') },\n ),\n ),\n payload,\n )\n // Refresh the optimistic-lock token so the next sequential inline edit does\n // not send a stale updatedAt and falsely 409 (#2055, default-ON locking).\n const nextUpdatedAt = result?.result?.updatedAt ?? null\n setData((prev) => {\n if (!prev) return prev\n const applied = apply(prev)\n return nextUpdatedAt\n ? { ...applied, company: { ...applied.company, updatedAt: nextUpdatedAt } }\n : applied\n })\n },\n [data, runMutationWithContext, t],\n )\n\n const updateDisplayName = React.useCallback(\n async (next: string | null) => {\n const send = typeof next === 'string' ? next : ''\n await saveCompany(\n { displayName: send },\n (prev) => ({\n ...prev,\n company: {\n ...prev.company,\n displayName: next && next.length ? next : prev.company.displayName,\n },\n })\n )\n },\n [saveCompany],\n )\n\n const updateCompanyField = React.useCallback(\n async (field: 'primaryEmail' | 'primaryPhone' | 'status' | 'lifecycleStage' | 'source', next: string | null) => {\n const send = typeof next === 'string' ? next : ''\n await saveCompany(\n { [field]: send },\n (prev) => ({\n ...prev,\n company: {\n ...prev.company,\n [field]: next && next.length ? next : null,\n },\n })\n )\n },\n [saveCompany],\n )\n\n const updateProfileField = React.useCallback(\n async (\n field: 'brandName' | 'legalName' | 'websiteUrl' | 'industry' | 'domain' | 'sizeBucket',\n next: string | null,\n ) => {\n const send = typeof next === 'string' ? next : ''\n await saveCompany(\n { [field]: send },\n (prev) => {\n if (!prev.profile) return prev\n const nextValue = next && next.length ? next : null\n return {\n ...prev,\n profile: {\n ...prev.profile,\n [field]: nextValue,\n },\n }\n }\n )\n },\n [saveCompany],\n )\n\n const submitCustomFields = React.useCallback(\n async (prefixedValues: Record<string, unknown>, { showFlash = true } = {}) => {\n if (!data) throw new Error(t('customers.companies.detail.inline.error', 'Unable to update company.'))\n const customPayload = collectCustomFieldValues(prefixedValues, {\n transform: (value) => normalizeCustomFieldSubmitValue(value),\n })\n const normalized: Record<string, unknown> = {}\n for (const [fieldId, value] of Object.entries(customPayload)) {\n normalized[`cf_${fieldId}`] = value\n }\n if (!Object.keys(customPayload).length) {\n if (showFlash) flash(t('ui.forms.flash.saveSuccess', 'Saved successfully.'), 'success')\n return\n }\n const payload = {\n id: data.company.id,\n customFields: customPayload,\n }\n let customFieldsUpdatedAt: string | null = null\n try {\n const result = await runMutationWithContext(\n () => withScopedApiRequestHeaders(\n buildOptimisticLockHeader((data?.company as { updatedAt?: string } | undefined)?.updatedAt),\n () => apiCallOrThrow<{ ok?: boolean; updatedAt?: string | null }>(\n '/api/customers/companies',\n {\n method: 'PUT',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(payload),\n },\n { errorMessage: t('customers.companies.detail.inline.error', 'Unable to update company.') },\n ),\n ),\n payload,\n )\n customFieldsUpdatedAt = result?.result?.updatedAt ?? null\n } catch (err) {\n const { message: helperMessage, fieldErrors } = mapCrudServerErrorToFormErrors(err)\n const message = helperMessage ?? t('customers.companies.detail.inline.error', 'Unable to update company.')\n const mappedErrors: Record<string, string> | undefined = fieldErrors\n ? Object.entries(fieldErrors).reduce<Record<string, string>>((acc, [key, value]) => {\n const formKey = key.startsWith('cf_') ? key : `cf_${key}`\n acc[formKey] = value\n return acc\n }, {})\n : undefined\n const error = new Error(message) as Error & { fieldErrors?: Record<string, string> }\n if (mappedErrors && Object.keys(mappedErrors).length) error.fieldErrors = mappedErrors\n throw error\n }\n setData((prev) => {\n if (!prev) return prev\n return {\n ...prev,\n company: customFieldsUpdatedAt\n ? { ...prev.company, updatedAt: customFieldsUpdatedAt }\n : prev.company,\n customFields: {\n ...prev.customFields,\n ...normalized,\n },\n }\n })\n if (showFlash) flash(t('ui.forms.flash.saveSuccess', 'Saved successfully.'), 'success')\n },\n [data, runMutationWithContext, t],\n )\n\n const handleAnnualRevenueChange = React.useCallback(\n async ({ amount, currency }: { amount: number | null; currency: string | null }) => {\n await saveCompany(\n { annualRevenue: amount ?? null },\n (prev) => {\n if (!prev.profile) return prev\n return {\n ...prev,\n profile: {\n ...prev.profile,\n annualRevenue: amount === null ? null : String(amount),\n },\n }\n }\n )\n await submitCustomFields(\n { cf_annual_revenue_currency: currency ?? null },\n { showFlash: false },\n )\n flash(t('ui.forms.flash.saveSuccess', 'Saved successfully.'), 'success')\n },\n [saveCompany, submitCustomFields, t],\n )\n\n const handleDelete = React.useCallback(async () => {\n if (!currentCompanyId) return\n const confirmed = await confirm({\n title: t('customers.companies.list.deleteConfirm', undefined, { name: companyName }),\n variant: 'destructive',\n })\n if (!confirmed) return\n setIsDeleting(true)\n try {\n await runMutationWithContext(\n () => withScopedApiRequestHeaders(\n buildOptimisticLockHeader((data?.company as { updatedAt?: string } | undefined)?.updatedAt),\n () => apiCallOrThrow(\n `/api/customers/companies?id=${encodeURIComponent(currentCompanyId)}`,\n {\n method: 'DELETE',\n headers: { 'content-type': 'application/json' },\n },\n { errorMessage: t('customers.companies.list.deleteError', 'Failed to delete company.') },\n ),\n ),\n { id: currentCompanyId },\n )\n flash(t('customers.companies.list.deleteSuccess', 'Company deleted.'), 'success')\n router.push('/backend/customers/companies')\n } catch (err) {\n const message = err instanceof Error ? err.message : t('customers.companies.list.deleteError', 'Failed to delete company.')\n flash(message, 'error')\n } finally {\n setIsDeleting(false)\n }\n }, [companyName, confirm, currentCompanyId, router, runMutationWithContext, t])\n\n const handleTagsChange = React.useCallback((nextTags: TagOption[]) => {\n setData((prev) => (prev ? { ...prev, tags: nextTags } : prev))\n }, [])\n\n const handleCustomFieldsSubmit = React.useCallback(\n async (values: Record<string, unknown>) => {\n await submitCustomFields(values)\n },\n [submitCustomFields],\n )\n\n const handleNotesLoadingChange = React.useCallback(() => {}, [])\n\n const handleActivitiesLoadingChange = React.useCallback(() => {}, [])\n\n const handleDealsLoadingChange = React.useCallback(() => {}, [])\n\n const handlePeopleLoadingChange = React.useCallback(() => {}, [])\n\n const handleAddressesLoadingChange = React.useCallback(() => {}, [])\n\n const handleTasksLoadingChange = React.useCallback(() => {}, [])\n\n const dealsScope = React.useMemo(\n () => (currentCompanyId ? ({ kind: 'company', entityId: currentCompanyId } as const) : null),\n [currentCompanyId],\n )\n\n if (isLoading) {\n return (\n <Page>\n <PageBody>\n <div className=\"flex h-[50vh] flex-col items-center justify-center gap-2 text-muted-foreground\">\n <Spinner className=\"h-6 w-6\" />\n <span>{t('customers.companies.detail.loading', 'Loading company\u2026')}</span>\n </div>\n </PageBody>\n </Page>\n )\n }\n\n if (isNotFound) {\n return (\n <Page>\n <PageBody>\n <RecordNotFoundState\n label={t('customers.companies.detail.error.notFound', 'Company not found.')}\n backHref=\"/backend/customers/companies\"\n backLabel={t('customers.companies.detail.actions.backToList', 'Back to companies')}\n />\n </PageBody>\n </Page>\n )\n }\n\n if (error || !data?.company?.id) {\n return (\n <Page>\n <PageBody>\n <ErrorMessage\n label={error ?? t('customers.companies.detail.error.notFound', 'Company not found.')}\n action={\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/backend/customers/companies\">\n {t('customers.companies.detail.actions.backToList', 'Back to companies')}\n </Link>\n </Button>\n }\n />\n </PageBody>\n </Page>\n )\n }\n\n const { company, profile } = data\n const companyId = company.id\n\n const annualRevenueCurrency =\n typeof data.customFields?.annual_revenue_currency === 'string'\n ? (data.customFields.annual_revenue_currency as string)\n : null\n\n const detailFields: DetailFieldConfig[] = [\n {\n key: 'displayName',\n kind: 'text',\n label: t('customers.companies.detail.fields.displayName', 'Display name'),\n value: company.displayName,\n placeholder: t('customers.companies.form.displayName.placeholder', 'Enter company name'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n validator: validators.displayName,\n onSave: updateDisplayName,\n },\n {\n key: 'legalName',\n kind: 'text',\n label: t('customers.companies.detail.fields.legalName', 'Legal name'),\n value: profile?.legalName ?? null,\n placeholder: t('customers.companies.detail.fields.legalNamePlaceholder', 'Add legal name'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n onSave: (value) => updateProfileField('legalName', value),\n },\n {\n key: 'brandName',\n kind: 'text',\n label: t('customers.companies.detail.fields.brandName', 'Brand name'),\n value: profile?.brandName ?? null,\n placeholder: t('customers.companies.detail.fields.brandNamePlaceholder', 'Add brand name'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n onSave: (value) => updateProfileField('brandName', value),\n },\n {\n key: 'description',\n kind: 'multiline',\n label: t('customers.companies.detail.fields.description', 'Description'),\n value: company.description ?? null,\n placeholder: t('customers.companies.detail.fields.descriptionPlaceholder', 'Describe the company'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n gridClassName: 'sm:col-span-2 xl:col-span-3',\n renderDisplay: renderMultilineMarkdownDisplay,\n onSave: async (next) => {\n const send = typeof next === 'string' ? next : ''\n await saveCompany(\n { description: send },\n (prev) => ({\n ...prev,\n company: { ...prev.company, description: next && next.length ? next : null },\n })\n )\n },\n },\n {\n key: 'lifecycleStage',\n kind: 'custom',\n label: t('customers.companies.detail.fields.lifecycleStage', 'Lifecycle stage'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n render: () => (\n <InlineDictionaryEditor\n label={t('customers.companies.detail.fields.lifecycleStage', 'Lifecycle stage')}\n value={company.lifecycleStage ?? null}\n emptyLabel={t('customers.companies.detail.noValue', 'Not provided')}\n kind=\"lifecycle-stages\"\n onSave={(next) => updateCompanyField('lifecycleStage', next)}\n selectClassName=\"h-9 w-full rounded border px-3 text-sm\"\n variant=\"muted\"\n activateOnClick\n />\n ),\n },\n {\n key: 'source',\n kind: 'custom',\n label: t('customers.companies.detail.fields.source', 'Source'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n render: () => (\n <InlineDictionaryEditor\n label={t('customers.companies.detail.fields.source', 'Source')}\n value={company.source ?? null}\n emptyLabel={t('customers.companies.detail.noValue', 'Not provided')}\n kind=\"sources\"\n onSave={(next) => updateCompanyField('source', next)}\n selectClassName=\"h-9 w-full rounded border px-3 text-sm\"\n variant=\"muted\"\n activateOnClick\n />\n ),\n },\n {\n key: 'domain',\n kind: 'text',\n label: t('customers.companies.detail.fields.domain', 'Domain'),\n value: profile?.domain ?? null,\n placeholder: t('customers.companies.detail.fields.domainPlaceholder', 'example.com'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n onSave: (value) => updateProfileField('domain', value),\n },\n {\n key: 'industry',\n kind: 'custom',\n label: t('customers.companies.detail.fields.industry', 'Industry'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n render: () => (\n <InlineDictionaryEditor\n label={t('customers.companies.detail.fields.industry', 'Industry')}\n value={profile?.industry ?? null}\n emptyLabel={t('customers.companies.detail.noValue', 'Not provided')}\n kind=\"industries\"\n onSave={(next) => updateProfileField('industry', next)}\n selectClassName=\"h-9 w-full rounded border px-3 text-sm\"\n variant=\"muted\"\n activateOnClick\n />\n ),\n },\n {\n key: 'sizeBucket',\n kind: 'text',\n label: t('customers.companies.detail.fields.sizeBucket', 'Company size'),\n value: profile?.sizeBucket ?? null,\n placeholder: t('customers.companies.detail.fields.sizeBucketPlaceholder', 'Add size bucket'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n onSave: (value) => updateProfileField('sizeBucket', value),\n },\n {\n key: 'annualRevenue',\n kind: 'custom',\n label: t('customers.companies.detail.fields.annualRevenue', 'Annual revenue'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n render: () => (\n <AnnualRevenueField\n label={t('customers.companies.detail.fields.annualRevenue', 'Annual revenue')}\n amount={profile?.annualRevenue ?? null}\n currency={annualRevenueCurrency}\n emptyLabel={t('customers.companies.detail.noValue', 'Not provided')}\n validator={validators.annualRevenue}\n onSave={handleAnnualRevenueChange}\n />\n ),\n },\n {\n key: 'websiteUrl',\n kind: 'text',\n label: t('customers.companies.detail.fields.website', 'Website'),\n value: profile?.websiteUrl ?? null,\n placeholder: t('customers.companies.detail.fields.websitePlaceholder', 'https://example.com'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n inputType: 'url',\n validator: validators.website,\n onSave: (value) => updateProfileField('websiteUrl', value),\n },\n ]\n\n return (\n <Page>\n <PageBody>\n <div className=\"space-y-8\">\n <CompanyHighlights\n company={company}\n profile={profile ?? null}\n validators={validators}\n onDisplayNameSave={updateDisplayName}\n utilityActions={(\n <SendObjectMessageDialog\n object={{\n entityModule: 'customers',\n entityType: 'company',\n entityId: companyId,\n previewData: {\n title: company.displayName,\n subtitle: company.primaryEmail ?? undefined,\n metadata: {\n [t('customers.companies.detail.highlights.primaryPhone')]: company.primaryPhone ?? '-',\n [t('customers.companies.detail.fields.industry')]: profile?.industry ?? '-',\n },\n },\n }}\n viewHref={`/backend/customers/companies/${companyId}`}\n />\n )}\n onPrimaryEmailSave={(value) => updateCompanyField('primaryEmail', value)}\n onPrimaryPhoneSave={(value) => updateCompanyField('primaryPhone', value)}\n onStatusSave={(value) => updateCompanyField('status', value)}\n onNextInteractionSave={async (payload) => {\n await saveCompany(\n {\n nextInteraction: payload\n ? {\n at: payload.at,\n name: payload.name ?? undefined,\n refId: payload.refId ?? undefined,\n icon: payload.icon ?? undefined,\n color: payload.color ?? undefined,\n }\n : null,\n },\n (prev) => ({\n ...prev,\n company: {\n ...prev.company,\n nextInteractionAt: payload?.at ?? null,\n nextInteractionName: payload?.name ?? null,\n nextInteractionRefId: payload?.refId ?? null,\n nextInteractionIcon: payload?.icon ?? null,\n nextInteractionColor: payload?.color ?? null,\n },\n })\n )\n }}\n onDelete={handleDelete}\n isDeleting={isDeleting}\n />\n\n <DetailTabsLayout\n className=\"space-y-6\"\n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n sectionAction={sectionAction}\n onSectionAction={handleSectionAction}\n navAriaLabel={t('customers.companies.detail.tabs.label', 'Company detail sections')}\n navClassName=\"gap-4\"\n >\n {(() => {\n const injected = injectedTabMap.get(activeTab)\n if (injected) return injected()\n if (activeTab === 'notes') {\n return (\n <NotesSection\n entityId={companyId}\n emptyLabel={t('customers.companies.detail.empty.comments', 'No notes yet.')}\n viewerUserId={data.viewer?.userId ?? null}\n viewerName={data.viewer?.name ?? null}\n viewerEmail={data.viewer?.email ?? null}\n addActionLabel={t('customers.companies.detail.notes.addLabel', 'Add note')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.notes.title', 'Keep everyone in the loop'),\n actionLabel: t('customers.companies.detail.emptyState.notes.action', 'Create a note'),\n }}\n onActionChange={handleSectionActionChange}\n translator={translateCompanyDetail}\n onLoadingChange={handleNotesLoadingChange}\n dataAdapter={notesAdapter}\n renderIcon={renderDictionaryIcon}\n renderColor={renderDictionaryColor}\n iconSuggestions={ICON_SUGGESTIONS}\n readMarkdownPreference={readMarkdownPreferenceCookie}\n writeMarkdownPreference={writeMarkdownPreferenceCookie}\n />\n )\n }\n if (activeTab === 'activities') {\n return (\n <ActivitiesSection\n entityId={companyId}\n runGuardedMutation={runMutationWithContext}\n addActionLabel={t('customers.companies.detail.activities.add', 'Log activity')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.activities.title', 'No activities logged yet'),\n actionLabel: t('customers.companies.detail.emptyState.activities.action', 'Log activity'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handleActivitiesLoadingChange}\n />\n )\n }\n if (activeTab === 'deals') {\n return (\n <DealsSection\n scope={dealsScope}\n emptyLabel={t('customers.companies.detail.empty.deals', 'No deals linked to this company.')}\n addActionLabel={t('customers.companies.detail.actions.addDeal', 'Add deal')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.deals.title', 'No deals yet'),\n actionLabel: t('customers.companies.detail.emptyState.deals.action', 'Create a deal'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handleDealsLoadingChange}\n translator={detailTranslator}\n runGuardedMutation={runMutationWithContext}\n />\n )\n }\n if (activeTab === 'people') {\n return (\n <CompanyPeopleSection\n companyId={companyId}\n initialPeople={data.people ?? []}\n addActionLabel={t('customers.companies.detail.people.add', 'Add person')}\n emptyLabel={t('customers.companies.detail.people.empty', 'No people linked to this company yet.')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.people.title', 'Build the account team'),\n actionLabel: t('customers.companies.detail.emptyState.people.action', 'Create person'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handlePeopleLoadingChange}\n translator={detailTranslator}\n runGuardedMutation={runMutationWithContext}\n onPeopleChange={(next) => {\n setData((prev) => (prev ? { ...prev, people: next } : prev))\n }}\n />\n )\n }\n if (activeTab === 'addresses') {\n return (\n <AddressesSection\n entityId={companyId}\n emptyLabel={t('customers.companies.detail.empty.addresses', 'No addresses recorded.')}\n addActionLabel={t('customers.companies.detail.addresses.add', 'Add address')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.addresses.title', 'No addresses yet'),\n actionLabel: t('customers.companies.detail.emptyState.addresses.action', 'Add address'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handleAddressesLoadingChange}\n translator={detailTranslator}\n />\n )\n }\n if (activeTab === 'tasks') {\n return (\n <TasksSection\n entityId={companyId}\n initialTasks={data.todos}\n runGuardedMutation={runMutationWithContext}\n emptyLabel={t('customers.companies.detail.empty.todos', 'No tasks linked to this company.')}\n addActionLabel={t('customers.companies.detail.tasks.add', 'Add task')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.tasks.title', 'Plan what happens next'),\n actionLabel: t('customers.companies.detail.emptyState.tasks.action', 'Create task'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handleTasksLoadingChange}\n translator={translateCompanyDetail}\n entityName={companyName}\n dialogContextKey=\"customers.companies.detail.tasks.dialog.context\"\n dialogContextFallback=\"This task will be linked to {{name}}\"\n />\n )\n }\n return null\n })()}\n </DetailTabsLayout>\n\n <div className=\"space-y-6\">\n <div className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold\">{t('customers.companies.detail.sections.details', 'Company details')}</h2>\n <DetailFieldsSection fields={detailFields} />\n <InjectionSpot\n spotId={extensionPoints.hosts.companyLegacyDetails.spotId}\n context={injectionContext}\n data={data}\n onDataChange={(next) => setData(next as CompanyOverview)}\n />\n </div>\n\n <CustomDataSection\n entityIds={[E.customers.customer_entity, E.customers.customer_company_profile]}\n values={data.customFields ?? {}}\n onSubmit={handleCustomFieldsSubmit}\n title={t('customers.companies.detail.sections.customFields', 'Custom fields')}\n />\n\n <TagsSection\n entityId={companyId}\n tags={data.tags}\n onChange={handleTagsChange}\n isSubmitting={false}\n />\n </div>\n\n <Separator className=\"my-4\" />\n </div>\n </PageBody>\n {ConfirmDialogElement}\n </Page>\n )\n}\n"],
|
|
5
|
-
"mappings": ";AAmQY,cA2TF,YA3TE;AAjQZ,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,OAAO,UAAU;AACjB,SAAS,WAAW,uBAAuB;AAC3C,SAAS,MAAM,gBAAgB;AAC/B,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,gBAAgB,sBAAsB,mCAAmC;AAClF,SAAS,iCAAiC;AAC1C,SAAS,gCAAgC;AACzC,SAAS,sCAAsC;AAC/C,SAAS,SAAS;AAClB,SAAS,YAAY;AACrB,SAAS,qBAAqB,oBAAoB;AAClD,SAAS,wBAAwB;AACjC,SAAS,2BAAmD;AAC5D;AAAA,EACE;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,uCAAuC;AAChD,SAAS,wBAAwB,sCAAsC;AACvE,SAAS,sBAAsB;AAC/B,SAAS,yBAAy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AAU;AAAA,YACV,MAAM,KAAK;AAAA,YACX,UAAU;AAAA,YACV,cAAc;AAAA;AAAA,QAChB;AAAA,SACF;AAAA,MAEA,oBAAC,aAAU,WAAU,QAAO;AAAA,OAC9B,GACF;AAAA,IACC;AAAA,KACH;AAEJ;",
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { extensionPoints } from '@open-mercato/core/modules/customers/extension-points'\nimport Link from 'next/link'\nimport { useRouter, useSearchParams } from 'next/navigation'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Separator } from '@open-mercato/ui/primitives/separator'\nimport { Spinner } from '@open-mercato/ui/primitives/spinner'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { apiCallOrThrow, readApiResultOrThrow, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'\nimport { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'\nimport { collectCustomFieldValues } from '@open-mercato/ui/backend/utils/customFieldValues'\nimport { mapCrudServerErrorToFormErrors } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { E } from '#generated/entities.ids.generated'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { RecordNotFoundState, ErrorMessage } from '@open-mercato/ui/backend/detail'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\nimport { DetailFieldsSection, type DetailFieldConfig } from '@open-mercato/ui/backend/detail'\nimport {\n ActivitiesSection,\n} from '../../../../components/detail/ActivitiesSection'\nimport {\n NotesSection,\n type CommentSummary,\n type SectionAction,\n} from '@open-mercato/ui/backend/detail'\nimport {\n TagsSection,\n type TagOption,\n} from '../../../../components/detail/TagsSection'\nimport { DealsSection } from '../../../../components/detail/DealsSection'\nimport { AddressesSection } from '../../../../components/detail/AddressesSection'\nimport { TasksSection } from '../../../../components/detail/TasksSection'\nimport { CustomDataSection } from '../../../../components/detail/CustomDataSection'\nimport { CompanyHighlights } from '../../../../components/detail/CompanyHighlights'\nimport { normalizeCustomFieldSubmitValue } from '../../../../components/detail/customFieldUtils'\nimport { InlineDictionaryEditor, renderMultilineMarkdownDisplay } from '../../../../components/detail/InlineEditors'\nimport { formatTemplate } from '../../../../components/detail/utils'\nimport { coerceDisplayName } from '../../../../lib/displayName'\nimport { isDetailNotFoundStatus } from '@open-mercato/core/modules/customers/lib/detailHelpers'\nimport { createTranslatorWithFallback } from '@open-mercato/shared/lib/i18n/translate'\nimport {\n CompanyPeopleSection,\n type CompanyPersonSummary,\n} from '../../../../components/detail/CompanyPeopleSection'\nimport { AnnualRevenueField } from '../../../../components/detail/AnnualRevenueField'\nimport type { ActivitySummary, DealSummary, TagSummary, TodoLinkSummary } from '../../../../components/detail/types'\nimport { renderDictionaryColor, renderDictionaryIcon } from '@open-mercato/core/modules/dictionaries/components/dictionaryAppearance'\nimport { ICON_SUGGESTIONS } from '../../../../lib/dictionaries'\nimport { createCustomerNotesAdapter } from '../../../../components/detail/notesAdapter'\nimport { readMarkdownPreferenceCookie, writeMarkdownPreferenceCookie } from '../../../../lib/markdownPreference'\nimport { InjectionSpot, useInjectionWidgets } from '@open-mercato/ui/backend/injection/InjectionSpot'\nimport { DetailTabsLayout } from '../../../../components/detail/DetailTabsLayout'\nimport { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'\nimport { SendObjectMessageDialog } from '@open-mercato/ui/backend/messages'\n\ntype CompanyOverview = {\n company: {\n id: string\n displayName: string\n description?: string | null\n ownerUserId?: string | null\n primaryEmail?: string | null\n primaryPhone?: string | null\n status?: string | null\n lifecycleStage?: string | null\n source?: string | null\n nextInteractionAt?: string | null\n nextInteractionName?: string | null\n nextInteractionRefId?: string | null\n nextInteractionIcon?: string | null\n nextInteractionColor?: string | null\n organizationId?: string | null\n updatedAt?: string | null\n }\n profile: {\n id: string\n legalName?: string | null\n brandName?: string | null\n domain?: string | null\n websiteUrl?: string | null\n industry?: string | null\n sizeBucket?: string | null\n annualRevenue?: string | null\n } | null\n customFields: Record<string, unknown>\n tags: TagSummary[]\n comments: CommentSummary[]\n activities: ActivitySummary[]\n deals: DealSummary[]\n todos: TodoLinkSummary[]\n people: CompanyPersonSummary[]\n viewer?: {\n userId: string | null\n name?: string | null\n email?: string | null\n } | null\n}\n\ntype SectionKey = 'notes' | 'activities' | 'deals' | 'people' | 'addresses' | 'tasks' | string\n\nexport default function CustomerCompanyDetailPage({ params }: { params?: { id?: string } }) {\n const id = params?.id\n const t = useT()\n const { confirm, ConfirmDialogElement } = useConfirmDialog()\n const detailTranslator = React.useMemo(() => createTranslatorWithFallback(t), [t])\n const notesAdapter = React.useMemo(() => createCustomerNotesAdapter(detailTranslator), [detailTranslator])\n const router = useRouter()\n const searchParams = useSearchParams()\n const initialTab = React.useMemo(() => {\n const raw = searchParams?.get('tab')\n if (raw === 'notes' || raw === 'activities' || raw === 'deals' || raw === 'people' || raw === 'addresses' || raw === 'tasks') {\n return raw\n }\n return 'notes'\n }, [searchParams])\n const [data, setData] = React.useState<CompanyOverview | null>(null)\n const [isLoading, setIsLoading] = React.useState(true)\n const [error, setError] = React.useState<string | null>(null)\n const [isNotFound, setIsNotFound] = React.useState(false)\n const [activeTab, setActiveTab] = React.useState<SectionKey>(initialTab)\n const [sectionAction, setSectionAction] = React.useState<SectionAction | null>(null)\n const [isDeleting, setIsDeleting] = React.useState(false)\n const currentCompanyId = data?.company?.id ?? null\n const companyDisplayName = coerceDisplayName(data?.company?.displayName)\n const companyName = companyDisplayName.trim().length\n ? companyDisplayName\n : t('customers.companies.list.deleteFallbackName', 'this company')\n const translateCompanyDetail = React.useCallback(\n (key: string, fallback?: string, params?: Record<string, string | number>) => {\n const mappedKey = key.startsWith('customers.people.detail.')\n ? key.replace('customers.people.detail.', 'customers.companies.detail.')\n : key\n const adjustedFallback =\n key.startsWith('customers.people.detail.') && fallback\n ? fallback\n .replace(/\\bPerson\\b/g, 'Company')\n .replace(/\\bperson\\b/g, 'company')\n .replace(/\\bPeople\\b/g, 'Companies')\n .replace(/\\bpeople\\b/g, 'companies')\n : fallback\n const translated = t(mappedKey, params)\n if (translated !== mappedKey || mappedKey === key) return translated\n const fallbackValue = t(key, params)\n if (fallbackValue !== key) return fallbackValue\n if (!adjustedFallback) return mappedKey\n return formatTemplate(adjustedFallback, params)\n },\n [t],\n )\n const sectionLoaderLabel =\n activeTab === 'activities'\n ? t('customers.companies.detail.activities.loading', 'Loading activities\u2026')\n : activeTab === 'deals'\n ? t('customers.companies.detail.deals.loading', 'Loading deals\u2026')\n : activeTab === 'people'\n ? t('customers.companies.detail.people.loading', 'Loading people\u2026')\n : t('customers.companies.detail.sectionLoading', 'Loading\u2026')\n const mutationContextId = React.useMemo(\n () => (currentCompanyId ? `customer-company:${currentCompanyId}` : `customer-company:${id ?? 'pending'}`),\n [currentCompanyId, id],\n )\n const { runMutation, retryLastMutation } = useGuardedMutation<{\n formId: string\n companyId?: string | null\n resourceKind: string\n resourceId?: string\n data: CompanyOverview | null\n retryLastMutation: () => Promise<boolean>\n }>({\n contextId: mutationContextId,\n blockedMessage: t('ui.forms.flash.saveBlocked', 'Save blocked by validation'),\n })\n const injectionContext = React.useMemo(\n () => ({\n formId: mutationContextId,\n companyId: currentCompanyId,\n resourceKind: 'customers.company',\n resourceId: currentCompanyId ?? (id ?? undefined),\n data,\n retryLastMutation,\n }),\n [currentCompanyId, data, id, mutationContextId, retryLastMutation],\n )\n const runMutationWithContext = React.useCallback(\n async <T,>(operation: () => Promise<T>, mutationPayload?: Record<string, unknown>): Promise<T> => {\n return runMutation({\n operation,\n mutationPayload,\n context: injectionContext,\n })\n },\n [injectionContext, runMutation],\n )\n\n const handleSectionActionChange = React.useCallback((action: SectionAction | null) => {\n setSectionAction(action)\n }, [])\n\n const handleSectionAction = React.useCallback(() => {\n if (!sectionAction || sectionAction.disabled) return\n sectionAction.onClick()\n }, [sectionAction])\n\n const handleTabChange = React.useCallback((tab: SectionKey) => {\n if (tab === activeTab) return\n setSectionAction(null)\n setActiveTab(tab)\n }, [activeTab])\n\n const validators = React.useMemo(() => ({\n email: (value: string) => {\n if (!value) return null\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n return emailRegex.test(value) ? null : t('customers.companies.detail.inline.emailInvalid', 'Enter a valid email address.')\n },\n phone: (value: string) => {\n if (!value) return null\n return value.length >= 3 ? null : t('customers.companies.detail.inline.phoneInvalid', 'Phone number is too short.')\n },\n displayName: (value: string) => {\n const trimmed = value.trim()\n return trimmed.length ? null : t('customers.companies.form.displayName.error', 'Company name is required.')\n },\n website: (value: string) => {\n if (!value) return null\n try {\n const url = new URL(value.trim())\n return url.protocol === 'http:' || url.protocol === 'https:'\n ? null\n : t('customers.companies.detail.inline.websiteInvalid', 'Use a valid http(s) address.')\n } catch {\n return t('customers.companies.detail.inline.websiteInvalid', 'Use a valid http(s) address.')\n }\n },\n annualRevenue: (value: string) => {\n if (!value) return null\n const normalized = value.replace(/[, ]+/g, '')\n const amount = Number(normalized)\n if (Number.isNaN(amount) || amount < 0) {\n return t('customers.companies.detail.inline.annualRevenueInvalid', 'Enter a non-negative number.')\n }\n return null\n },\n }), [t])\n\n const { widgets: injectedTabWidgets } = useInjectionWidgets('customers.company.detail:tabs', {\n context: injectionContext,\n triggerOnLoad: true,\n })\n const injectedTabs = React.useMemo(\n () =>\n (injectedTabWidgets ?? [])\n .filter((widget) => (widget.placement?.kind ?? 'tab') === 'tab')\n .map((widget) => {\n const id = widget.placement?.groupId ?? widget.widgetId\n const label = widget.placement?.groupLabel ?? widget.module.metadata.title\n const priority = typeof widget.placement?.priority === 'number' ? widget.placement.priority : 0\n const render = () => (\n <widget.module.Widget\n context={injectionContext}\n data={data}\n onDataChange={(next) => setData(next as CompanyOverview)}\n />\n )\n return { id, label, priority, render }\n })\n .sort((a, b) => b.priority - a.priority),\n [data, injectedTabWidgets, injectionContext],\n )\n const injectedTabMap = React.useMemo(() => new Map(injectedTabs.map((tab) => [tab.id, tab.render])), [injectedTabs])\n\n const tabs = React.useMemo(\n () => [\n { id: 'notes' as const, label: t('customers.companies.detail.tabs.notes', 'Notes') },\n { id: 'activities' as const, label: t('customers.companies.detail.tabs.activities', 'Activities') },\n { id: 'deals' as const, label: t('customers.companies.detail.tabs.deals', 'Deals') },\n { id: 'people' as const, label: t('customers.companies.detail.tabs.people', 'People') },\n { id: 'addresses' as const, label: t('customers.companies.detail.tabs.addresses', 'Addresses') },\n { id: 'tasks' as const, label: t('customers.companies.detail.tabs.tasks', 'Tasks') },\n ...injectedTabs.map((tab) => ({ id: tab.id as SectionKey, label: tab.label })),\n ],\n [injectedTabs, t],\n )\n\n React.useEffect(() => {\n if (!id) {\n setIsNotFound(true)\n setIsLoading(false)\n return\n }\n const companyId = id\n let cancelled = false\n async function load() {\n setIsLoading(true)\n setError(null)\n try {\n const search = new URLSearchParams()\n search.append('include', 'todos')\n search.append('include', 'people')\n const payload = await readApiResultOrThrow<CompanyOverview>(\n `/api/customers/companies/${encodeURIComponent(companyId)}?${search.toString()}`,\n undefined,\n { errorMessage: t('customers.companies.detail.error.load', 'Failed to load company.') },\n )\n if (cancelled) return\n setData(payload as CompanyOverview)\n } catch (err) {\n if (cancelled) return\n if (isDetailNotFoundStatus((err as { status?: number }).status)) {\n setIsNotFound(true)\n } else {\n const message = err instanceof Error ? err.message : t('customers.companies.detail.error.load', 'Failed to load company.')\n setError(message)\n }\n setData(null)\n } finally {\n if (!cancelled) setIsLoading(false)\n }\n }\n load().catch(() => {})\n return () => {\n cancelled = true\n }\n }, [id, t])\n\n const saveCompany = React.useCallback(\n async (patch: Record<string, unknown>, apply: (prev: CompanyOverview) => CompanyOverview) => {\n if (!data) return\n const payload = { id: data.company.id, ...patch }\n const result = await runMutationWithContext(\n () => withScopedApiRequestHeaders(\n buildOptimisticLockHeader((data?.company as { updatedAt?: string } | undefined)?.updatedAt),\n () => apiCallOrThrow<{ ok?: boolean; updatedAt?: string | null }>(\n '/api/customers/companies',\n {\n method: 'PUT',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(payload),\n },\n { errorMessage: t('customers.companies.detail.inline.error', 'Unable to update company.') },\n ),\n ),\n payload,\n )\n // Refresh the optimistic-lock token so the next sequential inline edit does\n // not send a stale updatedAt and falsely 409 (#2055, default-ON locking).\n const nextUpdatedAt = result?.result?.updatedAt ?? null\n setData((prev) => {\n if (!prev) return prev\n const applied = apply(prev)\n return nextUpdatedAt\n ? { ...applied, company: { ...applied.company, updatedAt: nextUpdatedAt } }\n : applied\n })\n },\n [data, runMutationWithContext, t],\n )\n\n const updateDisplayName = React.useCallback(\n async (next: string | null) => {\n const send = typeof next === 'string' ? next : ''\n await saveCompany(\n { displayName: send },\n (prev) => ({\n ...prev,\n company: {\n ...prev.company,\n displayName: next && next.length ? next : prev.company.displayName,\n },\n })\n )\n },\n [saveCompany],\n )\n\n const updateCompanyField = React.useCallback(\n async (field: 'primaryEmail' | 'primaryPhone' | 'status' | 'lifecycleStage' | 'source', next: string | null) => {\n const send = typeof next === 'string' ? next : ''\n await saveCompany(\n { [field]: send },\n (prev) => ({\n ...prev,\n company: {\n ...prev.company,\n [field]: next && next.length ? next : null,\n },\n })\n )\n },\n [saveCompany],\n )\n\n const updateProfileField = React.useCallback(\n async (\n field: 'brandName' | 'legalName' | 'websiteUrl' | 'industry' | 'domain' | 'sizeBucket',\n next: string | null,\n ) => {\n const send = typeof next === 'string' ? next : ''\n await saveCompany(\n { [field]: send },\n (prev) => {\n if (!prev.profile) return prev\n const nextValue = next && next.length ? next : null\n return {\n ...prev,\n profile: {\n ...prev.profile,\n [field]: nextValue,\n },\n }\n }\n )\n },\n [saveCompany],\n )\n\n const submitCustomFields = React.useCallback(\n async (prefixedValues: Record<string, unknown>, { showFlash = true } = {}) => {\n if (!data) throw new Error(t('customers.companies.detail.inline.error', 'Unable to update company.'))\n const customPayload = collectCustomFieldValues(prefixedValues, {\n transform: (value) => normalizeCustomFieldSubmitValue(value),\n })\n const normalized: Record<string, unknown> = {}\n for (const [fieldId, value] of Object.entries(customPayload)) {\n normalized[`cf_${fieldId}`] = value\n }\n if (!Object.keys(customPayload).length) {\n if (showFlash) flash(t('ui.forms.flash.saveSuccess', 'Saved successfully.'), 'success')\n return\n }\n const payload = {\n id: data.company.id,\n customFields: customPayload,\n }\n let customFieldsUpdatedAt: string | null = null\n try {\n const result = await runMutationWithContext(\n () => withScopedApiRequestHeaders(\n buildOptimisticLockHeader((data?.company as { updatedAt?: string } | undefined)?.updatedAt),\n () => apiCallOrThrow<{ ok?: boolean; updatedAt?: string | null }>(\n '/api/customers/companies',\n {\n method: 'PUT',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(payload),\n },\n { errorMessage: t('customers.companies.detail.inline.error', 'Unable to update company.') },\n ),\n ),\n payload,\n )\n customFieldsUpdatedAt = result?.result?.updatedAt ?? null\n } catch (err) {\n const { message: helperMessage, fieldErrors } = mapCrudServerErrorToFormErrors(err)\n const message = helperMessage ?? t('customers.companies.detail.inline.error', 'Unable to update company.')\n const mappedErrors: Record<string, string> | undefined = fieldErrors\n ? Object.entries(fieldErrors).reduce<Record<string, string>>((acc, [key, value]) => {\n const formKey = key.startsWith('cf_') ? key : `cf_${key}`\n acc[formKey] = value\n return acc\n }, {})\n : undefined\n const error = new Error(message) as Error & { fieldErrors?: Record<string, string> }\n if (mappedErrors && Object.keys(mappedErrors).length) error.fieldErrors = mappedErrors\n throw error\n }\n setData((prev) => {\n if (!prev) return prev\n return {\n ...prev,\n company: customFieldsUpdatedAt\n ? { ...prev.company, updatedAt: customFieldsUpdatedAt }\n : prev.company,\n customFields: {\n ...prev.customFields,\n ...normalized,\n },\n }\n })\n if (showFlash) flash(t('ui.forms.flash.saveSuccess', 'Saved successfully.'), 'success')\n },\n [data, runMutationWithContext, t],\n )\n\n const handleAnnualRevenueChange = React.useCallback(\n async ({ amount, currency }: { amount: number | null; currency: string | null }) => {\n await saveCompany(\n { annualRevenue: amount ?? null },\n (prev) => {\n if (!prev.profile) return prev\n return {\n ...prev,\n profile: {\n ...prev.profile,\n annualRevenue: amount === null ? null : String(amount),\n },\n }\n }\n )\n await submitCustomFields(\n { cf_annual_revenue_currency: currency ?? null },\n { showFlash: false },\n )\n flash(t('ui.forms.flash.saveSuccess', 'Saved successfully.'), 'success')\n },\n [saveCompany, submitCustomFields, t],\n )\n\n const handleDelete = React.useCallback(async () => {\n if (!currentCompanyId) return\n const confirmed = await confirm({\n title: t('customers.companies.list.deleteConfirm', undefined, { name: companyName }),\n variant: 'destructive',\n })\n if (!confirmed) return\n setIsDeleting(true)\n try {\n await runMutationWithContext(\n () => withScopedApiRequestHeaders(\n buildOptimisticLockHeader((data?.company as { updatedAt?: string } | undefined)?.updatedAt),\n () => apiCallOrThrow(\n `/api/customers/companies?id=${encodeURIComponent(currentCompanyId)}`,\n {\n method: 'DELETE',\n headers: { 'content-type': 'application/json' },\n },\n { errorMessage: t('customers.companies.list.deleteError', 'Failed to delete company.') },\n ),\n ),\n { id: currentCompanyId },\n )\n flash(t('customers.companies.list.deleteSuccess', 'Company deleted.'), 'success')\n router.push('/backend/customers/companies')\n } catch (err) {\n const message = err instanceof Error ? err.message : t('customers.companies.list.deleteError', 'Failed to delete company.')\n flash(message, 'error')\n } finally {\n setIsDeleting(false)\n }\n }, [companyName, confirm, currentCompanyId, router, runMutationWithContext, t])\n\n const handleTagsChange = React.useCallback((nextTags: TagOption[]) => {\n setData((prev) => (prev ? { ...prev, tags: nextTags } : prev))\n }, [])\n\n const handleCustomFieldsSubmit = React.useCallback(\n async (values: Record<string, unknown>) => {\n await submitCustomFields(values)\n },\n [submitCustomFields],\n )\n\n const handleNotesLoadingChange = React.useCallback(() => {}, [])\n\n const handleActivitiesLoadingChange = React.useCallback(() => {}, [])\n\n const handleDealsLoadingChange = React.useCallback(() => {}, [])\n\n const handlePeopleLoadingChange = React.useCallback(() => {}, [])\n\n const handleAddressesLoadingChange = React.useCallback(() => {}, [])\n\n const handleTasksLoadingChange = React.useCallback(() => {}, [])\n\n const dealsScope = React.useMemo(\n () => (currentCompanyId ? ({ kind: 'company', entityId: currentCompanyId } as const) : null),\n [currentCompanyId],\n )\n\n if (isLoading) {\n return (\n <Page>\n <PageBody>\n <div className=\"flex h-[50vh] flex-col items-center justify-center gap-2 text-muted-foreground\">\n <Spinner className=\"h-6 w-6\" />\n <span>{t('customers.companies.detail.loading', 'Loading company\u2026')}</span>\n </div>\n </PageBody>\n </Page>\n )\n }\n\n if (isNotFound) {\n return (\n <Page>\n <PageBody>\n <RecordNotFoundState\n label={t('customers.companies.detail.error.notFound', 'Company not found.')}\n backHref=\"/backend/customers/companies\"\n backLabel={t('customers.companies.detail.actions.backToList', 'Back to companies')}\n />\n </PageBody>\n </Page>\n )\n }\n\n if (error || !data?.company?.id) {\n return (\n <Page>\n <PageBody>\n <ErrorMessage\n label={error ?? t('customers.companies.detail.error.notFound', 'Company not found.')}\n action={\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/backend/customers/companies\">\n {t('customers.companies.detail.actions.backToList', 'Back to companies')}\n </Link>\n </Button>\n }\n />\n </PageBody>\n </Page>\n )\n }\n\n const { company, profile } = data\n const companyId = company.id\n\n const annualRevenueCurrency =\n typeof data.customFields?.annual_revenue_currency === 'string'\n ? (data.customFields.annual_revenue_currency as string)\n : null\n\n const detailFields: DetailFieldConfig[] = [\n {\n key: 'displayName',\n kind: 'text',\n label: t('customers.companies.detail.fields.displayName', 'Display name'),\n value: company.displayName,\n placeholder: t('customers.companies.form.displayName.placeholder', 'Enter company name'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n validator: validators.displayName,\n onSave: updateDisplayName,\n },\n {\n key: 'legalName',\n kind: 'text',\n label: t('customers.companies.detail.fields.legalName', 'Legal name'),\n value: profile?.legalName ?? null,\n placeholder: t('customers.companies.detail.fields.legalNamePlaceholder', 'Add legal name'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n onSave: (value) => updateProfileField('legalName', value),\n },\n {\n key: 'brandName',\n kind: 'text',\n label: t('customers.companies.detail.fields.brandName', 'Brand name'),\n value: profile?.brandName ?? null,\n placeholder: t('customers.companies.detail.fields.brandNamePlaceholder', 'Add brand name'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n onSave: (value) => updateProfileField('brandName', value),\n },\n {\n key: 'description',\n kind: 'multiline',\n label: t('customers.companies.detail.fields.description', 'Description'),\n value: company.description ?? null,\n placeholder: t('customers.companies.detail.fields.descriptionPlaceholder', 'Describe the company'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n gridClassName: 'sm:col-span-2 xl:col-span-3',\n renderDisplay: renderMultilineMarkdownDisplay,\n onSave: async (next) => {\n const send = typeof next === 'string' ? next : ''\n await saveCompany(\n { description: send },\n (prev) => ({\n ...prev,\n company: { ...prev.company, description: next && next.length ? next : null },\n })\n )\n },\n },\n {\n key: 'lifecycleStage',\n kind: 'custom',\n label: t('customers.companies.detail.fields.lifecycleStage', 'Lifecycle stage'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n render: () => (\n <InlineDictionaryEditor\n label={t('customers.companies.detail.fields.lifecycleStage', 'Lifecycle stage')}\n value={company.lifecycleStage ?? null}\n emptyLabel={t('customers.companies.detail.noValue', 'Not provided')}\n kind=\"lifecycle-stages\"\n onSave={(next) => updateCompanyField('lifecycleStage', next)}\n selectClassName=\"h-9 w-full rounded border px-3 text-sm\"\n variant=\"muted\"\n activateOnClick\n />\n ),\n },\n {\n key: 'source',\n kind: 'custom',\n label: t('customers.companies.detail.fields.source', 'Source'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n render: () => (\n <InlineDictionaryEditor\n label={t('customers.companies.detail.fields.source', 'Source')}\n value={company.source ?? null}\n emptyLabel={t('customers.companies.detail.noValue', 'Not provided')}\n kind=\"sources\"\n onSave={(next) => updateCompanyField('source', next)}\n selectClassName=\"h-9 w-full rounded border px-3 text-sm\"\n variant=\"muted\"\n activateOnClick\n />\n ),\n },\n {\n key: 'domain',\n kind: 'text',\n label: t('customers.companies.detail.fields.domain', 'Domain'),\n value: profile?.domain ?? null,\n placeholder: t('customers.companies.detail.fields.domainPlaceholder', 'example.com'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n onSave: (value) => updateProfileField('domain', value),\n },\n {\n key: 'industry',\n kind: 'custom',\n label: t('customers.companies.detail.fields.industry', 'Industry'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n render: () => (\n <InlineDictionaryEditor\n label={t('customers.companies.detail.fields.industry', 'Industry')}\n value={profile?.industry ?? null}\n emptyLabel={t('customers.companies.detail.noValue', 'Not provided')}\n kind=\"industries\"\n onSave={(next) => updateProfileField('industry', next)}\n selectClassName=\"h-9 w-full rounded border px-3 text-sm\"\n variant=\"muted\"\n activateOnClick\n />\n ),\n },\n {\n key: 'sizeBucket',\n kind: 'text',\n label: t('customers.companies.detail.fields.sizeBucket', 'Company size'),\n value: profile?.sizeBucket ?? null,\n placeholder: t('customers.companies.detail.fields.sizeBucketPlaceholder', 'Add size bucket'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n onSave: (value) => updateProfileField('sizeBucket', value),\n },\n {\n key: 'annualRevenue',\n kind: 'custom',\n label: t('customers.companies.detail.fields.annualRevenue', 'Annual revenue'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n render: () => (\n <AnnualRevenueField\n label={t('customers.companies.detail.fields.annualRevenue', 'Annual revenue')}\n amount={profile?.annualRevenue ?? null}\n currency={annualRevenueCurrency}\n emptyLabel={t('customers.companies.detail.noValue', 'Not provided')}\n validator={validators.annualRevenue}\n onSave={handleAnnualRevenueChange}\n />\n ),\n },\n {\n key: 'websiteUrl',\n kind: 'text',\n label: t('customers.companies.detail.fields.website', 'Website'),\n value: profile?.websiteUrl ?? null,\n placeholder: t('customers.companies.detail.fields.websitePlaceholder', 'https://example.com'),\n emptyLabel: t('customers.companies.detail.noValue', 'Not provided'),\n inputType: 'url',\n validator: validators.website,\n onSave: (value) => updateProfileField('websiteUrl', value),\n },\n ]\n\n return (\n <Page>\n <PageBody>\n <div className=\"space-y-8\">\n <CompanyHighlights\n company={company}\n profile={profile ?? null}\n validators={validators}\n onDisplayNameSave={updateDisplayName}\n utilityActions={(\n <SendObjectMessageDialog\n object={{\n entityModule: 'customers',\n entityType: 'company',\n entityId: companyId,\n previewData: {\n title: company.displayName,\n subtitle: company.primaryEmail ?? undefined,\n metadata: {\n [t('customers.companies.detail.highlights.primaryPhone')]: company.primaryPhone ?? '-',\n [t('customers.companies.detail.fields.industry')]: profile?.industry ?? '-',\n },\n },\n }}\n viewHref={`/backend/customers/companies/${companyId}`}\n />\n )}\n onPrimaryEmailSave={(value) => updateCompanyField('primaryEmail', value)}\n onPrimaryPhoneSave={(value) => updateCompanyField('primaryPhone', value)}\n onStatusSave={(value) => updateCompanyField('status', value)}\n onNextInteractionSave={async (payload) => {\n await saveCompany(\n {\n nextInteraction: payload\n ? {\n at: payload.at,\n name: payload.name ?? undefined,\n refId: payload.refId ?? undefined,\n icon: payload.icon ?? undefined,\n color: payload.color ?? undefined,\n }\n : null,\n },\n (prev) => ({\n ...prev,\n company: {\n ...prev.company,\n nextInteractionAt: payload?.at ?? null,\n nextInteractionName: payload?.name ?? null,\n nextInteractionRefId: payload?.refId ?? null,\n nextInteractionIcon: payload?.icon ?? null,\n nextInteractionColor: payload?.color ?? null,\n },\n })\n )\n }}\n onDelete={handleDelete}\n isDeleting={isDeleting}\n />\n\n <DetailTabsLayout\n className=\"space-y-6\"\n tabs={tabs}\n activeTab={activeTab}\n onTabChange={handleTabChange}\n sectionAction={sectionAction}\n onSectionAction={handleSectionAction}\n navAriaLabel={t('customers.companies.detail.tabs.label', 'Company detail sections')}\n navClassName=\"gap-4\"\n >\n {(() => {\n const injected = injectedTabMap.get(activeTab)\n if (injected) return injected()\n if (activeTab === 'notes') {\n return (\n <NotesSection\n entityId={companyId}\n emptyLabel={t('customers.companies.detail.empty.comments', 'No notes yet.')}\n viewerUserId={data.viewer?.userId ?? null}\n viewerName={data.viewer?.name ?? null}\n viewerEmail={data.viewer?.email ?? null}\n addActionLabel={t('customers.companies.detail.notes.addLabel', 'Add note')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.notes.title', 'Keep everyone in the loop'),\n actionLabel: t('customers.companies.detail.emptyState.notes.action', 'Create a note'),\n }}\n onActionChange={handleSectionActionChange}\n translator={translateCompanyDetail}\n onLoadingChange={handleNotesLoadingChange}\n dataAdapter={notesAdapter}\n renderIcon={renderDictionaryIcon}\n renderColor={renderDictionaryColor}\n iconSuggestions={ICON_SUGGESTIONS}\n readMarkdownPreference={readMarkdownPreferenceCookie}\n writeMarkdownPreference={writeMarkdownPreferenceCookie}\n />\n )\n }\n if (activeTab === 'activities') {\n return (\n <ActivitiesSection\n entityId={companyId}\n runGuardedMutation={runMutationWithContext}\n addActionLabel={t('customers.companies.detail.activities.add', 'Log activity')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.activities.title', 'No activities logged yet'),\n actionLabel: t('customers.companies.detail.emptyState.activities.action', 'Log activity'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handleActivitiesLoadingChange}\n />\n )\n }\n if (activeTab === 'deals') {\n return (\n <DealsSection\n scope={dealsScope}\n emptyLabel={t('customers.companies.detail.empty.deals', 'No deals linked to this company.')}\n addActionLabel={t('customers.companies.detail.actions.addDeal', 'Add deal')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.deals.title', 'No deals yet'),\n actionLabel: t('customers.companies.detail.emptyState.deals.action', 'Create a deal'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handleDealsLoadingChange}\n translator={detailTranslator}\n runGuardedMutation={runMutationWithContext}\n />\n )\n }\n if (activeTab === 'people') {\n return (\n <CompanyPeopleSection\n companyId={companyId}\n initialPeople={data.people ?? []}\n addActionLabel={t('customers.companies.detail.people.add', 'Add person')}\n emptyLabel={t('customers.companies.detail.people.empty', 'No people linked to this company yet.')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.people.title', 'Build the account team'),\n actionLabel: t('customers.companies.detail.emptyState.people.action', 'Create person'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handlePeopleLoadingChange}\n translator={detailTranslator}\n runGuardedMutation={runMutationWithContext}\n onPeopleChange={(next) => {\n setData((prev) => (prev ? { ...prev, people: next } : prev))\n }}\n />\n )\n }\n if (activeTab === 'addresses') {\n return (\n <AddressesSection\n entityId={companyId}\n emptyLabel={t('customers.companies.detail.empty.addresses', 'No addresses recorded.')}\n addActionLabel={t('customers.companies.detail.addresses.add', 'Add address')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.addresses.title', 'No addresses yet'),\n actionLabel: t('customers.companies.detail.emptyState.addresses.action', 'Add address'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handleAddressesLoadingChange}\n translator={detailTranslator}\n />\n )\n }\n if (activeTab === 'tasks') {\n return (\n <TasksSection\n entityId={companyId}\n initialTasks={data.todos}\n runGuardedMutation={runMutationWithContext}\n emptyLabel={t('customers.companies.detail.empty.todos', 'No tasks linked to this company.')}\n addActionLabel={t('customers.companies.detail.tasks.add', 'Add task')}\n emptyState={{\n title: t('customers.companies.detail.emptyState.tasks.title', 'Plan what happens next'),\n actionLabel: t('customers.companies.detail.emptyState.tasks.action', 'Create task'),\n }}\n onActionChange={handleSectionActionChange}\n onLoadingChange={handleTasksLoadingChange}\n translator={translateCompanyDetail}\n entityName={companyName}\n dialogContextKey=\"customers.companies.detail.tasks.dialog.context\"\n dialogContextFallback=\"This task will be linked to {{name}}\"\n />\n )\n }\n return null\n })()}\n </DetailTabsLayout>\n\n <div className=\"space-y-6\">\n <div className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold\">{t('customers.companies.detail.sections.details', 'Company details')}</h2>\n <DetailFieldsSection fields={detailFields} />\n <InjectionSpot\n spotId={extensionPoints.hosts.companyLegacyDetails.spotId}\n context={injectionContext}\n data={data}\n onDataChange={(next) => setData(next as CompanyOverview)}\n />\n </div>\n\n <CustomDataSection\n entityIds={[E.customers.customer_entity, E.customers.customer_company_profile]}\n values={data.customFields ?? {}}\n onSubmit={handleCustomFieldsSubmit}\n title={t('customers.companies.detail.sections.customFields', 'Custom fields')}\n />\n\n <TagsSection\n entityId={companyId}\n tags={data.tags}\n onChange={handleTagsChange}\n isSubmitting={false}\n />\n </div>\n\n <Separator className=\"my-4\" />\n </div>\n </PageBody>\n {ConfirmDialogElement}\n </Page>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAqQY,cA2TF,YA3TE;AAnQZ,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,OAAO,UAAU;AACjB,SAAS,WAAW,uBAAuB;AAC3C,SAAS,MAAM,gBAAgB;AAC/B,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,gBAAgB,sBAAsB,mCAAmC;AAClF,SAAS,iCAAiC;AAC1C,SAAS,gCAAgC;AACzC,SAAS,sCAAsC;AAC/C,SAAS,SAAS;AAClB,SAAS,YAAY;AACrB,SAAS,qBAAqB,oBAAoB;AAClD,SAAS,wBAAwB;AACjC,SAAS,2BAAmD;AAC5D;AAAA,EACE;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,uCAAuC;AAChD,SAAS,wBAAwB,sCAAsC;AACvE,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,8BAA8B;AACvC,SAAS,oCAAoC;AAC7C;AAAA,EACE;AAAA,OAEK;AACP,SAAS,0BAA0B;AAEnC,SAAS,uBAAuB,4BAA4B;AAC5D,SAAS,wBAAwB;AACjC,SAAS,kCAAkC;AAC3C,SAAS,8BAA8B,qCAAqC;AAC5E,SAAS,eAAe,2BAA2B;AAC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AAA,KACH;AAEJ;",
|
|
6
6
|
"names": ["params", "id", "companyId", "error"]
|
|
7
7
|
}
|
|
@@ -25,28 +25,6 @@ function useDealAssociations({
|
|
|
25
25
|
setPeopleEditorIds(data?.linkedPersonIds ?? []);
|
|
26
26
|
setCompaniesEditorIds(data?.linkedCompanyIds ?? []);
|
|
27
27
|
}, [data?.linkedCompanyIds, data?.linkedPersonIds]);
|
|
28
|
-
const loadLinkedPeoplePage = React.useCallback(
|
|
29
|
-
async (page, query) => {
|
|
30
|
-
if (!currentDealId) {
|
|
31
|
-
return { items: [], totalPages: 1, total: 0 };
|
|
32
|
-
}
|
|
33
|
-
const params = new URLSearchParams({
|
|
34
|
-
page: String(page),
|
|
35
|
-
pageSize: "20",
|
|
36
|
-
sort: "name-asc"
|
|
37
|
-
});
|
|
38
|
-
if (query.trim().length > 0) {
|
|
39
|
-
params.set("search", query.trim());
|
|
40
|
-
}
|
|
41
|
-
const payload = await readApiResultOrThrow(`/api/customers/deals/${encodeURIComponent(currentDealId)}/people?${params.toString()}`);
|
|
42
|
-
return {
|
|
43
|
-
items: Array.isArray(payload.items) ? payload.items : [],
|
|
44
|
-
totalPages: typeof payload.totalPages === "number" ? payload.totalPages : 1,
|
|
45
|
-
total: typeof payload.total === "number" ? payload.total : 0
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
[currentDealId]
|
|
49
|
-
);
|
|
50
28
|
const loadLinkedCompaniesPage = React.useCallback(
|
|
51
29
|
async (page, query) => {
|
|
52
30
|
if (!currentDealId) {
|
|
@@ -97,8 +75,10 @@ function useDealAssociations({
|
|
|
97
75
|
} : prev
|
|
98
76
|
);
|
|
99
77
|
if (!surfaceRecordConflict(error, t, { onRefresh })) {
|
|
100
|
-
|
|
78
|
+
const message = error instanceof Error && error.message ? error.message : t("customers.deals.detail.peopleUpdateError", "Failed to update linked people.");
|
|
79
|
+
flash(message, "error");
|
|
101
80
|
}
|
|
81
|
+
throw error;
|
|
102
82
|
} finally {
|
|
103
83
|
setPeopleSaving(false);
|
|
104
84
|
}
|
|
@@ -133,8 +113,10 @@ function useDealAssociations({
|
|
|
133
113
|
} : prev
|
|
134
114
|
);
|
|
135
115
|
if (!surfaceRecordConflict(error, t, { onRefresh })) {
|
|
136
|
-
|
|
116
|
+
const message = error instanceof Error && error.message ? error.message : t("customers.deals.detail.companiesUpdateError", "Failed to update linked companies.");
|
|
117
|
+
flash(message, "error");
|
|
137
118
|
}
|
|
119
|
+
throw error;
|
|
138
120
|
} finally {
|
|
139
121
|
setCompaniesSaving(false);
|
|
140
122
|
}
|
|
@@ -157,7 +139,6 @@ function useDealAssociations({
|
|
|
157
139
|
companiesSaving,
|
|
158
140
|
handlePeopleAssociationsChange,
|
|
159
141
|
handleCompaniesAssociationsChange,
|
|
160
|
-
loadLinkedPeoplePage,
|
|
161
142
|
loadLinkedCompaniesPage
|
|
162
143
|
};
|
|
163
144
|
}
|