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 opened this

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

Merged

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.

shipped production is serving it deploy d2eada7

opened this

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). refresh and restore need 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.ts is 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.ts and src/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_at null, 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.

Closes #158

commented

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). refresh and restore need 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.ts is 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.ts and src/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_at null, 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.

commented

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.
Changes requested — before the latest push

No security findings: no contract cell changed, no new door, no input or output path touched. Two things to fix.

  1. 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.
  1. README (box 5). The new intro sentence at line 12 is one very long run-on. It also splits the old sentence, leaving Sign in and first (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.

commented

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.ts renders 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. refresh shifts 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.

Approved

Both 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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs