Add trace files.
Some checks failed
Code Coverage / Generate Coverage Report (push) Has been cancelled
Tests / Run Tests (9.0.x) (push) Has been cancelled
Tests / Docker Build Test (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled

This commit is contained in:
Yaojia Wang
2025-11-04 23:28:56 +01:00
parent 25d30295ec
commit 08b317e789
75 changed files with 26456 additions and 37017 deletions

View File

@@ -0,0 +1,69 @@
# Task 5: Create API Client Services
**Task ID**: TASK-005 | **Story**: [STORY-002](sprint_1_story_2.md) | **Sprint**: [Sprint 1](sprint_1.md)
**Estimated Hours**: 4h | **Assignee**: Frontend Developer 2 | **Priority**: P0 | **Status**: Not Started
## Task Description
Create TypeScript API client services for Epic/Story/Task with CRUD operations, authentication, and error handling.
## Implementation
### File Structure
```
src/api/
├── clients/
│ ├── EpicApiClient.ts
│ ├── StoryApiClient.ts
│ └── TaskApiClient.ts
├── types.ts
└── axiosInstance.ts
```
### Example: EpicApiClient.ts
```typescript
import { axiosInstance } from '../axiosInstance';
import { Epic, CreateEpicDto, UpdateEpicDto } from '../types';
export class EpicApiClient {
async getAll(projectId: string): Promise<Epic[]> {
const { data } = await axiosInstance.get(`/epics?projectId=${projectId}`);
return data;
}
async getById(id: string): Promise<Epic> {
const { data } = await axiosInstance.get(`/epics/${id}`);
return data;
}
async create(dto: CreateEpicDto): Promise<Epic> {
const { data } = await axiosInstance.post('/epics', dto);
return data;
}
async update(id: string, dto: UpdateEpicDto): Promise<Epic> {
const { data } = await axiosInstance.put(`/epics/${id}`, dto);
return data;
}
async delete(id: string): Promise<void> {
await axiosInstance.delete(`/epics/${id}`);
}
}
export const epicApiClient = new EpicApiClient();
```
## Acceptance Criteria
- [ ] EpicApiClient with 5 CRUD methods
- [ ] StoryApiClient with 5 CRUD methods
- [ ] TaskApiClient with 5 CRUD methods
- [ ] JWT authentication in Axios interceptor
- [ ] Error handling and TypeScript types
## Deliverables
1. 3 API client classes
2. TypeScript types/interfaces
3. Axios instance with auth
4. Unit tests (15+ tests)
**Status**: Not Started | **Created**: 2025-11-04