package governance import "time" type ReleaseBatchState string const ( ReleaseBatchDraft ReleaseBatchState = "draft" ReleaseBatchSealed ReleaseBatchState = "sealed" ReleaseBatchCancelled ReleaseBatchState = "cancelled" ) func (state ReleaseBatchState) Valid() bool { switch state { case ReleaseBatchDraft, ReleaseBatchSealed, ReleaseBatchCancelled: return true default: return false } } type ReleaseBatch struct { ID string `json:"id"` Name string `json:"name"` State ReleaseBatchState `json:"state"` PolicyVersion string `json:"policy_version"` CreatedBy string `json:"created_by"` SealedBy string `json:"sealed_by"` ItemCount int `json:"item_count"` CreatedAt time.Time `json:"created_at"` SealedAt *time.Time `json:"sealed_at"` ReleaseChangeSetID string `json:"release_change_set_id,omitempty"` } type CreateReleaseBatchRequest struct { Name string CreatedBy string PublicationIDs []string DeletePublicationIDs []string // ReleaseChangeSetID (R1): a formal batch must cite a CONFIRMED persistent // release change set. Empty means "freeze the live plan at bind time" (P0-1). ReleaseChangeSetID string // SealImmediately (P0-3): 建批后立即锁定。清单在冻结时已不可变,草稿态只剩 // "查看/锁定"两个按钮,等于让操作员多按一次;锁定仍会逐项复核门禁。 SealImmediately bool Now time.Time } type SealReleaseBatchRequest struct { BatchID string SealedBy string Now time.Time } type ReleaseBatchFilter struct { State string Limit int Offset int } type ReleaseBatchPage struct { Items []ReleaseBatch `json:"items"` Total int `json:"total"` Limit int `json:"limit"` Offset int `json:"offset"` } type ReleaseBatchItemView struct { PublicationID string `json:"publication_id"` Title string `json:"title"` DecidedVisibility Visibility `json:"decided_visibility"` Action string `json:"action"` } type ReleaseBatchDetail struct { ReleaseBatch Items []ReleaseBatchItemView `json:"items"` }