8000 Fixed the overlapping dates and made sure that the following adjacent dates. by sahajsrivastava044-spec · Pull Request #48 · aelassas/movinin · GitHub
[go: up one dir, main page]

Skip to content

Fixed the overlapping dates and made sure that the following adjacent dates. - #48

Merged
aelassas merged 1 commit into
aelassas:mainfrom
sahajsrivastava044-spec:fix/issue-47-OverlappingBooking
Oct 28, 2026
Merged

aelassas merged 1 commit into
aelassas:mainfrom
sahajsrivastava044-spec:fix/issue-47-OverlappingBooking

Conversation

@sahajsrivastava044-spec
Copy link
Copy Markdown
Contributor

Summary

Fixes #47: properties are now available for a new booking that starts on the same date an existing booking checks out.

The availability query now treats booking ranges as end-exclusive. A booking is considered non-overlapping when it ends on or before the requested start, or starts on or after the requested end.

Files changed

File Change and impact
backend/src/controllers/propertyController.ts Uses inclusive boundary checks ($lte / $gte) when determining whether bookings overlap, allowing consecutive bookings while continuing to exclude genuine overlaps.
backend/__tests__/property.test.ts Adds API-level regression coverage for adjacent and overlapping dates, blocking booking statuses, blockOnPay, and availability when no booking exists.

How I verified it:

Ran the focused backend property test suite against a local test database:

npm --prefix backend test -- --runTestsByPath __tests__/property.test.ts

…jacent dates are treated as available slots.
@aelassas
aelassas merged commit 4c46130 into aelassas:main Oct 28, 2026
1 check passed
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.

Bug: Property incorrectly marked unavailable when a new booking starts on the previous booking’s checkout date

2 participants

0