@antelopejs/dms-saas 0.8.1 → 0.9.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.
Files changed (313) hide show
  1. package/README.md +20 -4
  2. package/dist/auth/owner-only-permissions-resolver.js.map +1 -1
  3. package/dist/auth/plan-permissions-resolver.js.map +1 -1
  4. package/dist/automation/index.js.map +1 -1
  5. package/dist/billing-state/directory-hooks.js.map +1 -1
  6. package/dist/billing-state/directory.js.map +1 -1
  7. package/dist/billing-state/past-due-banner.js.map +1 -1
  8. package/dist/billing-state/recovery.js +2 -1
  9. package/dist/billing-state/recovery.js.map +1 -1
  10. package/dist/billing-state/trial-ending-banner.js.map +1 -1
  11. package/dist/crons/hard-delete-cancelled.js.map +1 -1
  12. package/dist/data-api/platformOwner/admin-user-workspaces.js +1 -1
  13. package/dist/data-api/platformOwner/admin-user-workspaces.js.map +1 -1
  14. package/dist/data-api/platformOwner/credit-note-rows.d.ts +4 -4
  15. package/dist/data-api/platformOwner/credit-note-rows.js +2 -1
  16. package/dist/data-api/platformOwner/credit-note-rows.js.map +1 -1
  17. package/dist/data-api/platformOwner/credit-notes.d.ts +1 -1
  18. package/dist/data-api/platformOwner/credit-notes.js +1 -1
  19. package/dist/data-api/platformOwner/credit-notes.js.map +1 -1
  20. package/dist/data-api/platformOwner/features.js.map +1 -1
  21. package/dist/data-api/platformOwner/invitations.js.map +1 -1
  22. package/dist/data-api/platformOwner/invoice-cells.js.map +1 -1
  23. package/dist/data-api/platformOwner/invoice-rows.d.ts +5 -4
  24. package/dist/data-api/platformOwner/invoice-rows.js.map +1 -1
  25. package/dist/data-api/platformOwner/invoices.d.ts +5 -5
  26. package/dist/data-api/platformOwner/invoices.js +5 -4
  27. package/dist/data-api/platformOwner/invoices.js.map +1 -1
  28. package/dist/data-api/platformOwner/plan-migrations.js.map +1 -1
  29. package/dist/data-api/platformOwner/plans.d.ts +5 -5
  30. package/dist/data-api/platformOwner/plans.js.map +1 -1
  31. package/dist/data-api/platformOwner/segments.js.map +1 -1
  32. package/dist/data-api/platformOwner/table-scope.d.ts +2 -1
  33. package/dist/data-api/platformOwner/table-scope.js.map +1 -1
  34. package/dist/data-api/platformOwner/users.js +7 -6
  35. package/dist/data-api/platformOwner/users.js.map +1 -1
  36. package/dist/data-api/platformOwner/workspace-cells.d.ts +2 -2
  37. package/dist/data-api/platformOwner/workspace-cells.js +1 -1
  38. package/dist/data-api/platformOwner/workspace-cells.js.map +1 -1
  39. package/dist/data-api/platformOwner/workspaces.d.ts +6 -5
  40. package/dist/data-api/platformOwner/workspaces.js +7 -10
  41. package/dist/data-api/platformOwner/workspaces.js.map +1 -1
  42. package/dist/data-api/tenant/tenant-invoices.js.map +1 -1
  43. package/dist/frontend-module.js.map +1 -1
  44. package/dist/hooks/register.js.map +1 -1
  45. package/dist/hooks/tenant-export.js.map +1 -1
  46. package/dist/i18n/composed-text.js.map +1 -1
  47. package/dist/implementations/dms-saas/invoice-line-items.js.map +1 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/invoice-line-items/injection.d.ts +1 -1
  50. package/dist/invoice-line-items/injection.js.map +1 -1
  51. package/dist/invoice-line-items/recovery/discovery.js +11 -9
  52. package/dist/invoice-line-items/recovery/discovery.js.map +1 -1
  53. package/dist/invoice-line-items/recovery/managed-lines.js +18 -12
  54. package/dist/invoice-line-items/recovery/managed-lines.js.map +1 -1
  55. package/dist/metrics/activity-sources.js +1 -3
  56. package/dist/metrics/activity-sources.js.map +1 -1
  57. package/dist/metrics/activity.d.ts +3 -2
  58. package/dist/metrics/activity.js +19 -3
  59. package/dist/metrics/activity.js.map +1 -1
  60. package/dist/metrics/directory-summary.js +12 -4
  61. package/dist/metrics/directory-summary.js.map +1 -1
  62. package/dist/metrics/normalised-mrr.js.map +1 -1
  63. package/dist/metrics/revenue.d.ts +2 -2
  64. package/dist/metrics/revenue.js +3 -2
  65. package/dist/metrics/revenue.js.map +1 -1
  66. package/dist/operator-actions/commands.js +2 -1
  67. package/dist/operator-actions/commands.js.map +1 -1
  68. package/dist/operator-actions/db/lifecycle-delivery.model.js.map +1 -1
  69. package/dist/operator-actions/invitation-commands.d.ts +1 -1
  70. package/dist/operator-actions/invitation-commands.js +5 -27
  71. package/dist/operator-actions/invitation-commands.js.map +1 -1
  72. package/dist/operator-actions/journal.js +5 -2
  73. package/dist/operator-actions/journal.js.map +1 -1
  74. package/dist/operator-actions/lifecycle-consumers.js.map +1 -1
  75. package/dist/operator-actions/one-shot.d.ts +9 -0
  76. package/dist/operator-actions/one-shot.js +21 -0
  77. package/dist/operator-actions/one-shot.js.map +1 -0
  78. package/dist/operator-actions/types.d.ts +1 -1
  79. package/dist/operator-billing/billing-settings-store.js +7 -1
  80. package/dist/operator-billing/billing-settings-store.js.map +1 -1
  81. package/dist/operator-billing/billing-stats.d.ts +2 -1
  82. package/dist/operator-billing/billing-stats.js +3 -2
  83. package/dist/operator-billing/billing-stats.js.map +1 -1
  84. package/dist/operator-billing/credit-allowance.d.ts +6 -3
  85. package/dist/operator-billing/credit-allowance.js.map +1 -1
  86. package/dist/operator-billing/credit-note-request.js.map +1 -1
  87. package/dist/operator-billing/invoice-credit.js +9 -3
  88. package/dist/operator-billing/invoice-credit.js.map +1 -1
  89. package/dist/operator-billing/legal-documents-store.js +8 -3
  90. package/dist/operator-billing/legal-documents-store.js.map +1 -1
  91. package/dist/operator-billing/legal-versions.js +13 -8
  92. package/dist/operator-billing/legal-versions.js.map +1 -1
  93. package/dist/pages/platform/dashboard.js.map +1 -1
  94. package/dist/pages/platform/features.js.map +1 -1
  95. package/dist/pages/platform/plans/edit.js.map +1 -1
  96. package/dist/pages/platform/plans/index.js.map +1 -1
  97. package/dist/pages/platform/plans/migrations.js.map +1 -1
  98. package/dist/pages/platform/users/detail.js.map +1 -1
  99. package/dist/pages/platform/users/index.js.map +1 -1
  100. package/dist/pages/platform/workspaces/detail.js.map +1 -1
  101. package/dist/pages/platform/workspaces/index.js.map +1 -1
  102. package/dist/pages/public/index.js.map +1 -1
  103. package/dist/pages/public/legal/privacy-policy.js.map +1 -1
  104. package/dist/pages/public/legal/terms-and-conditions.js.map +1 -1
  105. package/dist/pages/public/legal/terms-of-use.js.map +1 -1
  106. package/dist/pages/public/pricing.js.map +1 -1
  107. package/dist/pages/public/register.js.map +1 -1
  108. package/dist/pages/public/screens.js +5 -2
  109. package/dist/pages/public/screens.js.map +1 -1
  110. package/dist/pages/tenant/billing.js.map +1 -1
  111. package/dist/pages/tenant/general.js.map +1 -1
  112. package/dist/pages/tenant/members-seat-quota.js.map +1 -1
  113. package/dist/pages/tenant/workspace-suspended.js.map +1 -1
  114. package/dist/plan-changes/applied-upgrade.d.ts +1 -1
  115. package/dist/plan-changes/applied-upgrade.js.map +1 -1
  116. package/dist/plan-changes/deferred.js.map +1 -1
  117. package/dist/plan-changes/guarded-free.js.map +1 -1
  118. package/dist/plan-changes/guarded-landing.js.map +1 -1
  119. package/dist/plan-changes/inventory-barrier.js.map +1 -1
  120. package/dist/plans/migration-blocks.js +6 -6
  121. package/dist/plans/migration-blocks.js.map +1 -1
  122. package/dist/plans/migration-dialogs.js.map +1 -1
  123. package/dist/plans/plan-diff.js +2 -1
  124. package/dist/plans/plan-diff.js.map +1 -1
  125. package/dist/plans/plan-permission-tree.js.map +1 -1
  126. package/dist/plans/plan-write.js +9 -7
  127. package/dist/plans/plan-write.js.map +1 -1
  128. package/dist/plans/seat-hooks.js.map +1 -1
  129. package/dist/plans/stripe-sync.js.map +1 -1
  130. package/dist/routes/platformOwner/dashboard.d.ts +2 -1
  131. package/dist/routes/platformOwner/dashboard.js.map +1 -1
  132. package/dist/routes/platformOwner/plan-deletion.js.map +1 -1
  133. package/dist/routes/platformOwner/plan-dialogs.d.ts +3 -2
  134. package/dist/routes/platformOwner/plan-dialogs.js.map +1 -1
  135. package/dist/routes/platformOwner/plan-migrations.d.ts +4 -2
  136. package/dist/routes/platformOwner/plan-migrations.js +2 -1
  137. package/dist/routes/platformOwner/plan-migrations.js.map +1 -1
  138. package/dist/routes/platformOwner/plans.d.ts +3 -2
  139. package/dist/routes/platformOwner/plans.js.map +1 -1
  140. package/dist/routes/platformOwner/platform-notes.js +3 -3
  141. package/dist/routes/platformOwner/platform-notes.js.map +1 -1
  142. package/dist/routes/platformOwner/segments-export.js.map +1 -1
  143. package/dist/routes/platformOwner/segments.js +2 -3
  144. package/dist/routes/platformOwner/segments.js.map +1 -1
  145. package/dist/routes/platformOwner/workspace-detail.d.ts +6 -2
  146. package/dist/routes/platformOwner/workspace-detail.js +10 -1
  147. package/dist/routes/platformOwner/workspace-detail.js.map +1 -1
  148. package/dist/routes/platformOwner/workspace-operator-actions.d.ts +2 -1
  149. package/dist/routes/platformOwner/workspace-operator-actions.js +4 -4
  150. package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -1
  151. package/dist/routes/platformOwner/workspaces-admin.d.ts +4 -2
  152. package/dist/routes/platformOwner/workspaces-admin.js +30 -7
  153. package/dist/routes/platformOwner/workspaces-admin.js.map +1 -1
  154. package/dist/routes/public/pricing.d.ts +2 -1
  155. package/dist/routes/public/pricing.js.map +1 -1
  156. package/dist/routes/public/public-plan-catalog.d.ts +2 -1
  157. package/dist/routes/public/public-plan-catalog.js +2 -1
  158. package/dist/routes/public/public-plan-catalog.js.map +1 -1
  159. package/dist/routes/public/register.d.ts +6 -3
  160. package/dist/routes/public/register.js +2 -1
  161. package/dist/routes/public/register.js.map +1 -1
  162. package/dist/routes/tenant/billing-pay-invoice.js.map +1 -1
  163. package/dist/routes/tenant/billing-portal.js.map +1 -1
  164. package/dist/routes/tenant/billing-self-refund.js.map +1 -1
  165. package/dist/routes/tenant/data-export.js.map +1 -1
  166. package/dist/routes/tenant/tenant-billing.js.map +1 -1
  167. package/dist/routes/tenant/tenant-plan-authentication.js.map +1 -1
  168. package/dist/routes/tenant/tenant-plan-cancellation.js.map +1 -1
  169. package/dist/routes/tenant/tenant-plan-checkout-recovery.js.map +1 -1
  170. package/dist/routes/tenant/tenant-plan-checkout.js +2 -3
  171. package/dist/routes/tenant/tenant-plan-checkout.js.map +1 -1
  172. package/dist/routes/tenant/tenant-plan-ops.js.map +1 -1
  173. package/dist/routes/tenant/tenant-plan-preview.js.map +1 -1
  174. package/dist/routes/tenant/tenant-plan-resubscription.js.map +1 -1
  175. package/dist/routes/tenant/tenant-plan.d.ts +5 -3
  176. package/dist/routes/tenant/tenant-plan.js +4 -3
  177. package/dist/routes/tenant/tenant-plan.js.map +1 -1
  178. package/dist/routes/tenant/tenant-upcoming-invoice.js +2 -3
  179. package/dist/routes/tenant/tenant-upcoming-invoice.js.map +1 -1
  180. package/dist/routes/tenant/workspaces.d.ts +2 -1
  181. package/dist/routes/tenant/workspaces.js.map +1 -1
  182. package/dist/stripe/client.js +2 -1
  183. package/dist/stripe/client.js.map +1 -1
  184. package/dist/stripe/customer-billing.d.ts +1 -1
  185. package/dist/stripe/customer-billing.js +1 -1
  186. package/dist/stripe/customer-billing.js.map +1 -1
  187. package/dist/stripe/payload-shapes.d.ts +20 -5
  188. package/dist/stripe/payload-shapes.js +4 -4
  189. package/dist/stripe/payload-shapes.js.map +1 -1
  190. package/dist/stripe/pending-update.js +2 -1
  191. package/dist/stripe/pending-update.js.map +1 -1
  192. package/dist/stripe/plan-schedule.js +3 -2
  193. package/dist/stripe/plan-schedule.js.map +1 -1
  194. package/dist/stripe/sync-plan.js +9 -8
  195. package/dist/stripe/sync-plan.js.map +1 -1
  196. package/dist/stripe/webhook-checkout.d.ts +2 -2
  197. package/dist/stripe/webhook-checkout.js +5 -4
  198. package/dist/stripe/webhook-checkout.js.map +1 -1
  199. package/dist/stripe/webhook-credit-notes.d.ts +2 -2
  200. package/dist/stripe/webhook-credit-notes.js +2 -1
  201. package/dist/stripe/webhook-credit-notes.js.map +1 -1
  202. package/dist/stripe/webhook-dispatch.js +6 -2
  203. package/dist/stripe/webhook-dispatch.js.map +1 -1
  204. package/dist/stripe/webhook-handlers.d.ts +10 -10
  205. package/dist/stripe/webhook-handlers.js.map +1 -1
  206. package/dist/stripe/webhook-shared.d.ts +1 -1
  207. package/dist/stripe/webhook-shared.js +2 -1
  208. package/dist/stripe/webhook-shared.js.map +1 -1
  209. package/dist/stripe/workspace-checkout.js +2 -1
  210. package/dist/stripe/workspace-checkout.js.map +1 -1
  211. package/dist/upcoming-invoice/eligibility.js.map +1 -1
  212. package/dist/upcoming-invoice/preview.js.map +1 -1
  213. package/dist/upcoming-invoice/pricing.js +6 -2
  214. package/dist/upcoming-invoice/pricing.js.map +1 -1
  215. package/dist/users/user-facts.js.map +1 -1
  216. package/dist/utils/content-language.d.ts +3 -1
  217. package/dist/utils/content-language.js +2 -1
  218. package/dist/utils/content-language.js.map +1 -1
  219. package/dist/utils/keyed-insert.d.ts +3 -7
  220. package/dist/utils/keyed-insert.js.map +1 -1
  221. package/dist/utils/parse-future-date.js +2 -1
  222. package/dist/utils/parse-future-date.js.map +1 -1
  223. package/dist/utils/primitive-guards.d.ts +4 -0
  224. package/dist/utils/primitive-guards.js +19 -0
  225. package/dist/utils/primitive-guards.js.map +1 -0
  226. package/dist/utils/query-parameter.d.ts +1 -0
  227. package/dist/utils/query-parameter.js +3 -0
  228. package/dist/utils/query-parameter.js.map +1 -0
  229. package/dist/utils/row-instance.js.map +1 -1
  230. package/dist/utils/segment-conditions-type.js +2 -1
  231. package/dist/utils/segment-conditions-type.js.map +1 -1
  232. package/dist/utils/segment-evaluator.js +8 -7
  233. package/dist/utils/segment-evaluator.js.map +1 -1
  234. package/dist/utils/segment-explain.js +2 -1
  235. package/dist/utils/segment-explain.js.map +1 -1
  236. package/dist/utils/segment-matching.js.map +1 -1
  237. package/dist/utils/segment-validation.js +12 -13
  238. package/dist/utils/segment-validation.js.map +1 -1
  239. package/dist/utils/time.js +2 -1
  240. package/dist/utils/time.js.map +1 -1
  241. package/dist/workers/plan-migration.js.map +1 -1
  242. package/dist/workspaces/billing-identity.d.ts +3 -1
  243. package/dist/workspaces/billing-identity.js +10 -1
  244. package/dist/workspaces/billing-identity.js.map +1 -1
  245. package/dist/workspaces/default-plan.js.map +1 -1
  246. package/dist/workspaces/deletion.js.map +1 -1
  247. package/dist/workspaces/detail-items.js.map +1 -1
  248. package/dist/workspaces/operator-creation.js +2 -3
  249. package/dist/workspaces/operator-creation.js.map +1 -1
  250. package/dist/workspaces/owner-invitation-email.js.map +1 -1
  251. package/dist/workspaces/provisioning-types.d.ts +46 -0
  252. package/dist/workspaces/provisioning-types.js +3 -0
  253. package/dist/workspaces/provisioning-types.js.map +1 -0
  254. package/dist/workspaces/provisioning.d.ts +3 -45
  255. package/dist/workspaces/provisioning.js.map +1 -1
  256. package/dist/workspaces/registration-extras.js +13 -9
  257. package/dist/workspaces/registration-extras.js.map +1 -1
  258. package/dist/workspaces/self-serve-creation.js.map +1 -1
  259. package/dist/workspaces/subscription-create-params.js.map +1 -1
  260. package/frontend-vue/app/build/PayInvoicePanel.vue +3 -2
  261. package/frontend-vue/app/build/PlanChangeReview.vue +7 -6
  262. package/frontend-vue/app/build/components/RetirePlanDiff.vue +178 -0
  263. package/frontend-vue/app/build/public/OtherWorkspaces.vue +4 -11
  264. package/frontend-vue/app/build/public/registration-errors.ts +2 -0
  265. package/frontend-vue/app/build/workspace-detail/ComplimentaryDialog.vue +7 -5
  266. package/frontend-vue/app/build/workspace-detail/CreditDialog.vue +5 -4
  267. package/frontend-vue/app/build/workspace-detail/UpgradeDialog.vue +7 -5
  268. package/frontend-vue/app/build/workspace-detail/types.ts +1 -1
  269. package/frontend-vue/app/build/workspace-detail/useWorkspaceActions.ts +2 -7
  270. package/frontend-vue/app/build/workspace-paths.ts +12 -0
  271. package/frontend-vue/app/components/CustomerPortalButton.vue +4 -2
  272. package/frontend-vue/app/components/DataExport.vue +14 -14
  273. package/frontend-vue/app/components/DataExportHistory.vue +7 -12
  274. package/frontend-vue/app/components/IssueCreditNoteModal.vue +4 -7
  275. package/frontend-vue/app/components/LegalLayout.vue +5 -4
  276. package/frontend-vue/app/components/MigrationStripeCheck.vue +2 -5
  277. package/frontend-vue/app/components/PendingCheckoutModal.vue +2 -7
  278. package/frontend-vue/app/components/PlanTaxSync.vue +2 -6
  279. package/frontend-vue/app/components/PlanUpgradeModal.vue +10 -11
  280. package/frontend-vue/app/components/PlatformNotes.vue +4 -8
  281. package/frontend-vue/app/components/Pricing.vue +4 -2
  282. package/frontend-vue/app/components/RefundButton.vue +4 -2
  283. package/frontend-vue/app/components/RetirePlanModal.vue +16 -165
  284. package/frontend-vue/app/components/TenantBillingForm.vue +3 -7
  285. package/frontend-vue/app/components/TenantPlanCard.vue +11 -18
  286. package/frontend-vue/app/components/UserPlatformRoleCard.vue +2 -5
  287. package/frontend-vue/app/components/WorkspaceAdminCreateModal.vue +5 -3
  288. package/frontend-vue/app/components/WorkspaceCreateModal.vue +12 -5
  289. package/frontend-vue/app/components/WorkspaceDangerZone.vue +8 -3
  290. package/frontend-vue/app/components/WorkspaceDetailHeader.vue +16 -13
  291. package/frontend-vue/app/components/WorkspaceInvitationLink.vue +3 -2
  292. package/frontend-vue/app/components/WorkspaceOperatorActions.vue +17 -4
  293. package/frontend-vue/app/components/WorkspaceSuspended.vue +6 -13
  294. package/frontend-vue/app/components/WorkspaceSwitcherWidget.vue +21 -15
  295. package/frontend-vue/app/composables/useApiErrorMessage.ts +4 -33
  296. package/frontend-vue/app/composables/useInvitationLink.ts +14 -11
  297. package/frontend-vue/app/composables/useSaasRegistration.ts +14 -72
  298. package/frontend-vue/app/composables/useSaasRegistrationPlan.ts +73 -0
  299. package/frontend-vue/app/custom-pages/auth/no-workspace.vue +14 -11
  300. package/frontend-vue/build/backend-boundary.ts +122 -0
  301. package/frontend-vue/dms.frontend.build.ts +2 -0
  302. package/frontend-vue/i18n/locales/saas-operator-dashboard-en-GB.json +66 -0
  303. package/frontend-vue/i18n/locales/saas-operator-dashboard-fr-FR.json +66 -0
  304. package/frontend-vue/i18n/locales/saas-operator-workspaces-en-GB.json +13 -65
  305. package/frontend-vue/i18n/locales/saas-operator-workspaces-fr-FR.json +13 -65
  306. package/frontend-vue/i18n/locales/saas-public-en-GB.json +2 -4
  307. package/frontend-vue/i18n/locales/saas-public-fr-FR.json +2 -4
  308. package/frontend-vue/i18n/locales/saas-tenant-workspace-en-GB.json +0 -1
  309. package/frontend-vue/i18n/locales/saas-tenant-workspace-fr-FR.json +0 -1
  310. package/frontend-vue/package.json +1 -1
  311. package/package.json +10 -11
  312. package/skills/dms-saas/SKILL.md +2 -3
  313. package/skills/dms-saas/cases.json +48 -0
