Files
pad/internal/models/webhook.go
T
xarmian 86722d7607 feat: Add webhooks, saved views, enhanced dashboard, and dependencies backend
Webhooks:
- Full subsystem with HMAC-SHA256 signing, event filtering, auto-disable
  after 10 failures, test delivery endpoint
- Migration 010_webhooks.sql, model, store CRUD, dispatcher with tests
- Wired into item create/update/delete/move and comment create handlers

Dashboard API:
- active_items: Returns actual in-progress items with refs and priorities
- active_item_count on collections (excludes terminal statuses)
- Blocked item detection in attention (via dependency links)
- isDoneStatus expanded to include cancelled/rejected/fixed/implemented

Saved Views:
- Store CRUD, API handlers, routes for per-collection saved views
- View config stores filters, sort, view_type

Activity:
- Source filtering support (web/cli/agent) in activity list endpoint
2026-03-28 13:55:06 +00:00

26 lines
912 B
Go

package models
import "time"
// Webhook represents a registered webhook endpoint that receives
// POST notifications when events occur in a workspace.
type Webhook struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
URL string `json:"url"`
Secret string `json:"secret,omitempty"`
Events string `json:"events"`
Active bool `json:"active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LastTriggeredAt *time.Time `json:"last_triggered_at,omitempty"`
FailureCount int `json:"failure_count"`
}
// WebhookCreate is the input for registering a new webhook.
type WebhookCreate struct {
URL string `json:"url"`
Secret string `json:"secret,omitempty"`
Events string `json:"events,omitempty"` // JSON array of event types, defaults to ["*"]
}