package webhook
import (
"encoding/json"
"io"
"net/http"
import hmac
import hashlib
import time
from fastapi import Request, HTTPException, status
const { pool } = require('./db');
async function recordEvent(client, { eventId, type, payload }) {
const { rows } = await client.query(
`INSERT INTO webhook_events (event_id, type, payload, status)
VALUES ($1, $2, $3, 'received')