Step 1 of 6
Create webhook configuration model and migration
Persist webhook registrations in the database.
The app uses PostgreSQL with Sequelize and has a migrations folder (e.g., ./migrations). Follow existing naming conventions.
1. Write a new Sequelize migration file that creates a table named "Webhooks" with the following columns: - id: primary key, UUID, not null - url: STRING(2048), not null - event: STRING(100), not null (event name to listen for) - secret: STRING(256), not null (used for HMAC signature) - enabled: BOOLEAN, default true - created_at / updated_at: TIMESTAMP with default now Ensure the migration includes up/down functions and uses snake_case column names. 2. Create a Sequelize model file (e.g., models/webhook.js) that defines the model with the same columns, enables timestamps, and exports it. 3. The model should include a class method `isEnabled()` returning the boolean flag. 4. Do not modify any other files. Keep code ready to run with `npx sequelize db:migrate`.
Expected after this step
Migration and model are present, table created, and model usable in code.
Should not happen
- ✕AI returns a mock migration lacking real column definitions
- ✕API code omits input validation or error handling
- ✕Dispatch function missing retry loop or HMAC signature
- ✕Only a comment is added where an actual function call is required
Verify before continuing
Do not move on until every check is true. The complete button stays locked until then.
Do not continue if…
- !AI returns a mock migration lacking real column definitions
- !API code omits input validation or error handling
- !Dispatch function missing retry loop or HMAC signature
- !Only a comment is added where an actual function call is required
- !Test files contain only descriptions or pseudo‑code, not executable Jest code
- !Endpoints return static strings instead of dynamic JSON payloads
- !Secret handling is omitted or replaced with placeholder values
If the AI messes this up
Use this when the AI fakes progress or breaks the feature. It forces a real fix.
Your previous output lacked a real migration file. Provide a complete Sequelize migration (up/down) that creates the 'Webhooks' table with the exact columns and a functional models/webhook.js file that defines and exports the model.