stakwork / sphinx-tribes

Backend for sphinx tribes and bounties. The bounty platform pays out in bitcoin. Sign up with Sphinx Chat, complete a bounty, and earn bitcoin! Go to our website for available bounties.
https://community.sphinx.chat/bounties
33 stars 60 forks source link

Add Workflow Request Route #1938

Closed humansinstitute closed 1 week ago

humansinstitute commented 1 week ago

Context

As part of implementing the Stakwork workflow plumbing system, we need to add a new route to handle workflow requests.

Technical Details

  1. Route Setup
    // In routes/workflow_routes.go
    // We'll need to add a new route for workflow requests
    func SetupWorkflowRoutes(r *gin.Engine) {
    workflows := r.Group("/workflows")
    {
        workflows.POST("/request", handlers.HandleWorkflowRequest)
    }
    }

Example Route Test

// In routes/workflow_routes_test.go
// We'll need to verify route registration and basic connectivity
func TestWorkflowRoutes(t *testing.T) {
    router := gin.New()
    SetupWorkflowRoutes(router)

    // Test POST request
    w := httptest.NewRecorder()
    req := httptest.NewRequest("POST", "/workflows/request", nil)
    router.ServeHTTP(w, req)

    // Should get 400 because no body (not 404)
    assert.NotEqual(t, 404, w.Code)
}

Notes for Implementer

Tasks

Acceptance Criteria

Dependencies

Shoaibdev7 commented 1 week ago

@humansinstitute assign me?

humansinstitute commented 1 week ago

This is a breakdown of work already assigned to @MahtabBukhari

MahtabBukhari commented 1 week ago

@humansinstitute Could you please assign me?