Problem
Bot users can complete or undo multiple homework items at once, but the bot currently loops over targets and calls PUT /api/homeworks/:id/completion once per homework.
That means multi-select operations are slow, partially successful states are harder to report consistently, and authorization/existence checks are duplicated per request.
Proposed server-side feature
Add a batch endpoint, for example:
PUT /api/homeworks/completions
Request shape idea:
{ "items": [{ "homeworkId": "...", "completed": true }] }
Response shape should report per-item result:
- success/failure,
- homework ID,
- completed state,
- completedAt when applicable,
- not-found / forbidden / deleted errors per item.
References
Existing single-item endpoint: src/routes/api/homeworks/[id]/completion/+server.ts and src/lib/api/routes/homework-completion.ts.
Server MCP has set_my_homework_completion, also single-item, in src/lib/mcp/tools/my-data-tools.ts.
Bot currently batches client-side in internal/commands/commands.go setHomeworkCompletionBatch.
Acceptance criteria
- Batch update is atomic where practical, or clearly returns per-item partial results.
- Single-item endpoint remains compatible.
- OpenAPI/schema docs include the new request/response.
- Bot can replace its per-homework loop with one API call.
Problem
Bot users can complete or undo multiple homework items at once, but the bot currently loops over targets and calls
PUT /api/homeworks/:id/completiononce per homework.That means multi-select operations are slow, partially successful states are harder to report consistently, and authorization/existence checks are duplicated per request.
Proposed server-side feature
Add a batch endpoint, for example:
PUT /api/homeworks/completionsRequest shape idea:
{ "items": [{ "homeworkId": "...", "completed": true }] }Response shape should report per-item result:
References
Existing single-item endpoint:
src/routes/api/homeworks/[id]/completion/+server.tsandsrc/lib/api/routes/homework-completion.ts.Server MCP has
set_my_homework_completion, also single-item, insrc/lib/mcp/tools/my-data-tools.ts.Bot currently batches client-side in
internal/commands/commands.gosetHomeworkCompletionBatch.Acceptance criteria