v0.2.6 calendar-anniversary billing

This commit is contained in:
local
2026-05-11 23:02:57 -05:00
parent 45c8462fa2
commit cd377683fb
5 changed files with 153 additions and 22 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ const inputSpec = InputSpec.of({
pro_monthly: Value.number({
name: 'Pro — Monthly Credits',
description:
'Total credits a Pro user gets each calendar month. Resets on the 1st. Default 50.',
'Total credits a Pro user gets each billing period. Renewals are calendar-anniversary based: a user who first activates on the 17th renews on the 17th of every following month (clamps to the last day for shorter months — e.g. Jan 31 → Feb 28/29 → Mar 31). Default 50.',
required: true,
default: 50,
min: 0,
+3 -2
View File
@@ -6,8 +6,9 @@ import { v_0_2_2 } from './v0.2.2'
import { v_0_2_3 } from './v0.2.3'
import { v_0_2_4 } from './v0.2.4'
import { v_0_2_5 } from './v0.2.5'
import { v_0_2_6 } from './v0.2.6'
export const versionGraph = VersionGraph.of({
current: v_0_2_5,
other: [v_0_2_4, v_0_2_3, v_0_2_2, v_0_2_1, v_0_2_0, v_0_1_0],
current: v_0_2_6,
other: [v_0_2_5, v_0_2_4, v_0_2_3, v_0_2_2, v_0_2_1, v_0_2_0, v_0_1_0],
})
+19
View File
@@ -0,0 +1,19 @@
import { VersionInfo } from '@start9labs/start-sdk'
import { configFile } from '../file-models/config.json'
export const v_0_2_6 = VersionInfo.of({
version: '0.2.6:0',
releaseNotes: {
en_US:
'Calendar-anniversary billing replaces calendar-month resets. A user who first activates on the 17th now renews on the 17th of every subsequent month (clamps to last day for shorter months — Jan 31 → Feb 28/29 → Mar 31, standard Stripe-style edge-case handling). Pre-existing credit rows migrate transparently on startup. The admin dashboard JSON now surfaces last_renewal_at + anniversary_day so you can audit when each install renews.',
},
migrations: {
// No config-side migration needed — the ledger migrates itself
// when initCredits() runs on first boot of this version. Rows
// with the legacy { month: "YYYY-MM" } shape get a
// last_renewal_at anchored at the first of that month so they
// don't unexpectedly re-issue credits.
up: async ({ effects }) => {},
down: async ({ effects }) => {},
},
})