feat(sprints): surface frontend du modèle de sprints

Ticket #10 — volet frontend des sprints.

- Domaine et ports frontend étendus au modèle de sprints (domain/index.ts,
  ports/index.ts).
- Adaptateurs : ticket.ts et mock/index.ts câblent les opérations sprints.
- UI tickets : useTickets + TicketsPanel exposent le rattachement/gestion des
  sprints, avec tests Vitest associés.

Typecheck / vitest / build verts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 10:57:38 +02:00
parent 48b652ff91
commit 69759d351c
7 changed files with 423 additions and 31 deletions

View File

@ -14,6 +14,7 @@ import { invoke } from "@tauri-apps/api/core";
import type {
GatewayError,
Sprint,
Ticket,
TicketCarnet,
TicketLinkKind,
@ -122,4 +123,29 @@ export class TauriTicketGateway implements TicketGateway {
request: { projectId, ref, agentId, assigned, expectedVersion },
});
}
async listSprints(projectId: string): Promise<Sprint[]> {
// `sprint_list` returns a `SprintListDto { items }`; unwrap to the array.
const list = await invoke<{ items: Sprint[] }>("sprint_list", {
request: { projectId },
});
return list.items;
}
async setTicketSprint(
projectId: string,
ref: string,
sprintId: string | null,
expectedVersion: number,
): Promise<Ticket> {
// Two backend commands: assign to a sprint, or unassign (clear membership).
if (sprintId === null) {
return invoke<Ticket>("ticket_unassign_sprint", {
request: { projectId, ref, expectedVersion },
});
}
return invoke<Ticket>("ticket_assign_sprint", {
request: { projectId, ref, sprintId, expectedVersion },
});
}
}