auctions.assess: pass assessed_at as ISO timestamptz (postgres.js rejects Date params in raw sql)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 changed file +2 −2
modified
workers/auctions/assess.ts
+2 −2
@@ -114,8 +114,8 @@ export async function assessLots(opts: { limit?: number; all?: boolean; now?: Da | ||
| 114 | 114 | buyer_premium_rate = ${a.buyerPremiumRate}, fee_basis = ${a.feeBasis}, |
| 115 | 115 | all_in_bid_usd = ${a.allInBidUsd}, all_in_estimate_low_usd = ${a.allInEstimateLowUsd}, all_in_estimate_high_usd = ${a.allInEstimateHighUsd}, |
| 116 | 116 | riv_usd_at_assessment = ${a.rivUsd}, bid_vs_riv = ${a.bidVsRiv}, estimate_vs_riv = ${a.estimateVsRiv}, |
| 117 | − assessment_verdict = ${a.verdict}, assessed_at = ${now} | |
| 118 | − where id = ${r.id}`); | |
| 117 | + assessment_verdict = ${a.verdict}, assessed_at = ${now.toISOString()}::timestamptz | |
| 118 | + where id = ${r.id}`); // postgres.js needs an ISO string for a Date parameter in raw sql | |
| 119 | 119 | res.assessed++; |
| 120 | 120 | res.verdicts[a.verdict] = (res.verdicts[a.verdict] ?? 0) + 1; |
| 121 | 121 | } |
| 122 | 122 | |