Skip to content

Extract webhook activity mapper#58

Open
GarbageBoy8 wants to merge 1 commit into
Adamantine-guild:mainfrom
GarbageBoy8:issue-46-webhook-activity-mapper
Open

Extract webhook activity mapper#58
GarbageBoy8 wants to merge 1 commit into
Adamantine-guild:mainfrom
GarbageBoy8:issue-46-webhook-activity-mapper

Conversation

@GarbageBoy8

Copy link
Copy Markdown

Summary

Closes #46

Extracts webhook-to-activity mapping from the webhook route handler into a dedicated activity
mapper service.

Changes

  • Moved webhook event mapping logic out of apps/dashboard/app/api/webhooks/route.ts
  • Added a focused mapper module for converting validated webhook payloads into ActivityEvent | null
  • Kept unsupported webhook event types returning null
  • Added tests covering membership, pass, guild, and verification event mappings
  • Added coverage for payloads missing optional display fields such as names

Why

This keeps the route handler focused on HTTP concerns like validation, idempotency, storage,
and responses, while making webhook activity mapping easier to test, reuse, and extend safely.

Testing

  • Added activity mapper tests for supported webhook event types
  • Verified existing webhook response behavior remains unchanged

@Lakes41 Lakes41 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job, Do resolve conflicts @GarbageBoy8

@Lakes41

Lakes41 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@GarbageBoy8 Do resolve conflicts, I might have to take you off when it 24 hours

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.

Extract webhook mapping into a tested service

2 participants