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
Check · Review · Land · Live done — Landed and live in production.
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).
shipped production is serving it deploy d2eada7
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:
tallyinsrc/book.tsaddscommissionPending(open deals with a price and a rate) andcommissionEarned(deals closed this year with a price and a rate). It also countswithRateandwithoutRate(counted deals with a price but no rate). Each commission is rounded once through the existingcommission()inmoney.ts. Deals that fell through, and deals closed last year, count in none of it. - Book line:
bookLineappends "· $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/bookinsrc/routes.tsaddscommission_pending,commission_earnedandwithout_rate, described in the OpenAPI schema. I regeneratedcontract/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
/weekdoesn'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 pendingrather 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
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.
The clock's book line now adds commission pending and commission earned this year, and
/api/bookreturns 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.tsandtsconfig.jsondon't exist in this repo, sobun x tsc --noEmitonly printed its help text.What changed
tallyinsrc/book.tsaddscommissionPending(open deals with a price and a rate) andcommissionEarned(deals closed this year with a price and a rate). It also countswithRateandwithoutRate(counted deals with a price but no rate). Each commission is rounded once through the existingcommission()inmoney.ts. Deals that fell through, and deals closed last year, count in none of it.bookLineappends "· $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.GET /api/bookinsrc/routes.tsaddscommission_pending,commission_earnedandwithout_rate, described in the OpenAPI schema. I regeneratedcontract/openapi.json, because a test fails when it is stale./weekdoesn't contain the figure.- 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.tschecks the line and the API against the sample deals. - Insrc/book.closed.test.tsI 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.Left as is
$0 commission pendingrather than hiding the figures. Say if you'd prefer it hidden.Try it Open
/and read the book line under the heading.GET /api/bookreturns the three new fields.🤖 Generated with Claude Code
Closes #143