my

package
v0.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailableFlow

type AvailableFlow struct {
	FlowID       string            `json:"flowId"`
	FlowCode     string            `json:"flowCode"`
	FlowName     string            `json:"flowName"`
	FlowIcon     *string           `json:"flowIcon,omitempty"`
	Description  *string           `json:"description,omitempty"`
	Labels       map[string]string `json:"labels,omitempty"`
	CategoryID   string            `json:"categoryId"`
	CategoryName string            `json:"categoryName"`
}

AvailableFlow describes a flow the current user is allowed to initiate.

type CCRecord

type CCRecord struct {
	CCRecordID    string            `json:"ccRecordId"`
	InstanceID    string            `json:"instanceId"`
	InstanceTitle string            `json:"instanceTitle"`
	InstanceNo    string            `json:"instanceNo"`
	FlowName      string            `json:"flowName"`
	FlowIcon      *string           `json:"flowIcon,omitempty"`
	Applicant     approval.UserInfo `json:"applicant"`
	NodeName      *string           `json:"nodeName,omitempty"`
	IsRead        bool              `json:"isRead"`
	CreatedAt     timex.DateTime    `json:"createdAt"`
}

CCRecord represents a CC notification addressed to the current user.

type CompletedTask

type CompletedTask struct {
	TaskID        string            `json:"taskId"`
	InstanceID    string            `json:"instanceId"`
	InstanceTitle string            `json:"instanceTitle"`
	InstanceNo    string            `json:"instanceNo"`
	FlowName      string            `json:"flowName"`
	FlowIcon      *string           `json:"flowIcon,omitempty"`
	Applicant     approval.UserInfo `json:"applicant"`
	NodeName      string            `json:"nodeName"`
	Status        string            `json:"status"`
	FinishedAt    *timex.DateTime   `json:"finishedAt,omitempty"`
}

CompletedTask represents a task the current user has already processed.

type InitiatedInstance

type InitiatedInstance struct {
	InstanceID      string          `json:"instanceId"`
	InstanceNo      string          `json:"instanceNo"`
	Title           string          `json:"title"`
	FlowName        string          `json:"flowName"`
	FlowIcon        *string         `json:"flowIcon,omitempty"`
	Status          string          `json:"status"`
	CurrentNodeName *string         `json:"currentNodeName,omitempty"`
	CreatedAt       timex.DateTime  `json:"createdAt"`
	FinishedAt      *timex.DateTime `json:"finishedAt,omitempty"`
}

InitiatedInstance represents an approval instance submitted by the current user.

type InstanceDetail

type InstanceDetail struct {
	Instance         InstanceInfo               `json:"instance"`
	FormSchema       json.RawMessage            `json:"formSchema,omitempty"`
	Timeline         []approval.TimelineEntry   `json:"timeline"`
	FlowGraph        approval.InstanceFlowGraph `json:"flowGraph"`
	AvailableActions []string                   `json:"availableActions"`
	// FieldPermissions is the viewer-scoped field interactivity projection,
	// materialized for every top-level form field — the client applies it
	// verbatim (no default resolution). Instance.FormData is already stripped
	// of the fields this viewer may not see.
	FieldPermissions map[string]approval.Permission `json:"fieldPermissions,omitempty"`
	// MyTask is the viewer's own actionable context: the pending task
	// process_task should target plus the node-level configuration the client
	// needs to build the action UI without re-deriving engine semantics. Nil
	// when the viewer holds no pending task on this instance.
	MyTask *ViewerTask `json:"myTask,omitempty"`
}

InstanceDetail is the self-service detail view for 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 schema the instance was submitted under — the counterpart of FlowGraph, which pins the flow definition), the node-by-node timeline for the transit-record view, the progress-annotated flow graph for the read-only diagram, and the viewer-specific action set.

type InstanceInfo

