feat: add query-events ability as single event query primitive#156
Merged
feat: add query-events ability as single event query primitive#156
Conversation
New ability `data-machine-events/query-events` centralizes all event date queries behind one primitive. Every consumer that previously built its own WP_Query + posts_clauses filters now calls this ability. - New EventDateQueryAbilities class with scope/date/tax/geo/search params - CalendarAbilities refactored: uses ability instead of EventQueryBuilder - 6 abilities refactored: Health, Timezone, Encoding, QualityAudit, TicketUrlResync, DuplicateDetection — all inline posts_clauses removed - CLI EventQueryTrait: inline filters replaced with ability call - EventUpsert: 5 dedup methods switched from inline filters to date_match - EventQueryBuilder deprecated (kept for external compatibility) - Net -109 lines: simpler code, consistent behavior across all consumers
Contributor
Homeboy Results —
|
…ilities PageBoundary SQL logic now lives in CalendarAbilities (its only caller). Taxonomy_Helper SQL logic now lives in FilterAbilities (its only caller). Both utility classes deprecated with pointers to the abilities. This eliminates raw SQL that bypassed the abilities layer. The principle: business logic lives in the ability, utility classes don't write SQL. - CalendarAbilities: absorbs compute_unique_event_dates() + cache - FilterAbilities: absorbs get_batch_term_counts(), hierarchy building - FilterAbilities::flatten_hierarchy() stays public (render.php uses it) - render.php: imports FilterAbilities instead of Taxonomy_Helper - DateFilter dependency removed from Taxonomy_Helper's SQL
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
New ability
data-machine-events/query-events— the single primitive for all event date queries. Every consumer that previously built its ownWP_Query + posts_clausesfilters now calls this ability.Architecture
Input Schema
Files Changed (13)
EventDateQueryAbilities.phpCalendarAbilities.phpEventHealthAbilities.phpTimezoneAbilities.phpEncodingFixAbilities.phpEventQualityAuditAbilities.phpTicketUrlResyncAbilities.phpDuplicateDetectionAbilities.phpEventQueryTrait.phpEventUpsert.phpEventQueryBuilder.phpEventQueryAbilities.phpdata-machine-events.phpNet: -109 lines — removes more code than it adds.
Verification
Cross-repo PR