Skip to content

feat(portal): apply the launch discount to orders with hosting - #622

Merged
devantler merged 3 commits into
mainfrom
claude/portal-launch-discount
Nov 16, 2026
Merged

devantler merged 3 commits into
mainfrom
claude/portal-launch-discount

Conversation

@devantler

@devantler devantler commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The maintainer's launch offer: 25% off the one-time price for the first 50 customers who order with hosting. Hosting keeps its full price. This PR makes the portal apply it, behind the existing order gates.

Stacked on #625 (new prices and the launchDiscount block in offerings.json). Review only this PR's commits. This PR makes offeringCatalogue.LaunchDiscount a pointer, so tests can switch the offer off. It also validates the block at load and points #625's drift assertion at the published value. CI fails TestProposalGeneratedVersionSavesWithoutTyping until #625 updates that test to its new app prices.

Rules (confirmed by the parent session)

  • One place per customer. A client takes at most one place, with their first order that has both a one-time and a monthly price. Only that order is discounted, by percent of its one-time price rounded to whole kroner.
  • Places are never reused. A withdrawn or ended order keeps its place, and the retention purge removes only who held it. The place number stays, so "the first 50" stays literally true.
  • Race-safe. The order takes its place in the transaction that inserts it, under a transaction-scoped advisory lock, so two orders never take the same place. A unique place number is a second guard (portal_launch_places, migration v24). The 50th order gets the discount and the 51st doesn't.
  • No silent price change. The order stores the discounted one-time price, so invoices, card payments, funding, withdrawals and settlements use it unchanged. The order form carries whether it showed the discount. If the last place went in between, the order is refused, and the receipt shows the full price with the reason.
  • Shown as its own line. The shared proposal, the order summary before the button and the receipt show the discount as a separate line, with the offer's sentence. The Numina and Stripe lines carry the discounted unit price and name the full price and the discount, e.g. … — normalpris 6000 DKK, lanceringsrabat 25 % −1500 DKK. A unit price that already includes the discount is valid on a Danish invoice, so the maintainer needs no Stripe coupon or negative Numina line. The confirmation email names it, and the operator's page shows the place number.
  • The portal refuses to start with any appliesTo other than setup, or requiresHosting other than true.

Tests

TestLaunch*:

  • the discount arithmetic and catalogue validation;
  • the 50th place: order, mail, receipt, operator page and Numina line, plus one place per customer with places left;
  • the 51st customer at full price;
  • the place going between display and order;
  • a second order waiting on the advisory lock, then finding no place;
  • the card path, where hosting stays at full price.

Mutation checks are load-bearing: removing the lock, the limit, the per-customer check or the changed-price refusal each fails its test.

The other tests run with the offer off (init in launch_test.go), so their prices stay as written. The full Go suite passes: all four cohorts, contactintegration and contacttrialintegration. golangci-lint, vet, gofmt, jscpd and cspell are clean.

Part of #21

🤖 Generated with Claude Code

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for launch discount: one place per client under an advisory lock, discounted one-time price stored on the order, refusal when the last place went before ordering, invoice and Stripe line text

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T01:31:46.568720Z e357d88 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97f8b61daf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread server/internal/identity/launch.go Resolved
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 1.56s
✅ CSS stylelint 1 0 0 0 1.36s
✅ GO golangci-lint yes yes no no 147.55s
✅ GO revive 185 0 0 1.08s
✅ HTML djlint 5 0 0 2.29s
✅ HTML htmlhint 5 0 0 0.37s
✅ JSON jsonlint 2 0 0 0.11s
✅ JSON prettier 2 0 0 0 0.64s
✅ JSON v8r 2 0 0 1.21s
✅ MARKDOWN markdownlint 17 0 0 0 2.02s
✅ MARKDOWN markdown-table-formatter 17 0 0 0 0.3s
✅ REPOSITORY betterleaks yes no no 0.84s
✅ REPOSITORY checkov yes no no 20.41s
✅ REPOSITORY git_diff yes no no 0.2s
✅ REPOSITORY grype yes no no 204.28s
✅ REPOSITORY osv-scanner yes no no 179.07s
✅ REPOSITORY secretlint yes no no 1.37s
✅ REPOSITORY syft yes no no 2.5s
✅ REPOSITORY trivy yes no no 18.15s
✅ REPOSITORY trivy-sbom yes no no 0.14s
✅ REPOSITORY trufflehog yes no no 1.85s
✅ SPELL cspell 212 0 0 6.86s
✅ SPELL lychee 24 0 0 155.57s

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.2.0 --custom-flavor-setup --custom-flavor-linters COPYPASTE_JSCPD,CSS_STYLELINT,GO_GOLANGCI_LINT,GO_REVIVE,HTML_DJLINT,HTML_HTMLHINT,JSON_JSONLINT,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_CSPELL,SPELL_LYCHEE

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@github-code-quality

