Skip to content

POC: Add KkEventFeedType for KK External Entities Event source#405

Draft
turegjorup wants to merge 1 commit into
developfrom
feature/KK_External_Entities_Event_Feed
Draft

POC: Add KkEventFeedType for KK External Entities Event source#405
turegjorup wants to merge 1 commit into
developfrom
feature/KK_External_Entities_Event_Feed

Conversation

@turegjorup
Copy link
Copy Markdown
Contributor

@turegjorup turegjorup commented Apr 27, 2026

Warning

Draft PR for inspiration only. Incomplete and untested.

Summary

  • New KkEventFeedType mirrors the admin UX and POSTER_OUTPUT shape of EventDatabaseApiV2FeedType, but reads events from a KK External Entities Event platform (field model per kkevent-external-entities-README.pdf).
  • New KkEventHelper handles HTTP, response shape detection (Hydra / data / items / flat list), next-upcoming occurrence resolution (via rlanvin/php-rrule for repeated schedules, RDATE/EXDATE handling for the rest), ticket price formatting (øre → kr per the spec), and contactPlace mapping.
  • Widened Poster, Occurrence, Event entity-id fields to int|string|null to carry KK's UUID identifiers. Backwards-compatible with V2's int IDs — only OutputModel/Poster and the V2 helper consume those types in this codebase.
  • Added KK_EVENT_FEED_CACHE_EXPIRE_SECONDS env var (defaults to 300s, parallel to V2).

Configuration

Required secrets:

  • host (exposed)
  • apikey (sent as X-Api-Key header)

Subscription filters: tags, categories, target_groups, district.

Open items / follow-ups

  • API endpoint contract is assumed. The README describes the external entity field model but not the HTTP shape we read from. The helper accepts Hydra (hydra:member/hydra:totalItems), data, items, and flat-list responses; paths assumed are events, events/{uuid}, plus the four taxonomy endpoints. Adjust KkEventHelper::request() once the real contract is known.
  • No Organizer mapping. KK external entities don't have a dedicated organizer field; district is exposed as a taxonomy filter instead. Open to changing this if the platform exposes one.
  • No unit tests yet — happy to add fixture-based tests for mapEventToPoster, formatTicketPriceRange, and resolveNextOccurrence once we have a representative API response sample.
  • Changelog entry not yet added (PR-number convention).

Test plan

  • Confirm assumed endpoint paths against the actual KK platform / adjust as needed
  • Configure a FeedSource with KK secrets and exercise admin search/entity/options/subscription endpoints
  • Verify single mode resolves a UUID correctly and subscription mode honors taxonomy filters and numberOfItems
  • Verify a repeated event renders the next upcoming occurrence (RRULE) rather than an expired start_date
  • Verify ticket price formatting for: no categories, all-zero, single category, multi-category
  • Confirm 404 on a stored UUID unpublishes the dependent slide
  • Add CHANGELOG entry referencing this PR

🤖 Generated with Claude Code

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>
@turegjorup turegjorup self-assigned this Apr 27, 2026
@tuj tuj changed the title Add KkEventFeedType for KK External Entities Event source POC: Add KkEventFeedType for KK External Entities Event source May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant