@antelopejs/dms-saas 0.7.3 → 0.8.0

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 (172) hide show
  1. package/README.md +2 -2
  2. package/dist/auth/owner-only-permissions-resolver.js +3 -2
  3. package/dist/auth/owner-only-permissions-resolver.js.map +1 -1
  4. package/dist/auth/plan-permissions-resolver.js +6 -3
  5. package/dist/auth/plan-permissions-resolver.js.map +1 -1
  6. package/dist/billing-state/directory.d.ts +2 -0
  7. package/dist/billing-state/directory.js +48 -3
  8. package/dist/billing-state/directory.js.map +1 -1
  9. package/dist/billing-state/past-due-banner.js +2 -0
  10. package/dist/billing-state/past-due-banner.js.map +1 -1
  11. package/dist/billing-state/recovery.js +4 -0
  12. package/dist/billing-state/recovery.js.map +1 -1
  13. package/dist/billing-state/trial-ending-banner.js +1 -0
  14. package/dist/billing-state/trial-ending-banner.js.map +1 -1
  15. package/dist/config/runtime.d.ts +2 -2
  16. package/dist/config/runtime.js +12 -4
  17. package/dist/config/runtime.js.map +1 -1
  18. package/dist/data-api/platformOwner/plans.d.ts +2 -0
  19. package/dist/data-api/platformOwner/plans.js +16 -0
  20. package/dist/data-api/platformOwner/plans.js.map +1 -1
  21. package/dist/frontend-module.d.ts +3 -0
  22. package/dist/frontend-module.js +29 -0
  23. package/dist/frontend-module.js.map +1 -0
  24. package/dist/implementations/dms-saas/billing.d.ts +2 -1
  25. package/dist/implementations/dms-saas/billing.js +15 -0
  26. package/dist/implementations/dms-saas/billing.js.map +1 -1
  27. package/dist/implementations/dms-saas/invoice-line-items.d.ts +2 -2
  28. package/dist/implementations/dms-saas/invoice-line-items.js +6 -6
  29. package/dist/implementations/dms-saas/invoice-line-items.js.map +1 -1
  30. package/dist/index.js +2 -19
  31. package/dist/index.js.map +1 -1
  32. package/dist/invoice-line-items/billing-window.d.ts +6 -2
  33. package/dist/invoice-line-items/billing-window.js.map +1 -1
  34. package/dist/invoice-line-items/recovery/admission.js +2 -5
  35. package/dist/invoice-line-items/recovery/admission.js.map +1 -1
  36. package/dist/invoice-line-items/recovery/process.d.ts +1 -0
  37. package/dist/invoice-line-items/recovery/process.js +119 -47
  38. package/dist/invoice-line-items/recovery/process.js.map +1 -1
  39. package/dist/invoice-line-items/recovery/task.model.js +1 -1
  40. package/dist/invoice-line-items/recovery/task.model.js.map +1 -1
  41. package/dist/invoice-line-items/recovery/task.table.d.ts +2 -2
  42. package/dist/invoice-line-items/recovery/task.table.js +3 -4
  43. package/dist/invoice-line-items/recovery/task.table.js.map +1 -1
  44. package/dist/metrics/revenue.d.ts +15 -3
  45. package/dist/metrics/revenue.js +58 -12
  46. package/dist/metrics/revenue.js.map +1 -1
  47. package/dist/operator-actions/previews.d.ts +1 -1
  48. package/dist/operator-actions/previews.js +13 -6
  49. package/dist/operator-actions/previews.js.map +1 -1
  50. package/dist/pages/platform/dashboard.d.ts +1 -1
  51. package/dist/pages/platform/dashboard.js +13 -10
  52. package/dist/pages/platform/dashboard.js.map +1 -1
  53. package/dist/pages/platform/plans/edit.js +4 -0
  54. package/dist/pages/platform/plans/edit.js.map +1 -1
  55. package/dist/pages/platform/plans/index.js +4 -0
  56. package/dist/pages/platform/plans/index.js.map +1 -1
  57. package/dist/pages/platform/plans/migrations.d.ts +1 -0
  58. package/dist/pages/platform/plans/migrations.js +3 -0
  59. package/dist/pages/platform/plans/migrations.js.map +1 -1
  60. package/dist/pages/platform/segments/edit.js +1 -0
  61. package/dist/pages/platform/segments/edit.js.map +1 -1
  62. package/dist/pages/platform/workspaces/index.js +1 -4
  63. package/dist/pages/platform/workspaces/index.js.map +1 -1
  64. package/dist/pages/tenant/billing.js +1 -2
  65. package/dist/pages/tenant/billing.js.map +1 -1
  66. package/dist/plans/catalogue-summary.d.ts +1 -0
  67. package/dist/plans/catalogue-summary.js +10 -4
  68. package/dist/plans/catalogue-summary.js.map +1 -1
  69. package/dist/plans/catalogue-usage.js +4 -2
  70. package/dist/plans/catalogue-usage.js.map +1 -1
  71. package/dist/plans/plan-audience.d.ts +1 -0
  72. package/dist/plans/plan-audience.js +4 -0
  73. package/dist/plans/plan-audience.js.map +1 -1
  74. package/dist/plans/plan-write.d.ts +9 -3
  75. package/dist/plans/plan-write.js +27 -1
  76. package/dist/plans/plan-write.js.map +1 -1
  77. package/dist/plans/seat-hooks.js +25 -16
  78. package/dist/plans/seat-hooks.js.map +1 -1
  79. package/dist/plans/stripe-sync.js +11 -3
  80. package/dist/plans/stripe-sync.js.map +1 -1
  81. package/dist/routes/platformOwner/credit-notes-issue.js +18 -12
  82. package/dist/routes/platformOwner/credit-notes-issue.js.map +1 -1
  83. package/dist/routes/platformOwner/dashboard.d.ts +4 -8
  84. package/dist/routes/platformOwner/dashboard.js +9 -28
  85. package/dist/routes/platformOwner/dashboard.js.map +1 -1
  86. package/dist/routes/platformOwner/plan-dialogs.js +2 -1
  87. package/dist/routes/platformOwner/plan-dialogs.js.map +1 -1
  88. package/dist/routes/platformOwner/plans.d.ts +5 -26
  89. package/dist/routes/platformOwner/plans.js +48 -18
  90. package/dist/routes/platformOwner/plans.js.map +1 -1
  91. package/dist/routes/platformOwner/workspace-detail.js +4 -2
  92. package/dist/routes/platformOwner/workspace-detail.js.map +1 -1
  93. package/dist/routes/platformOwner/workspace-operator-actions.js +6 -1
  94. package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -1
  95. package/dist/routes/platformOwner/workspaces-admin.d.ts +1 -1
  96. package/dist/routes/platformOwner/workspaces-admin.js +15 -7
  97. package/dist/routes/platformOwner/workspaces-admin.js.map +1 -1
  98. package/dist/routes/public/public-plan-catalog.js +3 -2
  99. package/dist/routes/public/public-plan-catalog.js.map +1 -1
  100. package/dist/routes/public/register.js +6 -5
  101. package/dist/routes/public/register.js.map +1 -1
  102. package/dist/routes/tenant/billing-portal.js +1 -1
  103. package/dist/routes/tenant/billing-portal.js.map +1 -1
  104. package/dist/routes/tenant/tenant-plan-checkout.js +4 -4
  105. package/dist/routes/tenant/tenant-plan-checkout.js.map +1 -1
  106. package/dist/routes/tenant/tenant-plan-resubscription.js +2 -1
  107. package/dist/routes/tenant/tenant-plan-resubscription.js.map +1 -1
  108. package/dist/routes/tenant/tenant-plan.d.ts +0 -1
  109. package/dist/routes/tenant/tenant-plan.js +20 -20
  110. package/dist/routes/tenant/tenant-plan.js.map +1 -1
  111. package/dist/routes/tenant/workspaces.d.ts +1 -1
  112. package/dist/routes/tenant/workspaces.js +13 -8
  113. package/dist/routes/tenant/workspaces.js.map +1 -1
  114. package/dist/stripe/availability.d.ts +5 -0
  115. package/dist/stripe/availability.js +43 -0
  116. package/dist/stripe/availability.js.map +1 -0
  117. package/dist/stripe/customer-billing.js +2 -0
  118. package/dist/stripe/customer-billing.js.map +1 -1
  119. package/dist/stripe/customer-locale.d.ts +3 -0
  120. package/dist/stripe/customer-locale.js +11 -0
  121. package/dist/stripe/customer-locale.js.map +1 -1
  122. package/dist/stripe/index.d.ts +1 -0
  123. package/dist/stripe/index.js +1 -0
  124. package/dist/stripe/index.js.map +1 -1
  125. package/dist/stripe/payload-shapes.d.ts +6 -0
  126. package/dist/stripe/payload-shapes.js +13 -0
  127. package/dist/stripe/payload-shapes.js.map +1 -1
  128. package/dist/stripe/subscription-cancellation.js +2 -0
  129. package/dist/stripe/subscription-cancellation.js.map +1 -1
  130. package/dist/stripe/sync-plan.js +8 -7
  131. package/dist/stripe/sync-plan.js.map +1 -1
  132. package/dist/stripe/webhook-checkout.js +1 -1
  133. package/dist/stripe/webhook-checkout.js.map +1 -1
  134. package/dist/stripe/webhook-handlers.js +5 -3
  135. package/dist/stripe/webhook-handlers.js.map +1 -1
  136. package/dist/utils/segment-matching.d.ts +4 -3
  137. package/dist/utils/segment-matching.js +29 -13
  138. package/dist/utils/segment-matching.js.map +1 -1
  139. package/dist/workspaces/provisioning.d.ts +0 -1
  140. package/dist/workspaces/provisioning.js +3 -6
  141. package/dist/workspaces/provisioning.js.map +1 -1
  142. package/dist/workspaces/self-serve-creation.d.ts +2 -2
  143. package/dist/workspaces/self-serve-creation.js +12 -6
  144. package/dist/workspaces/self-serve-creation.js.map +1 -1
  145. package/frontend-vue/app/build/period-range.ts +57 -0
  146. package/frontend-vue/app/build/plan-catalog.ts +2 -0
  147. package/frontend-vue/app/build/public/RegistrationPlanCard.vue +1 -2
  148. package/frontend-vue/app/components/BillingIdentityFields.vue +64 -76
  149. package/frontend-vue/app/components/PlanCard.vue +14 -2
  150. package/frontend-vue/app/components/PlanCardPublic.vue +1 -2
  151. package/frontend-vue/app/components/PlanEditorPreview.vue +26 -12
  152. package/frontend-vue/app/components/PlanUpgradeModal.vue +45 -3
  153. package/frontend-vue/app/components/TenantBillingForm.vue +2 -0
  154. package/frontend-vue/app/components/TenantPlanCard.vue +1 -2
  155. package/frontend-vue/app/components/WorkspaceCreateModal.vue +1 -2
  156. package/frontend-vue/app/composables/useBillingAddress.ts +108 -0
  157. package/frontend-vue/app/composables/useBillingCountries.ts +3 -69
  158. package/frontend-vue/app/composables/useBillingIdentity.ts +7 -5
  159. package/frontend-vue/app/composables/usePlanChangeReview.ts +21 -0
  160. package/frontend-vue/app/plugins/billing-data-types.ts +6 -13
  161. package/frontend-vue/i18n/locales/saas-en-GB.json +4 -0
  162. package/frontend-vue/i18n/locales/saas-fr-FR.json +4 -0
  163. package/frontend-vue/i18n/locales/saas-operator-catalog-en-GB.json +9 -2
  164. package/frontend-vue/i18n/locales/saas-operator-catalog-fr-FR.json +9 -2
  165. package/frontend-vue/i18n/locales/saas-operator-workspaces-en-GB.json +7 -2
  166. package/frontend-vue/i18n/locales/saas-operator-workspaces-fr-FR.json +7 -2
  167. package/frontend-vue/i18n/locales/saas-tenant-billing-en-GB.json +5 -7
  168. package/frontend-vue/i18n/locales/saas-tenant-billing-fr-FR.json +5 -7
  169. package/frontend-vue/package.json +1 -1
  170. package/package.json +7 -6
  171. package/skills/dms-saas/SKILL.md +22 -2
  172. package/frontend-vue/app/composables/usePlanDescription.ts +0 -12
