fix(rooms): allow moving a room to another room type, same-property checked - #319
Merged
telivity-otaip merged 3 commits intoAug 13, 2026
Merged
Conversation
…hecked UpdateRoomDto omits roomTypeId entirely, so PATCH /rooms/:id cannot re-categorise a room — there is no API path at all for a legitimate admin operation (splitting a shared type into per-room types, re-tiering inventory). Re-added as an optional update field WITH the FK-ownership check the codebase already applies to inbound-reservation mappings: the target type must belong to the same property, or 404 — an update can never re-point a room at another tenant's type.
Follow-up on the roomTypeId PATCH unlock: reject moves while the room is occupied or linked to an assigned/in-house reservation (avoids desyncing reservation.roomTypeId), and cover FK ownership + guards in unit tests. Co-authored-by: Charles Pizzato <311327716+modernitconsultants@users.noreply.github.com>
Collaborator
|
Pushed a small follow-up on your branch (maintainer edit) — credit stays with you via On top of the
Your original change is unchanged in intent; this just hardens the edge cases before merge. Thanks again for the fix. |
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.
UpdateRoomDtoomitsroomTypeIdentirely, soPATCH /rooms/:idcannot re-categorise a room — there's no API path at all for a legitimate admin operation (splitting a shared type into per-room types, re-tiering inventory). We hit it doing exactly that restructure.Re-added as an optional update field with the FK-ownership check the codebase already applies to inbound-reservation mappings: the target type must belong to the same property, or 404 — an update can never re-point a room at another tenant's type. That check is presumably why the field was omitted; this keeps the protection while restoring the operation.