type InstanceInfo struct {
	InstanceID      string            `json:"instanceId"`
	InstanceNo      string            `json:"instanceNo"`
	Title           string            `json:"title"`
	FlowID          string            `json:"flowId"`
	FlowCode        string            `json:"flowCode"`
	FlowName        string            `json:"flowName"`
	FlowIcon        *string           `json:"flowIcon,omitempty"`
	Labels          map[string]string `json:"labels,omitempty"`
	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"`
}

InstanceInfo holds the instance's runtime state within a detail view. Labels are the flow's host-owned selection metadata, read from the mutable flow at query time (like FlowName / FlowIcon — display identity, not a version-pinned snapshot).

type PendingCounts

type PendingCounts struct {
	PendingTaskCount int `json:"pendingTaskCount"`
	UnreadCCCount    int `json:"unreadCcCount"`
}

PendingCounts holds the counts of pending actions for the current user.

type PendingTask

type PendingTask struct {
	TaskID        string            `json:"taskId"`
	InstanceID    string            `json:"instanceId"`
	InstanceTitle string            `json:"instanceTitle"`
	InstanceNo    string            `json:"instanceNo"`
	FlowName      string            `json:"flowName"`
	FlowIcon      *string           `json:"flowIcon,omitempty"`
	Applicant     approval.UserInfo `json:"applicant"`
	NodeName      string            `json:"nodeName"`
	CreatedAt     timex.DateTime    `json:"createdAt"`
	Deadline      *timex.DateTime   `json:"deadline,omitempty"`
	IsTimeout     bool              `json:"isTimeout"`
}

PendingTask represents a task that is awaiting the current user's action.

type RemovableAssignee added in v0.39.0

type RemovableAssignee struct {
	TaskID   string            `json:"taskId"`
	Assignee approval.UserInfo `json:"assignee"`
	// Status is the peer task's status verbatim (pending / waiting).
	Status string `json:"status"`
}

RemovableAssignee is one peer task eligible for removal.

type RollbackTarget added in v0.39.0

type RollbackTarget struct {
	NodeID string `json:"nodeId"`
	Name   string `json:"name"`
}

RollbackTarget is one valid rollback destination.

type StartForm added in v0.39.0

type StartForm struct {
	FlowID      string          `json:"flowId"`
	FlowCode    string          `json:"flowCode"`
	FlowName    string          `json:"flowName"`
	FlowIcon    *string         `json:"flowIcon,omitempty"`
	Description *string         `json:"description,omitempty"`
	VersionID   string          `json:"versionId"`
	Version     int             `json:"version"`
	FormSchema  json.RawMessage `json:"formSchema,omitempty"`
}

StartForm is the pre-submission view of a flow for an applicant: the identity fields needed to render the initiation header plus the published version's host form-designer document, returned verbatim like the detail views. Loading it is gated exactly like starting the instance — active flow, initiation permission, published version — so a rendered form always implies a startable flow.

type ViewerTask added in v0.39.0

type ViewerTask struct {
	TaskID string `json:"taskId"`
	NodeID string `json:"nodeId"`
	// IsOpinionRequired mirrors the node config: approve/reject must carry a
	// non-empty opinion when set.
	IsOpinionRequired bool `json:"isOpinionRequired"`
	// AddAssigneeTypes lists the positions the node allows for dynamic
	// assignee addition; empty when adding assignees is not allowed.
	AddAssigneeTypes []approval.AddAssigneeType `json:"addAssigneeTypes,omitempty"`
	// RollbackTargets are the valid rollback destinations, resolved from the
	// node's rollback config and the instance's visit trail exactly like the
	// rollback command validates them; empty when rollback is not allowed.
	RollbackTargets []RollbackTarget `json:"rollbackTargets,omitempty"`
	// RemovableAssignees are the peer tasks the viewer may remove, resolved
	// exactly like the remove-assignee command authorizes them: still-actionable
	// peers of the viewer's own visit, excluding the viewer; empty when the
	// node disallows removal.
	RemovableAssignees []RemovableAssignee `json:"removableAssignees,omitempty"`
}

ViewerTask is the viewer's pending task within a detail view, with the current node's action configuration resolved server-side.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL