Feat v0.3.2 workflow engine (#16)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #16.
This commit is contained in:
@@ -633,6 +633,19 @@ func (s *WorkflowStore) ListAssignmentsByInstance(ctx context.Context, instanceI
|
||||
ORDER BY created_at ASC`, instanceID)
|
||||
}
|
||||
|
||||
func (s *WorkflowStore) ListAssignmentsByUser(ctx context.Context, userID string, status string) ([]models.WorkflowAssignment, error) {
|
||||
q := `SELECT id, instance_id, stage, team_id, assigned_to, status,
|
||||
review_data, claimed_at, completed_at, created_at
|
||||
FROM workflow_assignments WHERE assigned_to = ?`
|
||||
args := []interface{}{userID}
|
||||
if status != "" {
|
||||
q += " AND status = ?"
|
||||
args = append(args, status)
|
||||
}
|
||||
q += " ORDER BY created_at DESC"
|
||||
return s.queryAssignments(ctx, q, args...)
|
||||
}
|
||||
|
||||
func (s *WorkflowStore) queryAssignments(ctx context.Context, q string, args ...interface{}) ([]models.WorkflowAssignment, error) {
|
||||
rows, err := DB.QueryContext(ctx, q, args...)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user