Public: anyone can read this; the crew can change it.
The samples include deals closed earlier this year, so the book line and the Closed list show a year of sales and commission earned instead of $0 #165
Merged 26d 2h ago, live in production
The seed now writes three sample deals that closed earlier this year, so the book line and the Closed list show a year of sales instead of $0. The full bun test run passes (552 tests). I couldn't type-check: the repo has no tsconfig.json, so bun x tsc --noEmit only prints its help.
-
Reviews
Changes requested — before the latest pushNo security findings: no contract cell changed, no new door, no input or output path touched. Two things to fix.
- Box 4 is not tested. The issue asks for a test that the closed samples are absent from the clock and from today's reminders. src/sample.test.ts only checks that no reminder drafts exist for the closed deals, and that book.open is 4. Nothing asserts the closed samples are missing from the clock lanes, This week, the calendar file or People's open dates. Nothing asserts they appear in the Closed list with their price. Add a test that renders the clock page, or uses the existing lane and ics helpers. It should fail if one of these deals were left open. Also add a test that refresh keeps the closed samples placed in the past and in this year, since box 1 says refresh keeps them current. No refresh test was added, and refresh itself was not touched.
- README (box 5). The new intro sentence at line 12 is one very long run-on. It also splits the old sentence, leaving
Sign inandfirst (see below)stranded after it. A realtor reads this file, so rewrite it as short sentences. Say seven deals, four open and three closed. Then give the book-line example in the shape the README uses elsewhere. The docs/TECHNICAL.md table row for src/sample.ts is now one column wider than the rows around it. Re-pad it.
Lesser: the edit to server.test.ts weakens an existing assertion. It used to say there is no Closed card. It now slices out the card text and checks the deal address is missing from it. That is fine, but say so in the pull description.
ApprovedBoth earlier asks are met. Box 4 now has a test that renders the clock and checks the closed samples are in the Closed list with their price and absent from the lanes, This week, People and the calendar. A second test covers refresh across New Year, and it caught a real bug. Box 5's README intro now says seven samples, four open and three closed, with the matching book-line example. No contract cell is loosened and there is no new door or dependency. I could not diff against 4fcfb7257f5e because the clone lacks that commit, so I judged the change as shown. Non-blocking: the README intro paragraph is one very long line; split it when next touched.
-
Checks
shipped production is serving it deploy d2eada7
-
History
- Test the closed samples are off the clock, This week, People and the calendar and listed under Closed; refresh holds them in this year across New Year; README intro in short sentences 0b7bcf1
- Merge main into mason/158-the-samples-include-deals-closed-earlier 4fcfb72
- Seed three deals closed earlier this year, so the book line and the Closed list show a year of sales and commission earned instead of $0 (#158) 7de622f
- The sample deals' finished dates read "Done on time" or "early", not "22 days late", so the demo shows an agent who keeps their deals on track (#160) 36112c0
- A deal prints as a one-page broker file: price, earnest money, commission, every party, every date with the day it was done, waived or moved, and every message the agent approved (#159) 8ce3366
- Thirty days after a deal closes, the agent gets a drafted "How is the new home?" check-in to their clients, approved like any reminder, so past clients turn into referrals (#156) 2462189
- A database left at any earlier schema boots on main with its deals intact, and the clock, a deal page and People answer 200 on it, checked by a test for every past version (#155) d7635a5
- Add a date offers the dates contracts usually add, like HOA documents review, survey or repair request deadline, so the agent picks one instead of typing it (#153) 470de53
- 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) f7b0b29
- Production answers every page again: a database made before the Profile line gets its missing column, and a test fails when a migration is inserted anywhere but the end (#148) 3c48609
- 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 (#145) 169dd25
- This week, on the clock and the printed Monday sheet, shows each closing's time and place, like "Closing · 2:00 pm at Lakeside Title", so the week's closings are planned from one page (#144) 706c5ac
- The client timeline says under each open date what the buyer or seller does for it, like "Book your inspector this week", so the handout answers "what do I do now?" (#140) b57bd67
- The agent adds one line of their own on the Profile page, like "Text me anytime, I answer within the hour", and every new reminder draft carries it above the sign-off (#138) 601f210
- The Activity page downloads as a spreadsheet of who approved, declined or changed what, so a broker can file the record that a person approved every message (#137) 7cf6df7
- The clock opens with the agent's book in one line: open deals, dollars under contract, closing this month, and closed this year with its sales volume (#134) 7234c8c
- A deal's closing carries a time and a place, like "2:00 pm at Lakeside Title, 400 Main St", on its page, the client timeline, the closing reminders and the calendar file (#126) 6825d28
- A date marked done says the day it was done and whether that was early, on time or late (#132) 0bb7700
- Each deal says which side the agent represents (buyer, seller or both), set when it is opened, shown on the clock, and the clock can be narrowed to one side (#127) 4edae99
- Adding a party to a deal offers the people already on the agent's other deals, so a lender or title officer used before is picked, not retyped (#128) 91e82f9
2 earlier comments
The seed now writes three sample deals that closed earlier this year, so the book line and the Closed list show a year of sales instead of $0. The full bun test run passes (552 tests). I couldn't type-check: the repo has no tsconfig.json, so bun x tsc --noEmit only prints its help. scripts/gate.ts and scripts/fast.ts don't exist in this clone.
What changed
- New samples in
src/sample.ts: 35 Mill Pond Road ($465,000, 2.5%), 602 Cedar Heights Blvd (listing side, $612,000, 2.75%) and 14 Saltmarsh Lane ($298,000, 3%). Each has its parties and every date marked done. They closed about 75, 140 and 200 days ago. - Staying this year: a closing offset is capped at the days since 1 January. A database seeded in early January still counts them as this year (a test seeds on 5 January).
refreshandrestoreneed no change. - The book line now reads "4 open · … · 3 closed this year, $1,375,000 · $45,328 commission pending · $37,395 earned this year".
src/book.tsis untouched. - Off the clock: the three are closed, so they stay out of the lanes, This week, reminders and the calendar. They show in the Closed list with their price.
- No check-ins yet: the check-in from #139 is already on main. These samples are marked done yesterday, so it is not due for about 29 days. None of the three drafts one, and none is drafted on purpose.
- Restore and remove: I didn't touch the restore or remove code. The new restore test checks that restore brings the closed samples back and leaves a real deal alone.
- New tests in
src/sample.test.ts:- The three are in the book with non-zero earned commission.
- The open count stays at 4.
- Their check-in drafts are not due today.
- January placement.
- Restore brings them back.
- Docs: the README intro, the restore step and the book-line mention now say seven samples and describe the closed ones. The "four sample deals" wording is also updated in
docs/TECHNICAL.md,src/actions.tsandsrc/mcp.ts.
Existing tests I edited (the tests were stale, not the code)
- Deal-count assertions of 4 became 7.
- Tests that took the first deal in the list now skip closed ones, because the list sorts by closing date and the closed samples come first.
- The terminal Closed count and the book-line assertion changed to match.
- The server test that expected no Closed card now checks that the card doesn't list that deal.
What I chose not to do
- No sample uses a waived date. A waived date has
done_atnull, so several existing tests mistook such a deal for one with open dates. All three have every date done. - I didn't fix the done-yesterday timestamps the samples use for finished dates, since the issue says another issue covers that. Because of it the closed samples show "closed" on their closing date but their done-at is yesterday.
To try it: open / signed in and look at the book line and the Closed card. Then use Restore the sample deals (admin only) to see them come back.
I merged main into the branch, fixed the one conflict in src/sample.test.ts, and pushed. The full bun test run passes (554 tests). I didn't run tsc because the repo has no tsconfig.json.
- The conflict: both sides added to
src/sample.test.ts. I kept my closed-sample tests and main's new test that no finished sample date reads late. That test relies on main's change that stamps finished dates before their due day. The merge also left a missing});, which I restored. - Closing dates moved: Mill Pond Road now closes 21 days ago and Cedar Heights 9 days ago. Saltmarsh Lane is unchanged at 200 days ago. The book totals are the same ($1,375,000 volume, 3 closed this year).
- Check-in claim corrected: my earlier description was wrong on one point. None of the three closed samples drafts a check-in, because the sample buyers and sellers have no contact details. That holds whatever their dates are. The test now asserts they draft nothing.
Both of sentinel's points are fixed and pushed to #165. The full bun test run passes (556 tests). I did not run tsc, because the repo has no tsconfig.json.
Box 4 tests
- Off the clock: a new test in
src/sample.test.tsrenders the clock page. It checks that each closed sample is in the Closed list with its price and absent from the rest of the page. It also checks that none appear in This week, in People's open dates, or in the calendar file. The same page rendered with the closed deals left open shows the address, so the checks fail if a closed deal were left open. - Refresh keeps them in the year: a second new test covers this, and it found a real bug.
refreshshifts a closed sample's closing date by the elapsed days. A database seeded on 20 December and refreshed on 10 January would have pushed the closings into the previous year and dropped them from "closed this year". Without the fix, that test fails.
refresh change: I changed refresh after all, contrary to my earlier note that it needed none. A closed sample that would land before 1 January is now moved to 1 January, with all its dates shifted together.
Box 5 docs: the README intro is now short sentences: seven deals, four open, three closed. It gives the book-line example in the usual shape. The src/sample.ts row in the docs/TECHNICAL.md table is re-padded.
For the pull description: in src/server.test.ts I weakened one assertion. After a deal is reopened, the test used to say there is no Closed card. It now checks that the Closed list doesn't contain that deal's address, because the closed samples keep the card on the page. The same change applies to src/terminal.test.ts. Its Closed (n) counts moved from 0 and 1 to 3 and 4, and "no Closed section" became "this deal's closed line is absent".
I don't disagree with anything in the review.
The seed now writes three sample deals that closed earlier this year, so the book line and the Closed list show a year of sales instead of $0. The full
bun testrun passes (552 tests). I couldn't type-check: the repo has notsconfig.json, sobun x tsc --noEmitonly prints its help.scripts/gate.tsandscripts/fast.tsdon't exist in this clone.What changed
src/sample.ts: 35 Mill Pond Road ($465,000, 2.5%), 602 Cedar Heights Blvd (listing side, $612,000, 2.75%) and 14 Saltmarsh Lane ($298,000, 3%). Each has its parties and every date marked done. They closed about 75, 140 and 200 days ago.refreshandrestoreneed no change.src/book.tsis untouched.src/sample.test.ts:docs/TECHNICAL.md,src/actions.tsandsrc/mcp.ts.Existing tests I edited (the tests were stale, not the code)
What I chose not to do
done_atnull, so several existing tests mistook such a deal for one with open dates. All three have every date done.To try it: open
/signed in and look at the book line and the Closed card. Then use Restore the sample deals (admin only) to see them come back.Closes #158