Overview
Replace 6 V1 CRUD routes that currently delegate to admin-v1-mgmt (V1APIHandler) with declarative pipeline primitives using admin-db.
Reference: docs/ADMIN_CONFIG_DECOMPOSITION.md — Phase B
Depends on: Phase A (#85)
Routes to Decompose
All use existing tables in V1Store: companies, projects, workflows, workflow_versions.
| Route |
Pipeline Pattern |
POST /api/v1/admin/organizations/{id}/projects |
request_parse → validate(name) → set(uuid,now) → db_exec(INSERT projects) → json_response(201) |
POST /api/v1/admin/projects/{id}/workflows |
Same pattern, INSERT INTO workflows |
POST /api/v1/admin/workflows |
request_parse → validate(name,project_id,config_yaml) → set(uuid,now) → db_exec(INSERT workflows) → json_response(201) |
PUT /api/v1/admin/workflows/{id} |
request_parse → db_query(check exists) → conditional(found?) → set(now,version_id) → db_exec(UPDATE workflows) → db_exec(INSERT workflow_versions) → db_query(get updated) → json_response(200) |
POST /api/v1/admin/workflows/{id}/deploy |
request_parse → set(now) → db_exec(UPDATE status='active') → db_query(get workflow) → json_response(200) |
POST /api/v1/admin/workflows/{id}/stop |
Same as deploy but status='stopped' |
Pipeline Step Types Used
step.request_parse — path params + body
step.validate — required_fields strategy
step.set — uuid, timestamp generation
step.db_exec — INSERT/UPDATE against admin-db
step.db_query — SELECT with single mode
step.conditional — branching on found/not-found
step.json_response — HTTP response with body/body_from
Verification
- Each route returns correct HTTP status codes
- Data persists correctly in SQLite
- Workflow update creates version history
go test ./... passes
Files to Modify
admin/config.yaml — replace 6 route pipelines
Overview
Replace 6 V1 CRUD routes that currently delegate to
admin-v1-mgmt(V1APIHandler) with declarative pipeline primitives usingadmin-db.Reference:
docs/ADMIN_CONFIG_DECOMPOSITION.md— Phase BDepends on: Phase A (#85)
Routes to Decompose
All use existing tables in V1Store: companies, projects, workflows, workflow_versions.
/api/v1/admin/organizations/{id}/projects/api/v1/admin/projects/{id}/workflows/api/v1/admin/workflows/api/v1/admin/workflows/{id}/api/v1/admin/workflows/{id}/deploy/api/v1/admin/workflows/{id}/stopPipeline Step Types Used
step.request_parse— path params + bodystep.validate— required_fields strategystep.set— uuid, timestamp generationstep.db_exec— INSERT/UPDATE againstadmin-dbstep.db_query— SELECT with single modestep.conditional— branching on found/not-foundstep.json_response— HTTP response with body/body_fromVerification
go test ./...passesFiles to Modify
admin/config.yaml— replace 6 route pipelines