CluPilotCloud/app/Console/Commands
nexxo 34874adec3
tests / pest (push) Failing after 8m6s Details
tests / assets (push) Successful in 21s Details
tests / release (push) Has been skipped Details
Apply a bought plan change instead of only pricing it
PlanChange could say what a move would cost and whether it was allowed, and
that was all it could do. Billing::purchase() wrote an upgrade order and
nothing ever consumed it: same snapshot, same machine, same quota. A customer
could pay for a bigger package and receive nothing.

ApplyPlanChange is now the single place a change lands — it moves the contract
onto the target's current version, writes one register row, settles the custom
domain, and starts a run that resizes the machine. Applying the same order
twice is a no-op, enforced by a unique event key rather than by a check two
callers could both pass.

Two things a plan change must not do, and now does not. A disk is never shrunk
— Proxmox cannot, so the QUOTA shrinks instead, which is what was sold anyway.
And a live machine is never rebooted as a side effect: cores and RAM are
written, and where they need a restart the instance says so where an operator
and the customer can both see it.

The storage allowance also joins the build pipeline. ApplyStorageQuota was
written for plan changes and ran only there, so a brand-new customer still got
no quota at all — quota_gb reached the instance row and stopped, and every
package delivered the whole disk. The test guarding that pipeline only counted
its steps, which is how a list missing the one step that makes a package's
storage real stayed green for its whole life. It now names the step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 17:18:55 +02:00
..
ApplyDuePlanChanges.php Apply a bought plan change instead of only pricing it 2026-07-29 17:18:55 +02:00
ArchiveUnexportedInvoices.php Let the export have as many destinations as somebody wants 2026-07-29 02:43:15 +02:00
AutoUpdate.php Update on a schedule if the owner wants one, and say where incidents go 2026-07-29 15:01:54 +02:00
CheckDnsZone.php Put customer instances on their own domain, and say which domains are ours 2026-07-29 16:03:13 +02:00
CheckPlanCatalogue.php feat(billing): the plan catalogue becomes three tables, and config stops selling 2026-07-26 12:05:56 +02:00
ConsoleAccess.php Make the private hostnames look like nothing is there, and close the way past the proxy 2026-07-27 11:26:48 +02:00
CreateAdmin.php Check users directly for the reverse operator-identity collision, not just customers 2026-07-28 15:36:29 +02:00
PruneExportFolders.php Let a destination say how it is laid out and how long anything stays 2026-07-29 03:08:27 +02:00
PruneHostDns.php Move host DNS names off the public zone into vpn-dns's internal hostsdir 2026-07-28 23:44:31 +02:00
SampleServiceStatus.php Rebuild the status page as a status page 2026-07-29 12:45:18 +02:00
SyncStripeCatalogue.php feat(billing): Stripe owns the billing cycle, we own capability 2026-07-26 13:36:28 +02:00
VerifyCustomDomains.php Serve the custom domain, not just announce it 2026-07-29 16:44:52 +02:00