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

The book line on the clock adds commission pending on open deals and commission earned this year, so the agent sees their year in one look #150

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The clock's book line now adds commission pending and commission earned this year, and /api/book returns the same figures. The related tests pass (90 across book, openapi, week, speed, terminal, commission and sample).

Notes

shipped production is serving it deploy d2eada7

opened this

The clock's book line now adds commission pending and commission earned this year, and /api/book returns the same figures. The related tests pass (90 across book, openapi, week, speed, terminal, commission and sample). I didn't run the full suite, the gate or a type check: scripts/gate.ts and tsconfig.json don't exist in this repo, so bun x tsc --noEmit only printed its help text.

What changed

  • Tally: tally in src/book.ts adds commissionPending (open deals with a price and a rate) and commissionEarned (deals closed this year with a price and a rate). It also counts withRate and withoutRate (counted deals with a price but no rate). Each commission is rounded once through the existing commission() in money.ts. Deals that fell through, and deals closed last year, count in none of it.
  • Book line: bookLine appends "· $X commission pending · $Y earned this year" only when at least one counted deal has a rate. A book with no rates reads exactly as before. The terminal's clock view uses the same function, so it shows the line too.
  • API: GET /api/book in src/routes.ts adds commission_pending, commission_earned and without_rate, described in the OpenAPI schema. I regenerated contract/openapi.json, because a test fails when it is stale.
  • Where it shows: the figures appear only on the book line. This week, the printed sheet and the client pages are untouched, and a page test checks that /week doesn't contain the figure.
  • Tests:

- In src/book.test.ts, one test covers open, closed this year, closed last year and fell through, another covers a price with no rate, and a third covers a rate with no price. - src/book.page.test.ts checks the line and the API against the sample deals. - In src/book.closed.test.ts I changed one assertion that matched the old line ending. The commission text now sits between "closed this year, $612,000" and "(1 without a price)", so it checks for each piece separately.

  • README: the walkthrough now mentions the commission figures on the sample deals.

Left as is

  • A deal with a rate but no price counts as "has a rate", so the line shows $0 commission pending rather than hiding the figures. Say if you'd prefer it hidden.
  • The 200-deal speed test passes, but I added no new perf test.
  • No permission cell changed.

Try it Open / and read the book line under the heading. GET /api/book returns the three new fields.

🤖 Generated with Claude Code

Closes #143

commented

The clock's book line now adds commission pending and commission earned this year, and /api/book returns the same figures. The related tests pass (90 across book, openapi, week, speed, terminal, commission and sample). I didn't run the full suite, the gate or a type check: scripts/gate.ts and tsconfig.json don't exist in this repo, so bun x tsc --noEmit only printed its help text.

What changed

  • Tally: tally in src/book.ts adds commissionPending (open deals with a price and a rate) and commissionEarned (deals closed this year with a price and a rate). It also counts withRate and withoutRate (counted deals with a price but no rate). Each commission is rounded once through the existing commission() in money.ts. Deals that fell through, and deals closed last year, count in none of it.
  • Book line: bookLine appends "· $X commission pending · $Y earned this year" only when at least one counted deal has a rate. A book with no rates reads exactly as before. The terminal's clock view uses the same function, so it shows the line too.
  • API: GET /api/book in src/routes.ts adds commission_pending, commission_earned and without_rate, described in the OpenAPI schema. I regenerated contract/openapi.json, because a test fails when it is stale.
  • Where it shows: the figures appear only on the book line. This week, the printed sheet and the client pages are untouched, and a page test checks that /week doesn't contain the figure.
  • Tests:

- In src/book.test.ts, one test covers open, closed this year, closed last year and fell through, another covers a price with no rate, and a third covers a rate with no price. - src/book.page.test.ts checks the line and the API against the sample deals. - In src/book.closed.test.ts I changed one assertion that matched the old line ending. The commission text now sits between "closed this year, $612,000" and "(1 without a price)", so it checks for each piece separately.

  • README: the walkthrough now mentions the commission figures on the sample deals.

Left as is

  • A deal with a rate but no price counts as "has a rate", so the line shows $0 commission pending rather than hiding the figures. Say if you'd prefer it hidden.
  • The 200-deal speed test passes, but I added no new perf test.
  • No permission cell changed.

Try it Open / and read the book line under the heading. GET /api/book returns the three new fields.

🤖 Generated with Claude Code

Approved

Clean. tally adds commissionPending/commissionEarned through the existing commission(), fell-through and last-year deals count in neither, bookLine appends the figures only when a counted deal has a rate, and /api/book plus openapi.json carry the three new fields. The terminal reuses bookLine, so both doors agree. No permission cell changed; the route still asks permit via its deal/list cell. Tests cover open, closed this year, closed last year, fell through, no rate and rate-without-price. Preview needs sign-in, so I could not see the live line; the page test covers it on the sample deals.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs