88d73abaad
Co-authored-by: nova28 <17953305+nova28@users.noreply.github.com> Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
28 lines
1.2 KiB
Go
28 lines
1.2 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
// WorkspacePause is the durable record that makes an Office workspace
|
|
// paused. A workspace is paused exactly when it has an unreleased row
|
|
// (ReleasedAt == nil) in office_workspace_pauses; the partial unique index
|
|
// on workspace_id enforces at most one per workspace.
|
|
type WorkspacePause struct {
|
|
ID string `json:"id" db:"id"`
|
|
WorkspaceID string `json:"workspace_id" db:"workspace_id"`
|
|
Reason string `json:"reason" db:"reason"`
|
|
CreatedBy string `json:"created_by" db:"created_by"`
|
|
CreatedByKind string `json:"created_by_kind" db:"created_by_kind"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
ReleasedAt *time.Time `json:"released_at,omitempty" db:"released_at"`
|
|
ReleasedBy string `json:"released_by,omitempty" db:"released_by"`
|
|
ReleasedReason string `json:"released_reason,omitempty" db:"released_reason"`
|
|
}
|
|
|
|
// InflightRun is one queued-or-claimed run the halt sweep found for a
|
|
// workspace: its id, for cancellation, and its payload task id (empty for
|
|
// a taskless run), for checkout release and execution cancellation.
|
|
type InflightRun struct {
|
|
RunID string `db:"id"`
|
|
TaskID string `db:"task_id"`
|
|
}
|