Changeset 0.29.0 (#195)

This commit is contained in:
2026-03-17 16:28:47 +00:00
parent 128cbb8174
commit 5d637d3a90
129 changed files with 9418 additions and 3016 deletions

View File

@@ -28,4 +28,30 @@ type WorkflowStore interface {
Publish(ctx context.Context, v *models.WorkflowVersion) error
GetVersion(ctx context.Context, workflowID string, versionNumber int) (*models.WorkflowVersion, error)
GetLatestVersion(ctx context.Context, workflowID string) (*models.WorkflowVersion, error)
// ── Assignments (v0.29.0-cs3) ──
// CreateAssignment inserts a workflow_assignments row.
CreateAssignment(ctx context.Context, a *WorkflowAssignment) error
// ListAssignmentsForTeam returns assignments for a team filtered by status.
ListAssignmentsForTeam(ctx context.Context, teamID, status string) ([]WorkflowAssignment, error)
// ListAssignmentsMine returns claimed + unassigned assignments visible to a user.
ListAssignmentsMine(ctx context.Context, userID string) ([]WorkflowAssignment, error)
// ClaimAssignment sets assigned_to and status='claimed' on an unassigned row.
// Returns rows affected (0 = already claimed or not found).
ClaimAssignment(ctx context.Context, assignmentID, userID string) (int64, error)
// CompleteAssignment sets status='completed' on a claimed row.
// Returns rows affected (0 = not claimed or not found).
CompleteAssignment(ctx context.Context, assignmentID string) (int64, error)
// GetAssignmentChannelID returns the channel_id for an assignment.
GetAssignmentChannelID(ctx context.Context, assignmentID string) (string, error)
// TryRoundRobin finds the least-recently-assigned team member and claims.
// Returns the assigned user ID, or "" if no members available.
TryRoundRobin(ctx context.Context, teamID, assignmentID string) (string, error)
}