fix(email): honor secondary category in reservation email attributes#1119
fix(email): honor secondary category in reservation email attributes#1119JohnVillalovos merged 1 commit intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where ReservationEmailTemplateContext::ReservationAttributes() did not branch on SecondaryCategory() when filtering scoped reservation attributes, causing attributes scoped to RESOURCE_TYPE or USER to be incorrectly matched against resource IDs. The fix aligns the email context logic with the existing AttributeService::GetReservationAttributes() implementation.
Changes:
- Updated
ReservationAttributes()to branch onSecondaryCategory()using amatchexpression, comparing against resource IDs, resource type IDs, or owner ID depending on the category - Added a test (
testReservationAttributesRespectSecondaryCategoryWhenScoped) that validates correct filtering across all three secondary categories plus global attributes - Extended
ReservationEmailTemplateTestAttributewithForResourceTypeIds()andForUserIds()helper methods
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/Email/Messages/ReservationEmailTemplateContext.php | Branch on SecondaryCategory() in the match expression to intersect against the correct ID domain (resource IDs, resource type IDs, or owner ID) |
| tests/Application/Reservation/ReservationEmailTemplateContextTest.php | Add test covering RESOURCE_TYPE and USER scoped attributes with collision scenarios; add ForResourceTypeIds and ForUserIds helpers |
You can also share your feedback on Copilot code review. Take the survey.
Align ReservationEmailTemplateContext::ReservationAttributes() with reservation attribute scoping rules by filtering scoped attributes using SecondaryCategory(): - RESOURCE against AllResourceIds() - RESOURCE_TYPE against reservation resource type IDs - USER against reservation owner ID This prevents false includes/excludes from ID collisions across category domains and keeps global attributes included. Closes: #1118
1ef2fd3 to
09cb6df
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
You can also share your feedback on Copilot code review. Take the survey.
Align ReservationEmailTemplateContext::ReservationAttributes() with reservation attribute scoping rules by filtering scoped attributes using SecondaryCategory():
This prevents false includes/excludes from ID collisions across category domains and keeps global attributes included.
Closes: #1118