Commit 8f65b96
fix(billing): make forced plan overrides indefinite so the expiry cron can't undo them
forceTenantPlanChange created its manual override row with a +1 month
current_period_end, which put it squarely in the path of the
expire-platform-subscriptions cron (#471): the school would get renewal
reminders for a payment it never requested, then be silently downgraded
back to free a month later. The reactivation branch had the same bug via
a stale period end on a previously-canceled row.
Every cron phase filters on `.not('current_period_end', 'is', null)`, so
a NULL period end is the natural "indefinite override" marker: the row is
never reminded, never lapses, never auto-downgrades. Keep a real period
only when reactivating a sub already on a live paid cycle; a school that
later pays via confirmManualPayment upserts a dated cycle over the row.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HveVmDShzscMQVQdd9LuDZ1 parent 31805d3 commit 8f65b96
1 file changed
Lines changed: 35 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
248 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
249 | 258 | | |
250 | 259 | | |
251 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
252 | 273 | | |
253 | 274 | | |
254 | 275 | | |
255 | 276 | | |
256 | | - | |
257 | | - | |
258 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
259 | 285 | | |
260 | 286 | | |
261 | 287 | | |
| |||
264 | 290 | | |
265 | 291 | | |
266 | 292 | | |
267 | | - | |
268 | | - | |
| 293 | + | |
| 294 | + | |
269 | 295 | | |
270 | 296 | | |
271 | 297 | | |
| |||
0 commit comments