@open-mercato/core 0.6.6-develop.6465.1.019f0fb26f → 0.6.6-develop.6471.1.9ab5bdd79a
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/dist/bootstrap.js +13 -11
- package/dist/bootstrap.js.map +2 -2
- package/dist/helpers/integration/queue-runner.js +4 -2
- package/dist/helpers/integration/queue-runner.js.map +2 -2
- package/dist/modules/api_keys/services/apiKeyService.js +5 -3
- package/dist/modules/api_keys/services/apiKeyService.js.map +2 -2
- package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js +4 -2
- package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js.map +2 -2
- package/dist/modules/attachments/api/library/[id]/route.js +3 -1
- package/dist/modules/attachments/api/library/[id]/route.js.map +2 -2
- package/dist/modules/attachments/api/route.js +8 -6
- package/dist/modules/attachments/api/route.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js +5 -3
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
- package/dist/modules/attachments/lib/assignmentDetails.js +3 -1
- package/dist/modules/attachments/lib/assignmentDetails.js.map +2 -2
- package/dist/modules/attachments/lib/drivers/driverFactory.js +3 -1
- package/dist/modules/attachments/lib/drivers/driverFactory.js.map +2 -2
- package/dist/modules/attachments/lib/ocrQueue.js +10 -11
- package/dist/modules/attachments/lib/ocrQueue.js.map +2 -2
- package/dist/modules/attachments/lib/ocrService.js +6 -4
- package/dist/modules/attachments/lib/ocrService.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/redo/route.js +3 -1
- package/dist/modules/audit_logs/api/audit-logs/actions/redo/route.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/undo/route.js +3 -1
- package/dist/modules/audit_logs/api/audit-logs/actions/undo/route.js.map +2 -2
- package/dist/modules/audit_logs/backend/audit-logs/page.js +3 -1
- package/dist/modules/audit_logs/backend/audit-logs/page.js.map +2 -2
- package/dist/modules/audit_logs/components/AuditLogsActions.js +4 -2
- package/dist/modules/audit_logs/components/AuditLogsActions.js.map +2 -2
- package/dist/modules/audit_logs/services/accessLogService.js +4 -2
- package/dist/modules/audit_logs/services/accessLogService.js.map +2 -2
- package/dist/modules/audit_logs/services/actionLogService.js +7 -5
- package/dist/modules/audit_logs/services/actionLogService.js.map +3 -3
- package/dist/modules/auth/api/profile/route.js +4 -2
- package/dist/modules/auth/api/profile/route.js.map +2 -2
- package/dist/modules/auth/api/reset/confirm.js +3 -1
- package/dist/modules/auth/api/reset/confirm.js.map +2 -2
- package/dist/modules/auth/api/reset.js +4 -2
- package/dist/modules/auth/api/reset.js.map +2 -2
- package/dist/modules/auth/api/roles/route.js +3 -1
- package/dist/modules/auth/api/roles/route.js.map +2 -2
- package/dist/modules/auth/api/sidebar/variants/route.js +3 -1
- package/dist/modules/auth/api/sidebar/variants/route.js.map +2 -2
- package/dist/modules/auth/api/users/resend-invite/route.js +4 -2
- package/dist/modules/auth/api/users/resend-invite/route.js.map +2 -2
- package/dist/modules/auth/api/users/route.js +3 -1
- package/dist/modules/auth/api/users/route.js.map +2 -2
- package/dist/modules/auth/backend/auth/profile/page.js +3 -1
- package/dist/modules/auth/backend/auth/profile/page.js.map +2 -2
- package/dist/modules/auth/backend/profile/change-password/page.js +3 -1
- package/dist/modules/auth/backend/profile/change-password/page.js.map +2 -2
- package/dist/modules/auth/backend/users/[id]/edit/page.js +5 -3
- package/dist/modules/auth/backend/users/[id]/edit/page.js.map +2 -2
- package/dist/modules/auth/backend/users/create/page.js +4 -2
- package/dist/modules/auth/backend/users/create/page.js.map +2 -2
- package/dist/modules/auth/cli.js +10 -0
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/commands/users.js +4 -2
- package/dist/modules/auth/commands/users.js.map +2 -2
- package/dist/modules/auth/lib/consentIntegrity.js +3 -3
- package/dist/modules/auth/lib/consentIntegrity.js.map +2 -2
- package/dist/modules/auth/lib/setup-app.js +9 -10
- package/dist/modules/auth/lib/setup-app.js.map +2 -2
- package/dist/modules/auth/lib/tenantAccess.js +3 -1
- package/dist/modules/auth/lib/tenantAccess.js.map +2 -2
- package/dist/modules/auth/lib/tokenHash.js +3 -3
- package/dist/modules/auth/lib/tokenHash.js.map +2 -2
- package/dist/modules/business_rules/api/rules/route.js +4 -2
- package/dist/modules/business_rules/api/rules/route.js.map +2 -2
- package/dist/modules/business_rules/lib/expression-evaluator.js +7 -5
- package/dist/modules/business_rules/lib/expression-evaluator.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-engine.js +5 -3
- package/dist/modules/business_rules/lib/rule-engine.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-evaluator.js +11 -12
- package/dist/modules/business_rules/lib/rule-evaluator.js.map +2 -2
- package/dist/modules/business_rules/subscribers/crud-rule-trigger.js +3 -1
- package/dist/modules/business_rules/subscribers/crud-rule-trigger.js.map +2 -2
- package/dist/modules/business_rules/subscribers/rule-execution-failed-notification.js +3 -1
- package/dist/modules/business_rules/subscribers/rule-execution-failed-notification.js.map +2 -2
- package/dist/modules/catalog/ai-agents-context.js +4 -5
- package/dist/modules/catalog/ai-agents-context.js.map +2 -2
- package/dist/modules/catalog/ai-tools/_shared.js +3 -1
- package/dist/modules/catalog/ai-tools/_shared.js.map +2 -2
- package/dist/modules/catalog/ai-tools/authoring-pack.js +3 -1
- package/dist/modules/catalog/ai-tools/authoring-pack.js.map +2 -2
- package/dist/modules/catalog/ai-tools/merchandising-pack.js +3 -1
- package/dist/modules/catalog/ai-tools/merchandising-pack.js.map +2 -2
- package/dist/modules/catalog/api/dictionaries/[key]/route.js +3 -1
- package/dist/modules/catalog/api/dictionaries/[key]/route.js.map +2 -2
- package/dist/modules/catalog/api/prices/route.js +3 -1
- package/dist/modules/catalog/api/prices/route.js.map +2 -2
- package/dist/modules/catalog/api/products/route.js +5 -3
- package/dist/modules/catalog/api/products/route.js.map +2 -2
- package/dist/modules/catalog/api/settings/route.js +4 -2
- package/dist/modules/catalog/api/settings/route.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +14 -12
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +8 -6
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js +5 -3
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +5 -6
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/optionSchemaClient.js +3 -1
- package/dist/modules/catalog/backend/catalog/products/optionSchemaClient.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +5 -3
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/UnitPriceDisplaySettings.js +4 -2
- package/dist/modules/catalog/components/UnitPriceDisplaySettings.js.map +2 -2
- package/dist/modules/catalog/inbox-actions.js +4 -2
- package/dist/modules/catalog/inbox-actions.js.map +2 -2
- package/dist/modules/catalog/seed/examples.js +4 -5
- package/dist/modules/catalog/seed/examples.js.map +2 -2
- package/dist/modules/catalog/subscribers/low-stock-notification.js +3 -1
- package/dist/modules/catalog/subscribers/low-stock-notification.js.map +2 -2
- package/dist/modules/catalog/widgets/injection/product-seo/state.js +3 -1
- package/dist/modules/catalog/widgets/injection/product-seo/state.js.map +2 -2
- package/dist/modules/communication_channels/api/get/oauth/[provider]/callback/route.js +12 -11
- 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 +3 -1
- 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]/push/register/route.js +3 -1
- package/dist/modules/communication_channels/api/post/channels/[id]/push/register/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/webhook/[provider]/route.js +5 -3
- package/dist/modules/communication_channels/api/post/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/webhooks/gmail/route.js +6 -6
- package/dist/modules/communication_channels/api/post/webhooks/gmail/route.js.map +2 -2
- package/dist/modules/communication_channels/commands/connect-credential-channel.js +4 -6
- package/dist/modules/communication_channels/commands/connect-credential-channel.js.map +2 -2
- package/dist/modules/communication_channels/commands/delete-channel.js +3 -3
- package/dist/modules/communication_channels/commands/delete-channel.js.map +2 -2
- package/dist/modules/communication_channels/commands/deliver-outbound-message.js +4 -5
- package/dist/modules/communication_channels/commands/deliver-outbound-message.js.map +2 -2
- package/dist/modules/communication_channels/commands/disconnect-channel.js +3 -3
- package/dist/modules/communication_channels/commands/disconnect-channel.js.map +2 -2
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js +5 -12
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js.map +2 -2
- package/dist/modules/communication_channels/commands/push-unregister.js +3 -3
- package/dist/modules/communication_channels/commands/push-unregister.js.map +2 -2
- package/dist/modules/communication_channels/commands/reassign-conversation.js +5 -3
- package/dist/modules/communication_channels/commands/reassign-conversation.js.map +2 -2
- package/dist/modules/communication_channels/lib/dead-letter.js +3 -3
- package/dist/modules/communication_channels/lib/dead-letter.js.map +2 -2
- package/dist/modules/communication_channels/lib/email-mime.js +4 -6
- package/dist/modules/communication_channels/lib/email-mime.js.map +2 -2
- package/dist/modules/communication_channels/lib/oauth-client-config.js +5 -3
- package/dist/modules/communication_channels/lib/oauth-client-config.js.map +2 -2
- package/dist/modules/communication_channels/lib/send-as-user.js +3 -1
- package/dist/modules/communication_channels/lib/send-as-user.js.map +2 -2
- package/dist/modules/communication_channels/lib/thread-token.js +4 -2
- package/dist/modules/communication_channels/lib/thread-token.js.map +2 -2
- package/dist/modules/communication_channels/setup.js +3 -4
- package/dist/modules/communication_channels/setup.js.map +2 -2
- package/dist/modules/communication_channels/workers/channel-import-history.js +4 -6
- package/dist/modules/communication_channels/workers/channel-import-history.js.map +2 -2
- package/dist/modules/communication_channels/workers/gmail-history-sync.js +8 -16
- package/dist/modules/communication_channels/workers/gmail-history-sync.js.map +2 -2
- package/dist/modules/communication_channels/workers/gmail-renew-watch.js +5 -7
- package/dist/modules/communication_channels/workers/gmail-renew-watch.js.map +2 -2
- package/dist/modules/communication_channels/workers/outbound-delivery.js +6 -12
- package/dist/modules/communication_channels/workers/outbound-delivery.js.map +2 -2
- package/dist/modules/communication_channels/workers/poll-channel.js +7 -15
- package/dist/modules/communication_channels/workers/poll-channel.js.map +2 -2
- package/dist/modules/communication_channels/workers/poll-tick.js +5 -6
- package/dist/modules/communication_channels/workers/poll-tick.js.map +2 -2
- package/dist/modules/communication_channels/workers/reaction-processor.js +5 -9
- package/dist/modules/communication_channels/workers/reaction-processor.js.map +2 -2
- package/dist/modules/configs/api/cache/route.js +4 -2
- package/dist/modules/configs/api/cache/route.js.map +2 -2
- package/dist/modules/configs/api/system-status/route.js +4 -2
- package/dist/modules/configs/api/system-status/route.js.map +2 -2
- package/dist/modules/configs/api/upgrade-actions/route.js +4 -2
- package/dist/modules/configs/api/upgrade-actions/route.js.map +2 -2
- package/dist/modules/configs/components/ModuleTelemetryPanel.js +3 -1
- package/dist/modules/configs/components/ModuleTelemetryPanel.js.map +2 -2
- package/dist/modules/configs/lib/touchGeneratedBarrels.js +2 -1
- package/dist/modules/configs/lib/touchGeneratedBarrels.js.map +2 -2
- package/dist/modules/configs/services/upgradeActionsService.js +6 -3
- package/dist/modules/configs/services/upgradeActionsService.js.map +2 -2
- package/dist/modules/currencies/components/CurrencyFetchingConfig.js +3 -1
- package/dist/modules/currencies/components/CurrencyFetchingConfig.js.map +2 -2
- package/dist/modules/currencies/lib/exchangeRateFormConfig.js +3 -1
- package/dist/modules/currencies/lib/exchangeRateFormConfig.js.map +2 -2
- package/dist/modules/currencies/services/providers/nbp.js +6 -4
- package/dist/modules/currencies/services/providers/nbp.js.map +2 -2
- package/dist/modules/currencies/services/providers/raiffeisen.js +7 -7
- package/dist/modules/currencies/services/providers/raiffeisen.js.map +2 -2
- package/dist/modules/customer_accounts/api/domain-resolve/all.js +6 -5
- package/dist/modules/customer_accounts/api/domain-resolve/all.js.map +2 -2
- package/dist/modules/customer_accounts/api/signup.js +4 -2
- package/dist/modules/customer_accounts/api/signup.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerAuthServer.js +3 -1
- package/dist/modules/customer_accounts/lib/customerAuthServer.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js +3 -1
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmReverse.js +3 -1
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmReverse.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/unlinkOnCompanyDelete.js +3 -1
- package/dist/modules/customer_accounts/subscribers/unlinkOnCompanyDelete.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/unlinkOnPersonDelete.js +3 -1
- package/dist/modules/customer_accounts/subscribers/unlinkOnPersonDelete.js.map +2 -2
- package/dist/modules/customers/ai-agents-context.js +4 -5
- package/dist/modules/customers/ai-agents-context.js.map +2 -2
- package/dist/modules/customers/api/activities/route.js +6 -4
- package/dist/modules/customers/api/activities/route.js.map +2 -2
- package/dist/modules/customers/api/comments/route.js +3 -1
- package/dist/modules/customers/api/comments/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/people/route.js +3 -1
- package/dist/modules/customers/api/companies/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/route.js +5 -3
- package/dist/modules/customers/api/companies/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/companies/route.js +5 -3
- package/dist/modules/customers/api/companies/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/customer-todos/route.js +3 -1
- package/dist/modules/customers/api/dashboard/widgets/customer-todos/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/new-customers/route.js +3 -1
- package/dist/modules/customers/api/dashboard/widgets/new-customers/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/new-deals/route.js +3 -1
- package/dist/modules/customers/api/dashboard/widgets/new-deals/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/next-interactions/route.js +3 -1
- package/dist/modules/customers/api/dashboard/widgets/next-interactions/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/companies/route.js +3 -1
- package/dist/modules/customers/api/deals/[id]/companies/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/people/route.js +3 -1
- package/dist/modules/customers/api/deals/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/deals/aggregate/route.js +3 -1
- package/dist/modules/customers/api/deals/aggregate/route.js.map +2 -2
- package/dist/modules/customers/api/deals/bulk-update-owner/route.js +7 -5
- package/dist/modules/customers/api/deals/bulk-update-owner/route.js.map +2 -2
- package/dist/modules/customers/api/deals/bulk-update-stage/route.js +7 -5
- package/dist/modules/customers/api/deals/bulk-update-stage/route.js.map +2 -2
- package/dist/modules/customers/api/deals/route.js +3 -1
- package/dist/modules/customers/api/deals/route.js.map +2 -2
- package/dist/modules/customers/api/deals/summary/route.js +3 -1
- package/dist/modules/customers/api/deals/summary/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js +4 -2
- package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/[kind]/route.js +5 -3
- package/dist/modules/customers/api/dictionaries/[kind]/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/cache.js +3 -1
- package/dist/modules/customers/api/dictionaries/cache.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/context.js +3 -1
- package/dist/modules/customers/api/dictionaries/context.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/currency/route.js +3 -1
- package/dist/modules/customers/api/dictionaries/currency/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/kind-settings/route.js +4 -2
- package/dist/modules/customers/api/dictionaries/kind-settings/route.js.map +2 -2
- package/dist/modules/customers/api/entity-roles-factory.js +7 -5
- package/dist/modules/customers/api/entity-roles-factory.js.map +2 -2
- package/dist/modules/customers/api/interactions/cancel/route.js +3 -1
- package/dist/modules/customers/api/interactions/cancel/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/complete/route.js +3 -1
- package/dist/modules/customers/api/interactions/complete/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/conflicts/route.js +3 -1
- package/dist/modules/customers/api/interactions/conflicts/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/counts/route.js +3 -1
- package/dist/modules/customers/api/interactions/counts/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/route.js +7 -4
- package/dist/modules/customers/api/interactions/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/tasks/route.js +3 -1
- package/dist/modules/customers/api/interactions/tasks/route.js.map +2 -2
- package/dist/modules/customers/api/labels/assign/route.js +3 -1
- package/dist/modules/customers/api/labels/assign/route.js.map +2 -2
- package/dist/modules/customers/api/labels/route.js +6 -3
- package/dist/modules/customers/api/labels/route.js.map +2 -2
- package/dist/modules/customers/api/labels/unassign/route.js +3 -1
- package/dist/modules/customers/api/labels/unassign/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js +3 -1
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/route.js +5 -3
- package/dist/modules/customers/api/people/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/people/route.js +5 -3
- package/dist/modules/customers/api/people/route.js.map +2 -2
- package/dist/modules/customers/api/pipeline-stages/reorder/route.js +3 -1
- package/dist/modules/customers/api/pipeline-stages/reorder/route.js.map +2 -2
- package/dist/modules/customers/api/pipeline-stages/route.js +6 -4
- package/dist/modules/customers/api/pipeline-stages/route.js.map +2 -2
- package/dist/modules/customers/api/pipelines/route.js +6 -4
- package/dist/modules/customers/api/pipelines/route.js.map +2 -2
- package/dist/modules/customers/api/settings/address-format/route.js +4 -2
- package/dist/modules/customers/api/settings/address-format/route.js.map +2 -2
- package/dist/modules/customers/api/settings/dictionary-sort-modes/route.js +4 -2
- package/dist/modules/customers/api/settings/dictionary-sort-modes/route.js.map +2 -2
- package/dist/modules/customers/api/settings/stuck-threshold/route.js +4 -2
- package/dist/modules/customers/api/settings/stuck-threshold/route.js.map +2 -2
- package/dist/modules/customers/api/tags/assign/route.js +3 -1
- package/dist/modules/customers/api/tags/assign/route.js.map +2 -2
- package/dist/modules/customers/api/tags/unassign/route.js +3 -1
- package/dist/modules/customers/api/tags/unassign/route.js.map +2 -2
- package/dist/modules/customers/api/todos/route.js +6 -4
- package/dist/modules/customers/api/todos/route.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +5 -3
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.js +3 -1
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js +3 -1
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/map/components/DealsMapCanvasImpl.js +4 -2
- package/dist/modules/customers/backend/customers/deals/map/components/DealsMapCanvasImpl.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +4 -2
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +5 -3
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +3 -1
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/commands/dictionaries.js +3 -1
- package/dist/modules/customers/commands/dictionaries.js.map +2 -2
- package/dist/modules/customers/commands/interactions.js +4 -2
- package/dist/modules/customers/commands/interactions.js.map +2 -2
- package/dist/modules/customers/commands/shared.js +4 -2
- package/dist/modules/customers/commands/shared.js.map +2 -2
- package/dist/modules/customers/commands/todos.js +3 -1
- package/dist/modules/customers/commands/todos.js.map +2 -2
- package/dist/modules/customers/components/DictionarySettings.js +5 -3
- package/dist/modules/customers/components/DictionarySettings.js.map +2 -2
- package/dist/modules/customers/components/DictionarySortSettings.js +3 -1
- package/dist/modules/customers/components/DictionarySortSettings.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivitiesCard.js +3 -1
- package/dist/modules/customers/components/detail/ActivitiesCard.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivitiesDayStrip.js +3 -1
- package/dist/modules/customers/components/detail/ActivitiesDayStrip.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivitiesSection.js +6 -4
- package/dist/modules/customers/components/detail/ActivitiesSection.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivityCard.js +3 -1
- package/dist/modules/customers/components/detail/ActivityCard.js.map +2 -2
- package/dist/modules/customers/components/detail/ChangelogTab.js +3 -1
- package/dist/modules/customers/components/detail/ChangelogTab.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyCard.js +3 -1
- package/dist/modules/customers/components/detail/CompanyCard.js.map +2 -2
- package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js +3 -1
- package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/EntityTagsDialog.js +3 -1
- package/dist/modules/customers/components/detail/EntityTagsDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/InlineActivityComposer.js +3 -1
- package/dist/modules/customers/components/detail/InlineActivityComposer.js.map +2 -2
- package/dist/modules/customers/components/detail/ManageTagsDialog.js +3 -1
- package/dist/modules/customers/components/detail/ManageTagsDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/RoleAssignmentRow.js +5 -3
- package/dist/modules/customers/components/detail/RoleAssignmentRow.js.map +2 -2
- package/dist/modules/customers/components/detail/RolesSection.js +4 -2
- package/dist/modules/customers/components/detail/RolesSection.js.map +2 -2
- package/dist/modules/customers/components/detail/hooks/useInteractionMutations.js +5 -3
- package/dist/modules/customers/components/detail/hooks/useInteractionMutations.js.map +2 -2
- package/dist/modules/customers/components/linking/LinkEntityDialog.js +4 -2
- package/dist/modules/customers/components/linking/LinkEntityDialog.js.map +2 -2
- package/dist/modules/customers/inbox-actions.js +3 -1
- package/dist/modules/customers/inbox-actions.js.map +2 -2
- package/dist/modules/customers/lib/bulkDeals.js +3 -1
- package/dist/modules/customers/lib/bulkDeals.js.map +2 -2
- package/dist/modules/customers/lib/dealClosureNotification.js +4 -2
- package/dist/modules/customers/lib/dealClosureNotification.js.map +2 -2
- package/dist/modules/customers/lib/dealStageTransitionTable.js +3 -1
- package/dist/modules/customers/lib/dealStageTransitionTable.js.map +2 -2
- package/dist/modules/customers/lib/interactionFeatureFlags.js +3 -1
- package/dist/modules/customers/lib/interactionFeatureFlags.js.map +2 -2
- package/dist/modules/customers/lib/todoCompatibility.js +3 -1
- package/dist/modules/customers/lib/todoCompatibility.js.map +2 -2
- package/dist/modules/customers/search.js +14 -7
- package/dist/modules/customers/search.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -1
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +3 -1
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -1
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -1
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/batch/route.js +3 -1
- package/dist/modules/dashboards/api/widgets/data/batch/route.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/route.js +3 -1
- package/dist/modules/dashboards/api/widgets/data/route.js.map +2 -2
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +5 -3
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
- package/dist/modules/data_sync/api/run.js +3 -1
- package/dist/modules/data_sync/api/run.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js +1 -1
- package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js.map +2 -2
- package/dist/modules/data_sync/lib/adapter-registry.js +11 -4
- package/dist/modules/data_sync/lib/adapter-registry.js.map +2 -2
- package/dist/modules/data_sync/lib/sync-engine.js +23 -2
- package/dist/modules/data_sync/lib/sync-engine.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-export.js +3 -1
- package/dist/modules/data_sync/workers/sync-export.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-import.js +3 -1
- package/dist/modules/data_sync/workers/sync-import.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js +4 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.js +3 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js +4 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.js +3 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js +5 -3
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/context.js +3 -1
- package/dist/modules/dictionaries/api/context.js.map +2 -2
- package/dist/modules/dictionaries/api/route.js +4 -2
- package/dist/modules/dictionaries/api/route.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionariesManager.js +5 -3
- package/dist/modules/dictionaries/components/DictionariesManager.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +4 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionarySelectControl.js +3 -1
- package/dist/modules/dictionaries/components/DictionarySelectControl.js.map +2 -2
- package/dist/modules/dictionaries/fields/dictionary.js +3 -1
- package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
- package/dist/modules/directory/api/organization-branding/route.js +3 -1
- package/dist/modules/directory/api/organization-branding/route.js.map +2 -2
- package/dist/modules/directory/api/organization-switcher/route.js +3 -1
- package/dist/modules/directory/api/organization-switcher/route.js.map +2 -2
- package/dist/modules/directory/commands/tenants.js +5 -3
- package/dist/modules/directory/commands/tenants.js.map +2 -2
- package/dist/modules/directory/utils/organizationScope.js +6 -4
- package/dist/modules/directory/utils/organizationScope.js.map +2 -2
- package/dist/modules/entities/api/definitions.cache.js +3 -1
- package/dist/modules/entities/api/definitions.cache.js.map +2 -2
- package/dist/modules/entities/api/definitions.js +7 -5
- package/dist/modules/entities/api/definitions.js.map +2 -2
- package/dist/modules/entities/api/records.js +4 -8
- package/dist/modules/entities/api/records.js.map +2 -2
- package/dist/modules/entities/components/EncryptionManager.js +3 -1
- package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
- package/dist/modules/entities/lib/makeActivityRoute.js +3 -1
- package/dist/modules/entities/lib/makeActivityRoute.js.map +2 -2
- package/dist/modules/feature_toggles/api/overrides/route.js +3 -1
- package/dist/modules/feature_toggles/api/overrides/route.js.map +2 -2
- package/dist/modules/feature_toggles/lib/feature-flag-check.js +5 -9
- package/dist/modules/feature_toggles/lib/feature-flag-check.js.map +2 -2
- package/dist/modules/inbox_ops/api/emails/[id]/reprocess/route.js +4 -2
- package/dist/modules/inbox_ops/api/emails/[id]/reprocess/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/emails/[id]/route.js +4 -2
- package/dist/modules/inbox_ops/api/emails/[id]/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/emails/route.js +3 -1
- package/dist/modules/inbox_ops/api/emails/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/extract/route.js +3 -1
- package/dist/modules/inbox_ops/api/extract/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js +3 -1
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/[id]/replies/[replyId]/send/route.js +4 -2
- package/dist/modules/inbox_ops/api/proposals/[id]/replies/[replyId]/send/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/counts/route.js +4 -2
- package/dist/modules/inbox_ops/api/proposals/counts/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/route.js +3 -1
- package/dist/modules/inbox_ops/api/proposals/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/routeHelpers.js +3 -1
- package/dist/modules/inbox_ops/api/routeHelpers.js.map +2 -2
- package/dist/modules/inbox_ops/api/settings/route.js +3 -1
- package/dist/modules/inbox_ops/api/settings/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/webhook/inbound.js +7 -5
- package/dist/modules/inbox_ops/api/webhook/inbound.js.map +2 -2
- package/dist/modules/inbox_ops/lib/cache.js +4 -2
- package/dist/modules/inbox_ops/lib/cache.js.map +2 -2
- package/dist/modules/inbox_ops/lib/catalogLookup.js +3 -1
- package/dist/modules/inbox_ops/lib/catalogLookup.js.map +2 -2
- package/dist/modules/inbox_ops/lib/eventBus.js +3 -4
- package/dist/modules/inbox_ops/lib/eventBus.js.map +2 -2
- package/dist/modules/inbox_ops/lib/messagesIntegration.js +4 -8
- package/dist/modules/inbox_ops/lib/messagesIntegration.js.map +2 -2
- package/dist/modules/inbox_ops/subscribers/executionAuditor.js +3 -1
- package/dist/modules/inbox_ops/subscribers/executionAuditor.js.map +2 -2
- package/dist/modules/inbox_ops/subscribers/extractionWorker.js +10 -8
- package/dist/modules/inbox_ops/subscribers/extractionWorker.js.map +2 -2
- package/dist/modules/inbox_ops/subscribers/proposalNotifier.js +3 -1
- package/dist/modules/inbox_ops/subscribers/proposalNotifier.js.map +2 -2
- package/dist/modules/messages/api/[id]/route.js +3 -4
- package/dist/modules/messages/api/[id]/route.js.map +2 -2
- package/dist/modules/messages/commands/actions.js +3 -1
- package/dist/modules/messages/commands/actions.js.map +2 -2
- package/dist/modules/messages/components/MessagesInboxPageClient.js +3 -1
- package/dist/modules/messages/components/MessagesInboxPageClient.js.map +2 -2
- package/dist/modules/messages/lib/email-sender.js +3 -7
- package/dist/modules/messages/lib/email-sender.js.map +2 -2
- package/dist/modules/messages/lib/message-objects-registry.js +3 -1
- package/dist/modules/messages/lib/message-objects-registry.js.map +2 -2
- package/dist/modules/messages/lib/message-types-registry.js +3 -1
- package/dist/modules/messages/lib/message-types-registry.js.map +2 -2
- package/dist/modules/messages/workers/send-email.worker.js +6 -4
- package/dist/modules/messages/workers/send-email.worker.js.map +2 -2
- package/dist/modules/notifications/lib/notificationMapper.js +3 -4
- package/dist/modules/notifications/lib/notificationMapper.js.map +2 -2
- package/dist/modules/notifications/lib/notificationService.js +4 -5
- package/dist/modules/notifications/lib/notificationService.js.map +2 -2
- package/dist/modules/notifications/subscribers/deliver-notification.js +8 -13
- package/dist/modules/notifications/subscribers/deliver-notification.js.map +2 -2
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js +3 -1
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/perspectives/services/perspectiveService.js +3 -3
- package/dist/modules/perspectives/services/perspectiveService.js.map +2 -2
- package/dist/modules/planner/api/access.js +3 -3
- package/dist/modules/planner/api/access.js.map +2 -2
- package/dist/modules/planner/api/availability-date-specific.js +3 -1
- package/dist/modules/planner/api/availability-date-specific.js.map +2 -2
- package/dist/modules/planner/api/availability-weekly.js +3 -1
- package/dist/modules/planner/api/availability-weekly.js.map +2 -2
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js +4 -2
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js.map +2 -2
- package/dist/modules/planner/components/AvailabilityRulesEditor.js +3 -1
- package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
- package/dist/modules/progress/api/jobs/route.js +3 -1
- package/dist/modules/progress/api/jobs/route.js.map +2 -2
- package/dist/modules/query_index/components/QueryIndexesTable.js +5 -3
- package/dist/modules/query_index/components/QueryIndexesTable.js.map +2 -2
- package/dist/modules/query_index/lib/batch.js +4 -2
- package/dist/modules/query_index/lib/batch.js.map +2 -2
- package/dist/modules/query_index/lib/coverage.js +3 -1
- package/dist/modules/query_index/lib/coverage.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +13 -18
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/query_index/lib/reindexer.js +8 -6
- package/dist/modules/query_index/lib/reindexer.js.map +2 -2
- package/dist/modules/query_index/lib/search-tokens.js +3 -1
- package/dist/modules/query_index/lib/search-tokens.js.map +2 -2
- package/dist/modules/query_index/subscribers/coverage_refresh.js +3 -1
- package/dist/modules/query_index/subscribers/coverage_refresh.js.map +2 -2
- package/dist/modules/resources/api/comments.js +3 -1
- package/dist/modules/resources/api/comments.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/assign/route.js +3 -1
- package/dist/modules/resources/api/resources/tags/assign/route.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/unassign/route.js +3 -1
- package/dist/modules/resources/api/resources/tags/unassign/route.js.map +2 -2
- package/dist/modules/resources/backend/resources/resource-types/[id]/edit/page.js +3 -1
- package/dist/modules/resources/backend/resources/resource-types/[id]/edit/page.js.map +2 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js +4 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js.map +2 -2
- package/dist/modules/resources/commands/activities.js +6 -5
- package/dist/modules/resources/commands/activities.js.map +2 -2
- package/dist/modules/resources/commands/comments.js +6 -4
- package/dist/modules/resources/commands/comments.js.map +2 -2
- package/dist/modules/resources/commands/shared.js +24 -1
- package/dist/modules/resources/commands/shared.js.map +2 -2
- package/dist/modules/sales/api/channels/route.js +3 -1
- package/dist/modules/sales/api/channels/route.js.map +2 -2
- package/dist/modules/sales/api/document-history/route.js +3 -1
- package/dist/modules/sales/api/document-history/route.js.map +2 -2
- package/dist/modules/sales/api/document-numbers/route.js +3 -1
- package/dist/modules/sales/api/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/accept/route.js +4 -2
- package/dist/modules/sales/api/quotes/accept/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/convert/route.js +3 -1
- package/dist/modules/sales/api/quotes/convert/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/public/[token]/route.js +3 -1
- package/dist/modules/sales/api/quotes/public/[token]/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/send/route.js +3 -1
- package/dist/modules/sales/api/quotes/send/route.js.map +2 -2
- package/dist/modules/sales/api/returns/[id]/route.js +3 -1
- package/dist/modules/sales/api/returns/[id]/route.js.map +2 -2
- package/dist/modules/sales/api/settings/document-numbers/route.js +4 -2
- package/dist/modules/sales/api/settings/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/settings/order-editing/route.js +4 -2
- package/dist/modules/sales/api/settings/order-editing/route.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js +3 -1
- package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/offers/page.js +6 -4
- package/dist/modules/sales/backend/sales/channels/offers/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/page.js +4 -2
- package/dist/modules/sales/backend/sales/channels/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +20 -18
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +4 -8
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/commands/payments.js +3 -1
- package/dist/modules/sales/commands/payments.js.map +2 -2
- package/dist/modules/sales/commands/shipments.js +3 -1
- package/dist/modules/sales/commands/shipments.js.map +2 -2
- package/dist/modules/sales/components/AdjustmentKindSettings.js +5 -3
- package/dist/modules/sales/components/AdjustmentKindSettings.js.map +2 -2
- package/dist/modules/sales/components/DocumentNumberSettings.js +4 -2
- package/dist/modules/sales/components/DocumentNumberSettings.js.map +2 -2
- package/dist/modules/sales/components/OrderEditingSettings.js +4 -2
- package/dist/modules/sales/components/OrderEditingSettings.js.map +2 -2
- package/dist/modules/sales/components/PaymentMethodsSettings.js +5 -3
- package/dist/modules/sales/components/PaymentMethodsSettings.js.map +2 -2
- package/dist/modules/sales/components/ShippingMethodsSettings.js +5 -3
- package/dist/modules/sales/components/ShippingMethodsSettings.js.map +2 -2
- package/dist/modules/sales/components/StatusSettings.js +5 -3
- package/dist/modules/sales/components/StatusSettings.js.map +2 -2
- package/dist/modules/sales/components/TaxRatesSettings.js +5 -3
- package/dist/modules/sales/components/TaxRatesSettings.js.map +2 -2
- package/dist/modules/sales/components/channels/ChannelOfferForm.js +16 -14
- package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js +4 -2
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js.map +2 -2
- package/dist/modules/sales/components/documents/AddressesSection.js +5 -3
- package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentDialog.js +3 -1
- package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentsSection.js +5 -3
- package/dist/modules/sales/components/documents/AdjustmentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +6 -4
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +8 -6
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/PaymentDialog.js +5 -3
- package/dist/modules/sales/components/documents/PaymentDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js +4 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentForm.js +14 -12
- package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js +5 -3
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js.map +2 -2
- package/dist/modules/sales/components/documents/ShipmentDialog.js +9 -7
- package/dist/modules/sales/components/documents/ShipmentDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/ShipmentsSection.js +4 -2
- package/dist/modules/sales/components/documents/ShipmentsSection.js.map +2 -2
- package/dist/modules/sales/frontend/quote/[token]/page.js +4 -2
- package/dist/modules/sales/frontend/quote/[token]/page.js.map +2 -2
- package/dist/modules/sales/seed/examples.js +7 -9
- package/dist/modules/sales/seed/examples.js.map +2 -2
- package/dist/modules/sales/subscribers/quote-expiring-notification.js +3 -1
- package/dist/modules/sales/subscribers/quote-expiring-notification.js.map +2 -2
- package/dist/modules/sales/subscribers/reconcileOnAddressDelete.js +3 -1
- package/dist/modules/sales/subscribers/reconcileOnAddressDelete.js.map +2 -2
- package/dist/modules/sales/subscribers/reconcileOnCompanyDelete.js +3 -1
- package/dist/modules/sales/subscribers/reconcileOnCompanyDelete.js.map +2 -2
- package/dist/modules/sales/subscribers/reconcileOnCustomerDelete.js +3 -1
- package/dist/modules/sales/subscribers/reconcileOnCustomerDelete.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/makeDashboardWidgetRoute.js +5 -3
- package/dist/modules/sales/widgets/dashboard/makeDashboardWidgetRoute.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +3 -1
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +3 -1
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
- package/dist/modules/shipping_carriers/api/tracking/route.js +5 -0
- package/dist/modules/shipping_carriers/api/tracking/route.js.map +2 -2
- package/dist/modules/shipping_carriers/api/webhook/[provider]/route.js +3 -1
- package/dist/modules/shipping_carriers/api/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/shipping-service.js +41 -19
- package/dist/modules/shipping_carriers/lib/shipping-service.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/upstream-error-response.js +3 -1
- package/dist/modules/shipping_carriers/lib/upstream-error-response.js.map +2 -2
- package/dist/modules/shipping_carriers/workers/webhook-processor.js +3 -5
- package/dist/modules/shipping_carriers/workers/webhook-processor.js.map +2 -2
- package/dist/modules/staff/api/comments.js +3 -1
- package/dist/modules/staff/api/comments.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +3 -1
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +3 -1
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/assignable/route.js +3 -1
- package/dist/modules/staff/api/team-members/assignable/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/self/route.js +4 -2
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +3 -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 +3 -1
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js +3 -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 +3 -1
- package/dist/modules/staff/api/timesheets/my-projects/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js +3 -1
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js +3 -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 +4 -2
- 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 +4 -2
- 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 +3 -1
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js +3 -1
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-members/page.js +4 -2
- package/dist/modules/staff/backend/staff/team-members/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-roles/page.js +4 -2
- package/dist/modules/staff/backend/staff/team-roles/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js +4 -2
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/page.js +4 -2
- package/dist/modules/staff/backend/staff/teams/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/page.js +7 -5
- package/dist/modules/staff/backend/staff/timesheets/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js +3 -1
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js +4 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-entries.js +3 -1
- package/dist/modules/staff/commands/timesheets-entries.js.map +2 -2
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.client.js +3 -1
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.client.js.map +2 -2
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.client.js +5 -3
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.client.js.map +2 -2
- package/dist/modules/sync_excel/api/import/route.js +3 -1
- package/dist/modules/sync_excel/api/import/route.js.map +2 -2
- package/dist/modules/translations/api/[entityType]/[entityId]/route.js +5 -3
- package/dist/modules/translations/api/[entityType]/[entityId]/route.js.map +2 -2
- package/dist/modules/translations/api/get/locales.js +3 -1
- package/dist/modules/translations/api/get/locales.js.map +2 -2
- package/dist/modules/translations/api/put/locales.js +3 -1
- package/dist/modules/translations/api/put/locales.js.map +2 -2
- package/dist/modules/translations/components/TranslationManager.js +3 -1
- package/dist/modules/translations/components/TranslationManager.js.map +2 -2
- package/dist/modules/translations/subscribers/cleanup.js +3 -1
- package/dist/modules/translations/subscribers/cleanup.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js +4 -2
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js +4 -2
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/route.js +6 -4
- package/dist/modules/workflows/api/definitions/[id]/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/events/[id]/route.js +3 -1
- package/dist/modules/workflows/api/events/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/events/route.js +3 -1
- package/dist/modules/workflows/api/events/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/advance/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/advance/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/cancel/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/cancel/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/events/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/events/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/retry/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/retry/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/signal/route.js +5 -7
- package/dist/modules/workflows/api/instances/[id]/signal/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/route.js +5 -3
- package/dist/modules/workflows/api/instances/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/validate-start/route.js +3 -1
- package/dist/modules/workflows/api/instances/validate-start/route.js.map +2 -2
- package/dist/modules/workflows/api/signals/route.js +3 -1
- package/dist/modules/workflows/api/signals/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js +3 -1
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js +3 -1
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/route.js +3 -1
- package/dist/modules/workflows/api/tasks/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/route.js +3 -1
- package/dist/modules/workflows/api/tasks/route.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js +4 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/[id]/page.js +5 -3
- package/dist/modules/workflows/backend/instances/[id]/page.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/[id]/page.js +3 -1
- package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
- package/dist/modules/workflows/components/BusinessRulesSelector.js +5 -3
- package/dist/modules/workflows/components/BusinessRulesSelector.js.map +2 -2
- package/dist/modules/workflows/components/WorkflowSelector.js +5 -3
- package/dist/modules/workflows/components/WorkflowSelector.js.map +2 -2
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +3 -1
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +3 -1
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/WorkflowSelectorField.js +3 -1
- package/dist/modules/workflows/components/fields/WorkflowSelectorField.js.map +2 -2
- package/dist/modules/workflows/frontend/checkout-demo/page.js +8 -7
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/dist/modules/workflows/lib/activity-executor.js +25 -21
- package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
- package/dist/modules/workflows/lib/activity-worker-handler.js +8 -15
- package/dist/modules/workflows/lib/activity-worker-handler.js.map +2 -2
- package/dist/modules/workflows/lib/code-registry.js +7 -7
- package/dist/modules/workflows/lib/code-registry.js.map +2 -2
- package/dist/modules/workflows/lib/compensation-handler.js +4 -2
- package/dist/modules/workflows/lib/compensation-handler.js.map +2 -2
- package/dist/modules/workflows/lib/edgeFormTransforms.js +3 -1
- package/dist/modules/workflows/lib/edgeFormTransforms.js.map +2 -2
- package/dist/modules/workflows/lib/event-trigger-service.js +5 -3
- package/dist/modules/workflows/lib/event-trigger-service.js.map +2 -2
- package/dist/modules/workflows/lib/nodeFormTransforms.js +3 -1
- package/dist/modules/workflows/lib/nodeFormTransforms.js.map +2 -2
- package/dist/modules/workflows/lib/seeds.js +16 -2
- package/dist/modules/workflows/lib/seeds.js.map +2 -2
- package/dist/modules/workflows/lib/signal-handler.js +3 -1
- package/dist/modules/workflows/lib/signal-handler.js.map +2 -2
- package/dist/modules/workflows/lib/start-validator.js +9 -3
- package/dist/modules/workflows/lib/start-validator.js.map +2 -2
- package/dist/modules/workflows/lib/step-handler.js +3 -1
- package/dist/modules/workflows/lib/step-handler.js.map +2 -2
- package/dist/modules/workflows/lib/task-handler.js +3 -1
- package/dist/modules/workflows/lib/task-handler.js.map +2 -2
- package/dist/modules/workflows/lib/transition-handler.js +5 -3
- package/dist/modules/workflows/lib/transition-handler.js.map +2 -2
- package/dist/modules/workflows/lib/workflow-executor.js +27 -15
- package/dist/modules/workflows/lib/workflow-executor.js.map +2 -2
- package/dist/modules/workflows/subscribers/event-trigger.js +21 -18
- package/dist/modules/workflows/subscribers/event-trigger.js.map +2 -2
- package/dist/modules/workflows/subscribers/task-assigned-notification.js +3 -1
- package/dist/modules/workflows/subscribers/task-assigned-notification.js.map +2 -2
- package/dist/modules/workflows/workers/workflow-activities.worker.js +30 -20
- package/dist/modules/workflows/workers/workflow-activities.worker.js.map +2 -2
- package/package.json +7 -7
- package/src/bootstrap.ts +14 -11
- package/src/helpers/integration/queue-runner.ts +2 -2
- package/src/modules/api_keys/services/apiKeyService.ts +6 -3
- package/src/modules/attachments/api/image/[id]/[[...slug]]/route.ts +5 -2
- package/src/modules/attachments/api/library/[id]/route.ts +4 -1
- package/src/modules/attachments/api/route.ts +9 -6
- package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +6 -3
- package/src/modules/attachments/lib/assignmentDetails.ts +4 -1
- package/src/modules/attachments/lib/drivers/driverFactory.ts +4 -1
- package/src/modules/attachments/lib/ocrQueue.ts +11 -11
- package/src/modules/attachments/lib/ocrService.ts +7 -4
- package/src/modules/audit_logs/api/audit-logs/actions/redo/route.ts +4 -1
- package/src/modules/audit_logs/api/audit-logs/actions/undo/route.ts +4 -1
- package/src/modules/audit_logs/backend/audit-logs/page.tsx +4 -1
- package/src/modules/audit_logs/components/AuditLogsActions.tsx +5 -2
- package/src/modules/audit_logs/services/accessLogService.ts +5 -4
- package/src/modules/audit_logs/services/actionLogService.ts +5 -2
- package/src/modules/auth/api/profile/route.ts +5 -2
- package/src/modules/auth/api/reset/confirm.ts +4 -1
- package/src/modules/auth/api/reset.ts +5 -2
- package/src/modules/auth/api/roles/route.ts +4 -1
- package/src/modules/auth/api/sidebar/variants/route.ts +4 -2
- package/src/modules/auth/api/users/resend-invite/route.ts +5 -2
- package/src/modules/auth/api/users/route.ts +4 -1
- package/src/modules/auth/backend/auth/profile/page.tsx +4 -1
- package/src/modules/auth/backend/profile/change-password/page.tsx +4 -1
- package/src/modules/auth/backend/users/[id]/edit/page.tsx +6 -3
- package/src/modules/auth/backend/users/create/page.tsx +5 -2
- package/src/modules/auth/cli.ts +10 -0
- package/src/modules/auth/commands/users.ts +5 -2
- package/src/modules/auth/lib/consentIntegrity.ts +4 -4
- package/src/modules/auth/lib/setup-app.ts +10 -10
- package/src/modules/auth/lib/tenantAccess.ts +4 -1
- package/src/modules/auth/lib/tokenHash.ts +4 -4
- package/src/modules/business_rules/api/rules/route.ts +5 -2
- package/src/modules/business_rules/lib/expression-evaluator.ts +8 -6
- package/src/modules/business_rules/lib/rule-engine.ts +6 -3
- package/src/modules/business_rules/lib/rule-evaluator.ts +11 -11
- package/src/modules/business_rules/subscribers/crud-rule-trigger.ts +4 -1
- package/src/modules/business_rules/subscribers/rule-execution-failed-notification.ts +4 -1
- package/src/modules/catalog/ai-agents-context.ts +5 -5
- package/src/modules/catalog/ai-tools/_shared.ts +4 -1
- package/src/modules/catalog/ai-tools/authoring-pack.ts +4 -1
- package/src/modules/catalog/ai-tools/merchandising-pack.ts +4 -1
- package/src/modules/catalog/api/dictionaries/[key]/route.ts +4 -1
- package/src/modules/catalog/api/prices/route.ts +4 -1
- package/src/modules/catalog/api/products/route.ts +6 -3
- package/src/modules/catalog/api/settings/route.ts +5 -2
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +15 -12
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +9 -6
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/create/page.tsx +6 -3
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +6 -6
- package/src/modules/catalog/backend/catalog/products/optionSchemaClient.ts +4 -1
- package/src/modules/catalog/components/PriceKindSettings.tsx +6 -3
- package/src/modules/catalog/components/UnitPriceDisplaySettings.tsx +5 -2
- package/src/modules/catalog/inbox-actions.ts +5 -2
- package/src/modules/catalog/seed/examples.ts +5 -5
- package/src/modules/catalog/subscribers/low-stock-notification.ts +4 -1
- package/src/modules/catalog/widgets/injection/product-seo/state.ts +4 -1
- package/src/modules/communication_channels/api/get/oauth/[provider]/callback/route.ts +13 -13
- package/src/modules/communication_channels/api/post/channels/[id]/import-history/route.ts +4 -1
- package/src/modules/communication_channels/api/post/channels/[id]/push/register/route.ts +4 -1
- package/src/modules/communication_channels/api/post/webhook/[provider]/route.ts +6 -3
- package/src/modules/communication_channels/api/post/webhooks/gmail/route.ts +7 -6
- package/src/modules/communication_channels/commands/connect-credential-channel.ts +5 -10
- package/src/modules/communication_channels/commands/delete-channel.ts +4 -5
- package/src/modules/communication_channels/commands/deliver-outbound-message.ts +5 -5
- package/src/modules/communication_channels/commands/disconnect-channel.ts +4 -5
- package/src/modules/communication_channels/commands/ingest-inbound-message.ts +6 -12
- package/src/modules/communication_channels/commands/push-unregister.ts +4 -3
- package/src/modules/communication_channels/commands/reassign-conversation.ts +6 -3
- package/src/modules/communication_channels/lib/dead-letter.ts +4 -5
- package/src/modules/communication_channels/lib/email-mime.ts +5 -6
- package/src/modules/communication_channels/lib/oauth-client-config.ts +7 -3
- package/src/modules/communication_channels/lib/send-as-user.ts +4 -1
- package/src/modules/communication_channels/lib/thread-token.ts +5 -2
- package/src/modules/communication_channels/setup.ts +4 -4
- package/src/modules/communication_channels/workers/channel-import-history.ts +5 -8
- package/src/modules/communication_channels/workers/gmail-history-sync.ts +9 -18
- package/src/modules/communication_channels/workers/gmail-renew-watch.ts +6 -9
- package/src/modules/communication_channels/workers/outbound-delivery.ts +7 -12
- package/src/modules/communication_channels/workers/poll-channel.ts +8 -15
- package/src/modules/communication_channels/workers/poll-tick.ts +6 -6
- package/src/modules/communication_channels/workers/reaction-processor.ts +6 -9
- package/src/modules/configs/api/cache/route.ts +5 -2
- package/src/modules/configs/api/system-status/route.ts +5 -2
- package/src/modules/configs/api/upgrade-actions/route.ts +5 -2
- package/src/modules/configs/components/ModuleTelemetryPanel.tsx +4 -1
- package/src/modules/configs/lib/touchGeneratedBarrels.ts +1 -1
- package/src/modules/configs/services/upgradeActionsService.ts +7 -3
- package/src/modules/currencies/components/CurrencyFetchingConfig.tsx +4 -1
- package/src/modules/currencies/lib/exchangeRateFormConfig.ts +4 -1
- package/src/modules/currencies/services/providers/nbp.ts +7 -4
- package/src/modules/currencies/services/providers/raiffeisen.ts +8 -7
- package/src/modules/customer_accounts/api/domain-resolve/all.ts +7 -5
- package/src/modules/customer_accounts/api/signup.ts +5 -2
- package/src/modules/customer_accounts/lib/customerAuthServer.ts +4 -1
- package/src/modules/customer_accounts/subscribers/autoLinkCrm.ts +4 -1
- package/src/modules/customer_accounts/subscribers/autoLinkCrmReverse.ts +4 -1
- package/src/modules/customer_accounts/subscribers/unlinkOnCompanyDelete.ts +4 -1
- package/src/modules/customer_accounts/subscribers/unlinkOnPersonDelete.ts +4 -1
- package/src/modules/customers/ai-agents-context.ts +5 -5
- package/src/modules/customers/api/activities/route.ts +7 -4
- package/src/modules/customers/api/comments/route.ts +4 -1
- package/src/modules/customers/api/companies/[id]/people/route.ts +4 -1
- package/src/modules/customers/api/companies/[id]/route.ts +6 -3
- package/src/modules/customers/api/companies/route.ts +6 -3
- package/src/modules/customers/api/dashboard/widgets/customer-todos/route.ts +4 -1
- package/src/modules/customers/api/dashboard/widgets/new-customers/route.ts +4 -1
- package/src/modules/customers/api/dashboard/widgets/new-deals/route.ts +4 -1
- package/src/modules/customers/api/dashboard/widgets/next-interactions/route.ts +4 -1
- package/src/modules/customers/api/deals/[id]/companies/route.ts +4 -1
- package/src/modules/customers/api/deals/[id]/people/route.ts +4 -1
- package/src/modules/customers/api/deals/aggregate/route.ts +4 -1
- package/src/modules/customers/api/deals/bulk-update-owner/route.ts +8 -5
- package/src/modules/customers/api/deals/bulk-update-stage/route.ts +8 -5
- package/src/modules/customers/api/deals/route.ts +4 -1
- package/src/modules/customers/api/deals/summary/route.ts +4 -1
- package/src/modules/customers/api/dictionaries/[kind]/[id]/route.ts +5 -2
- package/src/modules/customers/api/dictionaries/[kind]/route.ts +6 -3
- package/src/modules/customers/api/dictionaries/cache.ts +4 -1
- package/src/modules/customers/api/dictionaries/context.ts +4 -1
- package/src/modules/customers/api/dictionaries/currency/route.ts +4 -1
- package/src/modules/customers/api/dictionaries/kind-settings/route.ts +5 -2
- package/src/modules/customers/api/entity-roles-factory.ts +8 -5
- package/src/modules/customers/api/interactions/cancel/route.ts +4 -1
- package/src/modules/customers/api/interactions/complete/route.ts +4 -1
- package/src/modules/customers/api/interactions/conflicts/route.ts +4 -1
- package/src/modules/customers/api/interactions/counts/route.ts +4 -1
- package/src/modules/customers/api/interactions/route.ts +8 -4
- package/src/modules/customers/api/interactions/tasks/route.ts +4 -1
- package/src/modules/customers/api/labels/assign/route.ts +4 -1
- package/src/modules/customers/api/labels/route.ts +7 -3
- package/src/modules/customers/api/labels/unassign/route.ts +4 -1
- package/src/modules/customers/api/people/[id]/companies/enriched/route.ts +4 -1
- package/src/modules/customers/api/people/[id]/route.ts +6 -3
- package/src/modules/customers/api/people/route.ts +6 -3
- package/src/modules/customers/api/pipeline-stages/reorder/route.ts +4 -1
- package/src/modules/customers/api/pipeline-stages/route.ts +7 -4
- package/src/modules/customers/api/pipelines/route.ts +7 -4
- package/src/modules/customers/api/settings/address-format/route.ts +5 -2
- package/src/modules/customers/api/settings/dictionary-sort-modes/route.ts +5 -2
- package/src/modules/customers/api/settings/stuck-threshold/route.ts +5 -2
- package/src/modules/customers/api/tags/assign/route.ts +4 -1
- package/src/modules/customers/api/tags/unassign/route.ts +4 -1
- package/src/modules/customers/api/todos/route.ts +7 -4
- package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +6 -3
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.ts +4 -1
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.ts +4 -1
- package/src/modules/customers/backend/customers/deals/map/components/DealsMapCanvasImpl.tsx +5 -3
- package/src/modules/customers/backend/customers/deals/page.tsx +5 -2
- package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +6 -3
- package/src/modules/customers/commands/deals.ts +4 -1
- package/src/modules/customers/commands/dictionaries.ts +4 -1
- package/src/modules/customers/commands/interactions.ts +5 -2
- package/src/modules/customers/commands/shared.ts +5 -2
- package/src/modules/customers/commands/todos.ts +4 -1
- package/src/modules/customers/components/DictionarySettings.tsx +6 -3
- package/src/modules/customers/components/DictionarySortSettings.tsx +4 -1
- package/src/modules/customers/components/detail/ActivitiesCard.tsx +4 -1
- package/src/modules/customers/components/detail/ActivitiesDayStrip.tsx +4 -1
- package/src/modules/customers/components/detail/ActivitiesSection.tsx +7 -4
- package/src/modules/customers/components/detail/ActivityCard.tsx +4 -1
- package/src/modules/customers/components/detail/ChangelogTab.tsx +4 -1
- package/src/modules/customers/components/detail/CompanyCard.tsx +4 -1
- package/src/modules/customers/components/detail/ConfirmDealLostDialog.tsx +4 -1
- package/src/modules/customers/components/detail/EntityTagsDialog.tsx +4 -1
- package/src/modules/customers/components/detail/InlineActivityComposer.tsx +4 -1
- package/src/modules/customers/components/detail/ManageTagsDialog.tsx +4 -1
- package/src/modules/customers/components/detail/RoleAssignmentRow.tsx +6 -3
- package/src/modules/customers/components/detail/RolesSection.tsx +5 -2
- package/src/modules/customers/components/detail/hooks/useInteractionMutations.ts +6 -3
- package/src/modules/customers/components/linking/LinkEntityDialog.tsx +5 -2
- package/src/modules/customers/inbox-actions.ts +4 -1
- package/src/modules/customers/lib/bulkDeals.ts +4 -1
- package/src/modules/customers/lib/dealClosureNotification.ts +5 -2
- package/src/modules/customers/lib/dealStageTransitionTable.ts +4 -1
- package/src/modules/customers/lib/interactionFeatureFlags.ts +5 -1
- package/src/modules/customers/lib/todoCompatibility.ts +4 -1
- package/src/modules/customers/search.ts +15 -7
- package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +4 -1
- package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +4 -1
- package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +4 -1
- package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +4 -1
- package/src/modules/dashboards/api/widgets/data/batch/route.ts +4 -1
- package/src/modules/dashboards/api/widgets/data/route.ts +4 -1
- package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +6 -3
- package/src/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +4 -1
- package/src/modules/data_sync/api/run.ts +4 -1
- package/src/modules/data_sync/backend/data-sync/runs/[id]/page.tsx +3 -1
- package/src/modules/data_sync/lib/adapter-registry.ts +16 -4
- package/src/modules/data_sync/lib/sync-engine.ts +31 -2
- package/src/modules/data_sync/workers/sync-export.ts +4 -1
- package/src/modules/data_sync/workers/sync-import.ts +4 -1
- package/src/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.ts +5 -2
- package/src/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.ts +4 -1
- package/src/modules/dictionaries/api/[dictionaryId]/entries/route.ts +5 -2
- package/src/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.ts +4 -1
- package/src/modules/dictionaries/api/[dictionaryId]/route.ts +6 -3
- package/src/modules/dictionaries/api/context.ts +4 -1
- package/src/modules/dictionaries/api/route.ts +5 -2
- package/src/modules/dictionaries/components/DictionariesManager.tsx +6 -3
- package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +5 -2
- package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +5 -2
- package/src/modules/dictionaries/components/DictionarySelectControl.tsx +4 -1
- package/src/modules/dictionaries/fields/dictionary.tsx +4 -1
- package/src/modules/directory/api/organization-branding/route.ts +4 -1
- package/src/modules/directory/api/organization-switcher/route.ts +4 -1
- package/src/modules/directory/commands/tenants.ts +6 -3
- package/src/modules/directory/utils/organizationScope.ts +7 -4
- package/src/modules/entities/api/definitions.cache.ts +4 -1
- package/src/modules/entities/api/definitions.ts +8 -5
- package/src/modules/entities/api/records.ts +5 -2
- package/src/modules/entities/components/EncryptionManager.tsx +4 -1
- package/src/modules/entities/lib/makeActivityRoute.ts +4 -1
- package/src/modules/feature_toggles/api/overrides/route.ts +4 -1
- package/src/modules/feature_toggles/lib/feature-flag-check.ts +6 -9
- package/src/modules/inbox_ops/api/emails/[id]/reprocess/route.ts +5 -2
- package/src/modules/inbox_ops/api/emails/[id]/route.ts +5 -2
- package/src/modules/inbox_ops/api/emails/route.ts +4 -1
- package/src/modules/inbox_ops/api/extract/route.ts +4 -1
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.ts +4 -1
- package/src/modules/inbox_ops/api/proposals/[id]/replies/[replyId]/send/route.ts +5 -2
- package/src/modules/inbox_ops/api/proposals/counts/route.ts +5 -2
- package/src/modules/inbox_ops/api/proposals/route.ts +4 -1
- package/src/modules/inbox_ops/api/routeHelpers.ts +4 -1
- package/src/modules/inbox_ops/api/settings/route.ts +4 -1
- package/src/modules/inbox_ops/api/webhook/inbound.ts +8 -5
- package/src/modules/inbox_ops/lib/cache.ts +5 -2
- package/src/modules/inbox_ops/lib/catalogLookup.ts +4 -1
- package/src/modules/inbox_ops/lib/eventBus.ts +4 -4
- package/src/modules/inbox_ops/lib/messagesIntegration.ts +5 -8
- package/src/modules/inbox_ops/subscribers/executionAuditor.ts +5 -1
- package/src/modules/inbox_ops/subscribers/extractionWorker.ts +11 -8
- package/src/modules/inbox_ops/subscribers/proposalNotifier.ts +4 -1
- package/src/modules/messages/api/[id]/route.ts +4 -4
- package/src/modules/messages/commands/actions.ts +4 -1
- package/src/modules/messages/components/MessagesInboxPageClient.tsx +4 -1
- package/src/modules/messages/lib/email-sender.ts +4 -7
- package/src/modules/messages/lib/message-objects-registry.ts +4 -1
- package/src/modules/messages/lib/message-types-registry.ts +4 -1
- package/src/modules/messages/workers/send-email.worker.ts +7 -4
- package/src/modules/notifications/lib/notificationMapper.ts +4 -4
- package/src/modules/notifications/lib/notificationService.ts +4 -5
- package/src/modules/notifications/subscribers/deliver-notification.ts +9 -14
- package/src/modules/payment_gateways/api/webhook/[provider]/route.ts +4 -1
- package/src/modules/perspectives/services/perspectiveService.ts +4 -3
- package/src/modules/planner/api/access.ts +4 -3
- package/src/modules/planner/api/availability-date-specific.ts +4 -1
- package/src/modules/planner/api/availability-weekly.ts +4 -1
- package/src/modules/planner/backend/planner/availability-rulesets/page.tsx +5 -2
- package/src/modules/planner/components/AvailabilityRulesEditor.tsx +4 -1
- package/src/modules/progress/api/jobs/route.ts +4 -1
- package/src/modules/query_index/components/QueryIndexesTable.tsx +6 -3
- package/src/modules/query_index/lib/batch.ts +5 -2
- package/src/modules/query_index/lib/coverage.ts +4 -1
- package/src/modules/query_index/lib/engine.ts +14 -17
- package/src/modules/query_index/lib/reindexer.ts +9 -6
- package/src/modules/query_index/lib/search-tokens.ts +4 -2
- package/src/modules/query_index/subscribers/coverage_refresh.ts +4 -1
- package/src/modules/resources/api/comments.ts +4 -1
- package/src/modules/resources/api/resources/tags/assign/route.ts +4 -1
- package/src/modules/resources/api/resources/tags/unassign/route.ts +4 -1
- package/src/modules/resources/backend/resources/resource-types/[id]/edit/page.tsx +4 -1
- package/src/modules/resources/backend/resources/resource-types/page.tsx +5 -2
- package/src/modules/resources/commands/activities.ts +5 -4
- package/src/modules/resources/commands/comments.ts +6 -4
- package/src/modules/resources/commands/shared.ts +36 -0
- package/src/modules/sales/api/channels/route.ts +4 -1
- package/src/modules/sales/api/document-history/route.ts +4 -1
- package/src/modules/sales/api/document-numbers/route.ts +4 -1
- package/src/modules/sales/api/quotes/accept/route.ts +5 -2
- package/src/modules/sales/api/quotes/convert/route.ts +4 -1
- package/src/modules/sales/api/quotes/public/[token]/route.ts +4 -1
- package/src/modules/sales/api/quotes/send/route.ts +4 -1
- package/src/modules/sales/api/returns/[id]/route.ts +4 -1
- package/src/modules/sales/api/settings/document-numbers/route.ts +5 -2
- package/src/modules/sales/api/settings/order-editing/route.ts +5 -2
- package/src/modules/sales/backend/sales/channels/[channelId]/edit/page.tsx +4 -1
- package/src/modules/sales/backend/sales/channels/offers/page.tsx +7 -4
- package/src/modules/sales/backend/sales/channels/page.tsx +5 -2
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +21 -18
- package/src/modules/sales/commands/documents.ts +5 -8
- package/src/modules/sales/commands/payments.ts +4 -1
- package/src/modules/sales/commands/shipments.ts +4 -2
- package/src/modules/sales/components/AdjustmentKindSettings.tsx +6 -3
- package/src/modules/sales/components/DocumentNumberSettings.tsx +5 -2
- package/src/modules/sales/components/OrderEditingSettings.tsx +5 -2
- package/src/modules/sales/components/PaymentMethodsSettings.tsx +6 -3
- package/src/modules/sales/components/ShippingMethodsSettings.tsx +6 -3
- package/src/modules/sales/components/StatusSettings.tsx +6 -3
- package/src/modules/sales/components/TaxRatesSettings.tsx +6 -3
- package/src/modules/sales/components/channels/ChannelOfferForm.tsx +17 -14
- package/src/modules/sales/components/channels/SalesChannelOffersPanel.tsx +5 -2
- package/src/modules/sales/components/documents/AddressesSection.tsx +6 -3
- package/src/modules/sales/components/documents/AdjustmentDialog.tsx +4 -1
- package/src/modules/sales/components/documents/AdjustmentsSection.tsx +6 -3
- package/src/modules/sales/components/documents/ItemsSection.tsx +7 -4
- package/src/modules/sales/components/documents/LineItemDialog.tsx +9 -6
- package/src/modules/sales/components/documents/PaymentDialog.tsx +6 -3
- package/src/modules/sales/components/documents/PaymentsSection.tsx +5 -2
- package/src/modules/sales/components/documents/SalesDocumentForm.tsx +15 -12
- package/src/modules/sales/components/documents/SalesDocumentsTable.tsx +6 -3
- package/src/modules/sales/components/documents/ShipmentDialog.tsx +10 -7
- package/src/modules/sales/components/documents/ShipmentsSection.tsx +5 -2
- package/src/modules/sales/frontend/quote/[token]/page.tsx +5 -2
- package/src/modules/sales/seed/examples.ts +8 -9
- package/src/modules/sales/subscribers/quote-expiring-notification.ts +4 -1
- package/src/modules/sales/subscribers/reconcileOnAddressDelete.ts +4 -1
- package/src/modules/sales/subscribers/reconcileOnCompanyDelete.ts +4 -1
- package/src/modules/sales/subscribers/reconcileOnCustomerDelete.ts +4 -1
- package/src/modules/sales/widgets/dashboard/makeDashboardWidgetRoute.ts +6 -3
- package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +274 -271
- package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +280 -277
- package/src/modules/shipping_carriers/api/tracking/route.ts +5 -1
- package/src/modules/shipping_carriers/api/webhook/[provider]/route.ts +4 -1
- package/src/modules/shipping_carriers/lib/shipping-service.ts +47 -22
- package/src/modules/shipping_carriers/lib/upstream-error-response.ts +4 -1
- package/src/modules/shipping_carriers/workers/webhook-processor.ts +4 -5
- package/src/modules/staff/api/comments.ts +4 -1
- package/src/modules/staff/api/leave-requests/accept/route.ts +4 -1
- package/src/modules/staff/api/leave-requests/reject/route.ts +4 -1
- package/src/modules/staff/api/team-members/assignable/route.ts +4 -1
- package/src/modules/staff/api/team-members/self/route.ts +5 -2
- package/src/modules/staff/api/team-members/tags/assign/route.ts +4 -1
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +4 -1
- package/src/modules/staff/api/timesheets/my-projects/[projectId]/route.ts +4 -1
- package/src/modules/staff/api/timesheets/my-projects/route.ts +4 -1
- package/src/modules/staff/api/timesheets/projects/kpis/route.ts +4 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/route.ts +4 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.ts +5 -2
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.ts +5 -2
- package/src/modules/staff/api/timesheets/time-entries/bulk/route.ts +4 -1
- package/src/modules/staff/api/timesheets/time-entries/start-timer/route.ts +4 -1
- package/src/modules/staff/backend/staff/team-members/page.tsx +5 -2
- package/src/modules/staff/backend/staff/team-roles/page.tsx +5 -2
- package/src/modules/staff/backend/staff/teams/[id]/edit/page.tsx +5 -2
- package/src/modules/staff/backend/staff/teams/page.tsx +5 -2
- package/src/modules/staff/backend/staff/timesheets/page.tsx +8 -5
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.tsx +4 -1
- package/src/modules/staff/backend/staff/timesheets/projects/page.tsx +5 -2
- package/src/modules/staff/commands/timesheets-entries.ts +4 -1
- package/src/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.client.tsx +4 -1
- package/src/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.client.tsx +6 -3
- package/src/modules/sync_excel/api/import/route.ts +4 -1
- package/src/modules/translations/api/[entityType]/[entityId]/route.ts +6 -3
- package/src/modules/translations/api/get/locales.ts +4 -1
- package/src/modules/translations/api/put/locales.ts +4 -1
- package/src/modules/translations/components/TranslationManager.tsx +4 -1
- package/src/modules/translations/subscribers/cleanup.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/customize/route.ts +5 -2
- package/src/modules/workflows/api/definitions/[id]/reset-to-code/route.ts +5 -2
- package/src/modules/workflows/api/definitions/[id]/route.ts +7 -4
- package/src/modules/workflows/api/definitions/route.ts +5 -2
- package/src/modules/workflows/api/events/[id]/route.ts +4 -1
- package/src/modules/workflows/api/events/route.ts +4 -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]/events/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/retry/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/signal/route.ts +6 -7
- package/src/modules/workflows/api/instances/route.ts +6 -3
- package/src/modules/workflows/api/instances/validate-start/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]/route.ts +4 -1
- package/src/modules/workflows/api/tasks/route.ts +4 -1
- package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +5 -2
- package/src/modules/workflows/backend/instances/[id]/page.tsx +6 -3
- package/src/modules/workflows/backend/tasks/[id]/page.tsx +4 -1
- package/src/modules/workflows/components/BusinessRulesSelector.tsx +6 -3
- package/src/modules/workflows/components/WorkflowSelector.tsx +6 -3
- package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +4 -1
- package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +4 -1
- package/src/modules/workflows/components/fields/WorkflowSelectorField.tsx +4 -1
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +9 -7
- package/src/modules/workflows/lib/activity-executor.ts +26 -21
- package/src/modules/workflows/lib/activity-worker-handler.ts +9 -15
- package/src/modules/workflows/lib/code-registry.ts +8 -7
- package/src/modules/workflows/lib/compensation-handler.ts +5 -2
- package/src/modules/workflows/lib/edgeFormTransforms.ts +4 -1
- package/src/modules/workflows/lib/event-trigger-service.ts +6 -3
- package/src/modules/workflows/lib/nodeFormTransforms.ts +4 -1
- package/src/modules/workflows/lib/seeds.ts +17 -2
- package/src/modules/workflows/lib/signal-handler.ts +4 -1
- package/src/modules/workflows/lib/start-validator.ts +10 -3
- package/src/modules/workflows/lib/step-handler.ts +4 -1
- package/src/modules/workflows/lib/task-handler.ts +4 -1
- package/src/modules/workflows/lib/transition-handler.ts +6 -3
- package/src/modules/workflows/lib/workflow-executor.ts +28 -15
- package/src/modules/workflows/subscribers/event-trigger.ts +22 -24
- package/src/modules/workflows/subscribers/task-assigned-notification.ts +4 -1
- package/src/modules/workflows/workers/workflow-activities.worker.ts +31 -20
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customers/components/detail/ChangelogTab.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { ArrowLeft, ArrowRight, ArrowUpDown, ChevronDown, ChevronUp, Clock3 } from 'lucide-react'\nimport { extractChangeRows } from '@open-mercato/core/modules/audit_logs/lib/changeRows'\nimport type { ActionLogProjectionType, ActionLogSourceKey } from '@open-mercato/core/modules/audit_logs/lib/projections'\nimport { deriveActionLogActionType, deriveActionLogSource } from '@open-mercato/core/modules/audit_logs/lib/projections'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { apiCallOrThrow, readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Badge } from '@open-mercato/ui/primitives/badge'\nimport { ErrorMessage, LoadingMessage, TabEmptyState } from '@open-mercato/ui/backend/detail'\nimport { ChangelogFilters } from './ChangelogFilters'\nimport { ChangelogKpiCards } from './ChangelogKpiCards'\nimport { ChangelogEntryRow } from './ChangelogEntryRow'\nimport { formatChangelogValue } from './changelogValues'\n\ntype AuditAction = {\n id: string\n commandId: string\n actionLabel: string | null\n executionState: 'done' | 'undone' | 'failed' | 'redone'\n actorUserId: string | null\n actorUserName: string | null\n resourceKind: string | null\n resourceId: string | null\n snapshotBefore: unknown | null\n snapshotAfter: unknown | null\n changes: Record<string, unknown> | null\n context: Record<string, unknown> | null\n createdAt: string\n updatedAt: string\n}\n\ntype AuditActionsResponse = {\n items: AuditAction[]\n total?: number\n}\n\ntype ChangelogActionType = ActionLogProjectionType\ntype ChangelogSource = ActionLogSourceKey\n\ntype ChangelogEntry = {\n id: string\n createdAt: string\n actorUserId: string | null\n actorUserName: string | null\n actionType: ChangelogActionType\n source: ChangelogSource\n description: string | null\n changes: Array<{\n fieldName: string\n oldValue: string\n newValue: string\n }>\n}\n\ntype ChangelogTabProps = {\n entityId: string\n entityType: 'company' | 'person' | 'deal'\n}\n\ntype FilterState = {\n fieldNames: string[]\n actorUserIds: string[]\n actionTypes: string[]\n dateRange: '7d' | '30d' | '90d'\n}\n\ntype FilterOption = {\n value: string\n label: string\n}\n\ntype SortField = 'createdAt' | 'user' | 'action' | 'field' | 'source'\n\ntype SortState = {\n field: SortField\n dir: 'asc' | 'desc'\n}\n\nconst PAGE_SIZE = 50\nconst ACTION_OPTIONS: Array<{ value: ChangelogActionType; key: string; fallback: string }> = [\n { value: 'create', key: 'customers.changelog.actions.create', fallback: 'Create' },\n { value: 'edit', key: 'customers.changelog.actions.edit', fallback: 'Edit' },\n { value: 'delete', key: 'customers.changelog.actions.delete', fallback: 'Delete' },\n { value: 'assign', key: 'customers.changelog.actions.assign', fallback: 'Assign' },\n]\nconst CRITICAL_FIELDS = ['status', 'lifecycleStage', 'ownerUserId', 'temperature', 'source', 'renewalQuarter'] as const\nconst HEADER_COLUMNS: Array<{ field: SortField; key: string; fallback: string; align?: 'left' | 'right' }> = [\n { field: 'createdAt', key: 'customers.changelog.col.when', fallback: 'When' },\n { field: 'user', key: 'customers.changelog.col.user', fallback: 'User' },\n { field: 'action', key: 'customers.changelog.col.action', fallback: 'Action' },\n { field: 'field', key: 'customers.changelog.col.change', fallback: 'What changed' },\n { field: 'source', key: 'customers.changelog.col.source', fallback: 'Source', align: 'right' },\n]\n\nfunction formatFieldLabel(fieldName: string): string {\n return fieldName\n .replace(/\\./g, ' ')\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim()\n .replace(/^\\w/, (char) => char.toUpperCase())\n}\n\nfunction mergeFilterOptions(...groups: FilterOption[][]): FilterOption[] {\n const options = new Map<string, FilterOption>()\n groups.flat().forEach((option) => {\n options.set(option.value, option)\n })\n return Array.from(options.values()).sort((left, right) =>\n left.label.localeCompare(right.label, undefined, { sensitivity: 'base' }),\n )\n}\n\nfunction mapAuditActionToEntry(action: AuditAction): ChangelogEntry {\n const changes = extractChangeRows(action.changes, action.snapshotBefore).map((change) => ({\n fieldName: change.field,\n oldValue: formatChangelogValue(change.from),\n newValue: formatChangelogValue(change.to),\n }))\n\n return {\n id: action.id,\n createdAt: action.createdAt,\n actorUserId: action.actorUserId,\n actorUserName: action.actorUserName,\n actionType: deriveActionLogActionType(action),\n source: deriveActionLogSource(action.context, action.actorUserId),\n description: action.actionLabel,\n changes,\n }\n}\n\nfunction startOfDay(daysAgo = 0): Date {\n const date = new Date()\n date.setHours(0, 0, 0, 0)\n if (daysAgo > 0) date.setDate(date.getDate() - daysAgo)\n return date\n}\n\nfunction computeRangeStart(range: FilterState['dateRange']): Date {\n const days = Number.parseInt(range.replace('d', ''), 10)\n const date = new Date()\n date.setHours(0, 0, 0, 0)\n date.setDate(date.getDate() - (Number.isFinite(days) ? days : 90))\n return date\n}\n\nfunction buildQueryUrl({\n entityId,\n entityType,\n dateRange,\n filters,\n limit,\n offset,\n sorting,\n includeTotal,\n before,\n after,\n}: {\n entityId: string\n entityType: 'company' | 'person' | 'deal'\n dateRange: FilterState['dateRange']\n filters: Pick<FilterState, 'fieldNames' | 'actorUserIds' | 'actionTypes'>\n limit: number\n offset?: number\n sorting?: SortState\n includeTotal?: boolean\n before?: string\n after?: string\n}) {\n const params = new URLSearchParams({\n resourceKind: `customers.${entityType}`,\n resourceId: entityId,\n includeRelated: 'true',\n limit: String(limit),\n offset: String(offset ?? 0),\n sortField: sorting?.field ?? 'createdAt',\n sortDir: sorting?.dir ?? 'desc',\n after: after ?? computeRangeStart(dateRange).toISOString(),\n })\n if (includeTotal) params.set('includeTotal', 'true')\n if (before) params.set('before', before)\n if (filters.fieldNames.length > 0) params.set('fieldName', filters.fieldNames.join(','))\n if (filters.actorUserIds.length > 0) params.set('actorUserId', filters.actorUserIds.join(','))\n if (filters.actionTypes.length > 0) params.set('actionType', filters.actionTypes.join(','))\n return `/api/audit_logs/audit-logs/actions?${params.toString()}`\n}\n\nfunction buildExportUrl({\n entityId,\n entityType,\n filters,\n dateRange,\n sorting,\n}: {\n entityId: string\n entityType: 'company' | 'person' | 'deal'\n filters: Pick<FilterState, 'fieldNames' | 'actorUserIds' | 'actionTypes'>\n dateRange: FilterState['dateRange']\n sorting: SortState\n}) {\n const params = new URLSearchParams({\n resourceKind: `customers.${entityType}`,\n resourceId: entityId,\n includeRelated: 'true',\n limit: '1000',\n sortField: sorting.field,\n sortDir: sorting.dir,\n after: computeRangeStart(dateRange).toISOString(),\n })\n if (filters.fieldNames.length > 0) params.set('fieldName', filters.fieldNames.join(','))\n if (filters.actorUserIds.length > 0) params.set('actorUserId', filters.actorUserIds.join(','))\n if (filters.actionTypes.length > 0) params.set('actionType', filters.actionTypes.join(','))\n return `/api/audit_logs/audit-logs/actions/export?${params.toString()}`\n}\n\nfunction groupEntriesByDay(entries: ChangelogEntry[], t: ReturnType<typeof useT>) {\n const groups = new Map<string, ChangelogEntry[]>()\n entries.forEach((entry) => {\n const date = new Date(entry.createdAt)\n const key = Number.isNaN(date.getTime()) ? entry.createdAt : date.toDateString()\n const bucket = groups.get(key) ?? []\n bucket.push(entry)\n groups.set(key, bucket)\n })\n\n const today = new Date().toDateString()\n const yesterdayDate = new Date()\n yesterdayDate.setDate(yesterdayDate.getDate() - 1)\n const yesterday = yesterdayDate.toDateString()\n\n return Array.from(groups.entries()).map(([key, items]) => ({\n key,\n label:\n key === today\n ? t('customers.changelog.groupLabel.today', 'TODAY')\n : key === yesterday\n ? t('customers.changelog.groupLabel.yesterday', 'YESTERDAY')\n : new Date(key).toLocaleDateString(undefined, {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n }).toUpperCase(),\n items,\n }))\n}\n\nfunction SortIcon({ active, dir }: { active: boolean; dir: 'asc' | 'desc' }) {\n if (!active) return <ArrowUpDown className=\"size-3 text-muted-foreground\" />\n return dir === 'asc'\n ? <ChevronUp className=\"size-3 text-foreground\" />\n : <ChevronDown className=\"size-3 text-foreground\" />\n}\n\nexport function ChangelogTab({ entityId, entityType }: ChangelogTabProps) {\n const t = useT()\n const [filters, setFilters] = React.useState<FilterState>({\n fieldNames: [],\n actorUserIds: [],\n actionTypes: [],\n dateRange: '90d',\n })\n const [entries, setEntries] = React.useState<ChangelogEntry[]>([])\n const [totalCount, setTotalCount] = React.useState(0)\n const [todayCount, setTodayCount] = React.useState(0)\n const [yesterdayCount, setYesterdayCount] = React.useState(0)\n const [fieldOptions, setFieldOptions] = React.useState<FilterOption[]>([])\n const [userOptions, setUserOptions] = React.useState<FilterOption[]>([])\n const [actionOptions, setActionOptions] = React.useState<FilterOption[]>([])\n const [loading, setLoading] = React.useState(true)\n const [error, setError] = React.useState<string | null>(null)\n const [exporting, setExporting] = React.useState(false)\n const [pageIndex, setPageIndex] = React.useState(0)\n const [sorting, setSorting] = React.useState<SortState>({\n field: 'createdAt',\n dir: 'desc',\n })\n\n const days = React.useMemo(() => Number.parseInt(filters.dateRange.replace('d', ''), 10) || 90, [filters.dateRange])\n\n const loadTab = React.useCallback(async () => {\n setLoading(true)\n setError(null)\n try {\n const todayStart = startOfDay(0).toISOString()\n const yesterdayStart = startOfDay(1).toISOString()\n\n const [mainResponse, todayResponse, yesterdayResponse] = await Promise.all([\n readApiResultOrThrow<AuditActionsResponse>(\n buildQueryUrl({\n entityId,\n entityType,\n dateRange: filters.dateRange,\n filters,\n limit: PAGE_SIZE,\n offset: pageIndex * PAGE_SIZE,\n sorting,\n includeTotal: true,\n }),\n ),\n readApiResultOrThrow<AuditActionsResponse>(\n buildQueryUrl({\n entityId,\n entityType,\n dateRange: filters.dateRange,\n filters,\n limit: 1,\n sorting,\n includeTotal: true,\n after: todayStart,\n }),\n ).catch(() => ({ items: [], total: 0 })),\n readApiResultOrThrow<AuditActionsResponse>(\n buildQueryUrl({\n entityId,\n entityType,\n dateRange: filters.dateRange,\n filters,\n limit: 1,\n sorting,\n includeTotal: true,\n after: yesterdayStart,\n before: todayStart,\n }),\n ).catch(() => ({ items: [], total: 0 })),\n ])\n\n const mappedEntries = Array.isArray(mainResponse.items) ? mainResponse.items.map(mapAuditActionToEntry) : []\n\n setEntries(mappedEntries)\n setTotalCount(typeof mainResponse.total === 'number' ? mainResponse.total : mappedEntries.length)\n setTodayCount(typeof todayResponse.total === 'number' ? todayResponse.total : 0)\n setYesterdayCount(typeof yesterdayResponse.total === 'number' ? yesterdayResponse.total : 0)\n\n const nextFieldOptions = mergeFilterOptions(\n filters.fieldNames.map((fieldName) => ({ value: fieldName, label: formatFieldLabel(fieldName) })),\n Array.from(\n new Set(\n mappedEntries.flatMap((entry) => entry.changes.map((change) => change.fieldName)),\n ),\n )\n .sort((left, right) => left.localeCompare(right))\n .map((fieldName) => ({ value: fieldName, label: formatFieldLabel(fieldName) })),\n )\n const nextActionOptions = ACTION_OPTIONS\n .filter((option) => filters.actionTypes.includes(option.value) || mappedEntries.some((entry) => entry.actionType === option.value))\n .map((option) => ({\n value: option.value,\n label: t(option.key, option.fallback),\n }))\n\n setFieldOptions(nextFieldOptions)\n setUserOptions((current) =>\n mergeFilterOptions(\n current.filter((option) => filters.actorUserIds.includes(option.value)),\n Array.from(\n new Map(\n mappedEntries\n .filter((entry) => entry.actorUserId && entry.actorUserName)\n .map((entry) => [entry.actorUserId as string, entry.actorUserName as string]),\n ).entries(),\n ).map(([value, label]) => ({ value, label })),\n ),\n )\n setActionOptions(nextActionOptions)\n } catch (loadError) {\n setEntries([])\n setTotalCount(0)\n setTodayCount(0)\n setYesterdayCount(0)\n setFieldOptions([])\n setUserOptions([])\n setActionOptions([])\n setError(t('customers.changelog.error', 'Failed to load change log'))\n } finally {\n setLoading(false)\n }\n }, [entityId, entityType, filters, pageIndex, sorting, t])\n\n React.useEffect(() => {\n void loadTab()\n }, [loadTab])\n\n const showGroupedEntries = sorting.field === 'createdAt'\n const groupedEntries = React.useMemo(() => groupEntriesByDay(entries, t), [entries, t])\n const uniqueUsers = React.useMemo(\n () => new Set(entries.map((entry) => entry.actorUserId).filter((value): value is string => Boolean(value))).size,\n [entries],\n )\n const criticalFieldCount = React.useMemo(\n () => entries.filter((entry) => entry.changes.some((change) => CRITICAL_FIELDS.includes(change.fieldName as (typeof CRITICAL_FIELDS)[number]))).length,\n [entries],\n )\n const criticalFieldLabel = React.useMemo(\n () => CRITICAL_FIELDS.map((fieldName) => formatFieldLabel(fieldName)).slice(0, 3).join(', '),\n [],\n )\n const previousPageLabel = React.useMemo(() => {\n if (sorting.field !== 'createdAt') return t('customers.changelog.previous', 'Previous')\n return sorting.dir === 'desc'\n ? t('customers.changelog.newer', 'Newer')\n : t('customers.changelog.older', 'Older')\n }, [sorting, t])\n const nextPageLabel = React.useMemo(() => {\n if (sorting.field !== 'createdAt') return t('customers.changelog.next', 'Next')\n return sorting.dir === 'desc'\n ? t('customers.changelog.older', 'Older')\n : t('customers.changelog.newer', 'Newer')\n }, [sorting, t])\n const shownCount = entries.length\n const hasOlder = (pageIndex + 1) * PAGE_SIZE < totalCount\n const hasNewer = pageIndex > 0\n\n const updateFilters = React.useCallback((partial: Partial<FilterState>) => {\n setFilters((current) => ({ ...current, ...partial }))\n setPageIndex(0)\n }, [])\n\n const handleOlder = React.useCallback(() => {\n if (!hasOlder) return\n setPageIndex((current) => current + 1)\n }, [hasOlder])\n\n const handleNewer = React.useCallback(() => {\n if (!hasNewer) return\n setPageIndex((current) => Math.max(current - 1, 0))\n }, [hasNewer])\n\n const handleSort = React.useCallback((field: SortField) => {\n setSorting((current) => {\n if (current.field === field) {\n return {\n field,\n dir: current.dir === 'desc' ? 'asc' : 'desc',\n }\n }\n\n return {\n field,\n dir: field === 'createdAt' ? 'desc' : 'asc',\n }\n })\n setPageIndex(0)\n }, [])\n\n const handleExport = React.useCallback(async () => {\n setExporting(true)\n try {\n const response = await apiCallOrThrow<string>(\n buildExportUrl({\n entityId,\n entityType,\n filters,\n dateRange: filters.dateRange,\n sorting,\n }),\n undefined,\n {\n parse: async (res) => res.text(),\n },\n )\n\n const body = response.result ?? ''\n const blob = new Blob([body], { type: 'text/csv;charset=utf-8' })\n const blobUrl = URL.createObjectURL(blob)\n const anchor = document.createElement('a')\n anchor.href = blobUrl\n anchor.download = 'changelog-export.csv'\n document.body.appendChild(anchor)\n anchor.click()\n anchor.remove()\n URL.revokeObjectURL(blobUrl)\n } catch (exportError) {\n console.error('customers.changelog.export failed', exportError)\n flash(t('customers.changelog.exportError', 'Failed to export change log'), 'error')\n } finally {\n setExporting(false)\n }\n }, [entityId, entityType, filters, sorting, t])\n\n return (\n <div className=\"space-y-5\">\n <ChangelogFilters\n dateRange={filters.dateRange}\n fieldNames={filters.fieldNames}\n actorUserIds={filters.actorUserIds}\n actionTypes={filters.actionTypes}\n fieldOptions={fieldOptions}\n userOptions={userOptions}\n actionOptions={actionOptions}\n exportDisabled={exporting}\n onDateRangeChange={(value) => updateFilters({ dateRange: value })}\n onFieldNamesChange={(value) => updateFilters({ fieldNames: value })}\n onActorUserIdsChange={(value) => updateFilters({ actorUserIds: value })}\n onActionTypesChange={(value) => updateFilters({ actionTypes: value })}\n onExport={handleExport}\n />\n\n <ChangelogKpiCards\n loading={loading}\n totalCount={totalCount}\n todayCount={todayCount}\n yesterdayCount={yesterdayCount}\n uniqueUsers={uniqueUsers}\n criticalFieldCount={criticalFieldCount}\n criticalFieldLabel={criticalFieldLabel}\n dateRangeDays={days}\n />\n\n <div className=\"overflow-hidden rounded-xl border bg-card\">\n <div className=\"flex items-center gap-2 border-b px-5 py-4\">\n <Clock3 className=\"size-4 text-muted-foreground\" />\n <h3 className=\"text-base font-semibold text-foreground\">\n {t('customers.changelog.title', 'Change log')}\n </h3>\n <Badge variant=\"secondary\" className=\"text-xs\">\n {totalCount}\n </Badge>\n </div>\n\n <div className=\"grid grid-cols-[92px_190px_120px_1fr_80px] gap-3 border-b bg-muted/20 px-5 py-2 text-overline font-semibold uppercase tracking-[0.12em] text-muted-foreground\">\n {HEADER_COLUMNS.map((column) => {\n const isActive = sorting.field === column.field\n return (\n <Button\n key={column.field}\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => handleSort(column.field)}\n className={`h-auto gap-1 rounded-none px-0 py-0 text-overline font-semibold uppercase tracking-[0.12em] text-muted-foreground hover:bg-transparent ${\n column.align === 'right' ? 'justify-end' : 'justify-start'\n }`}\n >\n <span>{t(column.key, column.fallback)}</span>\n <SortIcon active={isActive} dir={sorting.dir} />\n </Button>\n )\n })}\n </div>\n\n {loading && entries.length === 0 ? (\n <LoadingMessage label={t('customers.changelog.loading', 'Loading changes...')} className=\"min-h-[220px] justify-center\" />\n ) : error ? (\n <ErrorMessage label={error} className=\"m-5\" />\n ) : entries.length === 0 ? (\n <div className=\"p-5\">\n <TabEmptyState\n title={t('customers.changelog.emptyTitle', 'No changes in this period')}\n description={t('customers.changelog.empty', 'No changes recorded in this period.')}\n />\n </div>\n ) : (\n <div>\n {showGroupedEntries ? (\n groupedEntries.map((group) => (\n <div key={group.key}>\n <div className=\"border-b bg-muted/10 px-5 py-2 text-overline font-semibold uppercase tracking-[0.12em] text-muted-foreground\">\n {group.label}\n </div>\n {group.items.map((entry) => (\n <div key={entry.id} className=\"border-b last:border-b-0\">\n <ChangelogEntryRow entry={entry} />\n </div>\n ))}\n </div>\n ))\n ) : (\n entries.map((entry) => (\n <div key={entry.id} className=\"border-b last:border-b-0\">\n <ChangelogEntryRow entry={entry} />\n </div>\n ))\n )}\n </div>\n )}\n\n <div className=\"flex flex-col gap-3 border-t px-5 py-4 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between\">\n <span>\n {t('customers.changelog.showingWithPeriod', 'Showing {{shown}} of {{total}} entries \u00B7 last {{days}} days', {\n shown: shownCount,\n total: totalCount,\n days,\n })}\n </span>\n <div className=\"flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={handleNewer}\n disabled={!hasNewer || loading}\n className=\"h-8 rounded-lg px-3 text-xs\"\n >\n <ArrowLeft className=\"mr-1.5 size-3.5\" />\n {previousPageLabel}\n </Button>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={handleOlder}\n disabled={!hasOlder || loading}\n className=\"h-8 rounded-lg px-3 text-xs\"\n >\n {nextPageLabel}\n <ArrowRight className=\"ml-1.5 size-3.5\" />\n </Button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default ChangelogTab\n"],
|
|
5
|
-
"mappings": ";AA8PsB,cAsQd,YAtQc;AA5PtB,YAAY,WAAW;AACvB,SAAS,WAAW,YAAY,aAAa,aAAa,WAAW,cAAc;AACnF,SAAS,yBAAyB;AAElC,SAAS,2BAA2B,6BAA6B;AACjE,SAAS,YAAY;AACrB,SAAS,gBAAgB,4BAA4B;AACrD,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,cAAc,gBAAgB,qBAAqB;AAC5D,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AAkErC,MAAM,YAAY;AAClB,MAAM,iBAAuF;AAAA,EAC3F,EAAE,OAAO,UAAU,KAAK,sCAAsC,UAAU,SAAS;AAAA,EACjF,EAAE,OAAO,QAAQ,KAAK,oCAAoC,UAAU,OAAO;AAAA,EAC3E,EAAE,OAAO,UAAU,KAAK,sCAAsC,UAAU,SAAS;AAAA,EACjF,EAAE,OAAO,UAAU,KAAK,sCAAsC,UAAU,SAAS;AACnF;AACA,MAAM,kBAAkB,CAAC,UAAU,kBAAkB,eAAe,eAAe,UAAU,gBAAgB;AAC7G,M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AEA,IAAO,uBAAQ;",
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { ArrowLeft, ArrowRight, ArrowUpDown, ChevronDown, ChevronUp, Clock3 } from 'lucide-react'\nimport { extractChangeRows } from '@open-mercato/core/modules/audit_logs/lib/changeRows'\nimport type { ActionLogProjectionType, ActionLogSourceKey } from '@open-mercato/core/modules/audit_logs/lib/projections'\nimport { deriveActionLogActionType, deriveActionLogSource } from '@open-mercato/core/modules/audit_logs/lib/projections'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { apiCallOrThrow, readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Badge } from '@open-mercato/ui/primitives/badge'\nimport { ErrorMessage, LoadingMessage, TabEmptyState } from '@open-mercato/ui/backend/detail'\nimport { ChangelogFilters } from './ChangelogFilters'\nimport { ChangelogKpiCards } from './ChangelogKpiCards'\nimport { ChangelogEntryRow } from './ChangelogEntryRow'\nimport { formatChangelogValue } from './changelogValues'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('customers')\n\ntype AuditAction = {\n id: string\n commandId: string\n actionLabel: string | null\n executionState: 'done' | 'undone' | 'failed' | 'redone'\n actorUserId: string | null\n actorUserName: string | null\n resourceKind: string | null\n resourceId: string | null\n snapshotBefore: unknown | null\n snapshotAfter: unknown | null\n changes: Record<string, unknown> | null\n context: Record<string, unknown> | null\n createdAt: string\n updatedAt: string\n}\n\ntype AuditActionsResponse = {\n items: AuditAction[]\n total?: number\n}\n\ntype ChangelogActionType = ActionLogProjectionType\ntype ChangelogSource = ActionLogSourceKey\n\ntype ChangelogEntry = {\n id: string\n createdAt: string\n actorUserId: string | null\n actorUserName: string | null\n actionType: ChangelogActionType\n source: ChangelogSource\n description: string | null\n changes: Array<{\n fieldName: string\n oldValue: string\n newValue: string\n }>\n}\n\ntype ChangelogTabProps = {\n entityId: string\n entityType: 'company' | 'person' | 'deal'\n}\n\ntype FilterState = {\n fieldNames: string[]\n actorUserIds: string[]\n actionTypes: string[]\n dateRange: '7d' | '30d' | '90d'\n}\n\ntype FilterOption = {\n value: string\n label: string\n}\n\ntype SortField = 'createdAt' | 'user' | 'action' | 'field' | 'source'\n\ntype SortState = {\n field: SortField\n dir: 'asc' | 'desc'\n}\n\nconst PAGE_SIZE = 50\nconst ACTION_OPTIONS: Array<{ value: ChangelogActionType; key: string; fallback: string }> = [\n { value: 'create', key: 'customers.changelog.actions.create', fallback: 'Create' },\n { value: 'edit', key: 'customers.changelog.actions.edit', fallback: 'Edit' },\n { value: 'delete', key: 'customers.changelog.actions.delete', fallback: 'Delete' },\n { value: 'assign', key: 'customers.changelog.actions.assign', fallback: 'Assign' },\n]\nconst CRITICAL_FIELDS = ['status', 'lifecycleStage', 'ownerUserId', 'temperature', 'source', 'renewalQuarter'] as const\nconst HEADER_COLUMNS: Array<{ field: SortField; key: string; fallback: string; align?: 'left' | 'right' }> = [\n { field: 'createdAt', key: 'customers.changelog.col.when', fallback: 'When' },\n { field: 'user', key: 'customers.changelog.col.user', fallback: 'User' },\n { field: 'action', key: 'customers.changelog.col.action', fallback: 'Action' },\n { field: 'field', key: 'customers.changelog.col.change', fallback: 'What changed' },\n { field: 'source', key: 'customers.changelog.col.source', fallback: 'Source', align: 'right' },\n]\n\nfunction formatFieldLabel(fieldName: string): string {\n return fieldName\n .replace(/\\./g, ' ')\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim()\n .replace(/^\\w/, (char) => char.toUpperCase())\n}\n\nfunction mergeFilterOptions(...groups: FilterOption[][]): FilterOption[] {\n const options = new Map<string, FilterOption>()\n groups.flat().forEach((option) => {\n options.set(option.value, option)\n })\n return Array.from(options.values()).sort((left, right) =>\n left.label.localeCompare(right.label, undefined, { sensitivity: 'base' }),\n )\n}\n\nfunction mapAuditActionToEntry(action: AuditAction): ChangelogEntry {\n const changes = extractChangeRows(action.changes, action.snapshotBefore).map((change) => ({\n fieldName: change.field,\n oldValue: formatChangelogValue(change.from),\n newValue: formatChangelogValue(change.to),\n }))\n\n return {\n id: action.id,\n createdAt: action.createdAt,\n actorUserId: action.actorUserId,\n actorUserName: action.actorUserName,\n actionType: deriveActionLogActionType(action),\n source: deriveActionLogSource(action.context, action.actorUserId),\n description: action.actionLabel,\n changes,\n }\n}\n\nfunction startOfDay(daysAgo = 0): Date {\n const date = new Date()\n date.setHours(0, 0, 0, 0)\n if (daysAgo > 0) date.setDate(date.getDate() - daysAgo)\n return date\n}\n\nfunction computeRangeStart(range: FilterState['dateRange']): Date {\n const days = Number.parseInt(range.replace('d', ''), 10)\n const date = new Date()\n date.setHours(0, 0, 0, 0)\n date.setDate(date.getDate() - (Number.isFinite(days) ? days : 90))\n return date\n}\n\nfunction buildQueryUrl({\n entityId,\n entityType,\n dateRange,\n filters,\n limit,\n offset,\n sorting,\n includeTotal,\n before,\n after,\n}: {\n entityId: string\n entityType: 'company' | 'person' | 'deal'\n dateRange: FilterState['dateRange']\n filters: Pick<FilterState, 'fieldNames' | 'actorUserIds' | 'actionTypes'>\n limit: number\n offset?: number\n sorting?: SortState\n includeTotal?: boolean\n before?: string\n after?: string\n}) {\n const params = new URLSearchParams({\n resourceKind: `customers.${entityType}`,\n resourceId: entityId,\n includeRelated: 'true',\n limit: String(limit),\n offset: String(offset ?? 0),\n sortField: sorting?.field ?? 'createdAt',\n sortDir: sorting?.dir ?? 'desc',\n after: after ?? computeRangeStart(dateRange).toISOString(),\n })\n if (includeTotal) params.set('includeTotal', 'true')\n if (before) params.set('before', before)\n if (filters.fieldNames.length > 0) params.set('fieldName', filters.fieldNames.join(','))\n if (filters.actorUserIds.length > 0) params.set('actorUserId', filters.actorUserIds.join(','))\n if (filters.actionTypes.length > 0) params.set('actionType', filters.actionTypes.join(','))\n return `/api/audit_logs/audit-logs/actions?${params.toString()}`\n}\n\nfunction buildExportUrl({\n entityId,\n entityType,\n filters,\n dateRange,\n sorting,\n}: {\n entityId: string\n entityType: 'company' | 'person' | 'deal'\n filters: Pick<FilterState, 'fieldNames' | 'actorUserIds' | 'actionTypes'>\n dateRange: FilterState['dateRange']\n sorting: SortState\n}) {\n const params = new URLSearchParams({\n resourceKind: `customers.${entityType}`,\n resourceId: entityId,\n includeRelated: 'true',\n limit: '1000',\n sortField: sorting.field,\n sortDir: sorting.dir,\n after: computeRangeStart(dateRange).toISOString(),\n })\n if (filters.fieldNames.length > 0) params.set('fieldName', filters.fieldNames.join(','))\n if (filters.actorUserIds.length > 0) params.set('actorUserId', filters.actorUserIds.join(','))\n if (filters.actionTypes.length > 0) params.set('actionType', filters.actionTypes.join(','))\n return `/api/audit_logs/audit-logs/actions/export?${params.toString()}`\n}\n\nfunction groupEntriesByDay(entries: ChangelogEntry[], t: ReturnType<typeof useT>) {\n const groups = new Map<string, ChangelogEntry[]>()\n entries.forEach((entry) => {\n const date = new Date(entry.createdAt)\n const key = Number.isNaN(date.getTime()) ? entry.createdAt : date.toDateString()\n const bucket = groups.get(key) ?? []\n bucket.push(entry)\n groups.set(key, bucket)\n })\n\n const today = new Date().toDateString()\n const yesterdayDate = new Date()\n yesterdayDate.setDate(yesterdayDate.getDate() - 1)\n const yesterday = yesterdayDate.toDateString()\n\n return Array.from(groups.entries()).map(([key, items]) => ({\n key,\n label:\n key === today\n ? t('customers.changelog.groupLabel.today', 'TODAY')\n : key === yesterday\n ? t('customers.changelog.groupLabel.yesterday', 'YESTERDAY')\n : new Date(key).toLocaleDateString(undefined, {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n }).toUpperCase(),\n items,\n }))\n}\n\nfunction SortIcon({ active, dir }: { active: boolean; dir: 'asc' | 'desc' }) {\n if (!active) return <ArrowUpDown className=\"size-3 text-muted-foreground\" />\n return dir === 'asc'\n ? <ChevronUp className=\"size-3 text-foreground\" />\n : <ChevronDown className=\"size-3 text-foreground\" />\n}\n\nexport function ChangelogTab({ entityId, entityType }: ChangelogTabProps) {\n const t = useT()\n const [filters, setFilters] = React.useState<FilterState>({\n fieldNames: [],\n actorUserIds: [],\n actionTypes: [],\n dateRange: '90d',\n })\n const [entries, setEntries] = React.useState<ChangelogEntry[]>([])\n const [totalCount, setTotalCount] = React.useState(0)\n const [todayCount, setTodayCount] = React.useState(0)\n const [yesterdayCount, setYesterdayCount] = React.useState(0)\n const [fieldOptions, setFieldOptions] = React.useState<FilterOption[]>([])\n const [userOptions, setUserOptions] = React.useState<FilterOption[]>([])\n const [actionOptions, setActionOptions] = React.useState<FilterOption[]>([])\n const [loading, setLoading] = React.useState(true)\n const [error, setError] = React.useState<string | null>(null)\n const [exporting, setExporting] = React.useState(false)\n const [pageIndex, setPageIndex] = React.useState(0)\n const [sorting, setSorting] = React.useState<SortState>({\n field: 'createdAt',\n dir: 'desc',\n })\n\n const days = React.useMemo(() => Number.parseInt(filters.dateRange.replace('d', ''), 10) || 90, [filters.dateRange])\n\n const loadTab = React.useCallback(async () => {\n setLoading(true)\n setError(null)\n try {\n const todayStart = startOfDay(0).toISOString()\n const yesterdayStart = startOfDay(1).toISOString()\n\n const [mainResponse, todayResponse, yesterdayResponse] = await Promise.all([\n readApiResultOrThrow<AuditActionsResponse>(\n buildQueryUrl({\n entityId,\n entityType,\n dateRange: filters.dateRange,\n filters,\n limit: PAGE_SIZE,\n offset: pageIndex * PAGE_SIZE,\n sorting,\n includeTotal: true,\n }),\n ),\n readApiResultOrThrow<AuditActionsResponse>(\n buildQueryUrl({\n entityId,\n entityType,\n dateRange: filters.dateRange,\n filters,\n limit: 1,\n sorting,\n includeTotal: true,\n after: todayStart,\n }),\n ).catch(() => ({ items: [], total: 0 })),\n readApiResultOrThrow<AuditActionsResponse>(\n buildQueryUrl({\n entityId,\n entityType,\n dateRange: filters.dateRange,\n filters,\n limit: 1,\n sorting,\n includeTotal: true,\n after: yesterdayStart,\n before: todayStart,\n }),\n ).catch(() => ({ items: [], total: 0 })),\n ])\n\n const mappedEntries = Array.isArray(mainResponse.items) ? mainResponse.items.map(mapAuditActionToEntry) : []\n\n setEntries(mappedEntries)\n setTotalCount(typeof mainResponse.total === 'number' ? mainResponse.total : mappedEntries.length)\n setTodayCount(typeof todayResponse.total === 'number' ? todayResponse.total : 0)\n setYesterdayCount(typeof yesterdayResponse.total === 'number' ? yesterdayResponse.total : 0)\n\n const nextFieldOptions = mergeFilterOptions(\n filters.fieldNames.map((fieldName) => ({ value: fieldName, label: formatFieldLabel(fieldName) })),\n Array.from(\n new Set(\n mappedEntries.flatMap((entry) => entry.changes.map((change) => change.fieldName)),\n ),\n )\n .sort((left, right) => left.localeCompare(right))\n .map((fieldName) => ({ value: fieldName, label: formatFieldLabel(fieldName) })),\n )\n const nextActionOptions = ACTION_OPTIONS\n .filter((option) => filters.actionTypes.includes(option.value) || mappedEntries.some((entry) => entry.actionType === option.value))\n .map((option) => ({\n value: option.value,\n label: t(option.key, option.fallback),\n }))\n\n setFieldOptions(nextFieldOptions)\n setUserOptions((current) =>\n mergeFilterOptions(\n current.filter((option) => filters.actorUserIds.includes(option.value)),\n Array.from(\n new Map(\n mappedEntries\n .filter((entry) => entry.actorUserId && entry.actorUserName)\n .map((entry) => [entry.actorUserId as string, entry.actorUserName as string]),\n ).entries(),\n ).map(([value, label]) => ({ value, label })),\n ),\n )\n setActionOptions(nextActionOptions)\n } catch (loadError) {\n setEntries([])\n setTotalCount(0)\n setTodayCount(0)\n setYesterdayCount(0)\n setFieldOptions([])\n setUserOptions([])\n setActionOptions([])\n setError(t('customers.changelog.error', 'Failed to load change log'))\n } finally {\n setLoading(false)\n }\n }, [entityId, entityType, filters, pageIndex, sorting, t])\n\n React.useEffect(() => {\n void loadTab()\n }, [loadTab])\n\n const showGroupedEntries = sorting.field === 'createdAt'\n const groupedEntries = React.useMemo(() => groupEntriesByDay(entries, t), [entries, t])\n const uniqueUsers = React.useMemo(\n () => new Set(entries.map((entry) => entry.actorUserId).filter((value): value is string => Boolean(value))).size,\n [entries],\n )\n const criticalFieldCount = React.useMemo(\n () => entries.filter((entry) => entry.changes.some((change) => CRITICAL_FIELDS.includes(change.fieldName as (typeof CRITICAL_FIELDS)[number]))).length,\n [entries],\n )\n const criticalFieldLabel = React.useMemo(\n () => CRITICAL_FIELDS.map((fieldName) => formatFieldLabel(fieldName)).slice(0, 3).join(', '),\n [],\n )\n const previousPageLabel = React.useMemo(() => {\n if (sorting.field !== 'createdAt') return t('customers.changelog.previous', 'Previous')\n return sorting.dir === 'desc'\n ? t('customers.changelog.newer', 'Newer')\n : t('customers.changelog.older', 'Older')\n }, [sorting, t])\n const nextPageLabel = React.useMemo(() => {\n if (sorting.field !== 'createdAt') return t('customers.changelog.next', 'Next')\n return sorting.dir === 'desc'\n ? t('customers.changelog.older', 'Older')\n : t('customers.changelog.newer', 'Newer')\n }, [sorting, t])\n const shownCount = entries.length\n const hasOlder = (pageIndex + 1) * PAGE_SIZE < totalCount\n const hasNewer = pageIndex > 0\n\n const updateFilters = React.useCallback((partial: Partial<FilterState>) => {\n setFilters((current) => ({ ...current, ...partial }))\n setPageIndex(0)\n }, [])\n\n const handleOlder = React.useCallback(() => {\n if (!hasOlder) return\n setPageIndex((current) => current + 1)\n }, [hasOlder])\n\n const handleNewer = React.useCallback(() => {\n if (!hasNewer) return\n setPageIndex((current) => Math.max(current - 1, 0))\n }, [hasNewer])\n\n const handleSort = React.useCallback((field: SortField) => {\n setSorting((current) => {\n if (current.field === field) {\n return {\n field,\n dir: current.dir === 'desc' ? 'asc' : 'desc',\n }\n }\n\n return {\n field,\n dir: field === 'createdAt' ? 'desc' : 'asc',\n }\n })\n setPageIndex(0)\n }, [])\n\n const handleExport = React.useCallback(async () => {\n setExporting(true)\n try {\n const response = await apiCallOrThrow<string>(\n buildExportUrl({\n entityId,\n entityType,\n filters,\n dateRange: filters.dateRange,\n sorting,\n }),\n undefined,\n {\n parse: async (res) => res.text(),\n },\n )\n\n const body = response.result ?? ''\n const blob = new Blob([body], { type: 'text/csv;charset=utf-8' })\n const blobUrl = URL.createObjectURL(blob)\n const anchor = document.createElement('a')\n anchor.href = blobUrl\n anchor.download = 'changelog-export.csv'\n document.body.appendChild(anchor)\n anchor.click()\n anchor.remove()\n URL.revokeObjectURL(blobUrl)\n } catch (exportError) {\n logger.error('customers.changelog.export failed', { exportError })\n flash(t('customers.changelog.exportError', 'Failed to export change log'), 'error')\n } finally {\n setExporting(false)\n }\n }, [entityId, entityType, filters, sorting, t])\n\n return (\n <div className=\"space-y-5\">\n <ChangelogFilters\n dateRange={filters.dateRange}\n fieldNames={filters.fieldNames}\n actorUserIds={filters.actorUserIds}\n actionTypes={filters.actionTypes}\n fieldOptions={fieldOptions}\n userOptions={userOptions}\n actionOptions={actionOptions}\n exportDisabled={exporting}\n onDateRangeChange={(value) => updateFilters({ dateRange: value })}\n onFieldNamesChange={(value) => updateFilters({ fieldNames: value })}\n onActorUserIdsChange={(value) => updateFilters({ actorUserIds: value })}\n onActionTypesChange={(value) => updateFilters({ actionTypes: value })}\n onExport={handleExport}\n />\n\n <ChangelogKpiCards\n loading={loading}\n totalCount={totalCount}\n todayCount={todayCount}\n yesterdayCount={yesterdayCount}\n uniqueUsers={uniqueUsers}\n criticalFieldCount={criticalFieldCount}\n criticalFieldLabel={criticalFieldLabel}\n dateRangeDays={days}\n />\n\n <div className=\"overflow-hidden rounded-xl border bg-card\">\n <div className=\"flex items-center gap-2 border-b px-5 py-4\">\n <Clock3 className=\"size-4 text-muted-foreground\" />\n <h3 className=\"text-base font-semibold text-foreground\">\n {t('customers.changelog.title', 'Change log')}\n </h3>\n <Badge variant=\"secondary\" className=\"text-xs\">\n {totalCount}\n </Badge>\n </div>\n\n <div className=\"grid grid-cols-[92px_190px_120px_1fr_80px] gap-3 border-b bg-muted/20 px-5 py-2 text-overline font-semibold uppercase tracking-[0.12em] text-muted-foreground\">\n {HEADER_COLUMNS.map((column) => {\n const isActive = sorting.field === column.field\n return (\n <Button\n key={column.field}\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => handleSort(column.field)}\n className={`h-auto gap-1 rounded-none px-0 py-0 text-overline font-semibold uppercase tracking-[0.12em] text-muted-foreground hover:bg-transparent ${\n column.align === 'right' ? 'justify-end' : 'justify-start'\n }`}\n >\n <span>{t(column.key, column.fallback)}</span>\n <SortIcon active={isActive} dir={sorting.dir} />\n </Button>\n )\n })}\n </div>\n\n {loading && entries.length === 0 ? (\n <LoadingMessage label={t('customers.changelog.loading', 'Loading changes...')} className=\"min-h-[220px] justify-center\" />\n ) : error ? (\n <ErrorMessage label={error} className=\"m-5\" />\n ) : entries.length === 0 ? (\n <div className=\"p-5\">\n <TabEmptyState\n title={t('customers.changelog.emptyTitle', 'No changes in this period')}\n description={t('customers.changelog.empty', 'No changes recorded in this period.')}\n />\n </div>\n ) : (\n <div>\n {showGroupedEntries ? (\n groupedEntries.map((group) => (\n <div key={group.key}>\n <div className=\"border-b bg-muted/10 px-5 py-2 text-overline font-semibold uppercase tracking-[0.12em] text-muted-foreground\">\n {group.label}\n </div>\n {group.items.map((entry) => (\n <div key={entry.id} className=\"border-b last:border-b-0\">\n <ChangelogEntryRow entry={entry} />\n </div>\n ))}\n </div>\n ))\n ) : (\n entries.map((entry) => (\n <div key={entry.id} className=\"border-b last:border-b-0\">\n <ChangelogEntryRow entry={entry} />\n </div>\n ))\n )}\n </div>\n )}\n\n <div className=\"flex flex-col gap-3 border-t px-5 py-4 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between\">\n <span>\n {t('customers.changelog.showingWithPeriod', 'Showing {{shown}} of {{total}} entries \u00B7 last {{days}} days', {\n shown: shownCount,\n total: totalCount,\n days,\n })}\n </span>\n <div className=\"flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={handleNewer}\n disabled={!hasNewer || loading}\n className=\"h-8 rounded-lg px-3 text-xs\"\n >\n <ArrowLeft className=\"mr-1.5 size-3.5\" />\n {previousPageLabel}\n </Button>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={handleOlder}\n disabled={!hasOlder || loading}\n className=\"h-8 rounded-lg px-3 text-xs\"\n >\n {nextPageLabel}\n <ArrowRight className=\"ml-1.5 size-3.5\" />\n </Button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default ChangelogTab\n"],
|
|
5
|
+
"mappings": ";AAiQsB,cAsQd,YAtQc;AA/PtB,YAAY,WAAW;AACvB,SAAS,WAAW,YAAY,aAAa,aAAa,WAAW,cAAc;AACnF,SAAS,yBAAyB;AAElC,SAAS,2BAA2B,6BAA6B;AACjE,SAAS,YAAY;AACrB,SAAS,gBAAgB,4BAA4B;AACrD,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,cAAc,gBAAgB,qBAAqB;AAC5D,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAE7B,MAAM,SAAS,aAAa,WAAW;AAkEvC,MAAM,YAAY;AAClB,MAAM,iBAAuF;AAAA,EAC3F,EAAE,OAAO,UAAU,KAAK,sCAAsC,UAAU,SAAS;AAAA,EACjF,EAAE,OAAO,QAAQ,KAAK,oCAAoC,UAAU,OAAO;AAAA,EAC3E,EAAE,OAAO,UAAU,KAAK,sCAAsC,UAAU,SAAS;AAAA,EACjF,EAAE,OAAO,UAAU,KAAK,sCAAsC,UAAU,SAAS;AACnF;AACA,MAAM,kBAAkB,CAAC,UAAU,kBAAkB,eAAe,eAAe,UAAU,gBAAgB;AAC7G,MAAM,iBAAuG;AAAA,EAC3G,EAAE,OAAO,aAAa,KAAK,gCAAgC,UAAU,OAAO;AAAA,EAC5E,EAAE,OAAO,QAAQ,KAAK,gCAAgC,UAAU,OAAO;AAAA,EACvE,EAAE,OAAO,UAAU,KAAK,kCAAkC,UAAU,SAAS;AAAA,EAC7E,EAAE,OAAO,S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AC,SACE,+BACC,eAAe,IAAI,CAAC,UAClB,qBAAC,SACC;AAAA,4BAAC,SAAI,WAAU,gHACZ,gBAAM,OACT;AAAA,QACC,MAAM,MAAM,IAAI,CAAC,UAChB,oBAAC,SAAmB,WAAU,4BAC5B,8BAAC,qBAAkB,OAAc,KADzB,MAAM,EAEhB,CACD;AAAA,WARO,MAAM,GAShB,CACD,IAED,QAAQ,IAAI,CAAC,UACX,oBAAC,SAAmB,WAAU,4BAC5B,8BAAC,qBAAkB,OAAc,KADzB,MAAM,EAEhB,CACD,GAEL;AAAA,MAGF,qBAAC,SAAI,WAAU,uHACb;AAAA,4BAAC,UACE,YAAE,yCAAyC,kEAA+D;AAAA,UACzG,OAAO;AAAA,UACP,OAAO;AAAA,UACP;AAAA,QACF,CAAC,GACH;AAAA,QACA,qBAAC,SAAI,WAAU,2BACb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAS;AAAA,cACT,UAAU,CAAC,YAAY;AAAA,cACvB,WAAU;AAAA,cAEV;AAAA,oCAAC,aAAU,WAAU,mBAAkB;AAAA,gBACtC;AAAA;AAAA;AAAA,UACH;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAS;AAAA,cACT,UAAU,CAAC,YAAY;AAAA,cACvB,WAAU;AAAA,cAET;AAAA;AAAA,gBACD,oBAAC,cAAW,WAAU,mBAAkB;AAAA;AAAA;AAAA,UAC1C;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,10 +23,12 @@ import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
|
23
23
|
import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
24
24
|
import { renderDictionaryIcon } from "../../../dictionaries/components/dictionaryAppearance.js";
|
|
25
25
|
import { formatFallbackLabel } from "./utils.js";
|
|
26
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
27
|
+
const logger = createLogger("customers");
|
|
26
28
|
function copyToClipboard(text, t) {
|
|
27
29
|
navigator.clipboard.writeText(text).then(() => {
|
|
28
30
|
flash(t("customers.companies.detail.copied", "Copied to clipboard"), "success");
|
|
29
|
-
}).catch((err) =>
|
|
31
|
+
}).catch((err) => logger.warn("clipboard write failed", { component: "CompanyCard", err }));
|
|
30
32
|
}
|
|
31
33
|
function formatRelativeTime(isoDate, t) {
|
|
32
34
|
const date = new Date(isoDate);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customers/components/detail/CompanyCard.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport Link from 'next/link'\nimport {\n Building2,\n Clock,\n Copy,\n CreditCard,\n ExternalLink,\n FileText,\n Hash,\n Link2Off,\n MapPin,\n TrendingUp,\n Zap,\n Tag as TagIcon,\n Users,\n} from 'lucide-react'\nimport { Badge } from '@open-mercato/ui/primitives/badge'\nimport { StatusBadge } from '@open-mercato/ui/primitives/status-badge'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { renderDictionaryIcon } from '../../../dictionaries/components/dictionaryAppearance'\nimport type { CustomerDictionaryDisplayEntry, CustomerDictionaryMap } from '../../lib/dictionaries'\nimport { formatFallbackLabel } from './utils'\n\nexport type EnrichedCompanyData = {\n linkId: string\n companyId: string\n displayName: string\n isPrimary: boolean\n subtitle: string | null\n profile: {\n industry: string | null\n sizeBucket: string | null\n legalName: string | null\n domain: string | null\n websiteUrl: string | null\n } | null\n billing: {\n bankName: string | null\n bankAccountMasked: string | null\n paymentTerms: string | null\n preferredCurrency: string | null\n } | null\n primaryAddress: { formatted: string } | null\n tags: Array<{ id: string; label: string; color: string | null }>\n roles: Array<{ id: string; roleValue: string }>\n activeDeal: {\n title: string\n valueAmount: string | null\n valueCurrency: string | null\n } | null\n lastContactAt: string | null\n clv: { amount: number; currency: string } | null\n status: string | null\n lifecycleStage: string | null\n temperature: string | null\n renewalQuarter: string | null\n}\n\ntype CompanyCardProps = {\n data: EnrichedCompanyData\n personName: string\n statusMap?: CustomerDictionaryMap | undefined\n lifecycleMap?: CustomerDictionaryMap | undefined\n temperatureMap?: CustomerDictionaryMap | undefined\n renewalQuarterMap?: CustomerDictionaryMap | undefined\n roleMap?: CustomerDictionaryMap | undefined\n onUnlink?: () => void | Promise<void>\n unlinkLabel?: string\n unlinkDisabled?: boolean\n}\n\nfunction copyToClipboard(text: string, t: ReturnType<typeof useT>) {\n navigator.clipboard\n .writeText(text)\n .then(() => {\n flash(t('customers.companies.detail.copied', 'Copied to clipboard'), 'success')\n })\n .catch((err) => console.warn('[CompanyCard] clipboard write failed', err))\n}\n\nfunction formatRelativeTime(isoDate: string, t: ReturnType<typeof useT>): string {\n const date = new Date(isoDate)\n const now = new Date()\n const diffMs = now.getTime() - date.getTime()\n const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24))\n if (diffDays === 0) {\n return `${t('customers.companies.detail.relativeTime.today', 'today')}, ${date.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' })}`\n }\n if (diffDays === 1) return t('customers.companies.detail.relativeTime.oneDayAgo', '1 day ago')\n if (diffDays < 7) return t('customers.companies.detail.relativeTime.daysAgo', '{{days}} days ago', { days: diffDays })\n if (diffDays < 30) return t('customers.companies.detail.relativeTime.weeksAgo', '{{weeks}} wk. ago', { weeks: Math.floor(diffDays / 7) })\n return t('customers.companies.detail.relativeTime.monthsAgo', '{{months}} mo. ago', { months: Math.floor(diffDays / 30) })\n}\n\nfunction formatCurrency(amount: number, currency: string): string {\n try {\n return new Intl.NumberFormat(undefined, {\n style: 'currency',\n currency,\n maximumFractionDigits: 0,\n notation: amount >= 1_000_000 ? 'compact' : 'standard',\n }).format(amount)\n } catch {\n if (amount >= 1_000_000) return `${(amount / 1_000_000).toFixed(2)} M ${currency}`\n if (amount >= 1_000) return `${Math.round(amount / 1000)}k ${currency}`\n return `${amount} ${currency}`\n }\n}\n\nfunction ColorBadge({\n value,\n map,\n fallbackIcon,\n}: {\n value: string\n map: Record<string, CustomerDictionaryDisplayEntry> | undefined\n fallbackIcon?: React.ReactNode\n}) {\n const entry = map?.[value]\n const color = entry?.color ?? null\n const icon = entry?.icon ?? null\n const label = entry?.label ?? formatFallbackLabel(value)\n const colorStyle: React.CSSProperties | undefined = color\n ? { color, borderColor: color, backgroundColor: `${color}1A` }\n : undefined\n return (\n <Badge\n variant=\"outline\"\n className=\"rounded-sm gap-1.5 text-xs font-medium\"\n style={colorStyle}\n >\n {icon ? renderDictionaryIcon(icon, 'size-2.5') : fallbackIcon ?? null}\n {label}\n </Badge>\n )\n}\n\nfunction StatusDotBadge({\n value,\n map,\n}: {\n value: string\n map: Record<string, CustomerDictionaryDisplayEntry> | undefined\n}) {\n const entry = map?.[value]\n const color = entry?.color ?? null\n const label = entry?.label ?? formatFallbackLabel(value)\n const colorStyle: React.CSSProperties | undefined = color\n ? { color, borderColor: color, backgroundColor: `${color}1A` }\n : undefined\n return (\n <Badge\n variant=\"outline\"\n className=\"rounded-sm gap-1.5 text-xs font-medium\"\n style={colorStyle}\n >\n <span\n className=\"size-1.5 rounded-full\"\n style={color ? { backgroundColor: color } : undefined}\n />\n {label}\n </Badge>\n )\n}\n\nfunction BillingRow({\n icon: Icon,\n label,\n value,\n showCopy = true,\n showDottedLine = true,\n t,\n}: {\n icon: React.ComponentType<{ className?: string }>\n label: string\n value: string\n showCopy?: boolean\n showDottedLine?: boolean\n t: ReturnType<typeof useT>\n}) {\n return (\n <div className=\"flex min-w-0 flex-wrap items-center gap-1.5 min-h-[22px]\">\n <Icon className=\"size-3 shrink-0 text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground font-medium shrink-0\">{label}:</span>\n {showDottedLine && <div className=\"mx-1 hidden flex-1 border-b border-dotted border-border/50 sm:block\" />}\n <span className=\"min-w-0 break-words text-xs font-medium text-foreground\">{value}</span>\n {showCopy && (\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-auto shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0\"\n onClick={() => copyToClipboard(value, t)}\n aria-label={t('customers.companies.detail.copy', 'Copy')}\n >\n <Copy className=\"size-2.5\" />\n </IconButton>\n )}\n </div>\n )\n}\n\nexport function CompanyCard({\n data,\n personName,\n statusMap,\n lifecycleMap,\n temperatureMap,\n renewalQuarterMap,\n roleMap,\n onUnlink,\n unlinkLabel,\n unlinkDisabled,\n}: CompanyCardProps) {\n const t = useT()\n const resolvedUnlinkLabel = unlinkLabel ?? t('customers.people.detail.companies.unlinkAction', 'Unlink')\n\n const hasBillingSection =\n data.profile?.legalName ||\n data.primaryAddress?.formatted ||\n data.billing?.bankName ||\n data.billing?.bankAccountMasked ||\n data.billing?.paymentTerms ||\n data.billing?.preferredCurrency\n\n const dealValue =\n data.activeDeal?.valueAmount && data.activeDeal?.valueCurrency\n ? `${data.activeDeal.valueAmount} ${data.activeDeal.valueCurrency}`\n : null\n\n return (\n <div className=\"min-w-0 overflow-hidden rounded-2xl border border-border/60 bg-card\">\n {/* Header */}\n <div className=\"flex flex-col gap-3 px-5 py-5 sm:flex-row sm:items-center\">\n <div className=\"flex min-w-0 flex-1 items-center gap-3\">\n <div className=\"flex size-12 shrink-0 items-center justify-center rounded-xl bg-muted\">\n <Building2 className=\"size-5 text-muted-foreground\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"break-words text-base font-bold\">{data.displayName}</span>\n {data.isPrimary && (\n <StatusBadge\n variant=\"info\"\n className=\"rounded-sm px-1.5 py-0 text-overline font-bold uppercase tracking-wider\"\n >\n {t('customers.people.detail.companies.primaryBadge', 'Primary')}\n </StatusBadge>\n )}\n </div>\n {data.subtitle && (\n <p className=\"break-words text-sm text-muted-foreground\">{data.subtitle}</p>\n )}\n </div>\n </div>\n <div className=\"flex items-center gap-1 self-start sm:self-auto\">\n {onUnlink ? (\n <IconButton\n variant=\"ghost\"\n size=\"sm\"\n type=\"button\"\n aria-label={resolvedUnlinkLabel}\n disabled={unlinkDisabled}\n onClick={() => { void onUnlink() }}\n >\n <Link2Off className=\"size-4\" />\n </IconButton>\n ) : null}\n <Link href={`/backend/customers/companies-v2/${data.companyId}`}>\n <IconButton variant=\"ghost\" size=\"sm\" type=\"button\">\n <ExternalLink className=\"size-4\" />\n </IconButton>\n </Link>\n </div>\n </div>\n\n {/* Divider */}\n <div className=\"border-t border-border/60\" />\n\n {/* Body */}\n <div className=\"px-5 py-4 space-y-4\">\n {/* Info badges */}\n <div className=\"flex flex-wrap gap-1.5\">\n {data.profile?.industry && (\n <Badge variant=\"outline\" className=\"rounded-sm gap-1.5 text-xs font-medium\">\n <TagIcon className=\"size-2.5\" />\n {data.profile.industry}\n </Badge>\n )}\n {data.profile?.sizeBucket && (\n <Badge variant=\"outline\" className=\"rounded-sm gap-1.5 text-xs font-medium\">\n <Users className=\"size-2.5\" />\n {data.profile.sizeBucket} {t('customers.companies.detail.employees', 'employees')}\n </Badge>\n )}\n {data.status && <StatusDotBadge value={data.status} map={statusMap} />}\n {data.renewalQuarter && (\n <ColorBadge\n value={data.renewalQuarter}\n map={renewalQuarterMap}\n fallbackIcon={<Clock className=\"size-2.5\" />}\n />\n )}\n {data.temperature && (\n <ColorBadge\n value={data.temperature}\n map={temperatureMap}\n fallbackIcon={<Zap className=\"size-2.5\" />}\n />\n )}\n </div>\n\n {/* Roles */}\n {data.roles.length > 0 && (\n <div className=\"space-y-1.5\">\n <span className=\"text-overline font-bold uppercase tracking-wider text-muted-foreground\">\n {t('customers.companies.detail.roleInCompany', 'ROLE OF {{name}} IN THIS COMPANY', { name: personName.toUpperCase() })}\n </span>\n <div className=\"flex flex-wrap gap-1.5\">\n {data.roles.map((role) => (\n <ColorBadge\n key={role.id}\n value={role.roleValue}\n map={roleMap}\n />\n ))}\n </div>\n </div>\n )}\n\n {/* Stats divider */}\n <div className=\"border-t border-border/60\" />\n\n {/* Stats row */}\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n <div className=\"min-w-0\">\n <span className=\"text-overline font-bold uppercase tracking-wider text-muted-foreground block mb-1\">\n {t('customers.companies.detail.activeDeal', 'ACTIVE DEAL')}\n </span>\n <span className=\"flex min-w-0 items-center gap-1 text-xs font-medium text-foreground\">\n {data.activeDeal ? (\n <>\n <Building2 className=\"size-3 shrink-0\" />\n <span className=\"min-w-0 break-words\">\n {data.activeDeal.title}\n {dealValue ? ` \u00B7 ${dealValue}` : ''}\n </span>\n </>\n ) : (\n '\u2014'\n )}\n </span>\n </div>\n <div className=\"min-w-0\">\n <span className=\"text-overline font-bold uppercase tracking-wider text-muted-foreground block mb-1\">\n {t('customers.companies.detail.lastContact', 'LAST CONTACT')}\n </span>\n <span className=\"flex min-w-0 items-center gap-1 break-words text-xs font-medium text-foreground\">\n {data.lastContactAt ? (\n <>\n <Clock className=\"size-3 shrink-0\" />\n {formatRelativeTime(data.lastContactAt, t)}\n </>\n ) : (\n '\u2014'\n )}\n </span>\n </div>\n <div className=\"min-w-0\">\n <span className=\"text-overline font-bold uppercase tracking-wider text-muted-foreground block mb-1\">\n CLV\n </span>\n <span className=\"flex min-w-0 items-center gap-1 break-words text-xs font-medium text-foreground\">\n {data.clv ? (\n <>\n <TrendingUp className=\"size-3 shrink-0\" />\n {formatCurrency(data.clv.amount, data.clv.currency)}\n </>\n ) : (\n '\u2014'\n )}\n </span>\n </div>\n </div>\n\n {/* Billing section */}\n {hasBillingSection && (\n <>\n <div className=\"border-t border-border/60\" />\n <div className=\"rounded-lg bg-muted/40 border border-border/40 px-3.5 py-3 space-y-1.5\">\n {data.profile?.legalName && (\n <BillingRow icon={FileText} label={t('customers.companies.detail.billing.name', 'Name')} value={data.profile.legalName} t={t} />\n )}\n {data.primaryAddress?.formatted && (\n <BillingRow\n icon={MapPin}\n label={t('customers.companies.detail.billing.address', 'Address')}\n value={data.primaryAddress.formatted}\n t={t}\n />\n )}\n {(data.billing?.bankName || data.billing?.bankAccountMasked) && (\n <BillingRow\n icon={CreditCard}\n label={t('customers.fields.bankIban', 'Bank / IBAN')}\n value={[data.billing?.bankName, data.billing?.bankAccountMasked]\n .filter(Boolean)\n .join(' \u00B7 ')}\n t={t}\n />\n )}\n {data.billing?.paymentTerms && (\n <BillingRow\n icon={Clock}\n label={t('customers.companies.detail.billing.paymentTerms', 'Payment terms')}\n value={data.billing.paymentTerms}\n showCopy={false}\n showDottedLine={false}\n t={t}\n />\n )}\n {data.billing?.preferredCurrency && (\n <BillingRow\n icon={Hash}\n label={t('customers.companies.detail.billing.currency', 'Currency')}\n value={data.billing.preferredCurrency}\n showCopy={false}\n showDottedLine={false}\n t={t}\n />\n )}\n </div>\n </>\n )}\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport Link from 'next/link'\nimport {\n Building2,\n Clock,\n Copy,\n CreditCard,\n ExternalLink,\n FileText,\n Hash,\n Link2Off,\n MapPin,\n TrendingUp,\n Zap,\n Tag as TagIcon,\n Users,\n} from 'lucide-react'\nimport { Badge } from '@open-mercato/ui/primitives/badge'\nimport { StatusBadge } from '@open-mercato/ui/primitives/status-badge'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { renderDictionaryIcon } from '../../../dictionaries/components/dictionaryAppearance'\nimport type { CustomerDictionaryDisplayEntry, CustomerDictionaryMap } from '../../lib/dictionaries'\nimport { formatFallbackLabel } from './utils'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('customers')\n\nexport type EnrichedCompanyData = {\n linkId: string\n companyId: string\n displayName: string\n isPrimary: boolean\n subtitle: string | null\n profile: {\n industry: string | null\n sizeBucket: string | null\n legalName: string | null\n domain: string | null\n websiteUrl: string | null\n } | null\n billing: {\n bankName: string | null\n bankAccountMasked: string | null\n paymentTerms: string | null\n preferredCurrency: string | null\n } | null\n primaryAddress: { formatted: string } | null\n tags: Array<{ id: string; label: string; color: string | null }>\n roles: Array<{ id: string; roleValue: string }>\n activeDeal: {\n title: string\n valueAmount: string | null\n valueCurrency: string | null\n } | null\n lastContactAt: string | null\n clv: { amount: number; currency: string } | null\n status: string | null\n lifecycleStage: string | null\n temperature: string | null\n renewalQuarter: string | null\n}\n\ntype CompanyCardProps = {\n data: EnrichedCompanyData\n personName: string\n statusMap?: CustomerDictionaryMap | undefined\n lifecycleMap?: CustomerDictionaryMap | undefined\n temperatureMap?: CustomerDictionaryMap | undefined\n renewalQuarterMap?: CustomerDictionaryMap | undefined\n roleMap?: CustomerDictionaryMap | undefined\n onUnlink?: () => void | Promise<void>\n unlinkLabel?: string\n unlinkDisabled?: boolean\n}\n\nfunction copyToClipboard(text: string, t: ReturnType<typeof useT>) {\n navigator.clipboard\n .writeText(text)\n .then(() => {\n flash(t('customers.companies.detail.copied', 'Copied to clipboard'), 'success')\n })\n .catch((err) => logger.warn('clipboard write failed', { component: 'CompanyCard', err }))\n}\n\nfunction formatRelativeTime(isoDate: string, t: ReturnType<typeof useT>): string {\n const date = new Date(isoDate)\n const now = new Date()\n const diffMs = now.getTime() - date.getTime()\n const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24))\n if (diffDays === 0) {\n return `${t('customers.companies.detail.relativeTime.today', 'today')}, ${date.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' })}`\n }\n if (diffDays === 1) return t('customers.companies.detail.relativeTime.oneDayAgo', '1 day ago')\n if (diffDays < 7) return t('customers.companies.detail.relativeTime.daysAgo', '{{days}} days ago', { days: diffDays })\n if (diffDays < 30) return t('customers.companies.detail.relativeTime.weeksAgo', '{{weeks}} wk. ago', { weeks: Math.floor(diffDays / 7) })\n return t('customers.companies.detail.relativeTime.monthsAgo', '{{months}} mo. ago', { months: Math.floor(diffDays / 30) })\n}\n\nfunction formatCurrency(amount: number, currency: string): string {\n try {\n return new Intl.NumberFormat(undefined, {\n style: 'currency',\n currency,\n maximumFractionDigits: 0,\n notation: amount >= 1_000_000 ? 'compact' : 'standard',\n }).format(amount)\n } catch {\n if (amount >= 1_000_000) return `${(amount / 1_000_000).toFixed(2)} M ${currency}`\n if (amount >= 1_000) return `${Math.round(amount / 1000)}k ${currency}`\n return `${amount} ${currency}`\n }\n}\n\nfunction ColorBadge({\n value,\n map,\n fallbackIcon,\n}: {\n value: string\n map: Record<string, CustomerDictionaryDisplayEntry> | undefined\n fallbackIcon?: React.ReactNode\n}) {\n const entry = map?.[value]\n const color = entry?.color ?? null\n const icon = entry?.icon ?? null\n const label = entry?.label ?? formatFallbackLabel(value)\n const colorStyle: React.CSSProperties | undefined = color\n ? { color, borderColor: color, backgroundColor: `${color}1A` }\n : undefined\n return (\n <Badge\n variant=\"outline\"\n className=\"rounded-sm gap-1.5 text-xs font-medium\"\n style={colorStyle}\n >\n {icon ? renderDictionaryIcon(icon, 'size-2.5') : fallbackIcon ?? null}\n {label}\n </Badge>\n )\n}\n\nfunction StatusDotBadge({\n value,\n map,\n}: {\n value: string\n map: Record<string, CustomerDictionaryDisplayEntry> | undefined\n}) {\n const entry = map?.[value]\n const color = entry?.color ?? null\n const label = entry?.label ?? formatFallbackLabel(value)\n const colorStyle: React.CSSProperties | undefined = color\n ? { color, borderColor: color, backgroundColor: `${color}1A` }\n : undefined\n return (\n <Badge\n variant=\"outline\"\n className=\"rounded-sm gap-1.5 text-xs font-medium\"\n style={colorStyle}\n >\n <span\n className=\"size-1.5 rounded-full\"\n style={color ? { backgroundColor: color } : undefined}\n />\n {label}\n </Badge>\n )\n}\n\nfunction BillingRow({\n icon: Icon,\n label,\n value,\n showCopy = true,\n showDottedLine = true,\n t,\n}: {\n icon: React.ComponentType<{ className?: string }>\n label: string\n value: string\n showCopy?: boolean\n showDottedLine?: boolean\n t: ReturnType<typeof useT>\n}) {\n return (\n <div className=\"flex min-w-0 flex-wrap items-center gap-1.5 min-h-[22px]\">\n <Icon className=\"size-3 shrink-0 text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground font-medium shrink-0\">{label}:</span>\n {showDottedLine && <div className=\"mx-1 hidden flex-1 border-b border-dotted border-border/50 sm:block\" />}\n <span className=\"min-w-0 break-words text-xs font-medium text-foreground\">{value}</span>\n {showCopy && (\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-auto shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0\"\n onClick={() => copyToClipboard(value, t)}\n aria-label={t('customers.companies.detail.copy', 'Copy')}\n >\n <Copy className=\"size-2.5\" />\n </IconButton>\n )}\n </div>\n )\n}\n\nexport function CompanyCard({\n data,\n personName,\n statusMap,\n lifecycleMap,\n temperatureMap,\n renewalQuarterMap,\n roleMap,\n onUnlink,\n unlinkLabel,\n unlinkDisabled,\n}: CompanyCardProps) {\n const t = useT()\n const resolvedUnlinkLabel = unlinkLabel ?? t('customers.people.detail.companies.unlinkAction', 'Unlink')\n\n const hasBillingSection =\n data.profile?.legalName ||\n data.primaryAddress?.formatted ||\n data.billing?.bankName ||\n data.billing?.bankAccountMasked ||\n data.billing?.paymentTerms ||\n data.billing?.preferredCurrency\n\n const dealValue =\n data.activeDeal?.valueAmount && data.activeDeal?.valueCurrency\n ? `${data.activeDeal.valueAmount} ${data.activeDeal.valueCurrency}`\n : null\n\n return (\n <div className=\"min-w-0 overflow-hidden rounded-2xl border border-border/60 bg-card\">\n {/* Header */}\n <div className=\"flex flex-col gap-3 px-5 py-5 sm:flex-row sm:items-center\">\n <div className=\"flex min-w-0 flex-1 items-center gap-3\">\n <div className=\"flex size-12 shrink-0 items-center justify-center rounded-xl bg-muted\">\n <Building2 className=\"size-5 text-muted-foreground\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"break-words text-base font-bold\">{data.displayName}</span>\n {data.isPrimary && (\n <StatusBadge\n variant=\"info\"\n className=\"rounded-sm px-1.5 py-0 text-overline font-bold uppercase tracking-wider\"\n >\n {t('customers.people.detail.companies.primaryBadge', 'Primary')}\n </StatusBadge>\n )}\n </div>\n {data.subtitle && (\n <p className=\"break-words text-sm text-muted-foreground\">{data.subtitle}</p>\n )}\n </div>\n </div>\n <div className=\"flex items-center gap-1 self-start sm:self-auto\">\n {onUnlink ? (\n <IconButton\n variant=\"ghost\"\n size=\"sm\"\n type=\"button\"\n aria-label={resolvedUnlinkLabel}\n disabled={unlinkDisabled}\n onClick={() => { void onUnlink() }}\n >\n <Link2Off className=\"size-4\" />\n </IconButton>\n ) : null}\n <Link href={`/backend/customers/companies-v2/${data.companyId}`}>\n <IconButton variant=\"ghost\" size=\"sm\" type=\"button\">\n <ExternalLink className=\"size-4\" />\n </IconButton>\n </Link>\n </div>\n </div>\n\n {/* Divider */}\n <div className=\"border-t border-border/60\" />\n\n {/* Body */}\n <div className=\"px-5 py-4 space-y-4\">\n {/* Info badges */}\n <div className=\"flex flex-wrap gap-1.5\">\n {data.profile?.industry && (\n <Badge variant=\"outline\" className=\"rounded-sm gap-1.5 text-xs font-medium\">\n <TagIcon className=\"size-2.5\" />\n {data.profile.industry}\n </Badge>\n )}\n {data.profile?.sizeBucket && (\n <Badge variant=\"outline\" className=\"rounded-sm gap-1.5 text-xs font-medium\">\n <Users className=\"size-2.5\" />\n {data.profile.sizeBucket} {t('customers.companies.detail.employees', 'employees')}\n </Badge>\n )}\n {data.status && <StatusDotBadge value={data.status} map={statusMap} />}\n {data.renewalQuarter && (\n <ColorBadge\n value={data.renewalQuarter}\n map={renewalQuarterMap}\n fallbackIcon={<Clock className=\"size-2.5\" />}\n />\n )}\n {data.temperature && (\n <ColorBadge\n value={data.temperature}\n map={temperatureMap}\n fallbackIcon={<Zap className=\"size-2.5\" />}\n />\n )}\n </div>\n\n {/* Roles */}\n {data.roles.length > 0 && (\n <div className=\"space-y-1.5\">\n <span className=\"text-overline font-bold uppercase tracking-wider text-muted-foreground\">\n {t('customers.companies.detail.roleInCompany', 'ROLE OF {{name}} IN THIS COMPANY', { name: personName.toUpperCase() })}\n </span>\n <div className=\"flex flex-wrap gap-1.5\">\n {data.roles.map((role) => (\n <ColorBadge\n key={role.id}\n value={role.roleValue}\n map={roleMap}\n />\n ))}\n </div>\n </div>\n )}\n\n {/* Stats divider */}\n <div className=\"border-t border-border/60\" />\n\n {/* Stats row */}\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n <div className=\"min-w-0\">\n <span className=\"text-overline font-bold uppercase tracking-wider text-muted-foreground block mb-1\">\n {t('customers.companies.detail.activeDeal', 'ACTIVE DEAL')}\n </span>\n <span className=\"flex min-w-0 items-center gap-1 text-xs font-medium text-foreground\">\n {data.activeDeal ? (\n <>\n <Building2 className=\"size-3 shrink-0\" />\n <span className=\"min-w-0 break-words\">\n {data.activeDeal.title}\n {dealValue ? ` \u00B7 ${dealValue}` : ''}\n </span>\n </>\n ) : (\n '\u2014'\n )}\n </span>\n </div>\n <div className=\"min-w-0\">\n <span className=\"text-overline font-bold uppercase tracking-wider text-muted-foreground block mb-1\">\n {t('customers.companies.detail.lastContact', 'LAST CONTACT')}\n </span>\n <span className=\"flex min-w-0 items-center gap-1 break-words text-xs font-medium text-foreground\">\n {data.lastContactAt ? (\n <>\n <Clock className=\"size-3 shrink-0\" />\n {formatRelativeTime(data.lastContactAt, t)}\n </>\n ) : (\n '\u2014'\n )}\n </span>\n </div>\n <div className=\"min-w-0\">\n <span className=\"text-overline font-bold uppercase tracking-wider text-muted-foreground block mb-1\">\n CLV\n </span>\n <span className=\"flex min-w-0 items-center gap-1 break-words text-xs font-medium text-foreground\">\n {data.clv ? (\n <>\n <TrendingUp className=\"size-3 shrink-0\" />\n {formatCurrency(data.clv.amount, data.clv.currency)}\n </>\n ) : (\n '\u2014'\n )}\n </span>\n </div>\n </div>\n\n {/* Billing section */}\n {hasBillingSection && (\n <>\n <div className=\"border-t border-border/60\" />\n <div className=\"rounded-lg bg-muted/40 border border-border/40 px-3.5 py-3 space-y-1.5\">\n {data.profile?.legalName && (\n <BillingRow icon={FileText} label={t('customers.companies.detail.billing.name', 'Name')} value={data.profile.legalName} t={t} />\n )}\n {data.primaryAddress?.formatted && (\n <BillingRow\n icon={MapPin}\n label={t('customers.companies.detail.billing.address', 'Address')}\n value={data.primaryAddress.formatted}\n t={t}\n />\n )}\n {(data.billing?.bankName || data.billing?.bankAccountMasked) && (\n <BillingRow\n icon={CreditCard}\n label={t('customers.fields.bankIban', 'Bank / IBAN')}\n value={[data.billing?.bankName, data.billing?.bankAccountMasked]\n .filter(Boolean)\n .join(' \u00B7 ')}\n t={t}\n />\n )}\n {data.billing?.paymentTerms && (\n <BillingRow\n icon={Clock}\n label={t('customers.companies.detail.billing.paymentTerms', 'Payment terms')}\n value={data.billing.paymentTerms}\n showCopy={false}\n showDottedLine={false}\n t={t}\n />\n )}\n {data.billing?.preferredCurrency && (\n <BillingRow\n icon={Hash}\n label={t('customers.companies.detail.billing.currency', 'Currency')}\n value={data.billing.preferredCurrency}\n showCopy={false}\n showDottedLine={false}\n t={t}\n />\n )}\n </div>\n </>\n )}\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAsII,SAuNY,UAzLV,KA9BF;AAnIJ,OAAO,UAAU;AACjB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,OACK;AACP,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,kBA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,cACC,MAAM;AAAA,cACN,OAAO,EAAE,+CAA+C,UAAU;AAAA,cAClE,OAAO,KAAK,QAAQ;AAAA,cACpB,UAAU;AAAA,cACV,gBAAgB;AAAA,cAChB;AAAA;AAAA,UACF;AAAA,WAEJ;AAAA,SACF;AAAA,OAEJ;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -9,6 +9,8 @@ import { Button } from "@open-mercato/ui/primitives/button";
|
|
|
9
9
|
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@open-mercato/ui/primitives/dialog";
|
|
10
10
|
import { Textarea } from "@open-mercato/ui/primitives/textarea";
|
|
11
11
|
import { useDialogKeyHandler } from "@open-mercato/ui/hooks/useDialogKeyHandler";
|
|
12
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
13
|
+
const logger = createLogger("customers");
|
|
12
14
|
function ConfirmDealLostDialog({
|
|
13
15
|
open,
|
|
14
16
|
dealTitle,
|
|
@@ -34,7 +36,7 @@ function ConfirmDealLostDialog({
|
|
|
34
36
|
loadDictionaryEntriesByKey("sales.deal_loss_reason").then((items) => {
|
|
35
37
|
if (!cancelled) setLossReasons(items);
|
|
36
38
|
}).catch((loadError) => {
|
|
37
|
-
|
|
39
|
+
logger.error("customers.deals.detail.lossReasons failed", { loadError });
|
|
38
40
|
if (!cancelled) {
|
|
39
41
|
setLossReasons([]);
|
|
40
42
|
setDictionaryLoadFailed(true);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customers/components/detail/ConfirmDealLostDialog.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { AlertTriangle, Check, ChevronDown } from 'lucide-react'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { loadDictionaryEntriesByKey } from '@open-mercato/core/modules/dictionaries/lib/clientEntries'\nimport { Alert, AlertDescription, AlertTitle } from '@open-mercato/ui/primitives/alert'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@open-mercato/ui/primitives/dialog'\nimport { Textarea } from '@open-mercato/ui/primitives/textarea'\nimport { useDialogKeyHandler } from '@open-mercato/ui/hooks/useDialogKeyHandler'\n\ntype LossReasonOption = {\n id: string\n value: string\n label: string\n description?: string | null\n}\n\ntype ConfirmDealLostDialogProps = {\n open: boolean\n dealTitle: string\n dealValue?: string | null\n companyName?: string | null\n onClose: () => void\n onConfirm: (input: { lossReasonId: string; lossNotes?: string }) => void | Promise<void>\n}\n\nexport function ConfirmDealLostDialog({\n open,\n dealTitle,\n dealValue,\n companyName,\n onClose,\n onConfirm,\n}: ConfirmDealLostDialogProps) {\n const t = useT()\n const [lossReasonId, setLossReasonId] = React.useState('')\n const [lossNotes, setLossNotes] = React.useState('')\n const [lossReasons, setLossReasons] = React.useState<LossReasonOption[]>([])\n const [reasonListOpen, setReasonListOpen] = React.useState(false)\n const [error, setError] = React.useState('')\n const [dictionaryLoadFailed, setDictionaryLoadFailed] = React.useState(false)\n const [isLoadingReasons, setIsLoadingReasons] = React.useState(false)\n const [isConfirming, setIsConfirming] = React.useState(false)\n\n React.useEffect(() => {\n if (!open) return\n let cancelled = false\n setIsLoadingReasons(true)\n setDictionaryLoadFailed(false)\n loadDictionaryEntriesByKey('sales.deal_loss_reason')\n .then((items) => {\n if (!cancelled) setLossReasons(items)\n })\n .catch((loadError) => {\n console.error('customers.deals.detail.lossReasons failed', loadError)\n if (!cancelled) {\n setLossReasons([])\n setDictionaryLoadFailed(true)\n }\n })\n .finally(() => {\n if (!cancelled) setIsLoadingReasons(false)\n })\n return () => {\n cancelled = true\n }\n }, [open])\n\n React.useEffect(() => {\n if (!open) return\n setLossReasonId('')\n setLossNotes('')\n setReasonListOpen(false)\n setError('')\n setDictionaryLoadFailed(false)\n setIsConfirming(false)\n }, [open])\n\n const selectedLossReason = React.useMemo(\n () => lossReasons.find((reason) => reason.id === lossReasonId) ?? null,\n [lossReasonId, lossReasons],\n )\n const hasLossReasons = lossReasons.length > 0\n const reasonUnavailable = !isLoadingReasons && !hasLossReasons\n const unavailableReasonText = dictionaryLoadFailed\n ? t('customers.deals.detail.lost.reasonLoadError', 'Loss reasons could not be loaded.')\n : t('customers.deals.detail.lost.reasonUnavailable', 'No loss reasons are configured.')\n const reasonHelpText = React.useMemo(() => {\n if (selectedLossReason?.description) return selectedLossReason.description\n if (isLoadingReasons) {\n return t('customers.deals.detail.lost.reasonLoading', 'Loading loss reasons...')\n }\n if (reasonUnavailable) {\n return unavailableReasonText\n }\n return t('customers.deals.detail.lost.reasonHelp', 'Choose the closest reason from the dictionary.')\n }, [isLoadingReasons, reasonUnavailable, selectedLossReason?.description, t, unavailableReasonText])\n\n const handleConfirm = React.useCallback(async () => {\n if (isLoadingReasons || reasonUnavailable) {\n setError(unavailableReasonText)\n return\n }\n if (!lossReasonId) {\n setError(t('customers.deals.detail.lost.reasonRequired', 'Please select a loss reason'))\n return\n }\n setIsConfirming(true)\n try {\n await onConfirm({\n lossReasonId,\n lossNotes: lossNotes.trim() || undefined,\n })\n } finally {\n setIsConfirming(false)\n }\n }, [isLoadingReasons, lossNotes, lossReasonId, onConfirm, reasonUnavailable, t, unavailableReasonText])\n\n const confirmDisabled = isConfirming || isLoadingReasons || reasonUnavailable || !lossReasonId\n\n const handleKeyDown = useDialogKeyHandler({\n onConfirm: () => void handleConfirm(),\n disabled: confirmDisabled,\n })\n\n return (\n <Dialog open={open} onOpenChange={(nextOpen) => { if (!nextOpen) onClose() }}>\n <DialogContent className=\"overflow-hidden p-0 sm:max-w-[560px]\" onKeyDown={handleKeyDown}>\n <div className=\"overflow-hidden rounded-lg bg-card\">\n <DialogHeader className=\"border-b border-border/70 px-7 py-5\">\n <div className=\"flex items-start gap-4\">\n <div className=\"flex size-10 shrink-0 items-center justify-center rounded-md bg-destructive/10 text-destructive\">\n <AlertTriangle className=\"size-5\" />\n </div>\n <div className=\"min-w-0\">\n <DialogTitle className=\"text-lg font-bold leading-none tracking-tight text-foreground\">\n {t('customers.deals.detail.lost.title', 'Mark deal as Lost?')}\n </DialogTitle>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n {dealTitle}\n {dealValue ? ` \u00B7 ${dealValue}` : ''}\n {companyName ? ` \u00B7 ${companyName}` : ''}\n </p>\n </div>\n </div>\n </DialogHeader>\n\n <div className=\"space-y-6 px-7 py-6\">\n <Alert variant=\"warning\" className=\"rounded-md\">\n <AlertTitle>\n {t('customers.deals.detail.lost.warningTitle', 'This action closes the deal')}\n </AlertTitle>\n <AlertDescription>\n {t('customers.deals.detail.lost.warning', \"This action sets the stage to 'Lost' and cannot be undone without 'sales.reopen' permission\")}\n </AlertDescription>\n </Alert>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-semibold text-foreground\">\n {t('customers.deals.detail.lost.reasonLabel', 'Loss reason')}\n <span className=\"ml-1 text-destructive\">*</span>\n </label>\n <div className=\"space-y-3\">\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => setReasonListOpen((current) => !current)}\n className=\"h-auto flex w-full items-center justify-between rounded-md border-2 border-foreground bg-background px-4 py-3 text-left\"\n >\n <div className=\"min-w-0\">\n <div className=\"truncate text-base font-semibold text-foreground\">\n {selectedLossReason?.label\n ?? (isLoadingReasons\n ? t('customers.deals.detail.lost.reasonLoadingShort', 'Loading...')\n : t('customers.deals.detail.lost.reasonPlaceholder', 'Select loss reason'))}\n </div>\n <div className=\"truncate text-sm text-muted-foreground\">\n {reasonHelpText}\n </div>\n </div>\n <ChevronDown className=\"ml-3 size-4 shrink-0 text-muted-foreground\" />\n </Button>\n\n {reasonListOpen ? (\n <div className=\"overflow-hidden rounded-md border border-border/80 bg-background\">\n {hasLossReasons ? lossReasons.map((reason, index) => {\n const isSelected = reason.id === lossReasonId\n return (\n <Button\n key={reason.id}\n type=\"button\"\n variant=\"ghost\"\n onClick={() => {\n setLossReasonId(reason.id)\n setReasonListOpen(false)\n setError('')\n }}\n className={`h-auto flex w-full items-center justify-between rounded-none px-4 py-3 text-left ${\n index < lossReasons.length - 1 ? 'border-b border-border/60' : ''\n } ${isSelected ? 'bg-muted/60' : 'hover:bg-accent/50'}`}\n >\n <div className=\"min-w-0\">\n <div className=\"text-base font-semibold text-foreground\">{reason.label}</div>\n <div className=\"text-sm text-muted-foreground\">\n {reason.description ?? t('customers.deals.detail.lost.reasonFallbackDescription', 'No description available.')}\n </div>\n </div>\n {isSelected ? (\n <span className=\"ml-3 flex size-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background\">\n <Check className=\"size-3.5\" />\n </span>\n ) : null}\n </Button>\n )\n }) : (\n <div className=\"px-4 py-3 text-sm text-muted-foreground\">\n {unavailableReasonText}\n </div>\n )}\n </div>\n ) : null}\n </div>\n {reasonUnavailable ? (\n <p className=\"text-xs text-destructive\">\n {unavailableReasonText}\n </p>\n ) : null}\n {error ? <p className=\"text-xs text-destructive\">{error}</p> : null}\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-semibold text-foreground\">\n {t('customers.deals.detail.lost.notesLabel', 'Loss notes (optional)')}\n </label>\n <Textarea\n value={lossNotes}\n onChange={(event) => setLossNotes(event.target.value)}\n placeholder={t('customers.deals.detail.lost.notesPlaceholder', 'Additional context about the loss...')}\n rows={4}\n className=\"min-h-[88px] rounded-md border-border/80 px-4 py-3 shadow-none\"\n />\n </div>\n </div>\n\n <DialogFooter className=\"border-t border-border/70 px-7 py-4 sm:justify-end\">\n <Button type=\"button\" variant=\"outline\" onClick={onClose}>\n {t('customers.deals.detail.lost.cancel', 'Cancel')}\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={confirmDisabled}\n onClick={() => { void handleConfirm() }}\n >\n {t('customers.deals.detail.lost.confirm', 'Mark as Lost')}\n </Button>\n </DialogFooter>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { AlertTriangle, Check, ChevronDown } from 'lucide-react'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { loadDictionaryEntriesByKey } from '@open-mercato/core/modules/dictionaries/lib/clientEntries'\nimport { Alert, AlertDescription, AlertTitle } from '@open-mercato/ui/primitives/alert'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@open-mercato/ui/primitives/dialog'\nimport { Textarea } from '@open-mercato/ui/primitives/textarea'\nimport { useDialogKeyHandler } from '@open-mercato/ui/hooks/useDialogKeyHandler'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('customers')\n\ntype LossReasonOption = {\n id: string\n value: string\n label: string\n description?: string | null\n}\n\ntype ConfirmDealLostDialogProps = {\n open: boolean\n dealTitle: string\n dealValue?: string | null\n companyName?: string | null\n onClose: () => void\n onConfirm: (input: { lossReasonId: string; lossNotes?: string }) => void | Promise<void>\n}\n\nexport function ConfirmDealLostDialog({\n open,\n dealTitle,\n dealValue,\n companyName,\n onClose,\n onConfirm,\n}: ConfirmDealLostDialogProps) {\n const t = useT()\n const [lossReasonId, setLossReasonId] = React.useState('')\n const [lossNotes, setLossNotes] = React.useState('')\n const [lossReasons, setLossReasons] = React.useState<LossReasonOption[]>([])\n const [reasonListOpen, setReasonListOpen] = React.useState(false)\n const [error, setError] = React.useState('')\n const [dictionaryLoadFailed, setDictionaryLoadFailed] = React.useState(false)\n const [isLoadingReasons, setIsLoadingReasons] = React.useState(false)\n const [isConfirming, setIsConfirming] = React.useState(false)\n\n React.useEffect(() => {\n if (!open) return\n let cancelled = false\n setIsLoadingReasons(true)\n setDictionaryLoadFailed(false)\n loadDictionaryEntriesByKey('sales.deal_loss_reason')\n .then((items) => {\n if (!cancelled) setLossReasons(items)\n })\n .catch((loadError) => {\n logger.error('customers.deals.detail.lossReasons failed', { loadError })\n if (!cancelled) {\n setLossReasons([])\n setDictionaryLoadFailed(true)\n }\n })\n .finally(() => {\n if (!cancelled) setIsLoadingReasons(false)\n })\n return () => {\n cancelled = true\n }\n }, [open])\n\n React.useEffect(() => {\n if (!open) return\n setLossReasonId('')\n setLossNotes('')\n setReasonListOpen(false)\n setError('')\n setDictionaryLoadFailed(false)\n setIsConfirming(false)\n }, [open])\n\n const selectedLossReason = React.useMemo(\n () => lossReasons.find((reason) => reason.id === lossReasonId) ?? null,\n [lossReasonId, lossReasons],\n )\n const hasLossReasons = lossReasons.length > 0\n const reasonUnavailable = !isLoadingReasons && !hasLossReasons\n const unavailableReasonText = dictionaryLoadFailed\n ? t('customers.deals.detail.lost.reasonLoadError', 'Loss reasons could not be loaded.')\n : t('customers.deals.detail.lost.reasonUnavailable', 'No loss reasons are configured.')\n const reasonHelpText = React.useMemo(() => {\n if (selectedLossReason?.description) return selectedLossReason.description\n if (isLoadingReasons) {\n return t('customers.deals.detail.lost.reasonLoading', 'Loading loss reasons...')\n }\n if (reasonUnavailable) {\n return unavailableReasonText\n }\n return t('customers.deals.detail.lost.reasonHelp', 'Choose the closest reason from the dictionary.')\n }, [isLoadingReasons, reasonUnavailable, selectedLossReason?.description, t, unavailableReasonText])\n\n const handleConfirm = React.useCallback(async () => {\n if (isLoadingReasons || reasonUnavailable) {\n setError(unavailableReasonText)\n return\n }\n if (!lossReasonId) {\n setError(t('customers.deals.detail.lost.reasonRequired', 'Please select a loss reason'))\n return\n }\n setIsConfirming(true)\n try {\n await onConfirm({\n lossReasonId,\n lossNotes: lossNotes.trim() || undefined,\n })\n } finally {\n setIsConfirming(false)\n }\n }, [isLoadingReasons, lossNotes, lossReasonId, onConfirm, reasonUnavailable, t, unavailableReasonText])\n\n const confirmDisabled = isConfirming || isLoadingReasons || reasonUnavailable || !lossReasonId\n\n const handleKeyDown = useDialogKeyHandler({\n onConfirm: () => void handleConfirm(),\n disabled: confirmDisabled,\n })\n\n return (\n <Dialog open={open} onOpenChange={(nextOpen) => { if (!nextOpen) onClose() }}>\n <DialogContent className=\"overflow-hidden p-0 sm:max-w-[560px]\" onKeyDown={handleKeyDown}>\n <div className=\"overflow-hidden rounded-lg bg-card\">\n <DialogHeader className=\"border-b border-border/70 px-7 py-5\">\n <div className=\"flex items-start gap-4\">\n <div className=\"flex size-10 shrink-0 items-center justify-center rounded-md bg-destructive/10 text-destructive\">\n <AlertTriangle className=\"size-5\" />\n </div>\n <div className=\"min-w-0\">\n <DialogTitle className=\"text-lg font-bold leading-none tracking-tight text-foreground\">\n {t('customers.deals.detail.lost.title', 'Mark deal as Lost?')}\n </DialogTitle>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n {dealTitle}\n {dealValue ? ` \u00B7 ${dealValue}` : ''}\n {companyName ? ` \u00B7 ${companyName}` : ''}\n </p>\n </div>\n </div>\n </DialogHeader>\n\n <div className=\"space-y-6 px-7 py-6\">\n <Alert variant=\"warning\" className=\"rounded-md\">\n <AlertTitle>\n {t('customers.deals.detail.lost.warningTitle', 'This action closes the deal')}\n </AlertTitle>\n <AlertDescription>\n {t('customers.deals.detail.lost.warning', \"This action sets the stage to 'Lost' and cannot be undone without 'sales.reopen' permission\")}\n </AlertDescription>\n </Alert>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-semibold text-foreground\">\n {t('customers.deals.detail.lost.reasonLabel', 'Loss reason')}\n <span className=\"ml-1 text-destructive\">*</span>\n </label>\n <div className=\"space-y-3\">\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => setReasonListOpen((current) => !current)}\n className=\"h-auto flex w-full items-center justify-between rounded-md border-2 border-foreground bg-background px-4 py-3 text-left\"\n >\n <div className=\"min-w-0\">\n <div className=\"truncate text-base font-semibold text-foreground\">\n {selectedLossReason?.label\n ?? (isLoadingReasons\n ? t('customers.deals.detail.lost.reasonLoadingShort', 'Loading...')\n : t('customers.deals.detail.lost.reasonPlaceholder', 'Select loss reason'))}\n </div>\n <div className=\"truncate text-sm text-muted-foreground\">\n {reasonHelpText}\n </div>\n </div>\n <ChevronDown className=\"ml-3 size-4 shrink-0 text-muted-foreground\" />\n </Button>\n\n {reasonListOpen ? (\n <div className=\"overflow-hidden rounded-md border border-border/80 bg-background\">\n {hasLossReasons ? lossReasons.map((reason, index) => {\n const isSelected = reason.id === lossReasonId\n return (\n <Button\n key={reason.id}\n type=\"button\"\n variant=\"ghost\"\n onClick={() => {\n setLossReasonId(reason.id)\n setReasonListOpen(false)\n setError('')\n }}\n className={`h-auto flex w-full items-center justify-between rounded-none px-4 py-3 text-left ${\n index < lossReasons.length - 1 ? 'border-b border-border/60' : ''\n } ${isSelected ? 'bg-muted/60' : 'hover:bg-accent/50'}`}\n >\n <div className=\"min-w-0\">\n <div className=\"text-base font-semibold text-foreground\">{reason.label}</div>\n <div className=\"text-sm text-muted-foreground\">\n {reason.description ?? t('customers.deals.detail.lost.reasonFallbackDescription', 'No description available.')}\n </div>\n </div>\n {isSelected ? (\n <span className=\"ml-3 flex size-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background\">\n <Check className=\"size-3.5\" />\n </span>\n ) : null}\n </Button>\n )\n }) : (\n <div className=\"px-4 py-3 text-sm text-muted-foreground\">\n {unavailableReasonText}\n </div>\n )}\n </div>\n ) : null}\n </div>\n {reasonUnavailable ? (\n <p className=\"text-xs text-destructive\">\n {unavailableReasonText}\n </p>\n ) : null}\n {error ? <p className=\"text-xs text-destructive\">{error}</p> : null}\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-semibold text-foreground\">\n {t('customers.deals.detail.lost.notesLabel', 'Loss notes (optional)')}\n </label>\n <Textarea\n value={lossNotes}\n onChange={(event) => setLossNotes(event.target.value)}\n placeholder={t('customers.deals.detail.lost.notesPlaceholder', 'Additional context about the loss...')}\n rows={4}\n className=\"min-h-[88px] rounded-md border-border/80 px-4 py-3 shadow-none\"\n />\n </div>\n </div>\n\n <DialogFooter className=\"border-t border-border/70 px-7 py-4 sm:justify-end\">\n <Button type=\"button\" variant=\"outline\" onClick={onClose}>\n {t('customers.deals.detail.lost.cancel', 'Cancel')}\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={confirmDisabled}\n onClick={() => { void handleConfirm() }}\n >\n {t('customers.deals.detail.lost.confirm', 'Mark as Lost')}\n </Button>\n </DialogFooter>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAyIgB,cAMA,YANA;AAvIhB,YAAY,WAAW;AACvB,SAAS,eAAe,OAAO,mBAAmB;AAClD,SAAS,YAAY;AACrB,SAAS,kCAAkC;AAC3C,SAAS,OAAO,kBAAkB,kBAAkB;AACpD,SAAS,cAAc;AACvB,SAAS,QAAQ,eAAe,cAAc,cAAc,mBAAmB;AAC/E,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAE7B,MAAM,SAAS,aAAa,WAAW;AAkBhC,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA+B;AAC7B,QAAM,IAAI,KAAK;AACf,QAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAAS,EAAE;AACzD,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,EAAE;AACnD,QAAM,CAAC,aAAa,cAAc,IAAI,MAAM,SAA6B,CAAC,CAAC;AAC3E,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,MAAM,SAAS,KAAK;AAChE,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAS,EAAE;AAC3C,QAAM,CAAC,sBAAsB,uBAAuB,IAAI,MAAM,SAAS,KAAK;AAC5E,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,MAAM,SAAS,KAAK;AACpE,QAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAAS,KAAK;AAE5D,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,KAAM;AACX,QAAI,YAAY;AAChB,wBAAoB,IAAI;AACx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ACC,aACC,oBAAC,UAAK,WAAU,oGACd,8BAAC,SAAM,WAAU,YAAW,GAC9B,IACE;AAAA;AAAA;AAAA,cAtBC,OAAO;AAAA,YAuBd;AAAA,UAEJ,CAAC,IACC,oBAAC,SAAI,WAAU,2CACZ,iCACH,GAEJ,IACE;AAAA,WACN;AAAA,QACC,oBACC,oBAAC,OAAE,WAAU,4BACV,iCACH,IACE;AAAA,QACH,QAAQ,oBAAC,OAAE,WAAU,4BAA4B,iBAAM,IAAO;AAAA,SACjE;AAAA,MAEA,qBAAC,SAAI,WAAU,aACb;AAAA,4BAAC,WAAM,WAAU,yCACd,YAAE,0CAA0C,uBAAuB,GACtE;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU,CAAC,UAAU,aAAa,MAAM,OAAO,KAAK;AAAA,YACpD,aAAa,EAAE,gDAAgD,sCAAsC;AAAA,YACrG,MAAM;AAAA,YACN,WAAU;AAAA;AAAA,QACZ;AAAA,SACF;AAAA,OACF;AAAA,IAEA,qBAAC,gBAAa,WAAU,sDACtB;AAAA,0BAAC,UAAO,MAAK,UAAS,SAAQ,WAAU,SAAS,SAC9C,YAAE,sCAAsC,QAAQ,GACnD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,UAAU;AAAA,UACV,SAAS,MAAM;AAAE,iBAAK,cAAc;AAAA,UAAE;AAAA,UAErC,YAAE,uCAAuC,cAAc;AAAA;AAAA,MAC1D;AAAA,OACF;AAAA,KACF,GACF,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
DialogTitle
|
|
18
18
|
} from "@open-mercato/ui/primitives/dialog";
|
|
19
19
|
import { ManageTagsDialog } from "./ManageTagsDialog.js";
|
|
20
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
21
|
+
const logger = createLogger("customers");
|
|
20
22
|
const CATEGORY_DEFS = [
|
|
21
23
|
{
|
|
22
24
|
kind: "tags",
|
|
@@ -522,7 +524,7 @@ function EntityTagsDialog({
|
|
|
522
524
|
if (!open) return;
|
|
523
525
|
setSearchValue("");
|
|
524
526
|
setNewEntryInputByKind({});
|
|
525
|
-
loadData().catch((err) =>
|
|
527
|
+
loadData().catch((err) => logger.warn("loadData failed", { component: "EntityTagsDialog", err }));
|
|
526
528
|
}, [loadData, open]);
|
|
527
529
|
React.useEffect(() => {
|
|
528
530
|
if (open) return;
|