fix(GRO-2236): portal Book New service cards show price + duration #57
Reference in New Issue
Block a user
Delete Branch "flea/gro-2236-portal-service-cards"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GRO-2236 — Portal Book New: service cards show
$undefinedprice / emptyminRoot cause
The Book New "Select Services" cards read
svc.price(dollars) andsvc.duration, butGET /api/portal/services(apisrc/routes/portal.ts) projects the canonical DB columnsbasePriceCentsanddurationMinutes. Field-name + units mismatch → every card rendered$undefinedand an emptymin.Fix (web-only)
basePriceCents → price(dollars),durationMinutes → duration. Tolerates an already-normalized shape.formatServicePricehelper that returnsnullwhen neitherpriceRangenor numericpriceis present, so the card hides the field instead of printing$undefined. Duration line is gated ontypeof svc.duration === 'number'.$45); fractional to cents ($45.50).Tests
normalizeService(cents→dollars, already-normalized passthrough, absent/null fields) andformatServicePrice(priceRange precedence, integer/fractional formatting, null fallback).tsc --noEmitclean,eslintclean,vitest74/74 pass.Verification (UAT, after deploy)
Open Book New → Select Services → all cards show a real price +
60 min-style duration; no$undefined/ emptymin.🤖 Generated with Claude Code