@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,128 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
|
|
4
|
+
interface InvoiceRowData {
|
|
5
|
+
_id?: string;
|
|
6
|
+
number?: string | null;
|
|
7
|
+
amount?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const CREDIT_NOTE_ISSUE_ENDPOINT = "/api/saas/credit-notes/issue";
|
|
11
|
+
const CENTS_PER_UNIT = 100;
|
|
12
|
+
const CREDIT_MODE_BALANCE = "credit_to_balance";
|
|
13
|
+
const CREDIT_MODE_REFUND = "refund";
|
|
14
|
+
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
rowData?: InvoiceRowData;
|
|
17
|
+
onSuccessCallback?: () => void;
|
|
18
|
+
}>();
|
|
19
|
+
|
|
20
|
+
const nuxtApp = useDmsApp();
|
|
21
|
+
const toast = useToast();
|
|
22
|
+
const { resolveApiError } = useApiErrorMessage();
|
|
23
|
+
const { $authFetch } = useAuthFetch();
|
|
24
|
+
|
|
25
|
+
const invoiceId = computed(() => props.rowData?._id ?? "");
|
|
26
|
+
const invoiceNumber = computed(() => props.rowData?.number ?? "—");
|
|
27
|
+
const maxAmount = computed(() => props.rowData?.amount ?? 0);
|
|
28
|
+
|
|
29
|
+
const amount = ref<number>(maxAmount.value);
|
|
30
|
+
const mode = ref<"credit_to_balance" | "refund">(CREDIT_MODE_BALANCE);
|
|
31
|
+
const reason = ref("");
|
|
32
|
+
const isSubmitting = ref(false);
|
|
33
|
+
|
|
34
|
+
// Keep the amount in sync if the component instance is reused for another
|
|
35
|
+
// invoice row without remounting, otherwise it keeps the previous invoice's
|
|
36
|
+
// amount and the submit button silently disables.
|
|
37
|
+
watch(maxAmount, (value) => {
|
|
38
|
+
amount.value = value;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const modeItems = computed(() => [
|
|
42
|
+
{
|
|
43
|
+
value: CREDIT_MODE_BALANCE,
|
|
44
|
+
label: nuxtApp.$i18n.t("saas.credit_notes.modal.mode.credit_to_balance"),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: CREDIT_MODE_REFUND,
|
|
48
|
+
label: nuxtApp.$i18n.t("saas.credit_notes.modal.mode.refund"),
|
|
49
|
+
},
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
const isInvalid = computed(
|
|
53
|
+
() =>
|
|
54
|
+
!invoiceId.value ||
|
|
55
|
+
amount.value <= 0 ||
|
|
56
|
+
amount.value > maxAmount.value ||
|
|
57
|
+
reason.value.trim().length === 0,
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
async function submit(): Promise<void> {
|
|
61
|
+
if (isInvalid.value) return;
|
|
62
|
+
isSubmitting.value = true;
|
|
63
|
+
try {
|
|
64
|
+
await $authFetch(CREDIT_NOTE_ISSUE_ENDPOINT, {
|
|
65
|
+
method: "POST",
|
|
66
|
+
body: {
|
|
67
|
+
invoiceId: invoiceId.value,
|
|
68
|
+
amount: amount.value,
|
|
69
|
+
mode: mode.value,
|
|
70
|
+
reason: reason.value.trim(),
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
toast.add({
|
|
74
|
+
title: nuxtApp.$i18n.t("saas.credit_notes.modal.success"),
|
|
75
|
+
color: "success",
|
|
76
|
+
icon: "i-ph-check-circle",
|
|
77
|
+
});
|
|
78
|
+
props.onSuccessCallback?.();
|
|
79
|
+
} catch (error) {
|
|
80
|
+
toast.add({
|
|
81
|
+
title: resolveApiError(error, "saas.credit_notes.modal.error"),
|
|
82
|
+
color: "error",
|
|
83
|
+
icon: "i-ph-warning-circle",
|
|
84
|
+
});
|
|
85
|
+
} finally {
|
|
86
|
+
isSubmitting.value = false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<template>
|
|
92
|
+
<form class="flex flex-col gap-4" @submit.prevent="submit">
|
|
93
|
+
<p class="text-muted text-sm">
|
|
94
|
+
{{
|
|
95
|
+
$t("saas.credit_notes.modal.description", {
|
|
96
|
+
number: invoiceNumber,
|
|
97
|
+
max: (maxAmount / CENTS_PER_UNIT).toFixed(2),
|
|
98
|
+
})
|
|
99
|
+
}}
|
|
100
|
+
</p>
|
|
101
|
+
<UFormField :label="$t('saas.credit_notes.modal.amount')">
|
|
102
|
+
<UInput
|
|
103
|
+
v-model="amount"
|
|
104
|
+
type="number"
|
|
105
|
+
:min="1"
|
|
106
|
+
:max="maxAmount"
|
|
107
|
+
class="w-full"
|
|
108
|
+
/>
|
|
109
|
+
</UFormField>
|
|
110
|
+
<UFormField :label="$t('saas.credit_notes.modal.mode_label')">
|
|
111
|
+
<URadioGroup v-model="mode" :items="modeItems" />
|
|
112
|
+
</UFormField>
|
|
113
|
+
<UFormField :label="$t('saas.credit_notes.modal.reason')">
|
|
114
|
+
<UInput v-model="reason" required class="w-full" />
|
|
115
|
+
</UFormField>
|
|
116
|
+
<div class="flex justify-end">
|
|
117
|
+
<UButton
|
|
118
|
+
type="submit"
|
|
119
|
+
color="primary"
|
|
120
|
+
icon="i-ph-receipt-x"
|
|
121
|
+
:disabled="isInvalid"
|
|
122
|
+
:loading="isSubmitting"
|
|
123
|
+
>
|
|
124
|
+
{{ $t("saas.credit_notes.modal.submit") }}
|
|
125
|
+
</UButton>
|
|
126
|
+
</div>
|
|
127
|
+
</form>
|
|
128
|
+
</template>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
interface DmsPublicRuntime {
|
|
5
|
+
baseURL: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface LegalDocuments {
|
|
9
|
+
[field: string]: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface LegalLayoutProps {
|
|
13
|
+
endpoint: string;
|
|
14
|
+
documentField: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const props = defineProps<LegalLayoutProps>();
|
|
18
|
+
|
|
19
|
+
const config = useDmsRuntimeConfig();
|
|
20
|
+
const dmsRuntime = config.public.dms as DmsPublicRuntime;
|
|
21
|
+
const apiFetch = $fetch.create({ baseURL: dmsRuntime.baseURL });
|
|
22
|
+
const data = ref<LegalDocuments>({});
|
|
23
|
+
|
|
24
|
+
async function loadDocument(): Promise<void> {
|
|
25
|
+
try {
|
|
26
|
+
data.value = await apiFetch<LegalDocuments>(props.endpoint);
|
|
27
|
+
} catch {
|
|
28
|
+
data.value = {};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
onMounted(loadDocument);
|
|
33
|
+
|
|
34
|
+
const content = computed(() => data.value?.[props.documentField] ?? "");
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<UContainer class="mx-auto max-w-4xl">
|
|
39
|
+
<UCard v-if="content">
|
|
40
|
+
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
41
|
+
<div
|
|
42
|
+
class="prose prose-neutral dark:prose-invert max-w-none"
|
|
43
|
+
v-html="content"
|
|
44
|
+
/>
|
|
45
|
+
</UCard>
|
|
46
|
+
|
|
47
|
+
<UEmpty
|
|
48
|
+
v-else
|
|
49
|
+
icon="i-ph-file-text"
|
|
50
|
+
:title="$t('saas.legal.no_content_title')"
|
|
51
|
+
:description="$t('saas.legal.no_content_message')"
|
|
52
|
+
class="min-h-96"
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
<div class="mt-8 flex items-center justify-center">
|
|
56
|
+
<UButton
|
|
57
|
+
to="/auth"
|
|
58
|
+
:label="$t('button.go_home')"
|
|
59
|
+
icon="i-lucide-arrow-right"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</UContainer>
|
|
63
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{ title?: string }>();
|
|
3
|
+
const emit = defineEmits<{ retry: [] }>();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<UAlert
|
|
8
|
+
color="error"
|
|
9
|
+
variant="subtle"
|
|
10
|
+
icon="i-ph-warning-circle"
|
|
11
|
+
:title="title ?? $t('saas.common.load_failed')"
|
|
12
|
+
>
|
|
13
|
+
<template #actions>
|
|
14
|
+
<UButton
|
|
15
|
+
color="error"
|
|
16
|
+
variant="soft"
|
|
17
|
+
size="xs"
|
|
18
|
+
icon="i-ph-arrow-clockwise"
|
|
19
|
+
@click="emit('retry')"
|
|
20
|
+
>
|
|
21
|
+
{{ $t("saas.common.retry") }}
|
|
22
|
+
</UButton>
|
|
23
|
+
</template>
|
|
24
|
+
</UAlert>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted } from "vue";
|
|
3
|
+
|
|
4
|
+
const SUSPENDED_STATUS = "suspended";
|
|
5
|
+
const KEY_PREFIX = "saas.workspace.billing.past_due";
|
|
6
|
+
const DEADLINE_FORMAT: Intl.DateTimeFormatOptions = {
|
|
7
|
+
day: "numeric",
|
|
8
|
+
month: "long",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const { data, error, load, refresh } = useBillingStatus();
|
|
12
|
+
const { formatMinorUnits } = useMoneyFormat();
|
|
13
|
+
const { t, locale } = useI18n();
|
|
14
|
+
|
|
15
|
+
const invoice = computed(() => data.value?.unpaidInvoice ?? null);
|
|
16
|
+
const isSuspended = computed(() => data.value?.status === SUSPENDED_STATUS);
|
|
17
|
+
|
|
18
|
+
function formatDay(value: string | null | undefined): string | null {
|
|
19
|
+
return formatDate(value, locale.value, DEADLINE_FORMAT);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const amountLabel = computed(() =>
|
|
23
|
+
formatMinorUnits(invoice.value?.amount, invoice.value?.currency),
|
|
24
|
+
);
|
|
25
|
+
const invoiceLabel = computed(() => invoice.value?.number ?? amountLabel.value);
|
|
26
|
+
|
|
27
|
+
const heading = computed(() =>
|
|
28
|
+
isSuspended.value
|
|
29
|
+
? { title: `${KEY_PREFIX}.suspended_title`, badge: `${KEY_PREFIX}.suspended_badge` }
|
|
30
|
+
: { title: `${KEY_PREFIX}.title`, badge: `${KEY_PREFIX}.badge` },
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The banner is one paragraph assembled from what is actually known: the
|
|
35
|
+
* failure date, Stripe's next attempt and the suspension deadline are each
|
|
36
|
+
* dropped when the data behind them is missing.
|
|
37
|
+
*/
|
|
38
|
+
const message = computed(() => {
|
|
39
|
+
const subject = { invoice: invoiceLabel.value, amount: amountLabel.value };
|
|
40
|
+
if (isSuspended.value) {
|
|
41
|
+
return t(`${KEY_PREFIX}.suspended_summary`, subject);
|
|
42
|
+
}
|
|
43
|
+
const failedOn = formatDay(invoice.value?.failedAt);
|
|
44
|
+
const nextRetryOn = formatDay(invoice.value?.nextRetryAt);
|
|
45
|
+
const suspendOn = formatDay(invoice.value?.suspendAt);
|
|
46
|
+
const sentences = [
|
|
47
|
+
failedOn
|
|
48
|
+
? t(`${KEY_PREFIX}.summary_with_date`, { ...subject, date: failedOn })
|
|
49
|
+
: t(`${KEY_PREFIX}.summary`, subject),
|
|
50
|
+
nextRetryOn && t(`${KEY_PREFIX}.next_retry`, { date: nextRetryOn }),
|
|
51
|
+
suspendOn && t(`${KEY_PREFIX}.suspend_warning`, { date: suspendOn }),
|
|
52
|
+
];
|
|
53
|
+
return sentences.filter(Boolean).join(" ");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
function settle(): void {
|
|
57
|
+
const url = invoice.value?.hostedInvoiceUrl;
|
|
58
|
+
if (!url || typeof window === "undefined") return;
|
|
59
|
+
window.open(url, "_blank", "noopener");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
onMounted(load);
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<DmsSaasLoadFailure
|
|
67
|
+
v-if="error && !data"
|
|
68
|
+
:title="$t('saas.workspace.billing.past_due.load_failed')"
|
|
69
|
+
@retry="refresh"
|
|
70
|
+
/>
|
|
71
|
+
<UCard v-else-if="invoice" variant="subtle" class="ring-error/40">
|
|
72
|
+
<template #header>
|
|
73
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
74
|
+
<UIcon name="i-ph-warning-circle" class="text-error size-5" />
|
|
75
|
+
<h3 class="font-semibold">{{ $t(heading.title) }}</h3>
|
|
76
|
+
<UBadge color="warning" variant="subtle">
|
|
77
|
+
{{ $t(heading.badge) }}
|
|
78
|
+
</UBadge>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<div class="flex flex-col gap-3">
|
|
83
|
+
<p class="text-muted text-sm">{{ message }}</p>
|
|
84
|
+
<div>
|
|
85
|
+
<UButton
|
|
86
|
+
v-if="invoice.hostedInvoiceUrl"
|
|
87
|
+
color="primary"
|
|
88
|
+
icon="i-ph-arrow-square-out"
|
|
89
|
+
@click="settle"
|
|
90
|
+
>
|
|
91
|
+
{{ $t(`${KEY_PREFIX}.settle`) }}
|
|
92
|
+
</UButton>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</UCard>
|
|
96
|
+
</template>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted } from "vue";
|
|
3
|
+
|
|
4
|
+
const PAST_DUE_STATUS = "past_due";
|
|
5
|
+
const EXPIRY_YEAR_MODULO = 100;
|
|
6
|
+
const EXPIRY_PAD_LENGTH = 2;
|
|
7
|
+
|
|
8
|
+
const { data, error, load, refresh } = useBillingStatus();
|
|
9
|
+
|
|
10
|
+
const card = computed(() => data.value?.paymentMethod ?? null);
|
|
11
|
+
const needsUpdate = computed(() => data.value?.status === PAST_DUE_STATUS);
|
|
12
|
+
// Card details are owner-only in the API payload; showing the block to a
|
|
13
|
+
// member would falsely read as "no card on file".
|
|
14
|
+
const isVisible = computed(
|
|
15
|
+
() => !!data.value?.hasStripeCustomer && !!data.value?.isTenantOwner,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const headerBadge = computed(() => {
|
|
19
|
+
if (!card.value) return { color: "warning" as const, key: "missing" };
|
|
20
|
+
if (needsUpdate.value) return { color: "warning" as const, key: "needs_update" };
|
|
21
|
+
return { color: "success" as const, key: "active" };
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const cardBadge = computed(() =>
|
|
25
|
+
needsUpdate.value
|
|
26
|
+
? { color: "warning" as const, key: "declined" }
|
|
27
|
+
: { color: "neutral" as const, key: "default" },
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const expiryLabel = computed(() => {
|
|
31
|
+
if (!card.value) return "";
|
|
32
|
+
const month = String(card.value.expMonth).padStart(EXPIRY_PAD_LENGTH, "0");
|
|
33
|
+
const year = String(card.value.expYear % EXPIRY_YEAR_MODULO).padStart(
|
|
34
|
+
EXPIRY_PAD_LENGTH,
|
|
35
|
+
"0",
|
|
36
|
+
);
|
|
37
|
+
return `${month}/${year}`;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
onMounted(load);
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<DmsSaasLoadFailure v-if="error && !data" @retry="refresh" />
|
|
45
|
+
<UCard v-else-if="isVisible">
|
|
46
|
+
<template #header>
|
|
47
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
48
|
+
<h3 class="font-semibold">
|
|
49
|
+
{{ $t("saas.workspace.billing.payment_method.title") }}
|
|
50
|
+
</h3>
|
|
51
|
+
<UBadge :color="headerBadge.color" variant="subtle">
|
|
52
|
+
{{ $t(`saas.workspace.billing.payment_method.${headerBadge.key}`) }}
|
|
53
|
+
</UBadge>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<div class="flex flex-col gap-4">
|
|
58
|
+
<div
|
|
59
|
+
v-if="card"
|
|
60
|
+
class="border-default flex flex-wrap items-center gap-3 rounded-lg border p-3"
|
|
61
|
+
>
|
|
62
|
+
<UIcon name="i-ph-credit-card" class="text-muted size-5" />
|
|
63
|
+
<span class="font-medium capitalize">
|
|
64
|
+
{{ card.brand }} •••• {{ card.last4 }}
|
|
65
|
+
</span>
|
|
66
|
+
<span class="text-muted text-sm">
|
|
67
|
+
{{ $t("saas.workspace.billing.payment_method.expires", { date: expiryLabel }) }}
|
|
68
|
+
</span>
|
|
69
|
+
<span class="grow" />
|
|
70
|
+
<UBadge :color="cardBadge.color" variant="subtle">
|
|
71
|
+
{{ $t(`saas.workspace.billing.payment_method.${cardBadge.key}`) }}
|
|
72
|
+
</UBadge>
|
|
73
|
+
</div>
|
|
74
|
+
<p v-else class="text-muted text-sm">
|
|
75
|
+
{{ $t("saas.workspace.billing.payment_method.none") }}
|
|
76
|
+
</p>
|
|
77
|
+
|
|
78
|
+
<div class="border-default flex flex-wrap items-center gap-3 border-t pt-4">
|
|
79
|
+
<DmsSaasCustomerPortalButton />
|
|
80
|
+
<p class="text-muted grow text-xs">
|
|
81
|
+
{{ $t("saas.workspace.billing.payment_method.portal_hint") }}
|
|
82
|
+
</p>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</UCard>
|
|
86
|
+
</template>
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
const { $authFetch } = useAuthFetch();
|
|
5
|
+
const { t } = useI18n();
|
|
6
|
+
const planIntervalLabel = usePlanIntervalLabel("saas.plans.cycle");
|
|
7
|
+
|
|
8
|
+
interface PlanProp {
|
|
9
|
+
_id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
price: number;
|
|
13
|
+
currency: string;
|
|
14
|
+
interval: "month" | "year";
|
|
15
|
+
audience: string;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
borderColor: string | null;
|
|
18
|
+
borderLabel: string | null;
|
|
19
|
+
trialDays: number;
|
|
20
|
+
maxMembers: number;
|
|
21
|
+
workspaceCount: number;
|
|
22
|
+
features?: { featureId: string; value: unknown }[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface FeatureMeta {
|
|
26
|
+
displayName: string;
|
|
27
|
+
valueType: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const FEATURE_PREVIEW_LIMIT = 6;
|
|
31
|
+
|
|
32
|
+
const props = defineProps<{
|
|
33
|
+
plan: PlanProp;
|
|
34
|
+
featureMeta?: Record<string, FeatureMeta>;
|
|
35
|
+
}>();
|
|
36
|
+
const emit = defineEmits<{ changed: [] }>();
|
|
37
|
+
|
|
38
|
+
const showDeleteModal = ref(false);
|
|
39
|
+
const showConfirmDeactivateModal = ref(false);
|
|
40
|
+
const busy = ref(false);
|
|
41
|
+
|
|
42
|
+
const highlighted = computed(() => !!props.plan.borderLabel);
|
|
43
|
+
const accent = computed(() => props.plan.borderColor || "var(--ui-primary)");
|
|
44
|
+
|
|
45
|
+
const cardStyle = computed(() =>
|
|
46
|
+
highlighted.value ? { boxShadow: `0 0 0 2px ${accent.value}` } : undefined,
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const formattedPrice = computed(() =>
|
|
50
|
+
new Intl.NumberFormat("fr-FR", {
|
|
51
|
+
style: "currency",
|
|
52
|
+
currency: props.plan.currency,
|
|
53
|
+
minimumFractionDigits: 0,
|
|
54
|
+
maximumFractionDigits: 2,
|
|
55
|
+
}).format(props.plan.price),
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const cycle = computed(() => planIntervalLabel(props.plan.interval));
|
|
59
|
+
|
|
60
|
+
const membersLabel = computed(() =>
|
|
61
|
+
props.plan.maxMembers < 0
|
|
62
|
+
? t("saas.plans.card.members_unlimited")
|
|
63
|
+
: t("saas.plans.card.members", { count: props.plan.maxMembers }),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
function isFeatureEnabled(value: unknown, valueType: string): boolean {
|
|
67
|
+
if (valueType === "number") {
|
|
68
|
+
return typeof value === "number" && value >= 0;
|
|
69
|
+
}
|
|
70
|
+
return value === true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const features = computed(() =>
|
|
74
|
+
(props.plan.features ?? [])
|
|
75
|
+
.map((f) => {
|
|
76
|
+
const meta = props.featureMeta?.[f.featureId];
|
|
77
|
+
const valueType = meta?.valueType ?? "boolean";
|
|
78
|
+
return {
|
|
79
|
+
label: meta?.displayName ?? f.featureId,
|
|
80
|
+
valueType,
|
|
81
|
+
value: f.value,
|
|
82
|
+
enabled: isFeatureEnabled(f.value, valueType),
|
|
83
|
+
};
|
|
84
|
+
})
|
|
85
|
+
.sort((a, b) => Number(b.enabled) - Number(a.enabled))
|
|
86
|
+
.slice(0, FEATURE_PREVIEW_LIMIT),
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const editLink = computed(
|
|
90
|
+
() => `/modules/saas/catalog/plans/${props.plan._id}/edit`,
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
async function applyActive(value: boolean): Promise<void> {
|
|
94
|
+
busy.value = true;
|
|
95
|
+
try {
|
|
96
|
+
await $authFetch(`/api/saas/plans/${props.plan._id}`, {
|
|
97
|
+
method: "PUT",
|
|
98
|
+
body: { isActive: value },
|
|
99
|
+
});
|
|
100
|
+
emit("changed");
|
|
101
|
+
} finally {
|
|
102
|
+
busy.value = false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async function toggleActive(value: boolean): Promise<void> {
|
|
107
|
+
if (busy.value) return;
|
|
108
|
+
// Confirm grandfathering before deactivating. workspaceCount counts
|
|
109
|
+
// subscriptions in any status, so this also triggers for plans whose only
|
|
110
|
+
// subscriptions are cancelled or suspended.
|
|
111
|
+
if (!value && props.plan.workspaceCount > 0) {
|
|
112
|
+
showConfirmDeactivateModal.value = true;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
await applyActive(value);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function confirmDeactivate(): Promise<void> {
|
|
119
|
+
showConfirmDeactivateModal.value = false;
|
|
120
|
+
await applyActive(false);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function onDeleted(): void {
|
|
124
|
+
showDeleteModal.value = false;
|
|
125
|
+
emit("changed");
|
|
126
|
+
}
|
|
127
|
+
</script>
|
|
128
|
+
|
|
129
|
+
<template>
|
|
130
|
+
<div class="relative h-full">
|
|
131
|
+
<div
|
|
132
|
+
v-if="plan.borderLabel"
|
|
133
|
+
class="absolute -top-3 left-1/2 -translate-x-1/2 z-10"
|
|
134
|
+
>
|
|
135
|
+
<span
|
|
136
|
+
class="inline-flex items-center gap-1 rounded-full px-3 py-0.5 text-xs font-semibold text-white shadow"
|
|
137
|
+
:style="{ backgroundColor: accent }"
|
|
138
|
+
>
|
|
139
|
+
<UIcon name="i-ph-star-fill" class="size-3" />
|
|
140
|
+
{{ plan.borderLabel }}
|
|
141
|
+
</span>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<UCard
|
|
145
|
+
class="h-full"
|
|
146
|
+
:class="{ 'opacity-60': !plan.isActive }"
|
|
147
|
+
:style="cardStyle"
|
|
148
|
+
>
|
|
149
|
+
<template #header>
|
|
150
|
+
<div class="flex flex-col gap-2">
|
|
151
|
+
<div class="flex items-center justify-between gap-2">
|
|
152
|
+
<h3 class="text-lg font-semibold truncate">{{ plan.name }}</h3>
|
|
153
|
+
<USwitch
|
|
154
|
+
:model-value="plan.isActive"
|
|
155
|
+
:disabled="busy"
|
|
156
|
+
@update:model-value="toggleActive"
|
|
157
|
+
/>
|
|
158
|
+
</div>
|
|
159
|
+
<p v-if="plan.description" class="text-sm text-muted line-clamp-2">
|
|
160
|
+
{{ plan.description }}
|
|
161
|
+
</p>
|
|
162
|
+
</div>
|
|
163
|
+
</template>
|
|
164
|
+
|
|
165
|
+
<div class="flex flex-col gap-4">
|
|
166
|
+
<div>
|
|
167
|
+
<div class="flex items-baseline gap-1">
|
|
168
|
+
<span class="text-3xl font-bold tabular-nums">
|
|
169
|
+
{{ formattedPrice }}
|
|
170
|
+
</span>
|
|
171
|
+
<span v-if="cycle" class="text-muted">/{{ cycle }}</span>
|
|
172
|
+
</div>
|
|
173
|
+
<p v-if="plan.trialDays > 0" class="text-xs text-muted mt-1">
|
|
174
|
+
{{ $t("saas.plans.trial_days", { days: plan.trialDays }) }}
|
|
175
|
+
</p>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<div class="flex items-center gap-2 text-sm text-muted">
|
|
179
|
+
<UIcon name="i-ph-stack" class="size-4" />
|
|
180
|
+
<span>
|
|
181
|
+
{{
|
|
182
|
+
$t("saas.plans.card.subscriptions", {
|
|
183
|
+
count: plan.workspaceCount,
|
|
184
|
+
})
|
|
185
|
+
}}
|
|
186
|
+
</span>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<div class="flex items-center gap-2 text-sm text-muted">
|
|
190
|
+
<UIcon name="i-ph-users" class="size-4" />
|
|
191
|
+
<span>{{ membersLabel }}</span>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div
|
|
195
|
+
v-if="features.length"
|
|
196
|
+
class="flex flex-col gap-2 border-t border-default pt-4"
|
|
197
|
+
>
|
|
198
|
+
<p class="text-xs font-medium text-muted uppercase tracking-wide">
|
|
199
|
+
{{ $t("saas.plans.field.features") }}
|
|
200
|
+
</p>
|
|
201
|
+
<div class="flex flex-col gap-1.5">
|
|
202
|
+
<div
|
|
203
|
+
v-for="feature in features"
|
|
204
|
+
:key="feature.label"
|
|
205
|
+
class="flex items-center gap-2 text-sm"
|
|
206
|
+
>
|
|
207
|
+
<UIcon
|
|
208
|
+
:name="feature.enabled ? 'i-ph-check' : 'i-ph-x'"
|
|
209
|
+
class="size-4 shrink-0"
|
|
210
|
+
:class="
|
|
211
|
+
feature.enabled ? 'text-success' : 'text-muted opacity-50'
|
|
212
|
+
"
|
|
213
|
+
/>
|
|
214
|
+
<span
|
|
215
|
+
class="truncate"
|
|
216
|
+
:class="{ 'text-muted opacity-50': !feature.enabled }"
|
|
217
|
+
>
|
|
218
|
+
{{ feature.label }}
|
|
219
|
+
</span>
|
|
220
|
+
<span
|
|
221
|
+
v-if="feature.valueType === 'number' && feature.enabled"
|
|
222
|
+
class="text-muted text-xs tabular-nums ml-auto"
|
|
223
|
+
>
|
|
224
|
+
{{ feature.value }}
|
|
225
|
+
</span>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<template #footer>
|
|
232
|
+
<div class="flex gap-2">
|
|
233
|
+
<UButton
|
|
234
|
+
class="flex-1 justify-center"
|
|
235
|
+
variant="soft"
|
|
236
|
+
icon="i-ph-pencil"
|
|
237
|
+
:to="editLink"
|
|
238
|
+
>
|
|
239
|
+
{{ $t("saas.plans.action.edit") }}
|
|
240
|
+
</UButton>
|
|
241
|
+
<UButton
|
|
242
|
+
color="error"
|
|
243
|
+
variant="soft"
|
|
244
|
+
icon="i-ph-trash"
|
|
245
|
+
:aria-label="$t('saas.plans.action.delete')"
|
|
246
|
+
@click="showDeleteModal = true"
|
|
247
|
+
/>
|
|
248
|
+
</div>
|
|
249
|
+
</template>
|
|
250
|
+
</UCard>
|
|
251
|
+
|
|
252
|
+
<UModal
|
|
253
|
+
v-model:open="showDeleteModal"
|
|
254
|
+
:title="$t('saas.plans.delete.action_title')"
|
|
255
|
+
>
|
|
256
|
+
<template #body>
|
|
257
|
+
<DmsSaasDeletePlanModal
|
|
258
|
+
:row-data="{
|
|
259
|
+
_id: plan._id,
|
|
260
|
+
name: plan.name,
|
|
261
|
+
workspaceCount: plan.workspaceCount,
|
|
262
|
+
}"
|
|
263
|
+
:on-success-callback="onDeleted"
|
|
264
|
+
/>
|
|
265
|
+
</template>
|
|
266
|
+
</UModal>
|
|
267
|
+
|
|
268
|
+
<UModal
|
|
269
|
+
v-model:open="showConfirmDeactivateModal"
|
|
270
|
+
:title="$t('saas.plans.deactivate.title', { name: plan.name })"
|
|
271
|
+
>
|
|
272
|
+
<template #body>
|
|
273
|
+
<p>
|
|
274
|
+
{{
|
|
275
|
+
$t("saas.plans.deactivate.warning", { count: plan.workspaceCount })
|
|
276
|
+
}}
|
|
277
|
+
</p>
|
|
278
|
+
<p class="text-muted text-sm mt-2">
|
|
279
|
+
{{ $t("saas.plans.deactivate.public_removal") }}
|
|
280
|
+
</p>
|
|
281
|
+
</template>
|
|
282
|
+
<template #footer>
|
|
283
|
+
<div class="flex justify-end gap-2">
|
|
284
|
+
<UButton variant="ghost" @click="showConfirmDeactivateModal = false">
|
|
285
|
+
{{ $t("common.cancel") }}
|
|
286
|
+
</UButton>
|
|
287
|
+
<UButton color="warning" :loading="busy" @click="confirmDeactivate">
|
|
288
|
+
{{ $t("saas.plans.deactivate.confirm") }}
|
|
289
|
+
</UButton>
|
|
290
|
+
</div>
|
|
291
|
+
</template>
|
|
292
|
+
</UModal>
|
|
293
|
+
</div>
|
|
294
|
+
</template>
|