@antelopejs/dms-saas 0.0.1
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/LICENSE +190 -0
- package/README.md +658 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +20 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/oauth-entry.d.ts +5 -0
- package/dist/auth/oauth-entry.js +10 -0
- package/dist/auth/oauth-entry.js.map +1 -0
- package/dist/auth/plan-permissions-resolver.d.ts +1 -0
- package/dist/auth/plan-permissions-resolver.js +44 -0
- package/dist/auth/plan-permissions-resolver.js.map +1 -0
- package/dist/auth/subscription-access-gate.d.ts +8 -0
- package/dist/auth/subscription-access-gate.js +38 -0
- package/dist/auth/subscription-access-gate.js.map +1 -0
- package/dist/automation/index.d.ts +44 -0
- package/dist/automation/index.js +209 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/billing-state/index.d.ts +5 -0
- package/dist/billing-state/index.js +58 -0
- package/dist/billing-state/index.js.map +1 -0
- package/dist/billing-state/recovery.d.ts +22 -0
- package/dist/billing-state/recovery.js +81 -0
- package/dist/billing-state/recovery.js.map +1 -0
- package/dist/config/dev-mode.d.ts +3 -0
- package/dist/config/dev-mode.js +27 -0
- package/dist/config/dev-mode.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +19 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/runtime.d.ts +6 -0
- package/dist/config/runtime.js +54 -0
- package/dist/config/runtime.js.map +1 -0
- package/dist/crons/auto-suspend-past-due.d.ts +2 -0
- package/dist/crons/auto-suspend-past-due.js +43 -0
- package/dist/crons/auto-suspend-past-due.js.map +1 -0
- package/dist/crons/cleanup-stripe-webhook-events.d.ts +2 -0
- package/dist/crons/cleanup-stripe-webhook-events.js +27 -0
- package/dist/crons/cleanup-stripe-webhook-events.js.map +1 -0
- package/dist/crons/expire-free-workspaces.d.ts +2 -0
- package/dist/crons/expire-free-workspaces.js +36 -0
- package/dist/crons/expire-free-workspaces.js.map +1 -0
- package/dist/crons/hard-delete-cancelled.d.ts +2 -0
- package/dist/crons/hard-delete-cancelled.js +55 -0
- package/dist/crons/hard-delete-cancelled.js.map +1 -0
- package/dist/crons/index.d.ts +8 -0
- package/dist/crons/index.js +25 -0
- package/dist/crons/index.js.map +1 -0
- package/dist/crons/notify-free-workspaces-ending-soon.d.ts +2 -0
- package/dist/crons/notify-free-workspaces-ending-soon.js +69 -0
- package/dist/crons/notify-free-workspaces-ending-soon.js.map +1 -0
- package/dist/crons/recompute-billing-state.d.ts +2 -0
- package/dist/crons/recompute-billing-state.js +19 -0
- package/dist/crons/recompute-billing-state.js.map +1 -0
- package/dist/crons/recompute-segments.d.ts +2 -0
- package/dist/crons/recompute-segments.js +19 -0
- package/dist/crons/recompute-segments.js.map +1 -0
- package/dist/crons/reconcile-workspace-lifecycle.d.ts +2 -0
- package/dist/crons/reconcile-workspace-lifecycle.js +19 -0
- package/dist/crons/reconcile-workspace-lifecycle.js.map +1 -0
- package/dist/crons/register.d.ts +2 -0
- package/dist/crons/register.js +24 -0
- package/dist/crons/register.js.map +1 -0
- package/dist/crons/subscription-notifications.d.ts +2 -0
- package/dist/crons/subscription-notifications.js +55 -0
- package/dist/crons/subscription-notifications.js.map +1 -0
- package/dist/data-api/index.d.ts +2 -0
- package/dist/data-api/index.js +19 -0
- package/dist/data-api/index.js.map +1 -0
- package/dist/data-api/platformOwner/admin-user-invoices.d.ts +27 -0
- package/dist/data-api/platformOwner/admin-user-invoices.js +158 -0
- package/dist/data-api/platformOwner/admin-user-invoices.js.map +1 -0
- package/dist/data-api/platformOwner/admin-user-workspaces.d.ts +22 -0
- package/dist/data-api/platformOwner/admin-user-workspaces.js +97 -0
- package/dist/data-api/platformOwner/admin-user-workspaces.js.map +1 -0
- package/dist/data-api/platformOwner/credit-notes.d.ts +24 -0
- package/dist/data-api/platformOwner/credit-notes.js +133 -0
- package/dist/data-api/platformOwner/credit-notes.js.map +1 -0
- package/dist/data-api/platformOwner/features.d.ts +30 -0
- package/dist/data-api/platformOwner/features.js +141 -0
- package/dist/data-api/platformOwner/features.js.map +1 -0
- package/dist/data-api/platformOwner/hidden-filter.d.ts +1 -0
- package/dist/data-api/platformOwner/hidden-filter.js +18 -0
- package/dist/data-api/platformOwner/hidden-filter.js.map +1 -0
- package/dist/data-api/platformOwner/index.d.ts +12 -0
- package/dist/data-api/platformOwner/index.js +29 -0
- package/dist/data-api/platformOwner/index.js.map +1 -0
- package/dist/data-api/platformOwner/invoice-options.d.ts +7 -0
- package/dist/data-api/platformOwner/invoice-options.js +14 -0
- package/dist/data-api/platformOwner/invoice-options.js.map +1 -0
- package/dist/data-api/platformOwner/invoices.d.ts +26 -0
- package/dist/data-api/platformOwner/invoices.js +147 -0
- package/dist/data-api/platformOwner/invoices.js.map +1 -0
- package/dist/data-api/platformOwner/members.d.ts +24 -0
- package/dist/data-api/platformOwner/members.js +125 -0
- package/dist/data-api/platformOwner/members.js.map +1 -0
- package/dist/data-api/platformOwner/plan-migrations.d.ts +24 -0
- package/dist/data-api/platformOwner/plan-migrations.js +138 -0
- package/dist/data-api/platformOwner/plan-migrations.js.map +1 -0
- package/dist/data-api/platformOwner/plans.d.ts +30 -0
- package/dist/data-api/platformOwner/plans.js +228 -0
- package/dist/data-api/platformOwner/plans.js.map +1 -0
- package/dist/data-api/platformOwner/segments.d.ts +29 -0
- package/dist/data-api/platformOwner/segments.js +223 -0
- package/dist/data-api/platformOwner/segments.js.map +1 -0
- package/dist/data-api/platformOwner/support.d.ts +58 -0
- package/dist/data-api/platformOwner/support.js +111 -0
- package/dist/data-api/platformOwner/support.js.map +1 -0
- package/dist/data-api/platformOwner/users.d.ts +22 -0
- package/dist/data-api/platformOwner/users.js +128 -0
- package/dist/data-api/platformOwner/users.js.map +1 -0
- package/dist/data-api/platformOwner/workspaces.d.ts +22 -0
- package/dist/data-api/platformOwner/workspaces.js +153 -0
- package/dist/data-api/platformOwner/workspaces.js.map +1 -0
- package/dist/data-api/support-fields.d.ts +49 -0
- package/dist/data-api/support-fields.js +166 -0
- package/dist/data-api/support-fields.js.map +1 -0
- package/dist/data-api/support-routes.d.ts +10 -0
- package/dist/data-api/support-routes.js +71 -0
- package/dist/data-api/support-routes.js.map +1 -0
- package/dist/data-api/tenant/index.d.ts +2 -0
- package/dist/data-api/tenant/index.js +19 -0
- package/dist/data-api/tenant/index.js.map +1 -0
- package/dist/data-api/tenant/support.d.ts +39 -0
- package/dist/data-api/tenant/support.js +53 -0
- package/dist/data-api/tenant/support.js.map +1 -0
- package/dist/data-api/tenant/tenant-invoices.d.ts +37 -0
- package/dist/data-api/tenant/tenant-invoices.js +242 -0
- package/dist/data-api/tenant/tenant-invoices.js.map +1 -0
- package/dist/db/index.d.ts +1 -0
- package/dist/db/index.js +18 -0
- package/dist/db/index.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +20 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/register.d.ts +1 -0
- package/dist/hooks/register.js +57 -0
- package/dist/hooks/register.js.map +1 -0
- package/dist/hooks/tenant-export.d.ts +2 -0
- package/dist/hooks/tenant-export.js +64 -0
- package/dist/hooks/tenant-export.js.map +1 -0
- package/dist/hooks/tenant-provisioning.d.ts +3 -0
- package/dist/hooks/tenant-provisioning.js +12 -0
- package/dist/hooks/tenant-provisioning.js.map +1 -0
- package/dist/implementations/dms-saas/billing.d.ts +2 -0
- package/dist/implementations/dms-saas/billing.js +49 -0
- package/dist/implementations/dms-saas/billing.js.map +1 -0
- package/dist/implementations/dms-saas/invoice-line-items.d.ts +11 -0
- package/dist/implementations/dms-saas/invoice-line-items.js +24 -0
- package/dist/implementations/dms-saas/invoice-line-items.js.map +1 -0
- package/dist/implementations/dms-saas/pages.d.ts +3 -0
- package/dist/implementations/dms-saas/pages.js +12 -0
- package/dist/implementations/dms-saas/pages.js.map +1 -0
- package/dist/implementations/dms-saas/workspace-lifecycle.d.ts +2 -0
- package/dist/implementations/dms-saas/workspace-lifecycle.js +23 -0
- package/dist/implementations/dms-saas/workspace-lifecycle.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/invoice-line-items/billing-window.d.ts +3 -0
- package/dist/invoice-line-items/billing-window.js +19 -0
- package/dist/invoice-line-items/billing-window.js.map +1 -0
- package/dist/invoice-line-items/index.d.ts +1 -0
- package/dist/invoice-line-items/index.js +18 -0
- package/dist/invoice-line-items/index.js.map +1 -0
- package/dist/invoice-line-items/injection.d.ts +2 -0
- package/dist/invoice-line-items/injection.js +171 -0
- package/dist/invoice-line-items/injection.js.map +1 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +19 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/recipients.d.ts +14 -0
- package/dist/notifications/recipients.js +87 -0
- package/dist/notifications/recipients.js.map +1 -0
- package/dist/notifications/subjects.d.ts +21 -0
- package/dist/notifications/subjects.js +121 -0
- package/dist/notifications/subjects.js.map +1 -0
- package/dist/operator-actions/commands.d.ts +41 -0
- package/dist/operator-actions/commands.js +233 -0
- package/dist/operator-actions/commands.js.map +1 -0
- package/dist/operator-actions/db/index.d.ts +4 -0
- package/dist/operator-actions/db/index.js +21 -0
- package/dist/operator-actions/db/index.js.map +1 -0
- package/dist/operator-actions/db/lifecycle-delivery.model.d.ts +29 -0
- package/dist/operator-actions/db/lifecycle-delivery.model.js +85 -0
- package/dist/operator-actions/db/lifecycle-delivery.model.js.map +1 -0
- package/dist/operator-actions/db/lifecycle-delivery.table.d.ts +26 -0
- package/dist/operator-actions/db/lifecycle-delivery.table.js +107 -0
- package/dist/operator-actions/db/lifecycle-delivery.table.js.map +1 -0
- package/dist/operator-actions/db/operator-action.model.d.ts +33 -0
- package/dist/operator-actions/db/operator-action.model.js +63 -0
- package/dist/operator-actions/db/operator-action.model.js.map +1 -0
- package/dist/operator-actions/db/operator-action.table.d.ts +21 -0
- package/dist/operator-actions/db/operator-action.table.js +95 -0
- package/dist/operator-actions/db/operator-action.table.js.map +1 -0
- package/dist/operator-actions/index.d.ts +3 -0
- package/dist/operator-actions/index.js +20 -0
- package/dist/operator-actions/index.js.map +1 -0
- package/dist/operator-actions/journal.d.ts +22 -0
- package/dist/operator-actions/journal.js +183 -0
- package/dist/operator-actions/journal.js.map +1 -0
- package/dist/operator-actions/lifecycle-consumers.d.ts +12 -0
- package/dist/operator-actions/lifecycle-consumers.js +28 -0
- package/dist/operator-actions/lifecycle-consumers.js.map +1 -0
- package/dist/operator-actions/lifecycle-outbox.d.ts +19 -0
- package/dist/operator-actions/lifecycle-outbox.js +229 -0
- package/dist/operator-actions/lifecycle-outbox.js.map +1 -0
- package/dist/operator-actions/types.d.ts +11 -0
- package/dist/operator-actions/types.js +3 -0
- package/dist/operator-actions/types.js.map +1 -0
- package/dist/pages/definitions.d.ts +1 -0
- package/dist/pages/definitions.js +18 -0
- package/dist/pages/definitions.js.map +1 -0
- package/dist/pages/index.d.ts +4 -0
- package/dist/pages/index.js +21 -0
- package/dist/pages/index.js.map +1 -0
- package/dist/pages/module.d.ts +5 -0
- package/dist/pages/module.js +15 -0
- package/dist/pages/module.js.map +1 -0
- package/dist/pages/platform/categories.d.ts +6 -0
- package/dist/pages/platform/categories.js +48 -0
- package/dist/pages/platform/categories.js.map +1 -0
- package/dist/pages/platform/credit-notes.d.ts +9 -0
- package/dist/pages/platform/credit-notes.js +40 -0
- package/dist/pages/platform/credit-notes.js.map +1 -0
- package/dist/pages/platform/dashboard.d.ts +10 -0
- package/dist/pages/platform/dashboard.js +95 -0
- package/dist/pages/platform/dashboard.js.map +1 -0
- package/dist/pages/platform/features.d.ts +9 -0
- package/dist/pages/platform/features.js +42 -0
- package/dist/pages/platform/features.js.map +1 -0
- package/dist/pages/platform/index.d.ts +15 -0
- package/dist/pages/platform/index.js +32 -0
- package/dist/pages/platform/index.js.map +1 -0
- package/dist/pages/platform/invoices.d.ts +9 -0
- package/dist/pages/platform/invoices.js +63 -0
- package/dist/pages/platform/invoices.js.map +1 -0
- package/dist/pages/platform/plans/edit.d.ts +17 -0
- package/dist/pages/platform/plans/edit.js +213 -0
- package/dist/pages/platform/plans/edit.js.map +1 -0
- package/dist/pages/platform/plans/index.d.ts +9 -0
- package/dist/pages/platform/plans/index.js +99 -0
- package/dist/pages/platform/plans/index.js.map +1 -0
- package/dist/pages/platform/plans/migrations.d.ts +9 -0
- package/dist/pages/platform/plans/migrations.js +38 -0
- package/dist/pages/platform/plans/migrations.js.map +1 -0
- package/dist/pages/platform/segments/index.d.ts +9 -0
- package/dist/pages/platform/segments/index.js +59 -0
- package/dist/pages/platform/segments/index.js.map +1 -0
- package/dist/pages/platform/settings.d.ts +9 -0
- package/dist/pages/platform/settings.js +147 -0
- package/dist/pages/platform/settings.js.map +1 -0
- package/dist/pages/platform/support.d.ts +9 -0
- package/dist/pages/platform/support.js +29 -0
- package/dist/pages/platform/support.js.map +1 -0
- package/dist/pages/platform/users/detail.d.ts +9 -0
- package/dist/pages/platform/users/detail.js +78 -0
- package/dist/pages/platform/users/detail.js.map +1 -0
- package/dist/pages/platform/users/index.d.ts +9 -0
- package/dist/pages/platform/users/index.js +77 -0
- package/dist/pages/platform/users/index.js.map +1 -0
- package/dist/pages/platform/workspaces/detail.d.ts +9 -0
- package/dist/pages/platform/workspaces/detail.js +120 -0
- package/dist/pages/platform/workspaces/detail.js.map +1 -0
- package/dist/pages/platform/workspaces/index.d.ts +35 -0
- package/dist/pages/platform/workspaces/index.js +300 -0
- package/dist/pages/platform/workspaces/index.js.map +1 -0
- package/dist/pages/public/auth/index.d.ts +1 -0
- package/dist/pages/public/auth/index.js +18 -0
- package/dist/pages/public/auth/index.js.map +1 -0
- package/dist/pages/public/auth/no-workspace.d.ts +9 -0
- package/dist/pages/public/auth/no-workspace.js +26 -0
- package/dist/pages/public/auth/no-workspace.js.map +1 -0
- package/dist/pages/public/index.d.ts +3 -0
- package/dist/pages/public/index.js +20 -0
- package/dist/pages/public/index.js.map +1 -0
- package/dist/pages/public/legal/index.d.ts +3 -0
- package/dist/pages/public/legal/index.js +20 -0
- package/dist/pages/public/legal/index.js.map +1 -0
- package/dist/pages/public/legal/privacy-policy.d.ts +9 -0
- package/dist/pages/public/legal/privacy-policy.js +29 -0
- package/dist/pages/public/legal/privacy-policy.js.map +1 -0
- package/dist/pages/public/legal/terms-and-conditions.d.ts +9 -0
- package/dist/pages/public/legal/terms-and-conditions.js +29 -0
- package/dist/pages/public/legal/terms-and-conditions.js.map +1 -0
- package/dist/pages/public/legal/terms-of-use.d.ts +9 -0
- package/dist/pages/public/legal/terms-of-use.js +29 -0
- package/dist/pages/public/legal/terms-of-use.js.map +1 -0
- package/dist/pages/public/register.d.ts +9 -0
- package/dist/pages/public/register.js +29 -0
- package/dist/pages/public/register.js.map +1 -0
- package/dist/pages/public/screens.d.ts +3 -0
- package/dist/pages/public/screens.js +50 -0
- package/dist/pages/public/screens.js.map +1 -0
- package/dist/pages/tenant/billing.d.ts +15 -0
- package/dist/pages/tenant/billing.js +87 -0
- package/dist/pages/tenant/billing.js.map +1 -0
- package/dist/pages/tenant/data-export.d.ts +10 -0
- package/dist/pages/tenant/data-export.js +32 -0
- package/dist/pages/tenant/data-export.js.map +1 -0
- package/dist/pages/tenant/general.d.ts +10 -0
- package/dist/pages/tenant/general.js +33 -0
- package/dist/pages/tenant/general.js.map +1 -0
- package/dist/pages/tenant/index.d.ts +6 -0
- package/dist/pages/tenant/index.js +23 -0
- package/dist/pages/tenant/index.js.map +1 -0
- package/dist/pages/tenant/members-seat-quota.d.ts +3 -0
- package/dist/pages/tenant/members-seat-quota.js +25 -0
- package/dist/pages/tenant/members-seat-quota.js.map +1 -0
- package/dist/pages/tenant/support.d.ts +9 -0
- package/dist/pages/tenant/support.js +27 -0
- package/dist/pages/tenant/support.js.map +1 -0
- package/dist/pages/tenant/workspace-suspended.d.ts +9 -0
- package/dist/pages/tenant/workspace-suspended.js +26 -0
- package/dist/pages/tenant/workspace-suspended.js.map +1 -0
- package/dist/plan-changes/deferred.d.ts +18 -0
- package/dist/plan-changes/deferred.js +225 -0
- package/dist/plan-changes/deferred.js.map +1 -0
- package/dist/plan-changes/index.d.ts +1 -0
- package/dist/plan-changes/index.js +18 -0
- package/dist/plan-changes/index.js.map +1 -0
- package/dist/plans/index.d.ts +4 -0
- package/dist/plans/index.js +21 -0
- package/dist/plans/index.js.map +1 -0
- package/dist/plans/seat-capacity.d.ts +9 -0
- package/dist/plans/seat-capacity.js +38 -0
- package/dist/plans/seat-capacity.js.map +1 -0
- package/dist/plans/seat-hooks.d.ts +1 -0
- package/dist/plans/seat-hooks.js +80 -0
- package/dist/plans/seat-hooks.js.map +1 -0
- package/dist/plans/seat-sync.d.ts +10 -0
- package/dist/plans/seat-sync.js +23 -0
- package/dist/plans/seat-sync.js.map +1 -0
- package/dist/routes/index.d.ts +3 -0
- package/dist/routes/index.js +20 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/platformOwner/billing-settings.d.ts +20 -0
- package/dist/routes/platformOwner/billing-settings.js +98 -0
- package/dist/routes/platformOwner/billing-settings.js.map +1 -0
- package/dist/routes/platformOwner/credit-notes-issue.d.ts +16 -0
- package/dist/routes/platformOwner/credit-notes-issue.js +56 -0
- package/dist/routes/platformOwner/credit-notes-issue.js.map +1 -0
- package/dist/routes/platformOwner/dashboard.d.ts +62 -0
- package/dist/routes/platformOwner/dashboard.js +310 -0
- package/dist/routes/platformOwner/dashboard.js.map +1 -0
- package/dist/routes/platformOwner/index.d.ts +12 -0
- package/dist/routes/platformOwner/index.js +29 -0
- package/dist/routes/platformOwner/index.js.map +1 -0
- package/dist/routes/platformOwner/plan-deletion.d.ts +30 -0
- package/dist/routes/platformOwner/plan-deletion.js +156 -0
- package/dist/routes/platformOwner/plan-deletion.js.map +1 -0
- package/dist/routes/platformOwner/plans.d.ts +99 -0
- package/dist/routes/platformOwner/plans.js +376 -0
- package/dist/routes/platformOwner/plans.js.map +1 -0
- package/dist/routes/platformOwner/platform-notes.d.ts +36 -0
- package/dist/routes/platformOwner/platform-notes.js +149 -0
- package/dist/routes/platformOwner/platform-notes.js.map +1 -0
- package/dist/routes/platformOwner/platform-owners.d.ts +12 -0
- package/dist/routes/platformOwner/platform-owners.js +77 -0
- package/dist/routes/platformOwner/platform-owners.js.map +1 -0
- package/dist/routes/platformOwner/segments.d.ts +24 -0
- package/dist/routes/platformOwner/segments.js +174 -0
- package/dist/routes/platformOwner/segments.js.map +1 -0
- package/dist/routes/platformOwner/support.d.ts +21 -0
- package/dist/routes/platformOwner/support.js +180 -0
- package/dist/routes/platformOwner/support.js.map +1 -0
- package/dist/routes/platformOwner/users-detail.d.ts +26 -0
- package/dist/routes/platformOwner/users-detail.js +82 -0
- package/dist/routes/platformOwner/users-detail.js.map +1 -0
- package/dist/routes/platformOwner/workspace-operator-actions.d.ts +34 -0
- package/dist/routes/platformOwner/workspace-operator-actions.js +183 -0
- package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -0
- package/dist/routes/platformOwner/workspaces-admin.d.ts +27 -0
- package/dist/routes/platformOwner/workspaces-admin.js +140 -0
- package/dist/routes/platformOwner/workspaces-admin.js.map +1 -0
- package/dist/routes/public/index.d.ts +3 -0
- package/dist/routes/public/index.js +20 -0
- package/dist/routes/public/index.js.map +1 -0
- package/dist/routes/public/legal-documents.d.ts +15 -0
- package/dist/routes/public/legal-documents.js +72 -0
- package/dist/routes/public/legal-documents.js.map +1 -0
- package/dist/routes/public/register.d.ts +48 -0
- package/dist/routes/public/register.js +193 -0
- package/dist/routes/public/register.js.map +1 -0
- package/dist/routes/public/webhooks/index.d.ts +1 -0
- package/dist/routes/public/webhooks/index.js +18 -0
- package/dist/routes/public/webhooks/index.js.map +1 -0
- package/dist/routes/public/webhooks/stripe.d.ts +7 -0
- package/dist/routes/public/webhooks/stripe.js +41 -0
- package/dist/routes/public/webhooks/stripe.js.map +1 -0
- package/dist/routes/tenant/billing-portal.d.ts +31 -0
- package/dist/routes/tenant/billing-portal.js +117 -0
- package/dist/routes/tenant/billing-portal.js.map +1 -0
- package/dist/routes/tenant/billing-self-refund.d.ts +18 -0
- package/dist/routes/tenant/billing-self-refund.js +199 -0
- package/dist/routes/tenant/billing-self-refund.js.map +1 -0
- package/dist/routes/tenant/data-export.d.ts +16 -0
- package/dist/routes/tenant/data-export.js +102 -0
- package/dist/routes/tenant/data-export.js.map +1 -0
- package/dist/routes/tenant/index.d.ts +9 -0
- package/dist/routes/tenant/index.js +26 -0
- package/dist/routes/tenant/index.js.map +1 -0
- package/dist/routes/tenant/support.d.ts +27 -0
- package/dist/routes/tenant/support.js +185 -0
- package/dist/routes/tenant/support.js.map +1 -0
- package/dist/routes/tenant/tenant-billing.d.ts +26 -0
- package/dist/routes/tenant/tenant-billing.js +148 -0
- package/dist/routes/tenant/tenant-billing.js.map +1 -0
- package/dist/routes/tenant/tenant-plan-ops.d.ts +57 -0
- package/dist/routes/tenant/tenant-plan-ops.js +244 -0
- package/dist/routes/tenant/tenant-plan-ops.js.map +1 -0
- package/dist/routes/tenant/tenant-plan.d.ts +19 -0
- package/dist/routes/tenant/tenant-plan.js +172 -0
- package/dist/routes/tenant/tenant-plan.js.map +1 -0
- package/dist/routes/tenant/tenant-seats.d.ts +17 -0
- package/dist/routes/tenant/tenant-seats.js +58 -0
- package/dist/routes/tenant/tenant-seats.js.map +1 -0
- package/dist/routes/tenant/workspaces.d.ts +78 -0
- package/dist/routes/tenant/workspaces.js +301 -0
- package/dist/routes/tenant/workspaces.js.map +1 -0
- package/dist/stripe/client.d.ts +6 -0
- package/dist/stripe/client.js +44 -0
- package/dist/stripe/client.js.map +1 -0
- package/dist/stripe/customer-balance.d.ts +12 -0
- package/dist/stripe/customer-balance.js +16 -0
- package/dist/stripe/customer-balance.js.map +1 -0
- package/dist/stripe/customer-billing.d.ts +33 -0
- package/dist/stripe/customer-billing.js +140 -0
- package/dist/stripe/customer-billing.js.map +1 -0
- package/dist/stripe/index.d.ts +11 -0
- package/dist/stripe/index.js +28 -0
- package/dist/stripe/index.js.map +1 -0
- package/dist/stripe/plan-schedule.d.ts +9 -0
- package/dist/stripe/plan-schedule.js +83 -0
- package/dist/stripe/plan-schedule.js.map +1 -0
- package/dist/stripe/proration.d.ts +2 -0
- package/dist/stripe/proration.js +19 -0
- package/dist/stripe/proration.js.map +1 -0
- package/dist/stripe/sync-plan.d.ts +2 -0
- package/dist/stripe/sync-plan.js +66 -0
- package/dist/stripe/sync-plan.js.map +1 -0
- package/dist/stripe/webhook-checkout.d.ts +3 -0
- package/dist/stripe/webhook-checkout.js +157 -0
- package/dist/stripe/webhook-checkout.js.map +1 -0
- package/dist/stripe/webhook-credit-notes.d.ts +3 -0
- package/dist/stripe/webhook-credit-notes.js +192 -0
- package/dist/stripe/webhook-credit-notes.js.map +1 -0
- package/dist/stripe/webhook-dispatch.d.ts +2 -0
- package/dist/stripe/webhook-dispatch.js +45 -0
- package/dist/stripe/webhook-dispatch.js.map +1 -0
- package/dist/stripe/webhook-handlers.d.ts +11 -0
- package/dist/stripe/webhook-handlers.js +318 -0
- package/dist/stripe/webhook-handlers.js.map +1 -0
- package/dist/stripe/webhook-shared.d.ts +28 -0
- package/dist/stripe/webhook-shared.js +126 -0
- package/dist/stripe/webhook-shared.js.map +1 -0
- package/dist/stripe/workspace-checkout.d.ts +29 -0
- package/dist/stripe/workspace-checkout.js +106 -0
- package/dist/stripe/workspace-checkout.js.map +1 -0
- package/dist/support/admissions.d.ts +36 -0
- package/dist/support/admissions.js +136 -0
- package/dist/support/admissions.js.map +1 -0
- package/dist/support/attachments.d.ts +12 -0
- package/dist/support/attachments.js +56 -0
- package/dist/support/attachments.js.map +1 -0
- package/dist/support/config.d.ts +19 -0
- package/dist/support/config.js +75 -0
- package/dist/support/config.js.map +1 -0
- package/dist/support/index.d.ts +6 -0
- package/dist/support/index.js +23 -0
- package/dist/support/index.js.map +1 -0
- package/dist/support/operations.d.ts +51 -0
- package/dist/support/operations.js +109 -0
- package/dist/support/operations.js.map +1 -0
- package/dist/support/plans.d.ts +6 -0
- package/dist/support/plans.js +130 -0
- package/dist/support/plans.js.map +1 -0
- package/dist/support/publications.d.ts +8 -0
- package/dist/support/publications.js +106 -0
- package/dist/support/publications.js.map +1 -0
- package/dist/support/recovery.d.ts +7 -0
- package/dist/support/recovery.js +43 -0
- package/dist/support/recovery.js.map +1 -0
- package/dist/support/service.d.ts +51 -0
- package/dist/support/service.js +143 -0
- package/dist/support/service.js.map +1 -0
- package/dist/support/transitions.d.ts +4 -0
- package/dist/support/transitions.js +29 -0
- package/dist/support/transitions.js.map +1 -0
- package/dist/support/uploads.d.ts +39 -0
- package/dist/support/uploads.js +115 -0
- package/dist/support/uploads.js.map +1 -0
- package/dist/support/validation.d.ts +15 -0
- package/dist/support/validation.js +54 -0
- package/dist/support/validation.js.map +1 -0
- package/dist/types/config.d.ts +16 -0
- package/dist/types/config.js +3 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/billing-document-type.d.ts +3 -0
- package/dist/utils/billing-document-type.js +18 -0
- package/dist/utils/billing-document-type.js.map +1 -0
- package/dist/utils/billing-period-type.d.ts +3 -0
- package/dist/utils/billing-period-type.js +18 -0
- package/dist/utils/billing-period-type.js.map +1 -0
- package/dist/utils/email-hash.d.ts +1 -0
- package/dist/utils/email-hash.js +8 -0
- package/dist/utils/email-hash.js.map +1 -0
- package/dist/utils/export-dataset-stream.d.ts +19 -0
- package/dist/utils/export-dataset-stream.js +40 -0
- package/dist/utils/export-dataset-stream.js.map +1 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.js +32 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/invoice-lines-type.d.ts +27 -0
- package/dist/utils/invoice-lines-type.js +34 -0
- package/dist/utils/invoice-lines-type.js.map +1 -0
- package/dist/utils/money-cents-type.d.ts +3 -0
- package/dist/utils/money-cents-type.js +18 -0
- package/dist/utils/money-cents-type.js.map +1 -0
- package/dist/utils/pagination.d.ts +22 -0
- package/dist/utils/pagination.js +35 -0
- package/dist/utils/pagination.js.map +1 -0
- package/dist/utils/parse-future-date.d.ts +1 -0
- package/dist/utils/parse-future-date.js +15 -0
- package/dist/utils/parse-future-date.js.map +1 -0
- package/dist/utils/row-instance.d.ts +1 -0
- package/dist/utils/row-instance.js +8 -0
- package/dist/utils/row-instance.js.map +1 -0
- package/dist/utils/segment-conditions-type.d.ts +33 -0
- package/dist/utils/segment-conditions-type.js +86 -0
- package/dist/utils/segment-conditions-type.js.map +1 -0
- package/dist/utils/segment-evaluator.d.ts +3 -0
- package/dist/utils/segment-evaluator.js +117 -0
- package/dist/utils/segment-evaluator.js.map +1 -0
- package/dist/utils/segment-fields.d.ts +19 -0
- package/dist/utils/segment-fields.js +212 -0
- package/dist/utils/segment-fields.js.map +1 -0
- package/dist/utils/segment-matching.d.ts +56 -0
- package/dist/utils/segment-matching.js +200 -0
- package/dist/utils/segment-matching.js.map +1 -0
- package/dist/utils/segment-name-cache.d.ts +2 -0
- package/dist/utils/segment-name-cache.js +22 -0
- package/dist/utils/segment-name-cache.js.map +1 -0
- package/dist/utils/time.d.ts +3 -0
- package/dist/utils/time.js +10 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/workers/index.d.ts +1 -0
- package/dist/workers/index.js +18 -0
- package/dist/workers/index.js.map +1 -0
- package/dist/workers/plan-migration.d.ts +4 -0
- package/dist/workers/plan-migration.js +206 -0
- package/dist/workers/plan-migration.js.map +1 -0
- package/dist/workspaces/billing-profile.d.ts +3 -0
- package/dist/workspaces/billing-profile.js +55 -0
- package/dist/workspaces/billing-profile.js.map +1 -0
- package/dist/workspaces/complimentary.d.ts +7 -0
- package/dist/workspaces/complimentary.js +47 -0
- package/dist/workspaces/complimentary.js.map +1 -0
- package/dist/workspaces/db/card-capacity.model.d.ts +30 -0
- package/dist/workspaces/db/card-capacity.model.js +98 -0
- package/dist/workspaces/db/card-capacity.model.js.map +1 -0
- package/dist/workspaces/db/card-capacity.table.d.ts +11 -0
- package/dist/workspaces/db/card-capacity.table.js +34 -0
- package/dist/workspaces/db/card-capacity.table.js.map +1 -0
- package/dist/workspaces/db/provisioning-attempt.model.d.ts +24 -0
- package/dist/workspaces/db/provisioning-attempt.model.js +33 -0
- package/dist/workspaces/db/provisioning-attempt.model.js.map +1 -0
- package/dist/workspaces/db/provisioning-attempt.table.d.ts +18 -0
- package/dist/workspaces/db/provisioning-attempt.table.js +77 -0
- package/dist/workspaces/db/provisioning-attempt.table.js.map +1 -0
- package/dist/workspaces/db/trial-identity.model.d.ts +25 -0
- package/dist/workspaces/db/trial-identity.model.js +62 -0
- package/dist/workspaces/db/trial-identity.model.js.map +1 -0
- package/dist/workspaces/db/trial-identity.table.d.ts +7 -0
- package/dist/workspaces/db/trial-identity.table.js +34 -0
- package/dist/workspaces/db/trial-identity.table.js.map +1 -0
- package/dist/workspaces/deletion.d.ts +8 -0
- package/dist/workspaces/deletion.js +75 -0
- package/dist/workspaces/deletion.js.map +1 -0
- package/dist/workspaces/free-workspace-guard.d.ts +11 -0
- package/dist/workspaces/free-workspace-guard.js +96 -0
- package/dist/workspaces/free-workspace-guard.js.map +1 -0
- package/dist/workspaces/index.d.ts +6 -0
- package/dist/workspaces/index.js +23 -0
- package/dist/workspaces/index.js.map +1 -0
- package/dist/workspaces/provisioning-rollback.d.ts +2 -0
- package/dist/workspaces/provisioning-rollback.js +78 -0
- package/dist/workspaces/provisioning-rollback.js.map +1 -0
- package/dist/workspaces/provisioning-state.d.ts +6 -0
- package/dist/workspaces/provisioning-state.js +91 -0
- package/dist/workspaces/provisioning-state.js.map +1 -0
- package/dist/workspaces/provisioning.d.ts +49 -0
- package/dist/workspaces/provisioning.js +263 -0
- package/dist/workspaces/provisioning.js.map +1 -0
- package/dist/workspaces/registration-extras.d.ts +1 -0
- package/dist/workspaces/registration-extras.js +50 -0
- package/dist/workspaces/registration-extras.js.map +1 -0
- package/dist/workspaces/suspension.d.ts +13 -0
- package/dist/workspaces/suspension.js +124 -0
- package/dist/workspaces/suspension.js.map +1 -0
- package/frontend-vue/.editorconfig +12 -0
- package/frontend-vue/.prettierrc +11 -0
- package/frontend-vue/app/build/.gitkeep +0 -0
- package/frontend-vue/app/components/CardGrid.vue +77 -0
- package/frontend-vue/app/components/CustomerPortalButton.vue +45 -0
- package/frontend-vue/app/components/DataExport.vue +300 -0
- package/frontend-vue/app/components/DeletePlanModal.vue +223 -0
- package/frontend-vue/app/components/FreeAccessBanner.vue +70 -0
- package/frontend-vue/app/components/InvoiceLines.vue +57 -0
- package/frontend-vue/app/components/IssueCreditNoteModal.vue +128 -0
- package/frontend-vue/app/components/LegalLayout.vue +63 -0
- package/frontend-vue/app/components/LoadFailure.vue +25 -0
- package/frontend-vue/app/components/PastDueAlert.vue +96 -0
- package/frontend-vue/app/components/PaymentMethodCard.vue +86 -0
- package/frontend-vue/app/components/PlanCard.vue +294 -0
- package/frontend-vue/app/components/PlanCardPublic.vue +59 -0
- package/frontend-vue/app/components/PlanCardsDisplay.vue +127 -0
- package/frontend-vue/app/components/PlanComparisonModal.vue +213 -0
- package/frontend-vue/app/components/PlanInheritancePicker.vue +329 -0
- package/frontend-vue/app/components/PlatformNotes.vue +281 -0
- package/frontend-vue/app/components/PlatformSupport.vue +461 -0
- package/frontend-vue/app/components/RecentActivity.vue +72 -0
- package/frontend-vue/app/components/RefundButton.vue +126 -0
- package/frontend-vue/app/components/Register.vue +174 -0
- package/frontend-vue/app/components/RegistrationClosed.vue +15 -0
- package/frontend-vue/app/components/SeatQuotaBanner.vue +78 -0
- package/frontend-vue/app/components/SegmentConditionsBuilder.vue +176 -0
- package/frontend-vue/app/components/SegmentConditionsGroup.vue +494 -0
- package/frontend-vue/app/components/SupportAttachmentUpload.vue +140 -0
- package/frontend-vue/app/components/SupportThreadHistory.vue +139 -0
- package/frontend-vue/app/components/TenantBillingForm.vue +208 -0
- package/frontend-vue/app/components/TenantPlanCard.vue +223 -0
- package/frontend-vue/app/components/TenantSupport.vue +415 -0
- package/frontend-vue/app/components/UserSummaryCard.vue +166 -0
- package/frontend-vue/app/components/WorkspaceBillingInfo.vue +68 -0
- package/frontend-vue/app/components/WorkspaceCompAccessButton.vue +198 -0
- package/frontend-vue/app/components/WorkspaceCreateModal.vue +256 -0
- package/frontend-vue/app/components/WorkspaceDangerZone.vue +146 -0
- package/frontend-vue/app/components/WorkspaceDetailHeader.vue +24 -0
- package/frontend-vue/app/components/WorkspaceIdentity.vue +99 -0
- package/frontend-vue/app/components/WorkspaceJoinButton.vue +50 -0
- package/frontend-vue/app/components/WorkspaceOperatorActions.vue +340 -0
- package/frontend-vue/app/components/WorkspaceSummaryCard.vue +161 -0
- package/frontend-vue/app/components/WorkspaceSuspendButton.vue +167 -0
- package/frontend-vue/app/components/WorkspaceSuspended.vue +164 -0
- package/frontend-vue/app/components/WorkspaceSwitcherWidget.vue +247 -0
- package/frontend-vue/app/composables/useApiErrorMessage.ts +35 -0
- package/frontend-vue/app/composables/useBillingCountries.ts +54 -0
- package/frontend-vue/app/composables/useBillingDocumentType.ts +7 -0
- package/frontend-vue/app/composables/useBillingStatus.ts +39 -0
- package/frontend-vue/app/composables/useCurrentWorkspace.ts +43 -0
- package/frontend-vue/app/composables/useDetailRefresh.ts +17 -0
- package/frontend-vue/app/composables/useExportHistory.ts +143 -0
- package/frontend-vue/app/composables/useInvoiceLines.ts +22 -0
- package/frontend-vue/app/composables/useMoneyFormat.ts +49 -0
- package/frontend-vue/app/composables/useMyWorkspaces.ts +47 -0
- package/frontend-vue/app/composables/usePlanFeatureFormat.ts +60 -0
- package/frontend-vue/app/composables/usePlanIntervalLabel.ts +30 -0
- package/frontend-vue/app/composables/useSaasRegistration.ts +522 -0
- package/frontend-vue/app/composables/useSeatQuota.ts +18 -0
- package/frontend-vue/app/composables/useSharedRequest.ts +54 -0
- package/frontend-vue/app/composables/useStripePaymentElement.ts +74 -0
- package/frontend-vue/app/composables/useSubscriptionAccess.ts +12 -0
- package/frontend-vue/app/composables/useSupportRequest.ts +74 -0
- package/frontend-vue/app/composables/useTenantPlan.ts +95 -0
- package/frontend-vue/app/composables/useTenantSwitch.ts +22 -0
- package/frontend-vue/app/composables/useWorkspaceAccessCache.ts +25 -0
- package/frontend-vue/app/custom-pages/auth/no-workspace.vue +495 -0
- package/frontend-vue/app/middleware/workspace-suspended.global.ts +56 -0
- package/frontend-vue/app/plugins/auth-links.ts +24 -0
- package/frontend-vue/app/plugins/billing-data-types.ts +62 -0
- package/frontend-vue/app/plugins/footer-links.ts +36 -0
- package/frontend-vue/app/plugins/plan-cards-display.client.ts +16 -0
- package/frontend-vue/app/plugins/segment-conditions-data-type.client.ts +122 -0
- package/frontend-vue/app/plugins/sidebar-widgets.ts +13 -0
- package/frontend-vue/app/types/support.ts +123 -0
- package/frontend-vue/dms.frontend.ts +68 -0
- package/frontend-vue/eslint.config.mjs +13 -0
- package/frontend-vue/i18n/locales/saas-en-GB.json +1285 -0
- package/frontend-vue/i18n/locales/saas-fr-FR.json +1285 -0
- package/frontend-vue/package.json +27 -0
- package/frontend-vue/pnpm-lock.yaml +4948 -0
- package/frontend-vue/pnpm-workspace.yaml +2 -0
- package/frontend-vue/server/routes/auth/finalize-workspace.post.ts +61 -0
- package/package.json +91 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from "vue";
|
|
3
|
+
import { sendSupportRequest } from "../composables/useSupportRequest";
|
|
4
|
+
import SupportThreadHistory from "./SupportThreadHistory.vue";
|
|
5
|
+
|
|
6
|
+
const { $authFetch } = useAuthFetch();
|
|
7
|
+
const { t } = useI18n();
|
|
8
|
+
const toast = useToast();
|
|
9
|
+
const { resolveApiError } = useApiErrorMessage();
|
|
10
|
+
|
|
11
|
+
const FILTER_ALL = "all";
|
|
12
|
+
const ASSIGNEE_UNASSIGNED = "unassigned";
|
|
13
|
+
|
|
14
|
+
const inbox = ref<PlatformSupportTicketView[]>([]);
|
|
15
|
+
const owners = ref<PlatformOwnerOptionView[]>([]);
|
|
16
|
+
const selected = ref<PlatformSupportThreadView | null>(null);
|
|
17
|
+
const statusFilter = ref<string>(FILTER_ALL);
|
|
18
|
+
const priorityFilter = ref<string>(FILTER_ALL);
|
|
19
|
+
const isLoading = ref(true);
|
|
20
|
+
const isSubmitting = ref(false);
|
|
21
|
+
const replyBody = ref("");
|
|
22
|
+
const PAGE_SIZE = 20;
|
|
23
|
+
const OWNER_PAGE_SIZE = 100;
|
|
24
|
+
const listPage = ref(1);
|
|
25
|
+
const messagesPage = ref(1);
|
|
26
|
+
const eventsPage = ref(1);
|
|
27
|
+
const inboxTotal = ref(0);
|
|
28
|
+
let selectionRequest = 0;
|
|
29
|
+
let messagesRequest = 0;
|
|
30
|
+
let eventsRequest = 0;
|
|
31
|
+
let inboxRequest = 0;
|
|
32
|
+
|
|
33
|
+
const statusItems = [
|
|
34
|
+
{ value: FILTER_ALL, label: t("saas.support.filters.all_statuses") },
|
|
35
|
+
...["open", "in_progress", "waiting_customer", "resolved", "closed"].map(
|
|
36
|
+
(value) => ({ value, label: t(`saas.support.status.${value}`) }),
|
|
37
|
+
),
|
|
38
|
+
];
|
|
39
|
+
const priorityItems = [
|
|
40
|
+
{ value: FILTER_ALL, label: t("saas.support.filters.all_priorities") },
|
|
41
|
+
...["low", "normal", "high", "urgent"].map((value) => ({
|
|
42
|
+
value,
|
|
43
|
+
label: t(`saas.support.priority.${value}`),
|
|
44
|
+
})),
|
|
45
|
+
];
|
|
46
|
+
const assignmentItems = computed(() => [
|
|
47
|
+
{
|
|
48
|
+
value: ASSIGNEE_UNASSIGNED,
|
|
49
|
+
label: t("saas.support.platform.unassigned"),
|
|
50
|
+
},
|
|
51
|
+
...owners.value.map((owner) => ({
|
|
52
|
+
value: owner._id,
|
|
53
|
+
label: owner.name || owner.email || owner._id,
|
|
54
|
+
})),
|
|
55
|
+
]);
|
|
56
|
+
const assigneeLabels = computed<Record<string, string>>(() =>
|
|
57
|
+
Object.fromEntries(
|
|
58
|
+
owners.value.map((owner) => [
|
|
59
|
+
owner._id,
|
|
60
|
+
owner.name || owner.email || owner._id,
|
|
61
|
+
]),
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
function formatDate(value: string): string {
|
|
66
|
+
return new Intl.DateTimeFormat(undefined, {
|
|
67
|
+
dateStyle: "medium",
|
|
68
|
+
timeStyle: "short",
|
|
69
|
+
}).format(new Date(value));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function inboxQuery(): string {
|
|
73
|
+
const query = new URLSearchParams({
|
|
74
|
+
offset: String((listPage.value - 1) * PAGE_SIZE),
|
|
75
|
+
limit: String(PAGE_SIZE),
|
|
76
|
+
sortKey: "lastMessageAt",
|
|
77
|
+
sortDirection: "desc",
|
|
78
|
+
});
|
|
79
|
+
if (statusFilter.value !== FILTER_ALL) {
|
|
80
|
+
query.set("filter_status", `is:${statusFilter.value}`);
|
|
81
|
+
}
|
|
82
|
+
if (priorityFilter.value !== FILTER_ALL) {
|
|
83
|
+
query.set("filter_priority", `is:${priorityFilter.value}`);
|
|
84
|
+
}
|
|
85
|
+
return query.toString();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function threadQuery(page: number): string {
|
|
89
|
+
return new URLSearchParams({
|
|
90
|
+
offset: String((page - 1) * PAGE_SIZE),
|
|
91
|
+
limit: String(PAGE_SIZE),
|
|
92
|
+
sortKey: "createdAt",
|
|
93
|
+
sortDirection: "desc",
|
|
94
|
+
}).toString();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async function loadInbox(): Promise<void> {
|
|
98
|
+
const request = ++inboxRequest;
|
|
99
|
+
isLoading.value = true;
|
|
100
|
+
try {
|
|
101
|
+
const suffix = inboxQuery();
|
|
102
|
+
const page = await $authFetch<SupportPageView<PlatformSupportTicketView>>(
|
|
103
|
+
`/api/saas/tables/support-tickets/list?${suffix}`,
|
|
104
|
+
);
|
|
105
|
+
if (request !== inboxRequest) return;
|
|
106
|
+
inbox.value = page.results;
|
|
107
|
+
inboxTotal.value = page.total;
|
|
108
|
+
} catch (error) {
|
|
109
|
+
showError(error, "saas.support.error.load");
|
|
110
|
+
} finally {
|
|
111
|
+
if (request === inboxRequest) isLoading.value = false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async function loadOwners(): Promise<void> {
|
|
116
|
+
try {
|
|
117
|
+
const loadedOwners: PlatformOwnerOptionView[] = [];
|
|
118
|
+
let offset = 0;
|
|
119
|
+
let total = 0;
|
|
120
|
+
do {
|
|
121
|
+
const query = new URLSearchParams({
|
|
122
|
+
offset: String(offset),
|
|
123
|
+
limit: String(OWNER_PAGE_SIZE),
|
|
124
|
+
});
|
|
125
|
+
const page = await $authFetch<SupportPageView<PlatformOwnerOptionView>>(
|
|
126
|
+
`/api/saas/tables/support-owners/list?${query}`,
|
|
127
|
+
);
|
|
128
|
+
loadedOwners.push(...page.results);
|
|
129
|
+
if (!page.results.length) break;
|
|
130
|
+
offset += page.results.length;
|
|
131
|
+
total = page.total;
|
|
132
|
+
} while (offset < total);
|
|
133
|
+
owners.value = loadedOwners;
|
|
134
|
+
} catch (error) {
|
|
135
|
+
showError(error, "saas.support.error.load");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async function selectTicket(
|
|
140
|
+
ticket: PlatformSupportTicketView,
|
|
141
|
+
): Promise<void> {
|
|
142
|
+
messagesPage.value = 1;
|
|
143
|
+
eventsPage.value = 1;
|
|
144
|
+
const request = ++selectionRequest;
|
|
145
|
+
const messageRequest = ++messagesRequest;
|
|
146
|
+
const eventRequest = ++eventsRequest;
|
|
147
|
+
const baseUrl = `/api/saas/support/platform/${ticket._instance}/${ticket._id}`;
|
|
148
|
+
try {
|
|
149
|
+
const [detail, messages, events] = await Promise.all([
|
|
150
|
+
$authFetch<PlatformSupportTicketDetailView>(baseUrl),
|
|
151
|
+
$authFetch<SupportPageView<SupportMessageView>>(
|
|
152
|
+
`${baseUrl}/messages/list?${threadQuery(messagesPage.value)}`,
|
|
153
|
+
),
|
|
154
|
+
$authFetch<SupportPageView<SupportTicketEventView>>(
|
|
155
|
+
`${baseUrl}/events/list?${threadQuery(eventsPage.value)}`,
|
|
156
|
+
),
|
|
157
|
+
]);
|
|
158
|
+
if (
|
|
159
|
+
request === selectionRequest &&
|
|
160
|
+
messageRequest === messagesRequest &&
|
|
161
|
+
eventRequest === eventsRequest
|
|
162
|
+
) {
|
|
163
|
+
selected.value = { ...detail, messages, events };
|
|
164
|
+
}
|
|
165
|
+
} catch (error) {
|
|
166
|
+
showError(error, "saas.support.error.load");
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async function updateTicket(patch: SupportTicketPatch): Promise<void> {
|
|
171
|
+
if (!selected.value) return;
|
|
172
|
+
isSubmitting.value = true;
|
|
173
|
+
const { tenantId, ticket } = selected.value;
|
|
174
|
+
try {
|
|
175
|
+
await sendSupportRequest(
|
|
176
|
+
`platform:${tenantId}:${ticket._id}:update`,
|
|
177
|
+
patch,
|
|
178
|
+
(body) =>
|
|
179
|
+
$authFetch(`/api/saas/support/platform/${tenantId}/${ticket._id}`, {
|
|
180
|
+
method: "PUT",
|
|
181
|
+
body,
|
|
182
|
+
}),
|
|
183
|
+
);
|
|
184
|
+
eventsPage.value = 1;
|
|
185
|
+
await Promise.all([
|
|
186
|
+
loadInbox(),
|
|
187
|
+
refreshDetail(),
|
|
188
|
+
loadThreadPage("events"),
|
|
189
|
+
]);
|
|
190
|
+
} catch (error) {
|
|
191
|
+
showError(error, "saas.support.error.update");
|
|
192
|
+
} finally {
|
|
193
|
+
isSubmitting.value = false;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function changeStatus(status: string): void {
|
|
198
|
+
void updateTicket({ status: status as SupportStatus });
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function changeAssignment(assignedTo: string): void {
|
|
202
|
+
void updateTicket({
|
|
203
|
+
assignedTo: assignedTo === ASSIGNEE_UNASSIGNED ? null : assignedTo,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
async function sendReply(): Promise<void> {
|
|
208
|
+
if (!selected.value || !replyBody.value.trim()) return;
|
|
209
|
+
const { tenantId, ticket } = selected.value;
|
|
210
|
+
isSubmitting.value = true;
|
|
211
|
+
try {
|
|
212
|
+
await sendSupportRequest(
|
|
213
|
+
`platform:${tenantId}:${ticket._id}:reply`,
|
|
214
|
+
{ body: replyBody.value, attachments: [] },
|
|
215
|
+
(body) =>
|
|
216
|
+
$authFetch(
|
|
217
|
+
`/api/saas/support/platform/${tenantId}/${ticket._id}/messages`,
|
|
218
|
+
{ method: "POST", body },
|
|
219
|
+
),
|
|
220
|
+
);
|
|
221
|
+
replyBody.value = "";
|
|
222
|
+
messagesPage.value = 1;
|
|
223
|
+
eventsPage.value = 1;
|
|
224
|
+
await Promise.all([
|
|
225
|
+
loadInbox(),
|
|
226
|
+
refreshDetail(),
|
|
227
|
+
loadThreadPage("messages"),
|
|
228
|
+
loadThreadPage("events"),
|
|
229
|
+
]);
|
|
230
|
+
} catch (error) {
|
|
231
|
+
showError(error, "saas.support.error.reply");
|
|
232
|
+
} finally {
|
|
233
|
+
isSubmitting.value = false;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async function openAttachment(resourceKey: string): Promise<void> {
|
|
238
|
+
if (!selected.value) return;
|
|
239
|
+
const { tenantId, ticket } = selected.value;
|
|
240
|
+
const query = new URLSearchParams({ resourceKey });
|
|
241
|
+
try {
|
|
242
|
+
const file = await $authFetch<SupportAttachmentView>(
|
|
243
|
+
`/api/saas/support/platform/${tenantId}/${ticket._id}/attachment?${query}`,
|
|
244
|
+
);
|
|
245
|
+
window.open(file.url, "_blank", "noopener,noreferrer");
|
|
246
|
+
} catch (error) {
|
|
247
|
+
showError(error, "saas.support.error.attachment");
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function showError(error: unknown, fallback: string): void {
|
|
252
|
+
toast.add({
|
|
253
|
+
title: resolveApiError(error, fallback),
|
|
254
|
+
color: "error",
|
|
255
|
+
icon: "i-ph-warning-circle",
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
onMounted(() => Promise.all([loadInbox(), loadOwners()]));
|
|
260
|
+
|
|
261
|
+
function applyFilters(): void {
|
|
262
|
+
listPage.value = 1;
|
|
263
|
+
void loadInbox();
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function changeListPage(page: number): void {
|
|
267
|
+
listPage.value = page;
|
|
268
|
+
void loadInbox();
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
async function refreshDetail(): Promise<void> {
|
|
272
|
+
if (!selected.value) return Promise.resolve();
|
|
273
|
+
const { tenantId, ticket } = selected.value;
|
|
274
|
+
const request = ++selectionRequest;
|
|
275
|
+
const detail = await $authFetch<PlatformSupportTicketDetailView>(
|
|
276
|
+
`/api/saas/support/platform/${tenantId}/${ticket._id}`,
|
|
277
|
+
);
|
|
278
|
+
if (
|
|
279
|
+
request === selectionRequest &&
|
|
280
|
+
selected.value?.ticket._id === ticket._id &&
|
|
281
|
+
selected.value?.tenantId === tenantId
|
|
282
|
+
) {
|
|
283
|
+
Object.assign(selected.value, detail);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function changeThreadPage(kind: "messages" | "events", page: number): void {
|
|
288
|
+
const pages = { messages: messagesPage, events: eventsPage };
|
|
289
|
+
pages[kind].value = page;
|
|
290
|
+
void loadThreadPage(kind);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async function loadThreadPage(kind: "messages" | "events"): Promise<void> {
|
|
294
|
+
if (!selected.value) return;
|
|
295
|
+
const { tenantId, ticket } = selected.value;
|
|
296
|
+
const request = kind === "messages" ? ++messagesRequest : ++eventsRequest;
|
|
297
|
+
const pageNumber =
|
|
298
|
+
kind === "messages" ? messagesPage.value : eventsPage.value;
|
|
299
|
+
try {
|
|
300
|
+
const page = await $authFetch<
|
|
301
|
+
SupportPageView<SupportMessageView | SupportTicketEventView>
|
|
302
|
+
>(
|
|
303
|
+
`/api/saas/support/platform/${tenantId}/${ticket._id}/${kind}/list?${threadQuery(pageNumber)}`,
|
|
304
|
+
);
|
|
305
|
+
const currentRequest =
|
|
306
|
+
kind === "messages" ? messagesRequest : eventsRequest;
|
|
307
|
+
if (
|
|
308
|
+
request !== currentRequest ||
|
|
309
|
+
selected.value?.ticket._id !== ticket._id ||
|
|
310
|
+
selected.value?.tenantId !== tenantId
|
|
311
|
+
)
|
|
312
|
+
return;
|
|
313
|
+
if (kind === "messages") {
|
|
314
|
+
selected.value.messages = page as SupportPageView<SupportMessageView>;
|
|
315
|
+
} else {
|
|
316
|
+
selected.value.events = page as SupportPageView<SupportTicketEventView>;
|
|
317
|
+
}
|
|
318
|
+
} catch (error) {
|
|
319
|
+
showError(error, "saas.support.error.load");
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
</script>
|
|
323
|
+
|
|
324
|
+
<template>
|
|
325
|
+
<div class="flex flex-col gap-5">
|
|
326
|
+
<UCard>
|
|
327
|
+
<div class="flex flex-wrap items-end gap-4">
|
|
328
|
+
<UFormField
|
|
329
|
+
:label="$t('saas.support.filters.status')"
|
|
330
|
+
class="min-w-48"
|
|
331
|
+
>
|
|
332
|
+
<USelect
|
|
333
|
+
v-model="statusFilter"
|
|
334
|
+
:items="statusItems"
|
|
335
|
+
class="w-full"
|
|
336
|
+
/>
|
|
337
|
+
</UFormField>
|
|
338
|
+
<UFormField
|
|
339
|
+
:label="$t('saas.support.filters.priority')"
|
|
340
|
+
class="min-w-48"
|
|
341
|
+
>
|
|
342
|
+
<USelect
|
|
343
|
+
v-model="priorityFilter"
|
|
344
|
+
:items="priorityItems"
|
|
345
|
+
class="w-full"
|
|
346
|
+
/>
|
|
347
|
+
</UFormField>
|
|
348
|
+
<UButton color="neutral" variant="outline" @click="applyFilters">
|
|
349
|
+
{{ $t("saas.support.filters.apply") }}
|
|
350
|
+
</UButton>
|
|
351
|
+
</div>
|
|
352
|
+
</UCard>
|
|
353
|
+
|
|
354
|
+
<div class="grid gap-6 xl:grid-cols-[24rem_1fr]">
|
|
355
|
+
<div class="flex flex-col gap-3">
|
|
356
|
+
<USkeleton v-if="isLoading" class="h-40" />
|
|
357
|
+
<UCard v-else-if="!inbox.length">
|
|
358
|
+
<p class="text-muted text-center text-sm">
|
|
359
|
+
{{ $t("saas.support.platform.empty") }}
|
|
360
|
+
</p>
|
|
361
|
+
</UCard>
|
|
362
|
+
<template v-else>
|
|
363
|
+
<button
|
|
364
|
+
v-for="ticket in inbox"
|
|
365
|
+
:key="`${ticket._instance}:${ticket._id}`"
|
|
366
|
+
class="border-default hover:bg-elevated rounded-lg border p-4 text-left"
|
|
367
|
+
:class="{
|
|
368
|
+
'ring-primary ring-2':
|
|
369
|
+
selected?.ticket._id === ticket._id &&
|
|
370
|
+
selected?.tenantId === ticket._instance,
|
|
371
|
+
}"
|
|
372
|
+
@click="selectTicket(ticket)"
|
|
373
|
+
>
|
|
374
|
+
<div class="flex justify-between gap-2">
|
|
375
|
+
<p class="font-medium">{{ ticket.subject }}</p>
|
|
376
|
+
<UBadge size="sm" variant="subtle">
|
|
377
|
+
{{ $t(`saas.support.priority.${ticket.priority}`) }}
|
|
378
|
+
</UBadge>
|
|
379
|
+
</div>
|
|
380
|
+
<p class="text-muted mt-1 text-sm">{{ ticket.tenantName }}</p>
|
|
381
|
+
<div class="text-muted mt-3 flex justify-between text-xs">
|
|
382
|
+
<span>{{ $t(`saas.support.status.${ticket.status}`) }}</span>
|
|
383
|
+
<span>{{ formatDate(ticket.lastMessageAt) }}</span>
|
|
384
|
+
</div>
|
|
385
|
+
</button>
|
|
386
|
+
<UPagination
|
|
387
|
+
v-if="inboxTotal > PAGE_SIZE"
|
|
388
|
+
:page="listPage"
|
|
389
|
+
:total="inboxTotal"
|
|
390
|
+
:items-per-page="PAGE_SIZE"
|
|
391
|
+
size="sm"
|
|
392
|
+
class="self-center"
|
|
393
|
+
@update:page="changeListPage"
|
|
394
|
+
/>
|
|
395
|
+
</template>
|
|
396
|
+
</div>
|
|
397
|
+
|
|
398
|
+
<UCard v-if="selected">
|
|
399
|
+
<template #header>
|
|
400
|
+
<div>
|
|
401
|
+
<p class="text-muted text-sm">{{ selected.tenantName }}</p>
|
|
402
|
+
<h2 class="text-lg font-semibold">
|
|
403
|
+
{{ selected.ticket.subject }}
|
|
404
|
+
</h2>
|
|
405
|
+
</div>
|
|
406
|
+
</template>
|
|
407
|
+
<div class="flex flex-col gap-5">
|
|
408
|
+
<div class="grid gap-4 sm:grid-cols-2">
|
|
409
|
+
<UFormField :label="$t('saas.support.filters.status')">
|
|
410
|
+
<USelect
|
|
411
|
+
:model-value="selected.ticket.status"
|
|
412
|
+
:items="statusItems.slice(1)"
|
|
413
|
+
class="w-full"
|
|
414
|
+
:disabled="isSubmitting"
|
|
415
|
+
@update:model-value="changeStatus"
|
|
416
|
+
/>
|
|
417
|
+
</UFormField>
|
|
418
|
+
<UFormField :label="$t('saas.support.platform.assignee')">
|
|
419
|
+
<USelect
|
|
420
|
+
:model-value="
|
|
421
|
+
selected.ticket.assignedTo ?? ASSIGNEE_UNASSIGNED
|
|
422
|
+
"
|
|
423
|
+
:items="assignmentItems"
|
|
424
|
+
class="w-full"
|
|
425
|
+
:disabled="isSubmitting"
|
|
426
|
+
@update:model-value="changeAssignment"
|
|
427
|
+
/>
|
|
428
|
+
</UFormField>
|
|
429
|
+
</div>
|
|
430
|
+
<USeparator />
|
|
431
|
+
<SupportThreadHistory
|
|
432
|
+
:messages="selected.messages"
|
|
433
|
+
:events="selected.events"
|
|
434
|
+
:assignee-labels="assigneeLabels"
|
|
435
|
+
@attachment="openAttachment"
|
|
436
|
+
@messages-page="changeThreadPage('messages', $event)"
|
|
437
|
+
@events-page="changeThreadPage('events', $event)"
|
|
438
|
+
/>
|
|
439
|
+
<UTextarea
|
|
440
|
+
v-model="replyBody"
|
|
441
|
+
:rows="5"
|
|
442
|
+
:placeholder="$t('saas.support.reply_placeholder')"
|
|
443
|
+
class="w-full"
|
|
444
|
+
/>
|
|
445
|
+
<div class="flex justify-end">
|
|
446
|
+
<UButton :loading="isSubmitting" @click="sendReply">
|
|
447
|
+
{{ $t("saas.support.send") }}
|
|
448
|
+
</UButton>
|
|
449
|
+
</div>
|
|
450
|
+
</div>
|
|
451
|
+
</UCard>
|
|
452
|
+
<UCard v-else class="min-h-64">
|
|
453
|
+
<div
|
|
454
|
+
class="text-muted flex h-full items-center justify-center text-sm"
|
|
455
|
+
>
|
|
456
|
+
{{ $t("saas.support.platform.select") }}
|
|
457
|
+
</div>
|
|
458
|
+
</UCard>
|
|
459
|
+
</div>
|
|
460
|
+
</div>
|
|
461
|
+
</template>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
interface ActivityEntry {
|
|
5
|
+
id: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
iconColor: SemanticColor;
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle: string;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const RECENT_ACTIVITY_URL = "/api/saas/dashboard/recent-activity";
|
|
14
|
+
const MS_PER_MINUTE = 60000;
|
|
15
|
+
const MS_PER_HOUR = 3600000;
|
|
16
|
+
const MS_PER_DAY = 86400000;
|
|
17
|
+
|
|
18
|
+
const { $authFetch } = useAuthFetch();
|
|
19
|
+
const { locale } = useI18n();
|
|
20
|
+
|
|
21
|
+
const entries = ref<ActivityEntry[]>([]);
|
|
22
|
+
const isLoading = ref(true);
|
|
23
|
+
|
|
24
|
+
function relativeTime(iso: string): string {
|
|
25
|
+
if (!iso) return "";
|
|
26
|
+
const diff = Date.now() - new Date(iso).getTime();
|
|
27
|
+
const format = new Intl.RelativeTimeFormat(locale.value, { numeric: "auto" });
|
|
28
|
+
if (diff < MS_PER_HOUR) {
|
|
29
|
+
return format.format(-Math.round(diff / MS_PER_MINUTE), "minute");
|
|
30
|
+
}
|
|
31
|
+
if (diff < MS_PER_DAY) {
|
|
32
|
+
return format.format(-Math.round(diff / MS_PER_HOUR), "hour");
|
|
33
|
+
}
|
|
34
|
+
return format.format(-Math.round(diff / MS_PER_DAY), "day");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function load(): Promise<void> {
|
|
38
|
+
isLoading.value = true;
|
|
39
|
+
try {
|
|
40
|
+
entries.value = await $authFetch<ActivityEntry[]>(RECENT_ACTIVITY_URL);
|
|
41
|
+
} finally {
|
|
42
|
+
isLoading.value = false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
onMounted(load);
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<template>
|
|
50
|
+
<UCard>
|
|
51
|
+
<template #header>
|
|
52
|
+
<h2 class="font-semibold">{{ $t("saas.dashboard.recent_activity") }}</h2>
|
|
53
|
+
</template>
|
|
54
|
+
<div v-if="isLoading" class="flex justify-center py-6">
|
|
55
|
+
<UIcon name="i-ph-spinner" class="animate-spin text-2xl" />
|
|
56
|
+
</div>
|
|
57
|
+
<p v-else-if="!entries.length" class="text-muted py-6 text-center text-sm">
|
|
58
|
+
{{ $t("saas.dashboard.activity.empty") }}
|
|
59
|
+
</p>
|
|
60
|
+
<div v-else class="flex flex-col">
|
|
61
|
+
<DmsActivityItem
|
|
62
|
+
v-for="entry in entries"
|
|
63
|
+
:key="entry.id"
|
|
64
|
+
:icon="entry.icon"
|
|
65
|
+
:icon-color="entry.iconColor"
|
|
66
|
+
:title="entry.title"
|
|
67
|
+
:subtitle="$t(entry.subtitle)"
|
|
68
|
+
:trailing="relativeTime(entry.timestamp)"
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
</UCard>
|
|
72
|
+
</template>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
interface RefundEligibility {
|
|
5
|
+
eligible: boolean;
|
|
6
|
+
reason: string | null;
|
|
7
|
+
windowDays: number;
|
|
8
|
+
mode: string | null;
|
|
9
|
+
refundAmount: number | null;
|
|
10
|
+
currency: string | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ELIGIBILITY_ENDPOINT = "/api/saas/billing/refund-eligibility";
|
|
14
|
+
const REFUND_ENDPOINT = "/api/saas/billing/refund-self";
|
|
15
|
+
const CENTS_PER_UNIT = 100;
|
|
16
|
+
|
|
17
|
+
const REFRESH_SCOPE = "tenant-billing";
|
|
18
|
+
|
|
19
|
+
const { $authFetch } = useAuthFetch();
|
|
20
|
+
const nuxtApp = useDmsApp();
|
|
21
|
+
const toast = useToast();
|
|
22
|
+
const { resolveApiError } = useApiErrorMessage();
|
|
23
|
+
const { trigger } = useDetailRefresh(REFRESH_SCOPE);
|
|
24
|
+
|
|
25
|
+
const eligibility = ref<RefundEligibility | null>(null);
|
|
26
|
+
const isModalOpen = ref(false);
|
|
27
|
+
const isSubmitting = ref(false);
|
|
28
|
+
|
|
29
|
+
const isEligible = computed(() => eligibility.value?.eligible === true);
|
|
30
|
+
|
|
31
|
+
const formattedAmount = computed(() => {
|
|
32
|
+
const amount = eligibility.value?.refundAmount;
|
|
33
|
+
if (amount == null) return "";
|
|
34
|
+
const currency = (eligibility.value?.currency ?? "").toUpperCase();
|
|
35
|
+
return `${(amount / CENTS_PER_UNIT).toFixed(2)} ${currency}`.trim();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
async function loadEligibility(): Promise<void> {
|
|
39
|
+
try {
|
|
40
|
+
eligibility.value =
|
|
41
|
+
await $authFetch<RefundEligibility>(ELIGIBILITY_ENDPOINT);
|
|
42
|
+
} catch {
|
|
43
|
+
eligibility.value = null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function confirmRefund(): Promise<void> {
|
|
48
|
+
isSubmitting.value = true;
|
|
49
|
+
try {
|
|
50
|
+
await $authFetch(REFUND_ENDPOINT, { method: "POST" });
|
|
51
|
+
toast.add({
|
|
52
|
+
title: nuxtApp.$i18n.t("saas.workspace.billing.refund.success"),
|
|
53
|
+
color: "success",
|
|
54
|
+
icon: "i-ph-check-circle",
|
|
55
|
+
});
|
|
56
|
+
isModalOpen.value = false;
|
|
57
|
+
await loadEligibility();
|
|
58
|
+
trigger();
|
|
59
|
+
} catch (error) {
|
|
60
|
+
toast.add({
|
|
61
|
+
title: resolveApiError(error, "saas.workspace.billing.refund.error"),
|
|
62
|
+
color: "error",
|
|
63
|
+
icon: "i-ph-warning-circle",
|
|
64
|
+
});
|
|
65
|
+
} finally {
|
|
66
|
+
isSubmitting.value = false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
onMounted(loadEligibility);
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<UCard v-if="isEligible">
|
|
75
|
+
<template #header>
|
|
76
|
+
<h3 class="font-semibold">
|
|
77
|
+
{{ $t("saas.workspace.billing.refund.title") }}
|
|
78
|
+
</h3>
|
|
79
|
+
</template>
|
|
80
|
+
<div class="flex flex-col gap-4">
|
|
81
|
+
<p class="text-muted text-sm">
|
|
82
|
+
{{
|
|
83
|
+
$t("saas.workspace.billing.refund.description", {
|
|
84
|
+
amount: formattedAmount,
|
|
85
|
+
})
|
|
86
|
+
}}
|
|
87
|
+
</p>
|
|
88
|
+
<div class="flex justify-end">
|
|
89
|
+
<UButton
|
|
90
|
+
color="error"
|
|
91
|
+
variant="soft"
|
|
92
|
+
icon="i-ph-arrow-counter-clockwise"
|
|
93
|
+
@click="isModalOpen = true"
|
|
94
|
+
>
|
|
95
|
+
{{ $t("saas.workspace.billing.refund.button") }}
|
|
96
|
+
</UButton>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<UModal
|
|
101
|
+
:open="isModalOpen"
|
|
102
|
+
:title="$t('saas.workspace.billing.refund.confirm_title')"
|
|
103
|
+
@update:open="isModalOpen = $event"
|
|
104
|
+
>
|
|
105
|
+
<template #body>
|
|
106
|
+
<p>
|
|
107
|
+
{{
|
|
108
|
+
$t("saas.workspace.billing.refund.confirm_message", {
|
|
109
|
+
amount: formattedAmount,
|
|
110
|
+
})
|
|
111
|
+
}}
|
|
112
|
+
</p>
|
|
113
|
+
</template>
|
|
114
|
+
<template #footer>
|
|
115
|
+
<div class="flex justify-end gap-2">
|
|
116
|
+
<UButton variant="ghost" @click="isModalOpen = false">
|
|
117
|
+
{{ $t("common.cancel") }}
|
|
118
|
+
</UButton>
|
|
119
|
+
<UButton color="error" :loading="isSubmitting" @click="confirmRefund">
|
|
120
|
+
{{ $t("saas.workspace.billing.refund.confirm_action") }}
|
|
121
|
+
</UButton>
|
|
122
|
+
</div>
|
|
123
|
+
</template>
|
|
124
|
+
</UModal>
|
|
125
|
+
</UCard>
|
|
126
|
+
</template>
|