โ back to Commercialrealestate
CRCP: surface listing.created_at as '๐ captured <date+time>' chip on broker card rows (admin-card recency rule)
e515bc55e01f66b9b0ed63956e337f2cadd2900a ยท 2026-08-06 16:26:28 -0700 ยท Steve Abrams
Files touched
M public/index.htmlM scripts/serve.js
Diff
commit e515bc55e01f66b9b0ed63956e337f2cadd2900a
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Aug 6 16:26:28 2026 -0700
CRCP: surface listing.created_at as '๐ captured <date+time>' chip on broker card rows (admin-card recency rule)
---
public/index.html | 2 +-
scripts/serve.js | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/public/index.html b/public/index.html
index 4a6c764..ebe31bc 100644
--- a/public/index.html
+++ b/public/index.html
@@ -590,7 +590,7 @@
if(!leads.length){ bq('#bkleads').innerHTML='<div class="gate">No brokers to show yet.</div>'; return; }
bq('#bkleads').innerHTML=leads.map((l,i)=>{
const rows=(l.listings_json||[]).map(p=>'<tr class="mrow" data-addr="'+esc(p.address)+'" data-city="'+esc(p.city||'')+'">'
- +'<td>'+esc(p.address)+'<div style="color:var(--mut);font-size:11px">'+esc(p.city||'')+(p.zip?' '+esc(p.zip):'')+'</div></td>'
+ +'<td>'+esc(p.address)+'<div style="color:var(--mut);font-size:11px">'+esc(p.city||'')+(p.zip?' '+esc(p.zip):'')+'</div>'+(p.created_at?'<div style="color:var(--mut);font-size:10px" title="captured '+esc(String(p.created_at))+'">๐ '+new Date(p.created_at).toLocaleString(undefined,{year:'numeric',month:'short',day:'numeric',hour:'numeric',minute:'2-digit'})+'</div>':'')+'</td>'
+'<td>'+esc(p.type||'โ')+'</td><td class="n">'+money(p.price)+'</td><td class="n">'+(p.units||'โ')+'</td>'
+'<td class="n">'+(p.cap_rate!=null?p.cap_rate+'%':'โ')+'</td><td class="hist">๐ history</td></tr>').join('');
return '<div class="lead" data-id="'+l.broker_id+'" data-name="'+esc(l.name)+'">'
diff --git a/scripts/serve.js b/scripts/serve.js
index edceb9d..9c233b5 100644
--- a/scripts/serve.js
+++ b/scripts/serve.js
@@ -528,7 +528,7 @@ app.get('/api/leads/top', async (req, res) => {
const leads = (await brokerdb.pool.query(`
WITH ll AS (
SELECT b.id broker_id, b.name, f.name firm, b.agent_type,
- l.id lid, l.address, l.city, l.zip, l.type, l.price, l.units, l.cap_rate,
+ l.id lid, l.address, l.city, l.zip, l.type, l.price, l.units, l.cap_rate, l.created_at,
CASE WHEN l.type ILIKE '%mixed%' THEN 3
WHEN l.type ILIKE '%condo%' THEN 3
WHEN l.type ILIKE '%multi%' THEN 2
@@ -540,7 +540,7 @@ app.get('/api/leads/top', async (req, res) => {
SELECT broker_id, name, firm, agent_type,
count(*)::int listings, sum(fit)::int fit_score, coalesce(sum(price),0)::bigint total_value,
json_agg(json_build_object('id',lid,'address',address,'city',city,'zip',zip,'type',type,
- 'price',price,'units',units,'cap_rate',cap_rate)
+ 'price',price,'units',units,'cap_rate',cap_rate,'created_at',created_at)
ORDER BY price DESC NULLS LAST) listings_json
FROM ll GROUP BY broker_id, name, firm, agent_type
ORDER BY fit_score DESC, total_value DESC LIMIT $1`, [limit])).rows;
โ 4d95c1e CRCP: per-property public-record enrichment module (free ass
ยท
back to Commercialrealestate
ยท
enrich-property: fix Cody-verified field bugs + honest label d30373f โ