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

This week says "at the property" for an inspection or walkthrough held at the deal's own address #231

Merged opened this

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

Merged

mason/deal-clock:mason/220-this-week-says-at-the-property-for-an-in → main 1 commit fork

  • Merged. mason/220-this-week-says-at-the-property-for-an-in was merged into main as c283dc4.

Review

Sign in to review this change.
3 files changed +23 −1
src/week.appointment.test.ts +9
@@ -71,3 +71,12 @@ test("a day's timed dates come first, earliest first, then the untimed in today'
7171 const html = render();
7272 expect(html.indexOf("9:00 am")).toBeLessThan(html.indexOf("3:30 pm"));
7373 });
74
75 test("a booted /week says 'at the property' for a walkthrough at the deal's address", async () => {
76 const deal = open();
77 const w = dateOf(deal, "walkthrough");
78 const set = setAppointment(db, alice, { id: w.id, time: "08:15", place: deal.address });
79 if (!set.ok) throw new Error(set.message);
80 const html = await page();
81 expect(html).toContain("8:15 am · at the property");
82 });
src/week.test.ts +11
@@ -55,3 +55,14 @@ test("lateNote says when an overdue date was due and how late it is", async () =
5555 expect(lateNote("2026-11-08", "2026-11-08")).toBe("");
5656 expect(lateNote("2026-11-09", "2026-11-08")).toBe("");
5757 });
58
59 test("an appointment held at the deal's own address says it is at the property", async () => {
60 const { whereNote } = await import("./week.ts");
61 const deal = { address: "1418 Alder Lane", deadlines: [] };
62 const w = (place: string | null, time: string | null = "08:15") => whereNote(deal, { kind: "walkthrough", time, place });
63 expect(w("1418 Alder Lane")).toBe("8:15 am · at the property");
64 expect(w(" 1418 ALDER lane ")).toBe("8:15 am · at the property");
65 expect(w("1418 Alder Lane", null)).toBe("at the property");
66 expect(w("22 Elm St")).toBe("8:15 am · 22 Elm St");
67 expect(w(null)).toBe("8:15 am");
68 });
src/week.ts +3 −1
@@ -42,7 +42,9 @@ export function closingNote(deal: WeekDeal<unknown>, d: { kind?: string }): stri
4242 /** The time and place after a row's label: the closing's, or an inspection's or walkthrough's; "" when there is none. */
4343 export function whereNote(deal: WeekDeal<unknown>, d: { kind: string; time?: string | null; place?: string | null }): string {
4444 const where = closingNote(deal, d);
45 return where === "" ? appointmentNote(d) : where;
45 if (where !== "") return where;
46 const here = d.place != null && d.place.trim().toLowerCase() === deal.address.trim().toLowerCase();
47 return appointmentNote(here ? { ...d, place: "at the property" } : d);
4648 }
4749
4850 export function thisWeek<D extends { due: string; done_at: string | null; waived_at: string | null }, Deal extends WeekDeal<D>>(

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs