mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 11:06:06 +00:00
fix(db): find no nearest day for a date the calendar does not have
The nearest-day fallback of a booking's time cast the bound date to a timestamp on Postgres, which refuses 2024-02-30 with a 500, while SQLite's JULIANDAY rolled it over into March and placed the booking there. dayDistance now refuses anything but a calendar date on both engines (isCalendarDate), so a caller that forgets the check fails on SQLite too, and findNearestDayId answers no day for such a date. The size baseline of Reservations.repository.ts drops by one line.
This commit is contained in:
@@ -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": 1551,
|
||||
"src/db/repositories/Reservations.repository.ts": 1550,
|
||||
"src/db/repositories/Trips.repository.ts": 1120,
|
||||
"src/db/repositories/Users.repository.ts": 1421,
|
||||
"src/nest/atlas/atlas.service.ts": 1174,
|
||||
|
||||
Reference in New Issue
Block a user