POC: Add KkEventFeedType for KK External Entities Event source#405
Draft
turegjorup wants to merge 1 commit into
Draft
POC: Add KkEventFeedType for KK External Entities Event source#405turegjorup wants to merge 1 commit into
turegjorup wants to merge 1 commit into
Conversation
Mirrors the EventDatabaseApiV2FeedType admin UX and POSTER_OUTPUT shape, but sources events from the KK External Entities Event platform per the field model in kkevent-external-entities-README.pdf. - KkEventFeedType: single + subscription modes, search/entity/options/subscription config endpoints, taxonomy filters (tags, categories, target_groups, district), Redis caching identical to V2. - KkEventHelper: payload mapping including next-upcoming occurrence resolution via rlanvin/php-rrule, ticket price formatting (øre→kr), contact→Place mapping. - Widened Poster/Occurrence/Event entity-id fields to int|string|null to support KK's UUID identifiers (backwards-compatible with V2 ints). - Added KK_EVENT_FEED_CACHE_EXPIRE_SECONDS env var. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Warning
Draft PR for inspiration only. Incomplete and untested.
Summary
KkEventFeedTypemirrors the admin UX andPOSTER_OUTPUTshape ofEventDatabaseApiV2FeedType, but reads events from a KK External Entities Event platform (field model perkkevent-external-entities-README.pdf).KkEventHelperhandles HTTP, response shape detection (Hydra /data/items/ flat list), next-upcoming occurrence resolution (viarlanvin/php-rruleforrepeatedschedules,RDATE/EXDATEhandling for the rest), ticket price formatting (øre → kr per the spec), andcontact→Placemapping.Poster,Occurrence,Evententity-id fields toint|string|nullto carry KK's UUID identifiers. Backwards-compatible with V2's int IDs — onlyOutputModel/Posterand the V2 helper consume those types in this codebase.KK_EVENT_FEED_CACHE_EXPIRE_SECONDSenv var (defaults to 300s, parallel to V2).Configuration
Required secrets:
host(exposed)apikey(sent asX-Api-Keyheader)Subscription filters:
tags,categories,target_groups,district.Open items / follow-ups
hydra:member/hydra:totalItems),data,items, and flat-list responses; paths assumed areevents,events/{uuid}, plus the four taxonomy endpoints. AdjustKkEventHelper::request()once the real contract is known.Organizermapping. KK external entities don't have a dedicated organizer field;districtis exposed as a taxonomy filter instead. Open to changing this if the platform exposes one.mapEventToPoster,formatTicketPriceRange, andresolveNextOccurrenceonce we have a representative API response sample.Test plan
FeedSourcewith KK secrets and exercise admin search/entity/options/subscription endpointssinglemode resolves a UUID correctly andsubscriptionmode honors taxonomy filters andnumberOfItemsrepeatedevent renders the next upcoming occurrence (RRULE) rather than an expiredstart_date🤖 Generated with Claude Code