refactor(db): name the reservation-to-stay join condition once

The TEXT-against-INTEGER join between reservations.accommodation_id and
day_accommodations.id was spelled out eight times across Reservations and
DayAccommodations, each with its own cast and comment. accommodationIdMatches
in _shared/ is the one place that spells it, and it documents why the cast is
there: SQLite coerces the bare comparison and Postgres refuses it. The call
sites now read as what they test. The SQL is unchanged.

The size baseline is lowered to the new line counts.
This commit is contained in:
Isaias Tavares
2026-11-05 01:15:00 -03:00
parent 98533f3dbe
commit e82968d66c
4 changed files with 35 additions and 18 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
"scripts/db-call-graph.mjs": 1036,
"scripts/generate-entities.ts": 2259,
"src/db/repositories/Places.repository.ts": 1435,
"src/db/repositories/Reservations.repository.ts": 1554,
"src/db/repositories/Reservations.repository.ts": 1551,
"src/db/repositories/Trips.repository.ts": 1121,
"src/db/repositories/Users.repository.ts": 1445,
"src/nest/atlas/atlas.service.ts": 1177,
@@ -12,7 +12,7 @@
"src/nest/doc-sync/doc-sync.service.ts": 1060,
"src/nest/doc-sync/providers/synology-drive.client.ts": 1160,
"src/nest/journey/journey-domain.service.ts": 1659,
"src/nest/places/places.service.ts": 1548,
"src/nest/places/places.service.ts": 1546,
"src/nest/plugins/plugin-runtime.service.ts": 1460,
"src/nest/plugins/runtime/plugin-sdk.ts": 1093,
"src/nest/reservations/reservations.service.ts": 1237,