github-code-quality Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Go

Go / code-coverage/go

main claude/portal-launch... e357d88 +/-
— 78% —

Line coverage data for the main branch is not yet available.

View coverage of the 10 most covered files.
File main claude/portal-launch... e357d88 +/-
internal/identity/browser.go — 90% —
internal/webapp/app.go — 89% —
internal/identity/contact.go — 89% —
internal/custom...ity/material.go — 85% —
internal/identity/request.go — 80% —
internal/identi...ork_approval.go — 79% —
internal/identity/card.go — 77% —
internal/identi...l_acceptance.go — 77% —
cmd/business-site/main.go — 73% —
internal/identity/billing.go — 69% —

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 16, 2026 01:35 UTC

devantler added a commit that referenced this pull request Nov 16, 2026
Codex review on #622: readLaunchOffer evaluated the order gate after
showRequests had read the private request, proposal and acceptance
records. The caller already evaluates that gate first, so the helper
no longer evaluates any flag.

Also fixes gocritic's offBy1 and revive's unused parameter in the
launch tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for Re-review after the findings on the previous head were fixed (see the replies on each thread).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 3b46f0ced7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

devantler added a commit that referenced this pull request Nov 16, 2026
Codex review on #622: readLaunchOffer evaluated the order gate after
showRequests had read the private request, proposal and acceptance
records. The caller already evaluates that gate first, so the helper
no longer evaluates any flag.

Also fixes gocritic's offBy1 and revive's unused parameter in the
launch tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-launch-discount branch from 3b46f0c to dd0f46a Compare November 16, 2026 00:47
@devantler
devantler changed the base branch from main to claude/launch-prices-19 November 16, 2026 00:48
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for Review this PR's own commits; it is stacked on its base branch (rebased onto #625).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: dd0f46af18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

devantler added a commit that referenced this pull request Nov 16, 2026
Codex review on #622: readLaunchOffer evaluated the order gate after
showRequests had read the private request, proposal and acceptance
records. The caller already evaluates that gate first, so the helper
no longer evaluates any flag.

Also fixes gocritic's offBy1 and revive's unused parameter in the
launch tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-launch-discount branch from dd0f46a to a592c55 Compare November 16, 2026 01:05
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for Review this PR's own commits; it is stacked on its base branch, now on #625's latest head.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: a592c55f44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Base automatically changed from claude/launch-prices-19 to main November 16, 2026 01:21
devantler and others added 3 commits November 16, 2026 02:22
The maintainer's launch offer (offerings.json launchDiscount): 25% off
the one-time price for the first 50 customers who order with hosting.

- An order with a one-time and a monthly price takes the client's
  launch place, if one is open, in the transaction that inserts it,
  under an advisory lock (portal_launch_places, migration v24). One
  place per client; a taken place is never reused.
- The order stores the discounted one-time price, so invoices, card
  payments, funding and withdrawals use it unchanged. Hosting keeps its
  full price.
- The shared proposal, the order summary and the receipt show the
  discount as its own line. An order whose place went after the client
  saw the price is refused, and the receipt shows the new price.
- Numina and Stripe lines carry the discounted price and name the full
  price and the discount; the confirmation email and the operator's
  page show it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review on #622: readLaunchOffer evaluated the order gate after
showRequests had read the private request, proposal and acceptance
records. The caller already evaluates that gate first, so the helper
no longer evaluates any flag.

Also fixes gocritic's offBy1 and revive's unused parameter in the
launch tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-launch-discount branch from a592c55 to e357d88 Compare November 16, 2026 01:29
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for Re-review this PR's own commits after rebasing onto main (#625 merged); findings on earlier heads are answered on their threads.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: e357d884dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@devantler
devantler marked this pull request as ready for review November 16, 2026 01:46
@devantler
devantler requested a review from a team as a code owner November 16, 2026 01:46
@devantler
devantler merged commit 1518bee into main Nov 16, 2026
40 checks passed
@devantler
devantler deleted the claude/portal-launch-discount branch November 16, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant