36 lines
1.4 KiB
JSON
36 lines
1.4 KiB
JSON
{
|
|
"id": "phase1-foundation-18",
|
|
"seq": "18",
|
|
"title": "Create user profile and admin APIs",
|
|
"status": "completed",
|
|
"depends_on": ["17"],
|
|
"parallel": false,
|
|
"context_files": [
|
|
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
|
|
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
|
|
],
|
|
"acceptance_criteria": [
|
|
"GET /api/users/me endpoint created (returns current user)",
|
|
"PATCH /api/users/me endpoint created (update profile, change password)",
|
|
"GET /api/users endpoint created (admin only, list all users)",
|
|
"GET /api/users/:id endpoint created (admin only)",
|
|
"PATCH /api/users/:id endpoint created (admin only, update user)",
|
|
"DELETE /api/users/:id endpoint created (admin only, ban/unban)",
|
|
"All endpoints protected with requireAuth middleware",
|
|
"Admin endpoints protected with requireRole middleware",
|
|
"Input validation with zod",
|
|
"Error handling for unauthorized access",
|
|
"Unit tests written with Vitest",
|
|
"Tests pass with 90%+ coverage"
|
|
],
|
|
"deliverables": [
|
|
"src/app/api/users/me/route.ts",
|
|
"src/app/api/users/route.ts",
|
|
"src/app/api/users/[id]/route.ts",
|
|
"src/services/user.service.ts",
|
|
"src/app/api/users/__tests__/me.test.ts",
|
|
"src/app/api/users/__tests__/users.test.ts",
|
|
"src/app/api/users/__tests__/user-id.test.ts"
|
|
]
|
|
}
|