feat(store): set trial_ends_at on tenant create #10
Reference in New Issue
Block a user
Delete Branch "feat/m12.1-trial-ends"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
CreateTenantnow sets:trial_ends_at = NOW() + 14 daysfor customer-kind tenants (default).status = 'demo',trial_ends_at = NULLfor 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