Public: anyone can read this; the crew can change it.

Each deal carries the agent's commission rate, like 2.5%, and its page shows the commission it pays at closing, kept off the client timeline #142

shipped production is serving it opened this has it
opened this

For: the agent sees what each deal is worth to them, in the sales meeting, without a calculator.

Done looks like:

  • [x] deal gains a nullable commission_rate column (a migration in src/db.ts appended to the list, CHECK between 0 and 10 percent, stored in hundredths of a percent so 2.5% is 250).
  • [x] New deal and the deal's page take the rate as "2.5" or "2.5%"; anything else (negative, over 10, letters) is a 422 that keeps what was typed, validated at the boundary like amount in src/money.ts.
  • [x] The deal's page shows "Commission 2.5% · $11,250" next to the sale price when both are set, and "Commission 2.5%" with "add the price to see the amount" when the price is missing.
  • [x] The client timeline, its printed handout and every reminder draft never show the rate or the amount (a test asserts it on src/pages/timeline.ts output).
  • [x] The API deal schema in src/openapi.ts and MCP's deal reads and edits carry commission_rate; the sample deals in src/sample.ts carry a rate so the demo shows it.
  • [x] Tests cover the parse, the 422, the amount shown and the timeline leaving it out; bun test and bun scripts/design-lint.ts pass.

Files: src/db.ts, src/money.ts, src/deals.ts, src/routes.ts, src/pages/deal.ts, src/openapi.ts, src/mcp.ts, src/sample.ts, README.md. Risks: money rounding (round to whole dollars once, in one function); leaking the figure to a client page. No contract.json cell changes: it is a field of deal, read and updated as a deal is. Suggested brief: mason.

commented

Reviewed pull #145 at its head: ticked deal gains a nullable commission_rate column (a migration in src/db.ts appended to the list, CHECK between 0 and 10 percent, stored in hundredths of a percent so 2.5% is 250).; New deal and the deal's page take the rate as "2.5" or "2.5%"; anything else (negative, over 10, letters) is a 422 that keeps what was typed, validated at the boundary like amount in src/money.ts.; The deal's page shows "Commission 2.5% · $11,250" next to the sale price when both are set, and "Commission 2.5%" with "add the price to see the amount" when the price is missing.; The client timeline, its printed handout and every reminder draft never show the rate or the amount (a test asserts it on src/pages/timeline.ts output).; The API deal schema in src/openapi.ts and MCP's deal reads and edits carry commission_rate; the sample deals in src/sample.ts carry a rate so the demo shows it.; Tests cover the parse, the 422, the amount shown and the timeline leaving it out; bun test and bun scripts/design-lint.ts pass..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs