-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add new filters to orders/tickets endpoints #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds new filter capabilities to the orders and tickets endpoints to enhance search functionality. The implementation adds support for filtering by ticket owner email, ticket numbers, order numbers, and order owner email across multiple API endpoints.
- Added filter mappings for tickets_owner_email and tickets_number in the order repository
- Enhanced ticket repository with order_owner_email filter support
- Extended API controllers to support new filter parameters with proper validation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/Repositories/Summit/DoctrineSummitOrderRepository.php | Added filter mappings for tickets_owner_email and tickets_number using EXISTS subqueries |
| app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php | Added order_owner_email filter mapping and updated alias requirements |
| app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTicketApiController.php | Added '@@' operator support for number and order_number filters |
| app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitOrdersApiController.php | Added new filter parameters with validation for tickets_number, tickets_owner_email, number, and owner_email |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| JOIN to1:i.owner to1_o:i | ||
| LEFT JOIN to1_o:i.member to1_o_m:i | ||
| WHERE to1:i.order = e AND COALESCE(LOWER(to1_o:i.email), LOWER(to1_o_m:i.email)) :operator :value )',SummitAttendeeTicket::class), | ||
| 'tickets_number' => sprintf('EXISTS ( SELECT 1 FROM %s to1:i where to1:i.order = e )',SummitAttendeeTicket::class), |
Copilot
AI
Oct 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tickets_number filter is incomplete. It only checks for existence of tickets but doesn't filter by the actual ticket number. The WHERE clause should include a condition to match the ticket number against the filter value, similar to how tickets_owner_email is implemented.
| 'tickets_number' => sprintf('EXISTS ( SELECT 1 FROM %s to1:i where to1:i.order = e )',SummitAttendeeTicket::class), | |
| 'tickets_number' => sprintf('EXISTS ( SELECT 1 FROM %s to1:i WHERE to1:i.order = e AND to1:i.number :operator :value )',SummitAttendeeTicket::class), |
| 'tickets_owner_email' => sprintf('EXISTS ( SELECT 1 FROM %s to1:i | ||
| JOIN to1:i.owner to1_o:i | ||
| LEFT JOIN to1_o:i.member to1_o_m:i | ||
| WHERE to1:i.order = e AND COALESCE(LOWER(to1_o:i.email), LOWER(to1_o_m:i.email)) :operator :value )',SummitAttendeeTicket::class), |
Copilot
AI
Oct 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The query spans multiple lines but lacks proper indentation and formatting consistency. Consider reformatting for better readability, especially aligning the JOIN clauses and WHERE conditions.
| 'tickets_owner_email' => sprintf('EXISTS ( SELECT 1 FROM %s to1:i | |
| JOIN to1:i.owner to1_o:i | |
| LEFT JOIN to1_o:i.member to1_o_m:i | |
| WHERE to1:i.order = e AND COALESCE(LOWER(to1_o:i.email), LOWER(to1_o_m:i.email)) :operator :value )',SummitAttendeeTicket::class), | |
| 'tickets_owner_email' => sprintf( | |
| 'EXISTS ( | |
| SELECT 1 FROM %s to1:i | |
| JOIN to1:i.owner to1_o:i | |
| LEFT JOIN to1_o:i.member to1_o_m:i | |
| WHERE to1:i.order = e | |
| AND COALESCE(LOWER(to1_o:i.email), LOWER(to1_o_m:i.email)) :operator :value | |
| )', | |
| SummitAttendeeTicket::class | |
| ), |
GET api/v1/summits/{id}/orders/me
* tickets_owner_email
* tickets_number
GET api/v1/summits/{id}/orders/all/tickets/me
* order_number
* number
* order_owner_email
GET api/v1/summits/all/orders/{order_id}/tickets
* number
* owner_email
19a752f to
60c2879
Compare
2bed1f0 to
412e652
Compare
* feat: add new filters to orders/tickets endpoints
GET api/v1/summits/{id}/orders/me
* tickets_owner_email
* tickets_number
GET api/v1/summits/{id}/orders/all/tickets/me
* order_number
* number
* order_owner_email
GET api/v1/summits/all/orders/{order_id}/tickets
* number
* owner_email
* fix: add missing filter order_owner_email
* fix: query missing class
* chore: fix filter
ref : https://app.clickup.com/t/86b6z7ema
GET api/v1/summits/{id}/orders/me
GET api/v1/summits/{id}/orders/all/tickets/me
GET api/v1/summits/all/orders/{order_id}/tickets