@@ -30,7 +30,7 @@ interface PortalSession {
30
30
  }
31
31
 
32
32
  const { $authFetch } = useAuthFetch()
33
- const { resolveApiError } = useApiErrorMessage()
33
+ const { resolveError } = useApiErrorPresenter()
34
34
  const billingStatus = useBillingStatus({ server: !props.isDeferred }).data
35
35
  const data = props.isDeferred ? useMountedData(billingStatus) : billingStatus
36
36
  const isLoading = ref(false)
@@ -52,7 +52,9 @@ async function openCustomerPortal(): Promise<void> {
52
52
  })
53
53
  if (typeof window !== 'undefined') window.location.href = result.url
54
54
  } catch (error) {
55
- failure.value = resolveApiError(error, 'saas.tenant_billing.portal.error')
55
+ failure.value =
56
+ resolveError(error, { fallbackKey: 'saas.tenant_billing.portal.error' })
57
+ ?.message ?? ''
56
58
  isLoading.value = false
57
59
  }
58
60
  }
@@ -16,10 +16,9 @@ const TIME_FORMAT: Intl.DateTimeFormatOptions = {
16
16
 
17
17
  const { t, locale } = useI18n()
18
18
  const { user } = useCurrentUser()
19
- const { resolveApiError } = useApiErrorMessage()
19
+ const { presentError } = useApiErrorPresenter()
20
20
  const route = useDmsRoute()
21
21
  const router = useDmsRouter()
22
- const toast = useToast()
23
22
  const { state, running, load, start, download } = useExportHistory()
24
23
 
25
24
  /** The export this visit watched finish, shown until the page is left. */
@@ -34,7 +33,11 @@ const runningStatus = useApiData<ExportJobStatus>(
34
33
  running.value
35
34
  ? `${EXPORT_STATUS_ENDPOINT}/${encodeURIComponent(running.value.jobId)}`
36
35
  : null,
37
- { server: false, refreshInterval: POLL_INTERVAL_MS, refreshOnPageRefresh: false },
36
+ {
37
+ server: false,
38
+ refreshInterval: POLL_INTERVAL_MS,
39
+ refreshOnPageRefresh: false,
40
+ },
38
41
  )
39
42
 
40
43
  const email = computed(() => user.value?.email ?? '')
@@ -70,25 +73,21 @@ function errorStatus(error: unknown): number | undefined {
70
73
  return typeof status === 'number' ? status : undefined
71
74
  }
72
75
 
73
- function notifyError(error: unknown, fallbackKey: string): void {
74
- toast.add({
75
- title: resolveApiError(error, fallbackKey),
76
- color: 'error',
77
- icon: 'i-ph-warning-circle',
78
- })
79
- }
80
-
81
76
  async function requestExport(): Promise<void> {
82
77
  finished.value = null
83
78
  expiredLinkJobId.value = null
84
- await start().catch((error) => notifyError(error, `${KEYS}.error.start`))
79
+ await start().catch((error) =>
80
+ presentError(error, { fallbackKey: `${KEYS}.error.start` }),
81
+ )
85
82
  }
86
83
 
87
84
  async function downloadFinished(): Promise<void> {
88
85
  if (!finished.value || isDownloading.value) return
89
86
  isDownloading.value = true
90
87
  await download(finished.value.jobId, finished.value)
91
- .catch((error) => notifyError(error, `${KEYS}.error.download`))
88
+ .catch((error) =>
89
+ presentError(error, { fallbackKey: `${KEYS}.error.download` }),
90
+ )
92
91
  .finally(() => {
93
92
  isDownloading.value = false
94
93
  })
@@ -127,7 +126,8 @@ async function consumeDeliveredLink(): Promise<void> {
127
126
  await clearDeliveredLink()
128
127
  } catch (error) {
129
128
  const isGone = GONE_STATUSES.has(errorStatus(error) ?? 0)
130
- if (!isGone) return notifyError(error, `${KEYS}.error.download`)
129
+ if (!isGone)
130
+ return presentError(error, { fallbackKey: `${KEYS}.error.download` })
131
131
  expiredLinkJobId.value = jobId
132
132
  await clearDeliveredLink()
133
133
  }
@@ -28,8 +28,7 @@ const ROW_TONES: Record<ExportRowState, Tone> = {
28
28
  }
29
29
 
30
30
  const { t, locale } = useI18n()
31
- const { resolveApiError } = useApiErrorMessage()
32
- const toast = useToast()
31
+ const { presentError } = useApiErrorPresenter()
33
32
  const { state, running, load, goToPage, start, download } = useExportHistory()
34
33
 
35
34
  const downloadingJobId = ref<string | null>(null)
@@ -80,20 +79,14 @@ function detail(entry: ExportHistoryEntry): string {
80
79
  return t('saas.workspace.data_export.scope')
81
80
  }
82
81
 
83
- function notifyError(error: unknown, fallbackKey: string): void {
84
- toast.add({
85
- title: resolveApiError(error, fallbackKey),
86
- color: 'error',
87
- icon: 'i-ph-warning-circle',
88
- })
89
- }
90
-
91
82
  async function downloadEntry(entry: ExportHistoryEntry): Promise<void> {
92
83
  if (downloadingJobId.value) return
93
84
  downloadingJobId.value = entry.jobId
94
85
  await download(entry.jobId, entry)
95
86
  .catch((error) =>
96
- notifyError(error, 'saas.workspace.data_export.error.download'),
87
+ presentError(error, {
88
+ fallbackKey: 'saas.workspace.data_export.error.download',
89
+ }),
97
90
  )
98
91
  .finally(() => {
99
92
  downloadingJobId.value = null
@@ -102,7 +95,9 @@ async function downloadEntry(entry: ExportHistoryEntry): Promise<void> {
102
95
 
103
96
  function requestAnother(): Promise<void> {
104
97
  return start().catch((error) =>
105
- notifyError(error, 'saas.workspace.data_export.error.start'),
98
+ presentError(error, {
99
+ fallbackKey: 'saas.workspace.data_export.error.start',
100
+ }),
106
101
  )
107
102
  }
108
103
  </script>
@@ -33,7 +33,7 @@ const { t } = useI18n()
33
33
  const toast = useToast()
34
34
  const { confirm } = useConfirm()
35
35
  const { $authFetch } = useAuthFetch()
36
- const { resolveApiError } = useApiErrorMessage()
36
+ const { presentError, resolveError } = useApiErrorPresenter()
37
37
 
38
38
  const preview = ref<CreditNotePreview | null>(null)
39
39
  const isLoading = ref(true)
@@ -61,7 +61,8 @@ async function load(): Promise<void> {
61
61
  preview.value = await previewRead.read()
62
62
  draft.reset(preview.value)
63
63
  } catch (error) {
64
- loadError.value = resolveApiError(error, `${TEXT}.load_failed`)
64
+ loadError.value =
65
+ resolveError(error, { fallbackKey: `${TEXT}.load_failed` })?.message ?? ''
65
66
  } finally {
66
67
  isLoading.value = false
67
68
  }
@@ -166,11 +167,7 @@ async function creditDirectly(): Promise<void> {
166
167
  try {
167
168
  announce(await issue())
168
169
  } catch (error) {
169
- toast.add({
170
- title: resolveApiError(error, `${TEXT}.error`),
171
- color: 'error',
172
- icon: 'i-ph-warning-circle',
173
- })
170
+ presentError(error, { fallbackKey: `${TEXT}.error` })
174
171
  } finally {
175
172
  isSubmitting.value = false
176
173
  }
@@ -41,7 +41,7 @@ const HEADING_LEVEL_OFFSET = 1
41
41
  const { t, locale } = useI18n()
42
42
  const route = useDmsRoute()
43
43
  const publicFetch = usePublicFetch()
44
- const { resolveApiError } = useApiErrorMessage()
44
+ const { resolveError } = useApiErrorPresenter()
45
45
 
46
46
  const payload = ref<LegalDocumentsPayload | null>(null)
47
47
  const isLoading = ref(true)
@@ -137,7 +137,9 @@ async function loadDocument(): Promise<void> {
137
137
  try {
138
138
  payload.value = await publicFetch<LegalDocumentsPayload>(LEGAL_ENDPOINT)
139
139
  } catch (error) {
140
- loadError.value = resolveApiError(error, 'saas.public.legal.load_error')
140
+ loadError.value =
141
+ resolveError(error, { fallbackKey: 'saas.public.legal.load_error' })
142
+ ?.message ?? ''
141
143
  } finally {
142
144
  isLoading.value = false
143
145
  }
@@ -243,8 +245,7 @@ onMounted(() => {
243
245
  </p>
244
246
  </header>
245
247
  <DmsCard>
246
- <!-- Written by the platform admin in Billing rules & legal. -->
247
- <!-- eslint-disable-next-line vue/no-v-html -->
248
+ <!-- eslint-disable-next-line vue/no-v-html -- Legal documents are platform-admin-authored HTML. -->
248
249
  <div
249
250
  class="prose prose-neutral dark:prose-invert max-w-none"
250
251
  v-html="legalDocument.html"
@@ -36,7 +36,7 @@ const { $authFetch } = useAuthFetch()
36
36
  const { t } = useI18n()
37
37
  const { confirmFrom } = useConfirmFrom()
38
38
  const toast = useToast()
39
- const { resolveApiError } = useApiErrorMessage()
39
+ const { presentError } = useApiErrorPresenter()
40
40
 
41
41
  const reading = ref<StripeReading | null>(null)
42
42
  const loadFailed = ref(false)
@@ -83,10 +83,7 @@ async function openSettlement(kind: UncertainResolution): Promise<void> {
83
83
  onConfirm: () => settle(kind),
84
84
  })
85
85
  } catch (error) {
86
- toast.add({
87
- color: 'error',
88
- title: resolveApiError(error, `${DETAIL}.settle_failed`),
89
- })
86
+ presentError(error, { fallbackKey: `${DETAIL}.settle_failed` })
90
87
  }
91
88
  }
92
89
 
@@ -3,8 +3,7 @@ import { computed, ref } from 'vue'
3
3
 
4
4
  const KEY_PREFIX = 'saas.workspace.plan.checkout_pending'
5
5
 
6
- const toast = useToast()
7
- const { resolveApiError } = useApiErrorMessage()
6
+ const { presentError } = useApiErrorPresenter()
8
7
  const { prompt, resume, startOver } = usePendingCheckout()
9
8
 
10
9
  const isRestarting = ref(false)
@@ -32,11 +31,7 @@ async function restart(): Promise<void> {
32
31
  try {
33
32
  await startOver()
34
33
  } catch (error) {
35
- toast.add({
36
- title: resolveApiError(error, `${KEY_PREFIX}.restart_error`),
37
- color: 'error',
38
- icon: 'i-ph-warning-circle',
39
- })
34
+ presentError(error, { fallbackKey: `${KEY_PREFIX}.restart_error` })
40
35
  isRestarting.value = false
41
36
  }
42
37
  }
@@ -31,7 +31,7 @@ const DATE_TIME_FORMAT: Intl.DateTimeFormatOptions = {
31
31
  const { t, locale } = useI18n()
32
32
  const toast = useToast()
33
33
  const { $authFetch } = useAuthFetch()
34
- const { resolveApiError } = useApiErrorMessage()
34
+ const { presentError } = useApiErrorPresenter()
35
35
  const live = useLiveFormValues(() => props.componentId)
36
36
 
37
37
  const status = ref<PlanTaxSyncStatus | null>(props.modelValue ?? null)
@@ -77,11 +77,7 @@ async function resync(): Promise<void> {
77
77
  icon: 'i-ph-check-circle',
78
78
  })
79
79
  } catch (error) {
80
- toast.add({
81
- title: resolveApiError(error, `${TEXT}.resync_failed`),
82
- color: 'error',
83
- icon: 'i-ph-warning-circle',
84
- })
80
+ presentError(error, { fallbackKey: `${TEXT}.resync_failed` })
85
81
  } finally {
86
82
  isSyncing.value = false
87
83
  }
@@ -20,7 +20,7 @@ const PREVIEW_DEBOUNCE_MS = 400
20
20
 
21
21
  const toast = useToast()
22
22
  const { t, locale } = useI18n()
23
- const { resolveApiError } = useApiErrorMessage()
23
+ const { presentError, resolveError } = useApiErrorPresenter()
24
24
  const identity = useBillingIdentity()
25
25
  const { changePlan, previewChange } = useTenantPlanChanges()
26
26
  const { offerFor: offerPendingCheckout } = usePendingCheckout()
@@ -113,10 +113,9 @@ async function price(): Promise<void> {
113
113
  previewFailure.value = null
114
114
  } catch (error) {
115
115
  preview.value = null
116
- previewFailure.value = resolveApiError(
117
- error,
118
- `${KEY_PREFIX}.preview_failed`,
119
- )
116
+ previewFailure.value =
117
+ resolveError(error, { fallbackKey: `${KEY_PREFIX}.preview_failed` })
118
+ ?.message ?? ''
120
119
  } finally {
121
120
  isPricing.value = false
122
121
  }
@@ -149,10 +148,6 @@ watch(
149
148
  },
150
149
  )
151
150
 
152
- function notifyError(title: string): void {
153
- toast.add({ title, color: 'error', icon: 'i-ph-warning-circle' })
154
- }
155
-
156
151
  /**
157
152
  * The identity is saved first: the plan change checks the plan's audience
158
153
  * against the stored customer type, and Stripe Checkout bills the customer
@@ -163,7 +158,11 @@ async function confirm(): Promise<void> {
163
158
  if (!plan) return
164
159
  hasTriedSubmit.value = true
165
160
  if (invalidFields.value.length > 0) {
166
- notifyError(t('saas.tenant_billing.billing_info.incomplete_toast'))
161
+ toast.add({
162
+ title: t('saas.tenant_billing.billing_info.incomplete_toast'),
163
+ color: 'warning',
164
+ icon: 'i-ph-warning-circle',
165
+ })
167
166
  return
168
167
  }
169
168
  isSubmitting.value = true
@@ -186,7 +185,7 @@ async function confirm(): Promise<void> {
186
185
  open.value = false
187
186
  return
188
187
  }
189
- notifyError(resolveApiError(error, 'saas.workspace.plan.change_error'))
188
+ presentError(error, { fallbackKey: 'saas.workspace.plan.change_error' })
190
189
  } finally {
191
190
  isSubmitting.value = false
192
191
  }
@@ -35,9 +35,8 @@ const MAX_INITIALS = 2
35
35
 
36
36
  const { $authFetch } = useAuthFetch()
37
37
  const { t, locale } = useI18n()
38
- const toast = useToast()
39
38
  const { confirm } = useConfirm()
40
- const { resolveApiError } = useApiErrorMessage()
39
+ const { presentError, resolveError } = useApiErrorPresenter()
41
40
 
42
41
  const targetId = computed(() => props.routeParams?.id ?? '')
43
42
  const baseUrl = computed(
@@ -63,7 +62,8 @@ const isLoading = computed(
63
62
  )
64
63
  const loadError = computed(() =>
65
64
  page.error.value
66
- ? resolveApiError(page.error.value, `${N}.error.load`)
65
+ ? (resolveError(page.error.value, { fallbackKey: `${N}.error.load` })
66
+ ?.message ?? '')
67
67
  : null,
68
68
  )
69
69
  const isSubmitting = ref(false)
@@ -120,11 +120,7 @@ async function submit(): Promise<void> {
120
120
  // The note is listed before the button comes back.
121
121
  await refreshPageBlocks()
122
122
  } catch (error) {
123
- toast.add({
124
- color: 'error',
125
- icon: 'i-ph-warning',
126
- title: resolveApiError(error, `${N}.error.create`),
127
- })
123
+ presentError(error, { fallbackKey: `${N}.error.create` })
128
124
  } finally {
129
125
  isSubmitting.value = false
130
126
  }
@@ -25,7 +25,7 @@ import type { PlanInterval } from '../composables/usePlanIntervalLabel'
25
25
  const SKELETON_CARDS = 3
26
26
 
27
27
  const { t } = useI18n()
28
- const { resolveApiError } = useApiErrorMessage()
28
+ const { resolveError } = useApiErrorPresenter()
29
29
  const config = useDmsRuntimeConfig()
30
30
  const saasConfig = config.public.dmsSaas as
31
31
  | DmsSaasPublicRuntimeConfig
@@ -41,7 +41,9 @@ const isLoading = computed(
41
41
  )
42
42
  const loadError = computed(() =>
43
43
  pricingRead.error.value
44
- ? resolveApiError(pricingRead.error.value, 'saas.public.pricing.load_error')
44
+ ? (resolveError(pricingRead.error.value, {
45
+ fallbackKey: 'saas.public.pricing.load_error',
46
+ })?.message ?? '')
45
47
  : null,
46
48
  )
47
49
  const interval = ref<PlanInterval>('month')
@@ -57,7 +57,6 @@ const { $authFetch } = useAuthFetch()
57
57
  const toast = useToast()
58
58
  const { t, locale } = useI18n()
59
59
  const { confirm } = useConfirm()
60
- const { resolveApiError } = useApiErrorMessage()
61
60
  const { formatMinorUnits } = useMoneyFormat()
62
61
  const billingStatus = useBillingStatus()
63
62
  const tenantPlan = useTenantPlan()
@@ -223,7 +222,10 @@ async function requestRefund(): Promise<void> {
223
222
  try {
224
223
  await submitRefund()
225
224
  } catch (error) {
226
- throw new Error(resolveApiError(error, `${KEY_PREFIX}.error`))
225
+ throw new ConfirmActionError(
226
+ { fallbackKey: `${KEY_PREFIX}.error` },
227
+ { cause: error },
228
+ )
227
229
  }
228
230
  },
229
231
  })
@@ -2,23 +2,18 @@
2
2
  import { computed, onMounted, ref, watch } from 'vue'
3
3
  import FormFieldRow from '../build/components/FormFieldRow.vue'
4
4
  import FormRows from '../build/components/FormRows.vue'
5
- import { readApiErrorKey } from '../composables/useApiErrorMessage'
5
+ import RetirePlanDiff from '../build/components/RetirePlanDiff.vue'
6
6
  import {
7
7
  type CatalogFeature,
8
8
  formatPlanAmount,
9
- isFeatureIncluded,
10
9
  PLAN_UNLIMITED,
11
10
  } from '../build/plan-catalog'
12
11
  import {
13
- changedFeatures,
14
12
  MIGRATIONS_PAGE_URL,
15
- type PlanChangeKind,
16
13
  RETIRE_ENDPOINT,
17
- type RetireFeatureChange,
18
14
  type RetireImpact,
19
15
  type RetirePlanSummary,
20
16
  type RetirePreparation,
21
- unchangedFeatureIds,
22
17
  } from '../build/plan-retire'
23
18
 
24
19
  interface PlanRowData {
@@ -36,20 +31,6 @@ const ROWS_PREVIEW = 4
36
31
  const CONFIRM_TEXT_FIELD = 'confirmText'
37
32
  const RETIRE_FAILED_KEY = 'saas.catalog.retire.failed'
38
33
 
39
- const KIND_ICONS: Record<PlanChangeKind, string> = {
40
- lost: 'i-ph-minus-circle',
41
- gained: 'i-ph-plus-circle',
42
- changed: 'i-ph-arrows-left-right',
43
- same: 'i-ph-equals',
44
- }
45
-
46
- const KIND_CLASSES: Record<PlanChangeKind, string> = {
47
- lost: 'text-error',
48
- gained: 'text-success',
49
- changed: 'text-info',
50
- same: 'text-muted',
51
- }
52
-
53
34
  const props = defineProps<{
54
35
  rowData?: PlanRowData
55
36
  onSuccessCallback?: () => void
@@ -60,8 +41,7 @@ const { $authFetch } = useAuthFetch()
60
41
  const planCatalog = usePlanCatalog()
61
42
  const { t, locale } = useI18n()
62
43
  const toast = useToast()
63
- const { processApiMessage } = useTranslation()
64
- const { formatFeatureValue } = usePlanFeatureFormat()
44
+ const { resolveError } = useApiErrorPresenter()
65
45
  const { statusView } = useSaasStatus()
66
46
 
67
47
  const planId = computed(() => props.rowData?._id ?? '')
@@ -91,9 +71,6 @@ const typedError = ref<string | null>(null)
91
71
 
92
72
  const plan = computed(() => impact.value?.plan)
93
73
  const planName = computed(() => plan.value?.name ?? props.rowData?.name ?? '')
94
- const featuresById = computed(
95
- () => new Map(features.value.map((feature) => [feature._id, feature])),
96
- )
97
74
  const shownRows = computed(() => {
98
75
  const rows = impact.value?.rows ?? []
99
76
  return showAllRows.value ? rows : rows.slice(0, ROWS_PREVIEW)
@@ -113,14 +90,6 @@ const canChooseTarget = computed(
113
90
  !impact.value.hasOpenMigration,
114
91
  )
115
92
  const isTypedMatch = computed(() => typed.value.trim() === plan.value?.slug)
116
- const changes = computed(() =>
117
- changedFeatures(preparation.value?.features ?? []),
118
- )
119
- const unchanged = computed(() =>
120
- unchangedFeatureIds(preparation.value?.features ?? [])
121
- .map((id) => featuresById.value.get(id)?.displayName)
122
- .filter((name): name is string => !!name),
123
- )
124
93
 
125
94
  const steps = computed(() =>
126
95
  [1, 2, 3].map((index) => ({
@@ -169,49 +138,21 @@ const targetItems = computed(() =>
169
138
  })),
170
139
  )
171
140
 
172
- function readValue(change: RetireFeatureChange, value: unknown): string {
173
- const feature = featuresById.value.get(change.featureId)
174
- if (
175
- !feature ||
176
- feature.valueType === 'boolean' ||
177
- !isFeatureIncluded(value)
178
- ) {
179
- return isFeatureIncluded(value)
180
- ? t('saas.catalog.retire.included')
181
- : t('saas.catalog.retire.not_included')
182
- }
183
- return formatFeatureValue({ ...feature, featureId: feature._id }, value)
184
- }
185
-
186
- function featureName(featureId: string): string {
187
- return featuresById.value.get(featureId)?.displayName ?? featureId
188
- }
189
-
190
- function memberCap(value: number): string {
191
- return value === PLAN_UNLIMITED ? t('saas.catalog.plans.unlimited') : String(value)
192
- }
193
-
194
141
  async function loadImpact(): Promise<void> {
195
142
  isLoading.value = true
196
143
  loadError.value = null
197
144
  try {
198
- const [loaded] = await Promise.all([
199
- impactRead.read(),
200
- planCatalog,
201
- ])
145
+ const [loaded] = await Promise.all([impactRead.read(), planCatalog])
202
146
  impact.value = loaded
203
147
  features.value = planCatalog.data.value?.features ?? []
204
148
  } catch (error) {
205
- loadError.value = processApiMessage(readError(error))
149
+ loadError.value =
150
+ resolveError(error, { fallbackKey: RETIRE_FAILED_KEY })?.message ?? null
206
151
  } finally {
207
152
  isLoading.value = false
208
153
  }
209
154
  }
210
155
 
211
- function readError(error: unknown): string {
212
- return readApiErrorKey(error) ?? RETIRE_FAILED_KEY
213
- }
214
-
215
156
  async function prepare(): Promise<void> {
216
157
  if (!targetPlanId.value) return
217
158
  isPreparing.value = true
@@ -220,7 +161,8 @@ async function prepare(): Promise<void> {
220
161
  preparation.value = await preparationRead.read()
221
162
  } catch (error) {
222
163
  preparation.value = null
223
- prepareError.value = processApiMessage(readError(error))
164
+ prepareError.value =
165
+ resolveError(error, { fallbackKey: RETIRE_FAILED_KEY })?.message ?? null
224
166
  } finally {
225
167
  isPreparing.value = false
226
168
  }
@@ -261,7 +203,8 @@ async function retire(): Promise<void> {
261
203
  props.onSuccessCallback?.()
262
204
  await navigateDms(`${MIGRATIONS_PAGE_URL}/${response.migrationId}`)
263
205
  } catch (error) {
264
- const message = processApiMessage(readError(error))
206
+ const message =
207
+ resolveError(error, { fallbackKey: RETIRE_FAILED_KEY })?.message ?? null
265
208
  if (isTypedRefusal(error)) typedError.value = message
266
209
  else submitError.value = message
267
210
  } finally {
@@ -550,105 +493,13 @@ onMounted(loadImpact)
550
493
  :title="prepareError"
551
494
  @retry="prepare"
552
495
  />
553
- <DmsCard v-else-if="preparation && target" :padded="false">
554
- <div
555
- class="border-default flex items-center justify-between border-b px-4 py-2.5"
556
- >
557
- <span class="text-muted text-xs font-semibold uppercase">
558
- {{ $t('saas.catalog.retire.diff_title') }}
559
- </span>
560
- <span class="text-dimmed text-xs">
561
- {{ plan.name }} → {{ target.name }}
562
- </span>
563
- </div>
564
- <ul class="divide-default divide-y text-sm">
565
- <li
566
- v-for="change in changes"
567
- :key="change.featureId"
568
- class="flex items-center gap-2 px-4 py-2"
569
- >
570
- <UIcon
571
- :name="KIND_ICONS[change.kind]"
572
- class="size-4 shrink-0"
573
- :class="KIND_CLASSES[change.kind]"
574
- />
575
- <span class="min-w-0 flex-1 truncate">
576
- {{ featureName(change.featureId) }}
577
- </span>
578
- <span class="text-muted text-xs">
579
- {{ readValue(change, change.from) }} →
580
- <b class="text-default">
581
- {{ readValue(change, change.to) }}
582
- </b>
583
- </span>
584
- </li>
585
- <li
586
- v-if="preparation.members.kind !== 'same'"
587
- class="flex flex-wrap items-center gap-2 px-4 py-2"
588
- >
589
- <UIcon
590
- :name="KIND_ICONS[preparation.members.kind]"
591
- class="size-4 shrink-0"
592
- :class="KIND_CLASSES[preparation.members.kind]"
593
- />
594
- <span class="flex-1">
595
- {{ $t('saas.catalog.retire.members') }}
596
- </span>
597
- <span class="text-muted text-xs tabular-nums">
598
- {{ memberCap(preparation.members.from) }} →
599
- <b class="text-default">
600
- {{ memberCap(preparation.members.to) }}
601
- </b>
602
- </span>
603
- <small
604
- v-if="preparation.members.above > 0"
605
- class="text-warning w-full pl-6 text-xs"
606
- >
607
- {{
608
- $t(
609
- 'saas.catalog.retire.above_cap',
610
- {
611
- count: preparation.members.above,
612
- cap: preparation.members.to,
613
- },
614
- preparation.members.above,
615
- )
616
- }}
617
- </small>
618
- </li>
619
- <li
620
- v-if="preparation.permissions.length > 0"
621
- class="flex items-center gap-2 px-4 py-2"
622
- >
623
- <UIcon name="i-ph-key" class="text-info size-4 shrink-0" />
624
- <span class="flex-1">
625
- {{
626
- $t('saas.catalog.retire.permissions_changed', {
627
- added: preparation.permissions.filter(
628
- (row) => row.kind === 'gained',
629
- ).length,
630
- removed: preparation.permissions.filter(
631
- (row) => row.kind === 'lost',
632
- ).length,
633
- })
634
- }}
635
- </span>
636
- </li>
637
- <li
638
- v-if="unchanged.length > 0"
639
- class="text-muted flex items-center gap-2 px-4 py-2"
640
- >
641
- <UIcon :name="KIND_ICONS.same" class="size-4 shrink-0" />
642
- <span class="flex-1">
643
- {{
644
- $t('saas.catalog.retire.unchanged', {
645
- names: unchanged.join(', '),
646
- })
647
- }}
648
- </span>
649
- </li>
650
- </ul>
651
- </DmsCard>
496
+ <RetirePlanDiff
497
+ v-else-if="preparation && target"
498
+ :preparation="preparation"
499
+ :features="features"
500
+ :plan-name="plan.name"
501
+ :target-name="target.name"
502
+ />
652
503
  <p v-else class="text-muted text-sm">
653
504
  {{ $t('saas.catalog.retire.pick_target') }}
654
505
  </p>
@@ -22,7 +22,7 @@ const DRAFT_FIELDS: (keyof BillingIdentityDraft)[] = [
22
22
 
23
23
  const toast = useToast()
24
24
  const { t, locale } = useI18n()
25
- const { resolveApiError } = useApiErrorMessage()
25
+ const { presentError } = useApiErrorPresenter()
26
26
  const identity = useBillingIdentity()
27
27
  const info = useBillingInfo()
28
28
  const { data: billingStatus } = useBillingStatus()
@@ -81,7 +81,7 @@ async function save(): Promise<void> {
81
81
  if (invalidFields.value.length > 0) {
82
82
  toast.add({
83
83
  title: t(`${KEY_PREFIX}.incomplete_toast`),
84
- color: 'error',
84
+ color: 'warning',
85
85
  icon: 'i-ph-warning-circle',
86
86
  })
87
87
  return
@@ -95,11 +95,7 @@ async function save(): Promise<void> {
95
95
  icon: 'i-ph-check-circle',
96
96
  })
97
97
  } catch (error) {
98
- toast.add({
99
- title: resolveApiError(error, `${KEY_PREFIX}.save_error`),
100
- color: 'error',
101
- icon: 'i-ph-warning-circle',
102
- })
98
+ presentError(error, { fallbackKey: `${KEY_PREFIX}.save_error` })
103
99
  } finally {
104
100
  isSaving.value = false
105
101
  }