Guard quick check-in against conflicting bookings#2077
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the booking check-in functionality to prevent conflicts when multiple bookings share the same assets. It ensures that when checking in a booking, only assets that are not actively used by other ongoing or overdue bookings are marked as available.
Key Changes:
- Modified asset filtering logic to check for active booking conflicts before allowing asset status updates
- Updated database query to include linked booking information for conflict detection
- Added comprehensive test coverage for conflict scenarios and partial check-in history handling
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/modules/booking/service.server.ts | Updated checkinBooking function to include booking status checks and prevent asset conflicts |
| app/modules/booking/service.server.test.ts | Added test cases for partial check-in history and booking conflict scenarios |
…r asset mix - Scope booking relation query to only load ONGOING and OVERDUE bookings for performance - Add test covering the exact bug scenario: booking with kit (3 assets) + singular asset where singular was in partial check-in history - All 4 assets should be reset to AVAILABLE on full check-in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
https://chatgpt.com/codex/tasks/task_b_68dd468da6648320b46c4cb44ababb32