diff --git a/apps/api/src/controllers/webhook.controller.ts b/apps/api/src/controllers/webhook.controller.ts index 401e45aca..694003e51 100644 --- a/apps/api/src/controllers/webhook.controller.ts +++ b/apps/api/src/controllers/webhook.controller.ts @@ -148,6 +148,7 @@ const TRACKED_SUBSCRIPTION_FIELDS = [ 'subscriptionPeriodEventsLimit', 'subscriptionPauseAtPeriodEnd', 'subscriptionResumesAt', + 'subscriptionFirstStartedAt', ] as const; const CANCELLATION_REASONS = [ @@ -302,6 +303,12 @@ async function syncSubscriptionToOrg( subscriptionCancelComment: data.customerCancellationComment ?? null, subscriptionPauseAtPeriodEnd: data.pauseAtPeriodEnd, subscriptionResumesAt: data.resumesAt, + // Stable tenure anchor: keep the stored value while the subscription id is + // unchanged; a new subscription (re-subscribe) restarts tenure. + subscriptionFirstStartedAt: + organization.subscriptionId === data.id + ? (organization.subscriptionFirstStartedAt ?? data.createdAt) + : data.createdAt, subscriptionPeriodEventsLimit, subscriptionPeriodEventsCountExceededAt: typeof subscriptionPeriodEventsLimit === 'number' && diff --git a/apps/public/src/app/(home)/_sections/pricing.tsx b/apps/public/src/app/(home)/_sections/pricing.tsx index 10669f851..476e18467 100644 --- a/apps/public/src/app/(home)/_sections/pricing.tsx +++ b/apps/public/src/app/(home)/_sections/pricing.tsx @@ -79,6 +79,9 @@ export function Pricing() { + VAT if applicable + + Pay yearly and get 2 months free + > ) : (