Skip to content

feat(models): add parent_event_id to Event#96

Merged
cesarenaldi merged 1 commit into
mainfrom
feature/dev-260-parent-event-id
Jun 11, 2026
Merged

feat(models): add parent_event_id to Event#96
cesarenaldi merged 1 commit into
mainfrom
feature/dev-260-parent-event-id

Conversation

@cesarenaldi

@cesarenaldi cesarenaldi commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds parent_event_id to the Event model so sports "more markets" events can be linked to their parent game event.

  • Exposed as EventId | None (not int): upstream returns parentEventId as an integer while event ids are strings, so the value is coerced through the existing coerce_string_id validator to stay comparable with Event.id.
  • Defaults to None; the field is absent on many events and null on parents.
  • Mapped in both the flat-payload normalizer and the alias path.

Verification

  • make check (ruff, format, pyright, pytest) passes. One unrelated network-flaky test (test_secure_client_defaults_wallet_to_current_deposit_wallet) timed out once and passed on rerun.
  • New unit tests cover int-to-string coercion and absent/null defaults.
  • Live smoke: get_event(id='570555') returns parent_event_id == '570146', and get_event(id=child.parent_event_id) round-trips to the parent event, which itself has parent_event_id is None.

Note

Low Risk
Additive optional field on the Event parser with existing coercion patterns; no client or API behavior changes in this diff.

Overview
Adds optional parent_event_id on the gamma Event model so child events (e.g. sports “more markets”) can point at their parent game event.

The API’s parentEventId is wired through the parentEventId alias and the flat-payload _normalize_event path, and integers are coerced to string EventId via the same _coerce_id validator used for id. The field defaults to None when missing or null.

Unit tests cover integer coercion and absent/null defaults.

Reviewed by Cursor Bugbot for commit c966aec. Bugbot is set up for automated code reviews on this repo. Configure here.

@cesarenaldi cesarenaldi merged commit 4b87156 into main Jun 11, 2026
7 checks passed
@cesarenaldi cesarenaldi deleted the feature/dev-260-parent-event-id branch June 11, 2026 13:46
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