# Launch plan: production, Premium switch, trial (Oct–Nov 2026)

Agreed with the product owner on 21 Oct 2026, revised the same day. Peak season for scheduling tools runs mid October to
mid December, so the release goes out now, in two steps that keep the new UI's risk and the new Premium rules apart:

1. **Deploy** (Sun 25 Oct): only Beta accounts see the new UI. Everybody else, new sign-ups included, stays in classic
   and notices nothing, except on polls that only the new UI runs (course planner, waitlist) when a Beta owner invites
   them. No "try the new kulibri" button in the app or on the website.
2. **Day X** (when we trust the new UI; at the earliest about a week after the deploy, planned around Sun 8 Nov): the
   Premium switch goes on and the new UI opens to everybody, together with the new website and an e-mail to all admins.

## Timeline

| When | What | Who |
|---|---|---|
| Wed 21 – Sat 24 Oct | Build the musts below; test locally every day; the test server is updated regularly | product owner + Claude; Mitko updates test |
| **Sun 25 Oct** | **Production deploy**, Premium switch **off**, design switch for Beta accounts only | Mitko |
| from Mon 26 Oct | Real users test: the Beta accounts. Fix what they report; build what Day X needs | all |
| next week | New website finished (product owner); it goes online on Day X | product owner |
| **Day X** (≈ 8 Nov, set when we trust the new UI) | Premium switch on, trial and dialog live, "try the new kulibri" for everyone, new website, new users start in the new UI, e-mail to admins | all |
| Day X + 14 days | First trials end, still in peak season | – |

