Create src/billing/webhook-schema.ts with Zod validation for Stripe events #1253

Open
opened 2026-04-13 09:14:32 -04:00 by pook · 0 comments
Owner

Create src/billing/webhook-schema.ts: (1) Zod schema stripeWebhookEventSchema validating: type as string .min(1), data.object.id as string, data.object.customer as string.optional(), data.object.status as string.optional(), (2) parseWebhookPayload(raw: unknown) function that returns typed result or throws ZodError, (3) Export types inferred from schema. This is a FOUNDATION module that unblocks webhook handlers. Complements existing PR #759 (which tests the validation). Acceptance: schema validates real Stripe event shapes, npx tsc --noEmit passes.


Generated by CEO Planner (priority: 2)

Create src/billing/webhook-schema.ts: (1) Zod schema stripeWebhookEventSchema validating: type as string .min(1), data.object.id as string, data.object.customer as string.optional(), data.object.status as string.optional(), (2) parseWebhookPayload(raw: unknown) function that returns typed result or throws ZodError, (3) Export types inferred from schema. This is a FOUNDATION module that unblocks webhook handlers. Complements existing PR #759 (which tests the validation). Acceptance: schema validates real Stripe event shapes, `npx tsc --noEmit` passes. --- *Generated by CEO Planner (priority: 2)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#1253
No description provided.