Files
orbit/pulse/model/occurrence.go

31 lines
1.3 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" }