You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(publisher): critical issues in businessToSpec and buildSpecs
1. Status gate: add mapper-level guard rejecting pending/rejected businesses
- append &status=eq.published to businesses select
- businessToSpec returns null for status !== published
- prevents unpublished businesses leaking names via their deals
2. opening_hours JSONB: handle both string and object forms
- column is OpeningHours JSONB, not a string
- str() only works with strings, was a dead code path
- now accepts string directly or JSON.stringifies objects
- new test fixture with object-shaped hours serialization
3. buildSpecs fetch efficiency: add test coverage
- datasets [businesses] alone: businesses fetched once
- datasets [deals,businesses] together: businesses fetched once
- nameById map reuses shared fetch, no duplicate fetches
All 51 tests pass, including 4 new tests and 2 status guard tests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments