1.7 KiB
1.7 KiB
1. Permission Error Helper
- 1.1 Create
cmd/errors.gowithfriendlyAPIError(err error, operation string, permissionHint string) errorfunction - 1.2 Handle 401 (auth failed), 403 (permission denied with optional hint), 404 (not found / no access), and passthrough for non-API errors and unknown status codes
2. Client Methods
- 2.1 Add
CreateProject(ctx, fields) (*model.Project, error)toclient/projects.go— POST /api/projects - 2.2 Add
DeleteProject(ctx, id) errortoclient/projects.go— DELETE /api/projects/{id} - 2.3 Add
CreateBoard(ctx, projectId, fields) (*model.Board, error)toclient/boards.go— POST /api/projects/{projectId}/boards - 2.4 Add
DeleteBoard(ctx, id) errortoclient/boards.go— DELETE /api/boards/{id}
3. Project Commands
- 3.1 Add
projectCreateCmdtocmd/project.gowith--name(required),--type(required, values: public/private), and--description(optional) flags - 3.2 Add
projectDeleteCmdtocmd/project.goaccepting a positional project ID argument - 3.3 Wire both commands with
friendlyAPIError— create uses empty hint, delete uses "requires project manager role"
4. Board Commands
- 4.1 Add
boardCreateCmdtocmd/board.gowith--project(required),--name(required), and--position(optional, default 65536) flags - 4.2 Add
boardDeleteCmdtocmd/board.goaccepting a positional board ID argument - 4.3 Wire both commands with
friendlyAPIErrorusing "requires project manager role" hint
5. Verification
- 5.1 Run
go buildto verify compilation - 5.2 Run existing test suite (
test.sh) to verify no regressions