feat(store): set trial_ends_at on tenant create #10

Merged
sharang merged 1 commits from feat/m12.1-trial-ends into main 2026-05-19 16:27:09 +00:00
Owner

What

CreateTenant now sets:

  • trial_ends_at = NOW() + 14 days for customer-kind tenants (default).
  • status = 'demo', trial_ends_at = NULL for demo-kind tenants.

Both Memory and Postgres stores updated; eachStore harness asserts the
window for customer kind and the absence for demo.

Why

Unblocks the M12.1 portal trial banner — it needs a real countdown date.
Currently every signup landed in status='trial' with NULL trial_ends_at, so
the banner couldn't compute time-left.

Risk

Existing trial tenants in dev DBs are unaffected (they keep their NULL
trial_ends_at unless re-created). M12.2's lifecycle cron is the right
place to backfill if it ever matters; for dev it doesn't.

Refs: M4.1 follow-up + M12.1 prep

## What `CreateTenant` now sets: - `trial_ends_at = NOW() + 14 days` for customer-kind tenants (default). - `status = 'demo'`, `trial_ends_at = NULL` for demo-kind tenants. Both Memory and Postgres stores updated; eachStore harness asserts the window for customer kind and the absence for demo. ## Why Unblocks the M12.1 portal trial banner — it needs a real countdown date. Currently every signup landed in status='trial' with NULL trial_ends_at, so the banner couldn't compute time-left. ## Risk Existing trial tenants in dev DBs are unaffected (they keep their NULL trial_ends_at unless re-created). M12.2's lifecycle cron is the right place to backfill if it ever matters; for dev it doesn't. Refs: M4.1 follow-up + M12.1 prep
sharang added 1 commit 2026-05-19 16:18:26 +00:00
feat(store): set trial_ends_at on tenant create
ci / image (pull_request) Has been skipped
ci / shared (pull_request) Successful in 7s
ci / test (pull_request) Successful in 1m55s
ad0b2ef949
CreateTenant now defaults trial_ends_at to NOW() + 14 days when the
new tenant lands in status='trial'. Demo-kind tenants get
status='demo' (per PLATFORM_ARCHITECTURE.md §5d) and trial_ends_at
stays NULL — those flow through the M13.2 demo-provisioning path.

Both store implementations (Memory + Postgres) updated; tests assert
the 14-day window for customers and the absent end for demo kind.

Unblocks M12.1 (portal trial banner can render a real countdown).

Refs: M4.1 + M12.1
CODEOWNERS rules requested review from Benjamin_Boenisch 2026-05-19 16:18:26 +00:00
sharang merged commit 8fa1a1bffd into main 2026-05-19 16:27:09 +00:00
sharang deleted branch feat/m12.1-trial-ends 2026-05-19 16:27:10 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/tenant-registry#10