# Task 9: Migrate to ProjectManagement API

**Task ID**: TASK-009 | **Story**: [STORY-003](sprint_1_story_3.md) | **Sprint**: [Sprint 1](sprint_1.md)
**Estimated Hours**: 3h | **Assignee**: Frontend Developer 1 | **Priority**: P1 | **Status**: Not Started

## Task Description
Update Kanban board to fetch data from ProjectManagement API instead of Issue Management API.

## Implementation Steps

1. **Update API calls** (1h):
```typescript
// Before (Issue API)
const { data: issues } = await issueApiClient.getAll(projectId);

// After (ProjectManagement API)
const { data: epics } = await epicApiClient.getAll(projectId);
const { data: stories } = await storyApiClient.getAll(projectId);
const { data: tasks } = await taskApiClient.getAll(projectId);

// Combine into single list for Kanban
const allItems = [...epics, ...stories, ...tasks];
```

2. **Update KanbanBoard.tsx** (1.5h):
```typescript
export const KanbanBoard: React.FC = () => {
  const { projectId } = useParams();
  const { data: epics } = useEpics(projectId);
  const { data: stories } = useStories(projectId);
  const { data: tasks } = useTasks(projectId);

  const allCards = useMemo(() => {
    return [
      ...(epics || []).map(e => ({ ...e, type: 'Epic' })),
      ...(stories || []).map(s => ({ ...s, type: 'Story' })),
      ...(tasks || []).map(t => ({ ...t, type: 'Task' }))
    ];
  }, [epics, stories, tasks]);

  const cardsByStatus = groupBy(allCards, 'status');

  return (
    <div className="kanban-board">
      <KanbanColumn title="Backlog" cards={cardsByStatus['Backlog']} />
      <KanbanColumn title="Todo" cards={cardsByStatus['Todo']} />
      <KanbanColumn title="InProgress" cards={cardsByStatus['InProgress']} />
      <KanbanColumn title="Done" cards={cardsByStatus['Done']} />
    </div>
  );
};
```

3. **Test migration** (30 min):
- Verify all cards displayed
- Check filtering by type (Epic/Story/Task)
- Verify drag-and-drop still works

## Acceptance Criteria
- [ ] Kanban loads data from ProjectManagement API
- [ ] All three types (Epic/Story/Task) displayed
- [ ] Backward compatibility maintained
- [ ] No console errors
- [ ] Tests updated and passing

## Deliverables
1. Updated KanbanBoard.tsx
2. Updated KanbanCard.tsx
3. Migration tests passing

**Status**: Not Started | **Created**: 2025-11-04
