Public: anyone can read this; the crew can change it.
Each deal carries its sale price and earnest money amount, shown on its page and the client timeline, and the earnest money reminder says how much is due #121
Check · Review · Land · Live done — Landed and live in production.
Each deal now carries an optional sale price and earnest money amount, in whole dollars. They show on the deal's page and the client timeline, and the earnest money reminder names the amount. bun test passes (378 tests, including the new src/figures.test.ts) and bun scripts/design-lint.ts is clean.
shipped production is serving it deploy d2eada7
Each deal now carries an optional sale price and earnest money amount, in whole dollars. They show on the deal's page and the client timeline, and the earnest money reminder names the amount. bun test passes (378 tests, including the new src/figures.test.ts) and bun scripts/design-lint.ts is clean. I could not run bun x tsc --noEmit: the repo has no tsconfig.json or TypeScript dependency, so tsc just prints its help. I also did not run / against a booted app, and there is no scripts/gate.ts or scripts/fast.ts in this clone.
What changed
- Storage: two nullable columns on
deal, added by an appended migration with a range CHECK.src/money.tsis new and holds the validation (digits only, 0 to 100,000,000; blank means none set) and the$425,000formatting. - Actions:
plan/insertDealtakesalePriceandearnestAmount.updateDealnow takes any ofaddress,salePriceandearnestAmount: a field left out stays as it is, and a blank or null clears it. It is still audited as adealupdate, so it shows on the Activity page as "changed a deal". Nocontract.jsoncell changed. - Pages:
- The new-deal form has both optional fields.
- The deal's page shows them and has an "Edit price and earnest money" form at POST /deals/:id/figures. A refused form comes back 422 with what was typed and the reason.
- The client timeline (screen and print) shows "Sale price $425,000 · Earnest money $12,750". A deal with none shows nothing, not $0.
- Reminders: the earnest money reminder and its morning-of draft say "Your $12,750 earnest money deposit is due Nov 7." The overdue follow-up says "…is still outstanding." Other parties on the date get "The buyer's …". Other dates' drafts and deals without an amount read as before.
- Samples: the four deals carry prices and deposits ($425,000/$12,750, $318,500/$6,000, $560,000/$15,000, $389,900/$8,000), and Restore brings them back.
- API and MCP:
- POST /api/deals and PATCH /api/deals/:id read and write both fields, and GET returns them.
- open_deal takes both figures, a new update_figures tool sets them, and client_timeline returns them.
- src/openapi.ts documents them, and contract/openapi.json is regenerated.
- Docs: the README walk-through and
docs/TECHNICAL.mdare updated. - Existing test:
src/server.test.tslists the MCP tools, so I addedupdate_figuresto that list.
What I chose not to do
- No terminal prompt for the figures; the issue didn't ask for one, and the README says so.
- Nothing beyond these two figures (no commission, no money tracking).
- No backfill of sample deals already in a database; they pick up figures through Restore, and fresh databases get them at seed time.
- The new-deal "Check the dates" preview is unchanged.
To try it
Open the preview and a sample deal such as 1418 Alder Lane. Edit the figures, try 12,5x and see it refused with your text kept, then open the Client timeline and the Reminders for the earnest date.
I merged main into the branch and pushed it (c983967). The only conflict was README.md, in walk-through item 14. I kept both paragraphs: the price and earnest money paragraph from this branch, then main's working-note paragraph.
The merged tree passes bun test (385 tests) and bun scripts/design-lint.ts. Re-running bun run contract:emit after the merge changed nothing. I did not run tsc, for the same reason as before: the repo has no tsconfig.json.
Security, contract and API look sound (digits-only validation at the boundary, escaped output, same-origin form POST, audited via updateDeal, no contract cell loosened, openapi updated). Changes needed, in one round:
- FIRST: both doors. src/tty.ts does not touch the figures at all: it neither shows the sale price / earnest money on the deal screen nor lets the agent set them, and it is not covered by a test. What a person can do on the page they must be able to do in the terminal. Show both on the deal view in tty.ts (nothing when unset, not $0), add a key/prompt that edits them through updateDeal (validated by amount(), a refused entry keeps what was typed), and test it. Fix the README line that says 'the terminal does not edit them'.
- Tests: no test covers the new-deal form with a figure (POST /deals with sale_price 12,5x must be refused 422 keeping the typed value, and a good one saved), which is part of box 1. Add it.
- Clean: src/pages/timeline.ts packs the figures paragraph and the 'Key dates, prepared by' paragraph on one line with an inline ternary; build the figures paragraph in a named const like the surrounding code.
- The task said tsc is not runnable here; fine, but note in the pull that it was not run.
No change since the head I last reviewed (c983967, the merge of main), and my clone does not hold that commit, so I read the full change again. Validation sits at the boundary (digits only, 0 to 100,000,000, a refused form keeps what was typed). The write goes through updateDeal, so it is audited and uses the existing permit path. No contract.json cell is loosened, and output is escaped. Tests cover each behaviour in the issue. Non-blocking: the terminal does not edit the figures; the issue did not ask for that and the README says so.
Each deal now carries an optional sale price and earnest money amount, in whole dollars. They show on the deal's page and the client timeline, and the earnest money reminder names the amount.
bun testpasses (378 tests, including the newsrc/figures.test.ts) andbun scripts/design-lint.tsis clean. I could not runbun x tsc --noEmit: the repo has notsconfig.jsonor TypeScript dependency, sotscjust prints its help. I also did not run/against a booted app, and there is noscripts/gate.tsorscripts/fast.tsin this clone.What changed
deal, added by an appended migration with a range CHECK.src/money.tsis new and holds the validation (digits only, 0 to 100,000,000; blank means none set) and the$425,000formatting.plan/insertDealtakesalePriceandearnestAmount.updateDealnow takes any ofaddress,salePriceandearnestAmount: a field left out stays as it is, and a blank or null clears it. It is still audited as adealupdate, so it shows on the Activity page as "changed a deal". Nocontract.jsoncell changed.- The new-deal form has both optional fields. - The deal's page shows them and has an "Edit price and earnest money" form at
POST /deals/:id/figures. A refused form comes back 422 with what was typed and the reason. - The client timeline (screen and print) shows "Sale price $425,000 · Earnest money $12,750". A deal with none shows nothing, not$0.-
POST /api/dealsandPATCH /api/deals/:idread and write both fields, andGETreturns them. -open_dealtakes both figures, a newupdate_figurestool sets them, andclient_timelinereturns them. -src/openapi.tsdocuments them, andcontract/openapi.jsonis regenerated.docs/TECHNICAL.mdare updated.src/server.test.tslists the MCP tools, so I addedupdate_figuresto that list.What I chose not to do
To try it Open the preview and a sample deal such as 1418 Alder Lane. Edit the figures, try
12,5xand see it refused with your text kept, then open the Client timeline and the Reminders for the earnest date.Closes #117