package events

import "time"

type Event struct {
	ID      string
	Type    string
	Subject string
	// Payload is stored as a JSON object in the durable outbox.
	Payload   []byte
	CreatedAt time.Time
}

const (
	RepoChanged          = "repo.changed"
	BranchUpdated        = "branch.updated"
	WorkspaceLeased      = "workspace.leased"
	WorkspaceReleased    = "workspace.released"
	WorkspaceDirty       = "workspace.dirty"
	OperationStarted     = "operation.started"
	OperationCompleted   = "operation.completed"
	OperationFailed      = "operation.failed"
	AgentRunStarted      = "agent.run.started"
	AgentRunCompleted    = "agent.run.completed"
	ChangeRequestOpened  = "change_request.opened"
	ChangeRequestUpdated = "change_request.updated"
	ChangeRequestMerged  = "change_request.merged"
	ChangeRequestClosed  = "change_request.closed"
	ProviderWebhook      = "provider.webhook.received"
)

const PayloadEncodingJSON = "application/json"
