feat(cleanup): vervang open_todos door open_ideas in /api/products/:id/claude-context
Laatste prisma.todo-referentie verwijderd. Endpoint geeft nu open_ideas terug (ideeën van de gebruiker voor dit product die niet gearchiveerd zijn en nog niet status PLANNED hebben). Docs bijgewerkt in docs/api.md en docs/api/rest-contract.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4d51a54a2f
commit
d1df707b78
4 changed files with 26 additions and 14 deletions
|
|
@ -29,14 +29,26 @@ export async function GET(
|
|||
return Response.json({ error: 'Product niet gevonden' }, { status: 404 })
|
||||
}
|
||||
|
||||
const [activeSprint, openTodos] = await Promise.all([
|
||||
const [activeSprint, openIdeas] = await Promise.all([
|
||||
prisma.sprint.findFirst({
|
||||
where: { product_id: id, status: 'ACTIVE' },
|
||||
select: { id: true, sprint_goal: true, status: true },
|
||||
}),
|
||||
prisma.todo.findMany({
|
||||
where: { user_id: auth.userId, product_id: id, done: false, archived: false },
|
||||
select: { id: true, title: true, description: true, created_at: true },
|
||||
prisma.idea.findMany({
|
||||
where: {
|
||||
user_id: auth.userId,
|
||||
product_id: id,
|
||||
archived: false,
|
||||
status: { not: 'PLANNED' },
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
code: true,
|
||||
title: true,
|
||||
description: true,
|
||||
status: true,
|
||||
created_at: true,
|
||||
},
|
||||
orderBy: { created_at: 'asc' },
|
||||
take: 50,
|
||||
}),
|
||||
|
|
@ -89,6 +101,6 @@ export async function GET(
|
|||
product,
|
||||
active_sprint: activeSprint,
|
||||
next_story: nextStoryPayload,
|
||||
open_todos: openTodos,
|
||||
open_ideas: openIdeas,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ curl -H "Authorization: Bearer $TOKEN" https://scrum4me.app/api/products
|
|||
|
||||
### `GET /api/products/:id/claude-context`
|
||||
|
||||
Bundled context voor Claude Code: product, actieve sprint, volgende story (met tasks) en open todos van de tokengebruiker — in één call.
|
||||
Bundled context voor Claude Code: product, actieve sprint, volgende story (met tasks) en open ideas van de tokengebruiker — in één call.
|
||||
|
||||
**Response (200):**
|
||||
```json
|
||||
|
|
@ -111,13 +111,13 @@ Bundled context voor Claude Code: product, actieve sprint, volgende story (met t
|
|||
"priority", "sort_order", "status" }
|
||||
]
|
||||
} | null,
|
||||
"open_todos": [
|
||||
{ "id", "title", "description", "created_at" }
|
||||
"open_ideas": [
|
||||
{ "id", "code", "title", "description", "status", "created_at" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
`open_todos` is gelimiteerd op 50 items, gesorteerd op `created_at` asc. Demo-tokens kunnen dit endpoint lezen.
|
||||
`open_ideas` bevat ideeën van de gebruiker voor dit product die niet gearchiveerd zijn en nog niet de status `PLANNED` hebben (= nog niet als PBI gepromoveerd). Gelimiteerd op 50 items, gesorteerd op `created_at` asc. Demo-tokens kunnen dit endpoint lezen.
|
||||
|
||||
```bash
|
||||
curl -H "Authorization: Bearer $TOKEN" \
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ curl -H "Authorization: Bearer $TOKEN" https://scrum4me.app/api/products
|
|||
|
||||
### `GET /api/products/:id/claude-context`
|
||||
|
||||
Bundled context voor Claude Code: product, actieve sprint, volgende story (met tasks) en open todos van de tokengebruiker — in één call.
|
||||
Bundled context voor Claude Code: product, actieve sprint, volgende story (met tasks) en open ideas van de tokengebruiker — in één call.
|
||||
|
||||
**Response (200):**
|
||||
```json
|
||||
|
|
@ -120,13 +120,13 @@ Bundled context voor Claude Code: product, actieve sprint, volgende story (met t
|
|||
"priority", "sort_order", "status" }
|
||||
]
|
||||
} | null,
|
||||
"open_todos": [
|
||||
{ "id", "title", "description", "created_at" }
|
||||
"open_ideas": [
|
||||
{ "id", "code", "title", "description", "status", "created_at" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
`open_todos` is gelimiteerd op 50 items, gesorteerd op `created_at` asc. Demo-tokens kunnen dit endpoint lezen.
|
||||
`open_ideas` bevat ideeën van de gebruiker voor dit product die niet gearchiveerd zijn en nog niet de status `PLANNED` hebben (= nog niet als PBI gepromoveerd). Gelimiteerd op 50 items, gesorteerd op `created_at` asc. Demo-tokens kunnen dit endpoint lezen.
|
||||
|
||||
```bash
|
||||
curl -H "Authorization: Bearer $TOKEN" \
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 708 KiB After Width: | Height: | Size: 743 KiB |
Loading…
Add table
Add a link
Reference in a new issue