Skip to content

fix(restaurant-service): quote deliveryRadiusKm in the list by delivery location - #299

Merged
Yousefa7medmaher merged 1 commit into
devfrom
fix/restaurant-distance-list
Nov 9, 2026
Merged

Yousefa7medmaher merged 1 commit into
devfrom
fix/restaurant-distance-list

Conversation

@Yousefa7medmaher

Copy link
Copy Markdown
Member

Closes #298

What changed

  • restaurants.repository.ts: the delivery-radius condition quotes "r"."deliveryRadiusKm". TypeORM doesn't rewrite a property path followed by ::, so Postgres was looking for deliveryradiuskm, and every GET /restaurants?lat=&lng= returned 500.
  • The new PostgreSQL integration test: an approved restaurant is listed at its own point (distance ≈ 0, total 1), and nothing is listed from a point far outside its radius.
  • The unit test now expects the quoted column.

Tests

  • restaurant-service: jest 94 passed; the repository integration specs pass on local PostgreSQL 16 (13/13).
  • The migration-verification workflow runs the integration spec in CI.

No business rule changes.


Generated by Claude Code

…ry location

TypeORM leaves `r.deliveryRadiusKm::double precision` unquoted, so Postgres folded it to lower case and every list with lat/lng failed with 500. Quote the column and cover the query with a PostgreSQL integration test.
@Yousefa7medmaher
Yousefa7medmaher merged commit ec237a9 into dev Nov 9, 2026
25 checks passed
@Yousefa7medmaher
Yousefa7medmaher deleted the fix/restaurant-distance-list branch November 9, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(restaurant-service): the list by delivery location fails on PostgreSQL (unquoted deliveryRadiusKm)

1 participant