ericchang00's picture
add screenshot42-taskmanager-projectdetail task (build 2ecba08)
160f5ce verified
Raw History Blame Contribute Delete
1.57 kB
"""Seed task-manager with 1 user (Alice), 1 project (Apollo with Alice as
member), and 4 tasks across 3 statuses for the Kanban verifier."""
import sys
import requests
BASE = "http://127.0.0.1:5101"
def post(path, payload):
r = requests.post(f"{BASE}{path}", json=payload, timeout=10)
if r.status_code >= 400:
print(f"[seed] POST {path} -> {r.status_code} {r.text}", file=sys.stderr)
sys.exit(1)
return r.json()
def main():
alice = post("/api/users", {"name": "Alice", "email": "alice@example.com"})
project = post(
"/api/projects",
{"name": "Apollo", "description": "Mission control",
"owner_id": alice["id"], "member_ids": [alice["id"]]},
)
pid = project["id"]
t1 = post(f"/api/projects/{pid}/tasks",
{"title": "Wire credentials", "created_by": alice["id"],
"status": "todo", "priority": "high"})
t2 = post(f"/api/projects/{pid}/tasks",
{"title": "Draft retro doc", "created_by": alice["id"],
"status": "todo", "priority": "low"})
t3 = post(f"/api/projects/{pid}/tasks",
{"title": "Refactor adapter", "created_by": alice["id"],
"status": "in_progress", "priority": "medium"})
t4 = post(f"/api/projects/{pid}/tasks",
{"title": "Ship migration", "created_by": alice["id"],
"status": "done", "priority": "high"})
print(f"[seed] alice={alice['id']} project={pid} t1={t1['id']} t2={t2['id']} t3={t3['id']} t4={t4['id']}")
if __name__ == "__main__":
main()