Bill the startup fee on both routes to a plan, and record negotiated terms

FeatureBillingService
Shipped
September 5, 2026 at 2:11 AM UTC
Author
Kamo
Commit
948325a

Two routes reach the same plan and only one of them was going to charge the new per-seat startup fee. A sales-written order bills through SubscriptionService, which never touches Stripe; self-serve checkout goes straight to a Checkout Session and would have charged nobody who signed up themselves. The same plan would have cost different money depending on how it was bought, so the fee gets a non-recurring Stripe price and a line item, skipped when an agreement waives it and skipped rather than fatal when no price exists yet — a missing price must not stop a customer subscribing, and a fee is recoverable on an invoice in a way an abandoned checkout is not. The agreements API is platform-admin only and deliberately so: an agreement moves money in the customer's favour against the published list, which is Kamo's decision and not the customer owner's. Nothing deletes — withdrawing deactivates and keeps the row, because an invoice raised while it was live has to stay explicable. Two ways of recording one wrong are refused outright: a FLAT agreement with no amount prices at zero and reads as a waiver nobody agreed to, and an agreement edited through the wrong organization's page re-prices someone who was never part of the conversation. The DDL is by hand, as the COMP scripts beside it were: InitializerService is not deployed, Hibernate does not re-issue a CHECK on an existing table, and setup_fee_model is deliberately nullable so no existing plan's onboarding charge is multiplied by a default nobody chose.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing