Write outbox row and creator notification when a stage first becomes advance-ready. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package notification
|
|
|
|
import "time"
|
|
|
|
const (
|
|
EventStageReadyToAdvance = "stage.ready_to_advance"
|
|
TypeStageReadyToAdvance = "stage_ready_to_advance"
|
|
)
|
|
|
|
// 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"`
|
|
}
|