Lean event struct passed to webhook handlers (D2-29).
Deliberately does NOT include the raw Stripe object -- handlers
call Accrue.Processor.retrieve_*(event.object_id) for canonical state.
This forces WH-10 compliance (re-fetch current state) by shape.
The type field is kept as a String.t() in the struct. Conversion
to atom for pattern-matching dispatch happens at the handler call site
in Plan 04, using String.to_existing_atom/1 with a bounded allow-list.
Summary
Functions
Projects a %LatticeStripe.Event{} struct into an %Accrue.Webhook.Event{}.
Projects a persisted %Accrue.Webhook.WebhookEvent{} DB row into an
%Accrue.Webhook.Event{}.
Types
Functions
@spec from_stripe(LatticeStripe.Event.t(), atom()) :: t()
Projects a %LatticeStripe.Event{} struct into an %Accrue.Webhook.Event{}.
Extracts the object ID from data["object"]["id"] (string keys, as
returned by LatticeStripe.Event.from_map/1).
@spec from_webhook_event(Accrue.Webhook.WebhookEvent.t()) :: t()
Projects a persisted %Accrue.Webhook.WebhookEvent{} DB row into an
%Accrue.Webhook.Event{}.
Used by Accrue.Webhook.DispatchWorker to build the lean event struct
from the stored row (different from from_stripe/2 which projects from
a live LatticeStripe.Event).