Skip to content

Implement WebhookEvent model #42

Description

@codebestia

Represents a parsed, verified webhook event delivered by the Shade platform. The data field should be typed as the corresponding resource model rather than a raw dict.

Proposed Steps:

  • Create src/shade/models/webhook.py.
  • Fields: id, type: str, data: Any, created_at: datetime, livemode: bool.
  • Add a WebhookEventType constants class.
  • The Webhook.construct_event() method populates data with the typed model.

Acceptance Criteria:

  • WebhookEvent.from_dict(raw_payload) populates all fields.
  • event.livemode correctly reflects the event origin.
  • event.data is the raw dict at model level; typed model coercion happens in the resource layer.

Activity

  1. lifewithbigdamz commented on Jul 20, 2026

    @lifewithbigdamz

    i would like to work on this issue as a full stack and smart contract developer

  2. Scepter00 commented on Jul 20, 2026

    @Scepter00

    Hi! I'd like to work on this issue.

    I have experience designing typed data models and building SDKs that prioritize clean APIs and maintainability. This issue is a great opportunity to improve the webhook experience by providing a well structured event model while keeping the parsing flow flexible.

    My approach will be to implement a WebhookEvent model that accurately represents verified webhook payloads, including the required fields and a dedicated WebhookEventType constants class. I'll ensure WebhookEvent.from_dict() correctly parses and populates all event fields while keeping the model layer responsible only for representing the webhook payload.

    I'll preserve the separation of responsibilities by leaving event.data as the raw dictionary within the model and ensuring typed resource coercion happens in the resource layer through Webhook.construct_event(). This keeps the implementation clean, extensible, and aligned with the architecture described in the issue.

    I'll also add comprehensive tests covering payload parsing, livemode handling, event type parsing, and the expected model behavior to ensure all acceptance criteria are met.

    I'd be happy to take ownership of this issue and contribute a clean, well tested implementation.

  3. Menjay7 commented on Jul 20, 2026

    @Menjay7

    Hi! I came across this issue and would love to work on it. I have experience with similar tasks and I'm confident I can investigate, implement a clean solution, and thoroughly test it before submitting a PR. If the issue is still open, I would appreciate it if you could assign it to me. Thank you!

  4. Depo-dev commented on Jul 22, 2026

    @Depo-dev
    Contributor

    Hi team

    I’d like to take this one.

    My understanding is that WebhookEvent should act as a clean, reliable wrapper around incoming webhook payloads — handling parsing and normalization, but not taking on responsibility for resource-level typing. That separation keeps the model simple and avoids coupling it to specific resource schemas.

    I’ll add src/shade/models/webhook.py with a WebhookEvent model that includes id, type, data, created_at, and livemode, along with a small WebhookEventType constants class for known event types. The from_dict method will take the raw payload and map fields safely, including parsing created_at into a proper datetime and correctly setting livemode.

    Even though the initial note mentions typed data, I’ll follow the acceptance criteria and keep event.data as the raw dict at this level. Any coercion into typed resource models will happen later in the resource layer, based on event.type.

    I’ll also make sure this integrates cleanly with Webhook.construct_event() so it consistently returns a properly constructed WebhookEvent.

    Happy to get started.

  5. grantfox-oss commented on Jul 23, 2026

    @grantfox-oss

    🦊 GrantFox — @Depo-dev has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #42)
    2. Your PR will be reviewed by the ShadeProtocol maintainers

    Good luck! Track your progress on GrantFox.

  6. grantfox-oss commented on Jul 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign | FWC26 campaign!

    @Depo-dev's PR #52 was approved and merged by @codebestia.

    🏆 @Depo-dev: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (331 total points). Track your full progress on GrantFox.

    👏 Great work, @Depo-dev! Keep contributing to ShadeProtocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions