Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionLog ¶
type ActionLog struct {
LogID string `json:"logId"`
Action string `json:"action"`
NodeID *string `json:"nodeId,omitempty"`
TaskID *string `json:"taskId,omitempty"`
Operator approval.UserInfo `json:"operator"`
TransferTo *approval.UserInfo `json:"transferTo,omitempty"`
RollbackToNodeID *string `json:"rollbackToNodeId,omitempty"`
AddedAssignees []approval.UserInfo `json:"addedAssignees,omitempty"`
RemovedAssignees []approval.UserInfo `json:"removedAssignees,omitempty"`
CCUsers []approval.UserInfo `json:"ccUsers,omitempty"`
Opinion *string `json:"opinion,omitempty"`
Attachments []string `json:"attachments,omitempty"`
CreatedAt timex.DateTime `json:"createdAt"`
}
ActionLog represents an action log entry in the admin audit view. Person references are uniform UserInfo snapshots captured at action time.
type BusinessProjection ¶ added in v0.38.0
type BusinessProjection struct {
ProjectionID string `json:"projectionId"`
TenantID string `json:"tenantId"`
FlowID string `json:"flowId"`
FlowVersionID string `json:"flowVersionId"`
OwnerInstanceID string `json:"ownerInstanceId"`
AppliedOwnerInstanceID *string `json:"appliedOwnerInstanceId,omitempty"`
BusinessTable string `json:"businessTable"`
RecordKey json.RawMessage `json:"recordKey"`
Consistency config.ApprovalBindingConsistency `json:"consistency"`
DesiredStatus approval.InstanceStatus `json:"desiredStatus"`
DesiredStartedAt timex.DateTime `json:"desiredStartedAt"`
DesiredFinishedAt *timex.DateTime `json:"desiredFinishedAt,omitempty"`
DesiredRevision int64 `json:"desiredRevision"`
AppliedRevision int64 `json:"appliedRevision"`
Status approval.BindingProjectionStatus `json:"status"`
AttemptCount int `json:"attemptCount"`
NextAttemptAt *timex.DateTime `json:"nextAttemptAt,omitempty"`
LeaseUntil *timex.DateTime `json:"leaseUntil,omitempty"`
LastError *string `json:"lastError,omitempty"`
AppliedAt *timex.DateTime `json:"appliedAt,omitempty"`
UpdatedAt timex.DateTime `json:"updatedAt"`
}
BusinessProjection is the operator-facing convergence state for one bound business record.
type Instance ¶
type Instance struct {
InstanceID string `json:"instanceId"`
InstanceNo string `json:"instanceNo"`
Title string `json:"title"`
TenantID string `json:"tenantId"`
FlowID string `json:"flowId"`
FlowName string `json:"flowName"`
Applicant approval.UserInfo `json:"applicant"`
Status string `json:"status"`
CurrentNodeName *string `json:"currentNodeName,omitempty"`
CreatedAt timex.DateTime `json:"createdAt"`
FinishedAt *timex.DateTime `json:"finishedAt,omitempty"`
}
Instance represents an approval instance in the admin view.
type InstanceDetail ¶
type InstanceDetail struct {
Instance InstanceDetailInfo `json:"instance"`
FormSchema json.RawMessage `json:"formSchema,omitempty"`
Timeline []approval.TimelineEntry `json:"timeline"`
FlowGraph approval.InstanceFlowGraph `json:"flowGraph"`
}
InstanceDetail represents the full admin detail view of an approval instance. Each top-level field is one renderable concern: the instance's runtime state, the version-pinned host form-designer document returned verbatim (the counterpart of FlowGraph, which pins the flow definition), the node-by-node timeline, and the progress-annotated flow graph. The raw audit trail stays available through the paginated admin action-log query.
type InstanceDetailInfo ¶
type InstanceDetailInfo struct {
InstanceID string `json:"instanceId"`
InstanceNo string `json:"instanceNo"`
Title string `json:"title"`
TenantID string `json:"tenantId"`
FlowID string `json:"flowId"`
FlowName string `json:"flowName"`
FlowVersionID string `json:"flowVersionId"`
Applicant approval.UserInfo `json:"applicant"`
Status string `json:"status"`
CurrentNodeID *string `json:"currentNodeId,omitempty"`
CurrentNodeName *string `json:"currentNodeName,omitempty"`
BusinessRef *string `json:"businessRef,omitempty"`
FormData map[string]any `json:"formData,omitempty"`
CreatedAt timex.DateTime `json:"createdAt"`
FinishedAt *timex.DateTime `json:"finishedAt,omitempty"`
}
InstanceDetailInfo carries the instance's runtime state within an admin detail view.
type Metrics ¶ added in v0.24.0
type Metrics struct {
// TenantID is the tenant scope of the snapshot. Empty when the
// snapshot is cross-tenant (super-admin only).
TenantID string `json:"tenantId"`
// CapturedAt is the moment the metrics were materialized.
CapturedAt timex.DateTime `json:"capturedAt"`
// InstanceCounts reports running/approved/rejected/withdrawn/returned/
// terminated instance counts. Keys are the InstanceStatus string values.
InstanceCounts map[string]int `json:"instanceCounts"`
// TaskCounts reports task counts indexed by TaskStatus string.
TaskCounts map[string]int `json:"taskCounts"`
// TimeoutTaskCount is the number of pending tasks past their deadline.
TimeoutTaskCount int `json:"timeoutTaskCount"`
// AvgCompletionSeconds is the average end-to-end duration (created_at →
// finished_at) for instances that reached a final status in the
// reporting window. -1 indicates "no completed instances yet".
AvgCompletionSeconds float64 `json:"avgCompletionSeconds"`
// PendingBindingFailures is the number of projection targets whose latest
// write attempt failed and is scheduled for retry.
PendingBindingFailures int `json:"pendingBindingFailures"`
// BusinessProjectionCounts reports durable projection rows by convergence
// status (pending / processing / applied / failed).
BusinessProjectionCounts map[string]int `json:"businessProjectionCounts"`
// PendingBusinessProjections is the number of eventual projections whose
// desired revision has not yet been applied.
PendingBusinessProjections int `json:"pendingBusinessProjections"`
}
Metrics aggregates approval engine health and throughput indicators. It is shaped for admin dashboards and ops alerting, not for fine-grained APM. All counts are tenant-scoped when TenantID is set on the query; super- admin callers can request a cross-tenant view.
type Task ¶
type Task struct {
TaskID string `json:"taskId"`
InstanceID string `json:"instanceId"`
InstanceTitle string `json:"instanceTitle"`
FlowName string `json:"flowName"`
NodeName string `json:"nodeName"`
Assignee approval.UserInfo `json:"assignee"`
Status string `json:"status"`
CreatedAt timex.DateTime `json:"createdAt"`
Deadline *timex.DateTime `json:"deadline,omitempty"`
FinishedAt *timex.DateTime `json:"finishedAt,omitempty"`
}
Task represents an approval task in the admin view.