Files
orbit/pulse/model/occurrence.go

31 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import (
"time"
core "git.yuntuo.hk/k2safe/orbit/model"
)
// Occurrence 表示一个原计划触发点的处理记录,包含触发、跳过或合并决定。
// 对应表 pulse_schedule_occurrences;这是服务端持久化模型,不直接作为 API 响应。
type Occurrence struct {
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
core.Record
// ScheduleID 所属调度计划标识。
ScheduleID core.ID `db:"schedule_id"`
// ScheduleVersion 该触发点采用的计划版本号。
ScheduleVersion uint64 `db:"schedule_version"`
// ScheduledAt 原计划触发时间,统一 UTC;参与触发去重。
ScheduledAt time.Time `db:"scheduled_at"`
// Decision 触发处理决定:已触发、已跳过或已合并。
Decision string `db:"decision"`
// TaskID 已触发或合并生成的 Pulse 任务标识;跳过时为空。
TaskID *core.ID `db:"task_id"`
// CoveredUntil 合并或跳过范围的排除边界;单点处理时为空。
CoveredUntil *time.Time `db:"covered_until"`
// Reason 稳定处理分类;新调度器始终写入,旧人工记录可为空。
Reason *string `db:"reason"`
}
func (Occurrence) TableName() string { return "pulse_schedule_occurrences" }