nomadcode/services/core/internal/notification/model.go
toki ac242e5fac feat: notification event model with workflow context (WFC-EVENTS)
- Add Attempt, Reason, OccurredAt fields to notification.TaskEvent
- Populate workflow context in scheduler event emission via parseTaskEventContext
- Extend proto-socket task.status.changed payload with additive fields
- Update contracts note with new event payload shape
- Archive notification_model subtask to agent-task/archive
- Fix Plane compose path in core domain rules
2026-06-01 13:19:07 +09:00

39 lines
808 B
Go

package notification
import (
"context"
"time"
)
// TaskEventSink receives every task event so non-Mattermost consumers (e.g. the
// proto-socket broadcaster) can fan out task status changes.
type TaskEventSink interface {
HandleTaskEvent(context.Context, TaskEvent) error
}
type TaskNotification struct {
TaskID string
Title string
Status string
Message string
}
type TaskEventType string
const (
TaskEventRunning TaskEventType = "task.running"
TaskEventCompleted TaskEventType = "task.completed"
TaskEventFailed TaskEventType = "task.failed"
TaskEventCanceled TaskEventType = "task.canceled"
)
type TaskEvent struct {
Type TaskEventType
TaskID string
Title string
Status string
Message string
Attempt int
Reason string
OccurredAt time.Time
}