@@ -1 +1 @@
1
- {"version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** Builds the `Intl.DateTimeFormat` a period is written with. */
2
+ export type DateFormatFactory = (
3
+ locale: string,
4
+ options: Intl.DateTimeFormatOptions,
5
+ ) => Intl.DateTimeFormat
6
+
7
+ const RANGE_FORMAT: Intl.DateTimeFormatOptions = {
8
+ day: 'numeric',
9
+ month: 'short',
10
+ }
11
+ const RANGE_FORMAT_WITH_YEAR: Intl.DateTimeFormatOptions = {
12
+ ...RANGE_FORMAT,
13
+ year: 'numeric',
14
+ }
15
+ const YEAR_FORMAT: Intl.DateTimeFormatOptions = { year: 'numeric' }
16
+
17
+ /**
18
+ * Thin and narrow no-break spaces. Recent ICU data (Node 24) puts thin spaces
19
+ * around a range's dash ("15 oct. – 15 nov.") where a browser's
20
+ * older data puts plain ones, so a server-rendered period would not hydrate.
21
+ */
22
+ const ICU_SPACES = /[  ]/g
23
+
24
+ const intlFormat: DateFormatFactory = (locale, options) =>
25
+ new Intl.DateTimeFormat(locale, options)
26
+
27
+ /**
28
+ * "Sep 29 – Oct 28", with the years once the period spans two; a lone start
29
+ * when the end is unknown. Written the same by every ICU version, so a server
30
+ * render and the browser agree.
31
+ *
32
+ * @param createFormat Builds the formatters; the console passes the one that
33
+ * applies the reader's time zone, so the year test runs in that zone too
34
+ */
35
+ export function formatPeriodRange(
36
+ from: Date,
37
+ to: Date | null,
38
+ locale: string,
39
+ createFormat: DateFormatFactory = intlFormat,
40
+ ): string {
41
+ const text = to
42
+ ? formatRange(from, to, locale, createFormat)
43
+ : createFormat(locale, RANGE_FORMAT).format(from)
44
+ return text.replace(ICU_SPACES, ' ')
45
+ }
46
+
47
+ function formatRange(
48
+ from: Date,
49
+ to: Date,
50
+ locale: string,
51
+ createFormat: DateFormatFactory,
52
+ ): string {
53
+ const year = createFormat(locale, YEAR_FORMAT)
54
+ const isSameYear = year.format(from) === year.format(to)
55
+ const format = isSameYear ? RANGE_FORMAT : RANGE_FORMAT_WITH_YEAR
56
+ return createFormat(locale, format).formatRange(from, to)
57
+ }
@@ -27,6 +27,8 @@ export interface CatalogPlanRow {
27
27
  resolvedFeatures: CatalogFeatureValue[]
28
28
  stripeProductId: string | null
29
29
  stripeProductUrl: string | null
30
+ /** Priced, but holding no Stripe price: it cannot be subscribed to. */
31
+ isMissingStripePrice: boolean
30
32
  updatedAt: string | null
31
33
  }
32
34
 
@@ -33,7 +33,6 @@ const MAX_HIGHLIGHTS = 4
33
33
  const { priceLabel } = usePublicPlanFormat()
34
34
  const { formatFeatureValue } = usePlanFeatureFormat()
35
35
  const { processI18n } = useTranslation()
36
- const planDescription = usePlanDescription()
37
36
 
38
37
  const highlights = computed(() => {
39
38
  const summary = props.summary
@@ -89,7 +88,7 @@ const highlights = computed(() => {
89
88
  v-if="isDetailed && summary.plan.description"
90
89
  class="text-muted text-xs"
91
90
  >
92
- {{ planDescription(summary.plan.description) }}
91
+ {{ summary.plan.description }}
93
92
  </p>
94
93
  <ul
95
94
  v-if="highlights.length"
@@ -1,20 +1,14 @@
1
1
  <script setup lang="ts">
2
- import { type FunctionalComponent, computed, resolveComponent } from 'vue'
2
+ import {
3
+ type FunctionalComponent,
4
+ computed,
5
+ ref,
6
+ resolveComponent,
7
+ watch,
8
+ } from 'vue'
3
9
  import FormFieldRow from '../build/components/FormFieldRow.vue'
4
10
  import FormRows from '../build/components/FormRows.vue'
5
11
 
6
- type AddressField = Extract<
7
- BillingIdentityField,
8
- 'line1' | 'postalCode' | 'city'
9
- >
10
-
11
- interface AddressFieldRow {
12
- id: AddressField
13
- /** Key of the label, under the billing info texts. */
14
- label: string
15
- autocomplete: string
16
- }
17
-
18
12
  /** The props of a group: a titled row of the card, or a stretch of rows. */
19
13
  interface GroupBindings {
20
14
  label?: string
@@ -55,25 +49,23 @@ const VAT_BADGE_TONES: Record<VatVerificationStatus, VatBadgeTone> = {
55
49
  unverified: 'warning',
56
50
  }
57
51
  const KEY_PREFIX = 'saas.tenant_billing.billing_info'
58
- const STREET_FIELD: AddressFieldRow = {
59
- id: 'line1',
60
- label: 'address_line1',
61
- autocomplete: 'address-line1',
62
- }
63
- const LOCALITY_FIELDS: AddressFieldRow[] = [
64
- { id: 'postalCode', label: 'postal_code', autocomplete: 'postal-code' },
65
- { id: 'city', label: 'city', autocomplete: 'address-level2' },
52
+ /** The required fields the address input holds, in its order. */
53
+ const ADDRESS_FIELDS: BillingIdentityField[] = [
54
+ 'line1',
55
+ 'postalCode',
56
+ 'city',
57
+ 'country',
66
58
  ]
59
+ /** The DMS address input's street search (its default geocoder). */
60
+ const ADDRESS_AUTOCOMPLETE = { enabled: true }
67
61
  // Compact, the groups follow each other as one list of rows: a hairline
68
62
  // above each group but the first, as between its rows.
69
63
  const COMPACT_GROUP_CLASS = 'border-muted border-t first:border-t-0'
70
64
 
71
65
  // Side by side once the row has room, as the settings design pairs fields
72
- // (company name and VAT number; postal code, city and country).
66
+ // (company name and VAT number).
73
67
  const CLUSTER_CLASS = '@container'
74
68
  const PAIR_GRID_CLASS = 'grid gap-3 @min-[420px]:grid-cols-2'
75
- const TRIPLE_GRID_CLASS =
76
- 'grid gap-3 @min-[420px]:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_minmax(0,1.4fr)]'
77
69
 
78
70
  // Literal, so the build resolves the DMS field row at compile time.
79
71
  const DmsFieldRowComponent = resolveComponent('DmsFieldRow')
@@ -90,22 +82,55 @@ const clusterWrapper = computed(() =>
90
82
  props.sectioned ? 'div' : SlotPassthrough,
91
83
  )
92
84
 
93
- const { countryItems } = useBillingCountries()
94
- const { t } = useI18n()
85
+ const { t, locale } = useI18n()
95
86
 
96
87
  const isBusiness = computed(() => draft.value.customerType === 'business')
97
- const countryLabel = computed(
98
- () =>
99
- countryItems.value.find((item) => item.value === draft.value.country)
100
- ?.label ?? '',
88
+ const countryLabel = computed(() =>
89
+ draft.value.country
90
+ ? formatBillingCountry(draft.value.country, locale.value)
91
+ : '',
101
92
  )
102
93
 
94
+ // The address input edits its own value, the street split in parts; the
95
+ // draft keeps the stored street line. Its value is read back from the draft
96
+ // only when the draft changed from elsewhere (loaded, discarded): re-split
97
+ // as the user types, a number typed in the street box would jump to the
98
+ // number box under the cursor.
99
+ const address = ref<AddressInputValue>(toAddressInputValue(draft.value))
100
+
101
+ function hasDraftAddress(next: BillingAddressDraft): boolean {
102
+ return (Object.keys(next) as (keyof BillingAddressDraft)[]).every(
103
+ (field) => next[field] === draft.value[field],
104
+ )
105
+ }
106
+
107
+ function updateAddress(value: AddressInputValue | null | undefined): void {
108
+ if (!value) return
109
+ address.value = value
110
+ draft.value = {
111
+ ...draft.value,
112
+ ...fromAddressInputValue(value, draft.value),
113
+ }
114
+ }
115
+
116
+ watch(draft, () => {
117
+ if (hasDraftAddress(fromAddressInputValue(address.value, draft.value)))
118
+ return
119
+ address.value = toAddressInputValue(draft.value)
120
+ })
121
+
103
122
  function fieldError(field: BillingIdentityField): string | undefined {
104
123
  return props.invalidFields?.includes(field)
105
124
  ? t(`${KEY_PREFIX}.errors.${field}`)
106
125
  : undefined
107
126
  }
108
127
 
128
+ /** Every missing part of the address, one message each. */
129
+ const addressError = computed(() => {
130
+ const messages = ADDRESS_FIELDS.map(fieldError).filter(Boolean)
131
+ return messages.length > 0 ? messages.join(' ') : undefined
132
+ })
133
+
109
134
  function selectCustomerType(customerType: CustomerType): void {
110
135
  if (props.isLocked) return
111
136
  draft.value = { ...draft.value, customerType }
@@ -228,61 +253,24 @@ function cluster(className: string): ClusterBindings {
228
253
 
229
254
  <component :is="groupWrapper" v-bind="group('address')">
230
255
  <FormFieldRow
231
- :label="$t(`${KEY_PREFIX}.${STREET_FIELD.label}`)"
232
- :error="fieldError(STREET_FIELD.id)"
256
+ :label="sectioned ? undefined : $t(`${KEY_PREFIX}.sections.address.title`)"
257
+ :description="
258
+ sectioned ? undefined : $t(`${KEY_PREFIX}.sections.address.description`)
259
+ "
260
+ :error="addressError"
233
261
  :stacked="sectioned"
234
262
  required
235
263
  >
236
264
  <template #default="{ id }">
237
- <DmsInputText
265
+ <DmsInputAddress
238
266
  :id="id"
239
- v-model="draft[STREET_FIELD.id]"
240
- :autocomplete="STREET_FIELD.autocomplete"
267
+ :model-value="address"
268
+ :autocomplete="ADDRESS_AUTOCOMPLETE"
241
269
  :disabled="isLocked"
242
- class="w-full"
270
+ @update:model-value="updateAddress"
243
271
  />
244
272
  </template>
245
273
  </FormFieldRow>
246
- <component :is="clusterWrapper" v-bind="cluster(CLUSTER_CLASS)">
247
- <component :is="clusterWrapper" v-bind="cluster(TRIPLE_GRID_CLASS)">
248
- <FormFieldRow
249
- v-for="field in LOCALITY_FIELDS"
250
- :key="field.id"
251
- :label="$t(`${KEY_PREFIX}.${field.label}`)"
252
- :error="fieldError(field.id)"
253
- :stacked="sectioned"
254
- required
255
- >
256
- <template #default="{ id }">
257
- <DmsInputText
258
- :id="id"
259
- v-model="draft[field.id]"
260
- :autocomplete="field.autocomplete"
261
- :disabled="isLocked"
262
- class="w-full"
263
- />
264
- </template>
265
- </FormFieldRow>
266
- <FormFieldRow
267
- :label="$t(`${KEY_PREFIX}.country`)"
268
- :error="fieldError('country')"
269
- :stacked="sectioned"
270
- required
271
- >
272
- <template #default="{ id }">
273
- <USelectMenu
274
- :id="id"
275
- v-model="draft.country"
276
- :items="countryItems"
277
- value-key="value"
278
- :disabled="isLocked"
279
- :placeholder="$t(`${KEY_PREFIX}.country_placeholder`)"
280
- class="w-full"
281
- />
282
- </template>
283
- </FormFieldRow>
284
- </component>
285
- </component>
286
274
  </component>
287
275
 
288
276
  <component :is="groupWrapper" v-bind="group('email')">
@@ -42,7 +42,6 @@ const props = withDefaults(
42
42
 
43
43
  const { t, locale } = useI18n()
44
44
  const { processI18n } = useTranslation()
45
- const planDescription = usePlanDescription()
46
45
  const { formatFeatureValue } = usePlanFeatureFormat()
47
46
  const catalog = usePlanCatalog()
48
47
 
@@ -263,6 +262,19 @@ function toggleSale(): void {
263
262
  >
264
263
  {{ plan.borderLabel }}
265
264
  </UBadge>
265
+ <UTooltip
266
+ v-if="plan.isMissingStripePrice"
267
+ :text="$t('saas.catalog.plans.card.not_on_stripe_hint')"
268
+ >
269
+ <UBadge
270
+ size="sm"
271
+ variant="soft"
272
+ color="warning"
273
+ icon="i-ph-warning"
274
+ >
275
+ {{ $t('saas.catalog.plans.card.not_on_stripe') }}
276
+ </UBadge>
277
+ </UTooltip>
266
278
  </div>
267
279
  <p class="text-muted text-xs">{{ subtitle }}</p>
268
280
  </div>
@@ -275,7 +287,7 @@ function toggleSale(): void {
275
287
  </div>
276
288
 
277
289
  <p v-if="plan.description" class="text-muted line-clamp-2 text-sm">
278
- {{ planDescription(plan.description) }}
290
+ {{ plan.description }}
279
291
  </p>
280
292
 
281
293
  <div>
@@ -26,7 +26,6 @@ const props = withDefaults(defineProps<PlanCardPublicProps>(), {
26
26
 
27
27
  const { t } = useI18n()
28
28
  const { priceLabel, seatExampleLabel, termsLabel } = usePublicPlanFormat()
29
- const planDescription = usePlanDescription()
30
29
  const { formatFeatureValue } = usePlanFeatureFormat()
31
30
  const { processI18n } = useTranslation()
32
31
 
@@ -86,7 +85,7 @@ const accentStyle = computed(() =>
86
85
  <header class="pr-16">
87
86
  <h2 class="text-highlighted text-base font-semibold">{{ plan.name }}</h2>
88
87
  <p v-if="plan.description" class="text-muted mt-1 text-[13px]">
89
- {{ planDescription(plan.description) }}
88
+ {{ plan.description }}
90
89
  </p>
91
90
  </header>
92
91
 
@@ -16,17 +16,20 @@ interface PlanAccess {
16
16
  extraFeatures: Record<string, unknown>
17
17
  }
18
18
 
19
+ /** A plan text as the editor holds it: one value per locale. */
20
+ type PlanText = Record<string, string>
21
+
19
22
  /** The plan fields the preview reads, saved or as typed. */
20
23
  interface PlanDraft {
21
- name?: string
22
- description?: string
24
+ name?: PlanText | null
25
+ description?: PlanText | null
23
26
  price?: number
24
27
  currency?: string
25
28
  interval?: 'month' | 'year'
26
29
  billingMode?: 'flat' | 'seat'
27
30
  trialDays?: number
28
31
  maxMembers?: number
29
- borderLabel?: string | null
32
+ borderLabel?: PlanText | null
30
33
  borderColor?: string | null
31
34
  inheritance?: PlanAccess | null
32
35
  }
@@ -51,7 +54,7 @@ const SYNC_TONES: Record<SyncState, 'success' | 'warning' | 'neutral'> = {
51
54
  synced: 'success',
52
55
  out_of_sync: 'warning',
53
56
  off_stripe: 'neutral',
54
- not_configured: 'neutral',
57
+ not_configured: 'warning',
55
58
  }
56
59
 
57
60
  const props = defineProps<{
@@ -66,8 +69,10 @@ const EMPTY_CATALOG: PlanCatalog = {
66
69
  newPlanPermissions: [],
67
70
  }
68
71
 
72
+ // Locale the server reads a plan text in when the reader's has none.
73
+ const PLAN_FALLBACK_LOCALE = 'en'
74
+
69
75
  const { t, locale } = useI18n()
70
- const planDescription = usePlanDescription()
71
76
  const { formatFeatureValue } = usePlanFeatureFormat()
72
77
 
73
78
  const planId = computed(() => props.routeParams?.id)
@@ -99,6 +104,15 @@ const isLoading = computed(
99
104
  (!planCatalog.data.value || reads.some((read) => read.pending.value)),
100
105
  )
101
106
  const draft = computed<PlanDraft>(() => live.value ?? saved.value ?? {})
107
+
108
+ /** A plan text as the cards show it: the reader's locale, else the fallback one. */
109
+ function textOf(value: PlanText | null | undefined): string {
110
+ return value?.[locale.value] || value?.[PLAN_FALLBACK_LOCALE] || ''
111
+ }
112
+
113
+ const name = computed(() => textOf(draft.value.name))
114
+ const description = computed(() => textOf(draft.value.description))
115
+ const badge = computed(() => textOf(draft.value.borderLabel))
102
116
  const currency = computed(() => draft.value.currency ?? 'EUR')
103
117
  const price = computed(() => Number(draft.value.price ?? 0))
104
118
  const interval = computed(() => draft.value.interval ?? 'month')
@@ -132,7 +146,7 @@ const terms = computed(() => {
132
146
  const cta = computed(() =>
133
147
  trialDays.value > 0
134
148
  ? t('saas.catalog.editor.preview.start_trial')
135
- : t('saas.catalog.editor.preview.choose', { name: draft.value.name || '' }),
149
+ : t('saas.catalog.editor.preview.choose', { name: name.value }),
136
150
  )
137
151
 
138
152
  const resolvedFeatures = computed(() => {
@@ -232,13 +246,13 @@ async function load(): Promise<void> {
232
246
  v-else
233
247
  class="border-default relative flex flex-col gap-3 rounded-xl border p-4"
234
248
  :style="
235
- draft.borderLabel
249
+ badge
236
250
  ? { borderColor: draft.borderColor || undefined }
237
251
  : undefined
238
252
  "
239
253
  >
240
254
  <UBadge
241
- v-if="draft.borderLabel"
255
+ v-if="badge"
242
256
  class="absolute -top-2.5 left-4"
243
257
  size="sm"
244
258
  icon="i-ph-star"
@@ -248,14 +262,14 @@ async function load(): Promise<void> {
248
262
  : undefined
249
263
  "
250
264
  >
251
- {{ draft.borderLabel }}
265
+ {{ badge }}
252
266
  </UBadge>
253
267
  <div>
254
268
  <p class="text-highlighted text-lg font-semibold">
255
- {{ draft.name || $t('saas.catalog.editor.preview.unnamed') }}
269
+ {{ name || $t('saas.catalog.editor.preview.unnamed') }}
256
270
  </p>
257
- <p v-if="draft.description" class="text-muted line-clamp-2 text-sm">
258
- {{ planDescription(draft.description) }}
271
+ <p v-if="description" class="text-muted line-clamp-2 text-sm">
272
+ {{ description }}
259
273
  </p>
260
274
  </div>
261
275
  <div>
@@ -2,6 +2,7 @@
2
2
  import { computed, ref, watch } from 'vue'
3
3
  import { SENTENCE_DAY_FORMAT } from '../build/day-formats'
4
4
  import { checkoutHeadingCase } from '../build/plan-change-heading'
5
+ import { canContinueToCheckout } from '../composables/usePlanChangeReview'
5
6
 
6
7
  const props = defineProps<{
7
8
  plan: OfferedPlanView | null
@@ -38,6 +39,9 @@ const loadFailed = ref(false)
38
39
  const isSubmitting = ref(false)
39
40
  const preview = ref<PlanChangePreview | null>(null)
40
41
  const isPricing = ref(false)
42
+ // A refused preview (a plan Stripe does not bill yet, Stripe unreachable)
43
+ // would be refused again at checkout: say why, and offer no payment.
44
+ const previewFailure = ref<string | null>(null)
41
45
  let pricingTimer: ReturnType<typeof setTimeout> | null = null
42
46
 
43
47
  const currency = computed(() => preview.value?.currency ?? props.plan?.currency)
@@ -72,6 +76,14 @@ const headingParams = computed(() => ({
72
76
  date: firstChargeOn.value ?? '',
73
77
  }))
74
78
 
79
+ const canContinue = computed(() =>
80
+ canContinueToCheckout({
81
+ isLoading: isLoading.value,
82
+ hasLoadFailed: loadFailed.value,
83
+ previewFailure: previewFailure.value,
84
+ }),
85
+ )
86
+
75
87
  const dueToday = computed(() => {
76
88
  if (isTrial.value) return formatMinorUnits(0, currency.value)
77
89
  return charge.value
@@ -98,8 +110,13 @@ async function price(): Promise<void> {
98
110
  isPricing.value = true
99
111
  try {
100
112
  preview.value = await previewChange(plan._id, draft.value.country || null)
101
- } catch {
113
+ previewFailure.value = null
114
+ } catch (error) {
102
115
  preview.value = null
116
+ previewFailure.value = resolveApiError(
117
+ error,
118
+ `${KEY_PREFIX}.preview_failed`,
119
+ )
103
120
  } finally {
104
121
  isPricing.value = false
105
122
  }
@@ -118,6 +135,7 @@ watch(
118
135
  async (isOpen) => {
119
136
  if (!isOpen) return
120
137
  preview.value = null
138
+ previewFailure.value = null
121
139
  await loadIdentity()
122
140
  void price()
123
141
  },
@@ -261,12 +279,36 @@ async function confirm(): Promise<void> {
261
279
  })
262
280
  }}
263
281
  </p>
264
- <p v-else-if="!charge && !isPricing" class="text-muted">
282
+ <p
283
+ v-else-if="!charge && !isPricing && !previewFailure"
284
+ class="text-muted"
285
+ >
265
286
  {{ $t(`${KEY_PREFIX}.tax_on_stripe`) }}
266
287
  </p>
267
288
  </div>
268
289
  </DmsCard>
269
290
 
291
+ <UAlert
292
+ v-if="previewFailure"
293
+ color="error"
294
+ variant="subtle"
295
+ icon="i-ph-warning-circle"
296
+ :title="previewFailure"
297
+ >
298
+ <template #actions>
299
+ <UButton
300
+ color="error"
301
+ variant="soft"
302
+ size="xs"
303
+ icon="i-ph-arrow-clockwise"
304
+ :loading="isPricing"
305
+ @click="price"
306
+ >
307
+ {{ $t('saas.common.retry') }}
308
+ </UButton>
309
+ </template>
310
+ </UAlert>
311
+
270
312
  <p class="text-muted flex items-center gap-2 text-sm">
271
313
  <UIcon name="i-ph-lock-simple" />
272
314
  {{ $t(`${KEY_PREFIX}.card_note`) }}
@@ -285,7 +327,7 @@ async function confirm(): Promise<void> {
285
327
  color="primary"
286
328
  icon="i-ph-lock-simple"
287
329
  :loading="isSubmitting"
288
- :disabled="isLoading || loadFailed"
330
+ :disabled="!canContinue"
289
331
  >
290
332
  {{ $t(`${KEY_PREFIX}.confirm`) }}
291
333
  </UButton>
@@ -12,8 +12,10 @@ const DRAFT_FIELDS: (keyof BillingIdentityDraft)[] = [
12
12
  'companyName',
13
13
  'vatNumber',
14
14
  'line1',
15
+ 'line2',
15
16
  'postalCode',
16
17
  'city',
18
+ 'state',
17
19
  'country',
18
20
  'billingEmail',
19
21
  ]
@@ -29,7 +29,6 @@ const billingStatus = useBillingStatus()
29
29
  const nextInvoice = useNextInvoice()
30
30
  const { formatMajorUnits, formatMinorUnits } = useMoneyFormat()
31
31
  const { statusView } = useSaasStatus()
32
- const planDescription = usePlanDescription()
33
32
  const { formatFeatureValue } = usePlanFeatureFormat()
34
33
  const comparison = usePlanComparison()
35
34
  const { consumeCancelledCheckout } = usePendingCheckout()
@@ -98,7 +97,7 @@ const pill = computed(() => {
98
97
 
99
98
  const summary = computed(() => {
100
99
  if (current.value?.description)
101
- return planDescription(current.value.description)
100
+ return current.value.description
102
101
  const view = data.value?.available.find(
103
102
  (plan) => plan._id === current.value?._id,
104
103
  )
@@ -69,7 +69,6 @@ const { resolveApiError } = useApiErrorMessage()
69
69
  const { formatMajorUnits } = useMoneyFormat()
70
70
  const planPriceLabel = usePlanPriceLabel()
71
71
  const planIntervalLabel = usePlanIntervalLabel(`${KEYS}.interval`)
72
- const planDescription = usePlanDescription()
73
72
  const config = useDmsRuntimeConfig()
74
73
  const { user } = useCurrentUser()
75
74
 
@@ -141,7 +140,7 @@ function planMeta(plan: CreatePlanOption): string {
141
140
  rule.limit,
142
141
  )
143
142
  }
144
- const parts = [planDescription(plan.description)].filter(Boolean)
143
+ const parts = [plan.description].filter(Boolean)
145
144
  if (plan.trialDays > 0 && plan.cardRequirement === 'payment') {
146
145
  parts.push(t(`${KEYS}.trial`, { days: plan.trialDays }))
147
146
  }