NewEvent constructs an Event with a fresh ID and now() timestamp. Trigger sites use this rather than building struct literals so the ID format stays consistent (evt_<32-hex>).
(eventType, userID string, data any)
| 151 | // Trigger sites use this rather than building struct literals so the |
| 152 | // ID format stays consistent (evt_<32-hex>). |
| 153 | func NewEvent(eventType, userID string, data any) Event { |
| 154 | return Event{ |
| 155 | ID: generateEventID(), |
| 156 | Type: eventType, |
| 157 | CreatedAt: time.Now().UTC(), |
| 158 | UserID: userID, |
| 159 | Data: data, |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | // Envelope is the wire shape sent in the HTTP body to webhook |
| 164 | // subscribers. Stable across retries — the event_payload JSON column |
no test coverage detected