feat(store): add incidents, notification channels and delivery outbox

At most one open incident per monitor is enforced by a partial unique
index.

Refs #15, #16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 01:23:37 +01:00
1 parent 4b4e134bfd
commit ffef63e586
9 files changed
+770 -11

No files matched your search

+35
View File
@@ -70,6 +70,15 @@ type CheckResults1h struct {
MaxLatencyMs interface{}
}
type Incident struct {
ID uuid.UUID
OrgID uuid.UUID
MonitorID uuid.UUID
StartedAt time.Time
ResolvedAt *time.Time
Cause []byte
}
type Invitation struct {
ID uuid.UUID
OrgID uuid.UUID
@@ -101,6 +110,7 @@ type Monitor struct {
Enabled bool
CreatedAt time.Time
UpdatedAt time.Time
Confirmations int32
}
type MonitorRegion struct {
@@ -109,6 +119,31 @@ type MonitorRegion struct {
Region string
}
type Notification struct {
ID uuid.UUID
OrgID uuid.UUID
ChannelID uuid.UUID
IncidentID uuid.UUID
Event string
Status string
Attempts int32
NextAttemptAt time.Time
LastError *string
CreatedAt time.Time
SentAt *time.Time
}
type NotificationChannel struct {
ID uuid.UUID
OrgID uuid.UUID
Name string
Type string
Config []byte
Enabled bool
CreatedAt time.Time
UpdatedAt time.Time
}
type Org struct {
ID uuid.UUID
Slug string