Prices: 36 € a year applies to new customers since August 2026 (announced to active admins in May, together with "one
or another" tightening of the free limits). Existing Premium customers keep their price until their renewal. Nothing
about prices changes on Day X.

## Before the production deploy (musts)

1. **Premium switch** (`KULIBRI_PREMIUM_2026`, off). **Built 21 Oct 2026** on `feat/premium-switch`; Mitko to review the server part. Covers exactly the four rules decided on 8 Oct, which were free on
   production (checked against release 2.1.3, 24 Sep: no Premium check on Excel or messages in classic, no 402 in
   `PollController`):
   - hidden mode: switching it on (polls that have it keep it either way),
   - Excel export,
   - invitations through kulibri: 100 free while off (classic's old limit), 50 while on,
   - messages to participants.

   Off means: the server does not refuse them, and both UIs show no Premium mark, no lock and list them under "always
   free" on the membership page and in the Premium dialog. The UIs learn the switch from the server (embedded
   `kulibri-ui-config`). Everything else in `docs/premium.md` stays as it is: it was Premium in classic already, or it is a
   new feature (waitlist, deadline per course date, course planner).
2. **Design switch for Beta only** (plan 7.11, `KULIBRI_UI_SWITCH_FOR_ALL`, off). **Built 21 Oct 2026** on
   `feat/beta-only-switch`. Only Beta and Admin accounts see "Neues kulibri | Klassisch" and the menu entries; others
   keep classic and do not notice the new UI, except where a poll needs it (course planner, waitlist, a Beta owner's
   poll mode, whose one-off link stays the owner's choice). Whoever already chose the new UI (account or cookie) keeps
   the switch as a way back. New sign-ups start in classic (`KULIBRI_UI_DEFAULT=legacy`). The rule is one function for
   both UIs (`designSwitchOpen` in `frontend/src/services/uiVersion.js`); the server only hands the flag over
   (`switchForAll` in `kulibri-ui-config`) and serves a visitor's choice either way.
3. **Merge `feat/course-v3-only`**: the course planner only in the new UI. Done 21 Oct 2026.
4. **Release check on test** with the production settings (below) and the smoke test.

## Production settings and deploy steps

- Deploy `master` after merging `vue3-redesign` into it. The jump is large: release 2.1.x (Sept) to today, 317 commits,
  backend included (security fixes SEC-0xx, invoices and billing profile, membership flow, waitlist, archive per user, the bring list
  for Alpha and Admin).
- **Database backup first**, then `php artisan migrate`. New since the production build of 22 Sep (to be confirmed with
  `php artisan migrate:status`):
  `2026_09_17_080000` description nullable, `2026_09_17_080100` ensure default design, `2026_09_17_120000` ui_version on
  users, `2026_09_23_090000` committed_at on preferences (backfills from participants), `2026_09_23_093000` options to text,
  `2026_10_03_090000` billing profiles, `2026_10_03_090100` issuing data on invoices, `2026_10_08_090000` poll user archive,
  `2026_10_16_090000` waitlist switch, `2026_10_17_090000` email challenges, `2026_10_23_090000` bring list fields
  (tasks.unit, tasks.sort, resources.amount), `2026_10_23_120000` tasks.created_by_participant_id (both additive; the bring
  list itself is for Alpha and Admin accounts only, docs/bring-list.md).
- `.env`: `KULIBRI_UI_V3_ENABLED=true`, `KULIBRI_UI_DEFAULT=legacy`, `KULIBRI_UI_SWITCH_FOR_ALL=false`,
  `KULIBRI_PREMIUM_2026=false`; then
  `php artisan config:cache`.
- Build both frontends (classic and `frontend-v3`). `public/images` and the `storage` link must stay in place.
- **Old invoices** (customer report, 22 Oct 2026): invoices from before 2 Oct recorded no amount and show the current
  price of membership 5, which was raised in place from 24 € to 36 €, so every older invoice shows 36 €. After the
  migrations, record what Mollie actually charged:
  1. `php artisan invoices:record-amounts` (dry run: a table of every invoice, what it shows now and what was paid);
  2. check the table, then `php artisan invoices:record-amounts --apply`;
  3. invoices of membership 5 that Mollie cannot match are filled by the date of the price change
     (`config/invoices.php` `price_change`: 24.00 gross before 15 Sep 2026, the current 36.00 from then on; the same rule
     `InvoiceIssuer` uses for a payment of unknown amount). The dry run lists them with the source "price change".
     `--price-change=YYYY-MM-DD --old-gross=24.00` replace the date and the old price of the rule. Invoices of another
     membership that Mollie cannot match stay unresolved.
     Only invoices of a subscription with the status "paid" get an amount: invoices of a checkout that was started and
     left (status open, failed, expired; 25 of 374 in the copy of 6 Oct, for example invoice 190) are listed as "not paid"
     and stay without an amount; what to do with them (cancel, hide) is open. An invoice without a start date is dated
     by when it was created.
  It fills only invoices without amounts and never overwrites one. Both UIs then show the recorded amounts (classic
  `shared/invoiceAmounts.js`, new UI `utils/invoice.ts`). **Do not run `mollie:sync-invoices`** without checking it
  first: it deletes invoices that have no `payment_id` ("stray"), and on production that is almost all of them (10 of
  384 have one in the local copy). An invoice must never be deleted, only cancelled.
- Kill switch: `KULIBRI_UI_V3_ENABLED=false` serves everything classic again, course planners and waitlists included
  (classic does not know waitlist entries: an emergency measure only).
- No code rollback (product owner, 21 Oct 2026; Mitko to confirm): testing the previous release on the new schema
  would take a full test round. Instead: the database backup before the deploy; the kill switch for problems of the new
  UI; server bugs fixed forward. The backup is restored only in a disaster, and loses everything since the deploy. The
  migrations look additive (new tables and columns, `options` widened to text), which is not verified.

## Smoke test on production (after the deploy)

- Logged out: a classic poll link opens classic; no design switch; sign-in works.
- A non-Beta account: dashboard classic, no switch; Excel export, messages and 60 invitations work (switch off).
- A new sign-up: classic, no switch.
- A Beta account: switch visible; the new UI's dashboard, a date poll, a guest list, a course planner.
- Mollie: a payment from the new UI returns to its "Mein Account" tab.
- `X-Kulibri-UI` / `X-Kulibri-UI-Reason` headers on a course planner: `v3` / `poll-course`.

## Between the deploy and Day X (to build)

1. **14-day Premium trial** (backend, Mitko): own account only, once per account, fixed end date, the role taken away
   at the end (reuse the job for cancelled memberships), no payment data. The old `start-trial` was removed in SEC-011
   because it gave a paid plan to any user id; the new one must not repeat that.
2. **Paywall dialog** in both UIs, where a free owner meets a Premium rule: "14 Tage kostenlos testen", "Premium für
   36 € im Jahr". The story (investment, no ads, data protection in Germany, therefore a few functions are Premium now)
   only for accounts created before Day X: they had these functions for free. Accounts created later get the same
   dialog without the "now". Draft first, on the design canvas.
3. **"Neues kulibri mit deinen Daten ausprobieren"** for every account, in classic (a button or banner) and on the
   membership page; it sets `users.ui_version` to v3 through the existing `PUT` of the UI version. Hidden until Day X
   by `KULIBRI_UI_SWITCH_FOR_ALL` (built with the Beta-only switch), so it goes live with one setting.
4. **New sign-ups start in the new UI** from Day X: store `ui_version = v3` on registration (small backend change,
   Mitko), behind `KULIBRI_UI_SWITCH_FOR_ALL`. Not `KULIBRI_UI_DEFAULT=v3`: that would move every existing account without a choice of
   its own, and every logged-out participant, to the new UI at once.
5. **E-mail to all admins** (product owner's text; two versions): active admins (what is new, the new Premium rules,
   the trial) and lapsed admins (the main target: win them back with the new kulibri). Needs: the two recipient lists
   with a clear "active" cut-off (agreed: a poll in the last 12 months), the newsletter consent and unsubscribe link
   (`NewsletterService`), sending in batches. This is a campaign, not one of the server's e-mail texts, which still
   come last.
6. **Card change and failed renewals** (backend, Mitko; with the trial, product owner 21 Oct 2026). Today a Mollie
   subscription is bound to the mandate of the first payment (`CheckAndCreateSubscription::createSubscription`,
   `mandateId`); when a renewal fails (an expired card) we mark it failed, mail the team and cancel at the end date, but
   the customer hears nothing and cannot add a new card. In the local copy of production (early Oct 2026): 112 active
   paid subscriptions, 13 failed renewals in twelve months. Mollie has no hosted "change card" page; the usual way is a
   new first payment (a new mandate) and then updating the subscription's mandate through the API.
   - "Zahlungsmethode ändern" on the account page (both UIs): a first payment with the new card, then the subscription
     moves to the new mandate (check in Mollie's docs whether 0 € works for cards or a small amount is needed).
   - On a failed renewal: a mail to the customer with that link, about 14 days of grace with one reminder before
     Premium is taken away (today: cancelled at the end date).
   - 30 days before the card expires (the mandate carries the expiry date): a mail with the link.
   - Optional: SEPA direct debit as a payment method (its mandate does not expire).
   The mails are new texts, like the trial reminder (item 7).
   Until it is built, a customer who asks gets the two steps by hand (Mitko: first payment link, then the mandate).
7. Counting: how often the rule is met, the trial started, the new UI chosen, Premium bought.
8. Open: the trial reminder mail (about three days before the trial ends: "your trial ends on …, how to go on") is a
   new e-mail text, and e-mail texts were to be done in the last step; decide whether that one goes earlier.

Day X itself: agreed criterion, a week without a serious bug from the Beta.

## After the deploy: invoices as PDF (product owner, 22 Oct 2026)

Invoices have to be kept unchanged for ten years (GoBD). Today an invoice is rendered on every view from the database and
no file is kept; until 2 Oct it even took the current price.
1. **New invoices:** a PDF is created when the invoice is issued (`InvoiceIssuer`), stored outside `public/`, attached to
   the payment confirmation mail, and offered for download in "Mein Account" (both UIs). It needs a PDF library
   (none in the project yet, for example `barryvdh/laravel-dompdf`).
2. **Old invoices:** create their PDFs once, after `invoices:record-amounts` has recorded the paid amounts.
3. **Invoice numbers (product owner, 27 Oct 2026, built on `feat/invoice-numbers`):** `KU-<year>-<series>-<number>`, e.g.
   `KU-2026-P-1234`; series P premium, S cancellation/correction, E single unlock (reserved). One counter per year and
   series (`invoice_number_counters`, row lock), start value per series in `config/invoices.php` (`INVOICE_START_*`,
   default 1234), `invoices.number` UNIQUE. A number is given once, never reused; an issued invoice is never changed: a
   correction is a new invoice in series S with the negated amounts and `corrects_invoice_id`
   (`php artisan invoices:cancel <number|key|id>`). Amounts are the Mollie payment's (an older subscription renews at its
   old price), recorded at issue; the issue date and the year of the number are the day the payment was paid. Old invoices keep their "Kaufbelegnummer" (`key`), no renumbering; under 250 EUR they
   need no running number (product owner). The numbers `KU-2026-NNNNN` given since the production deploy of 26 Oct stay
   valid. `mollie:sync-invoices` no longer deletes invoices and issues numbers and amounts like the payment code.
4. **Earlier question for the tax adviser (settled, see 3):** the invoices before 2 Oct carry only the "Kaufbelegnummer", a random piece of a UUID
   (`substr(Str::uuid(), 2, 19)`, for example `3d6b12-32ae-4069-aa`), with no order, no year and no unique index in the
   database. § 14 UStG asks for a number that is unique and part of a running series. Since 2 Oct new invoices get
   `KU-<year>-NNNNN`. Ask whether the old ones may keep their key or need numbers, and whether invoices are cancelled
   and reissued for that.

## After the deploy: feedback and analyses (product owner, 24 Oct 2026)

Feedback stored and tied to the account, the feedback button in classic too, then an admin view "Feedback" with each
account's polls beside it, in the new UI for kulibri admins only. Plan and stages: `docs/feedback-analytics.md`.

## On Day X

`KULIBRI_PREMIUM_2026=true` and `KULIBRI_UI_SWITCH_FOR_ALL=true`, `php artisan config:cache`;
new website online; send the admin e-mail after the check. Check on production with a free account: the four rules
(402, the dialog with the trial), the "try" button, a new sign-up lands in the new UI.
