Poll pending requests every 15 minutes, emit deduplicated escalation notifications, and close requests when creator confirms stage advance. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.2 KiB
Go
37 lines
1.2 KiB
Go
package notification
|
|
|
|
import "time"
|
|
|
|
const (
|
|
EventStageReadyToAdvance = "stage.ready_to_advance"
|
|
EventStageReadyReminder24 = "stage.ready_to_advance.reminder24"
|
|
TypeStageReadyToAdvance = "stage_ready_to_advance"
|
|
TypeStageReadyReminder24 = "stage_ready_reminder_24h"
|
|
)
|
|
|
|
// StageReadyPayload Outbox / 通知载荷。
|
|
type StageReadyPayload struct {
|
|
ProjectID int64 `json:"project_id"`
|
|
WorkflowInstanceID int64 `json:"workflow_instance_id"`
|
|
StageInstanceID int64 `json:"stage_instance_id"`
|
|
StageKey string `json:"stage_key"`
|
|
StageName string `json:"stage_name"`
|
|
ConfigRevision int `json:"config_revision"`
|
|
RequiredDocCount int `json:"required_doc_count"`
|
|
ApprovedDocCount int `json:"approved_doc_count"`
|
|
}
|
|
|
|
// Notification 用户站内通知。
|
|
type Notification struct {
|
|
ID int64 `json:"id"`
|
|
UserID int64 `json:"user_id"`
|
|
ProjectID int64 `json:"project_id"`
|
|
EventID int64 `json:"event_id,omitempty"`
|
|
Type string `json:"type"`
|
|
Title string `json:"title"`
|
|
Body string `json:"body"`
|
|
Status string `json:"status"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
Payload StageReadyPayload `json:"payload,omitempty"`
|
|
}
|