# Guide de Test Postman - Flux de Progression Étudiant

## Configuration
```
Base URL: https://infosmile17.com/irtiqaa/backend/api
Header: Authorization: Bearer {token}
Header: X-Student-ID: {student_id}
```

---

## 1. Authentification

### POST /auth/login
```json
{
    "email": "test@example.com",
    "password": "password123"
}
```

**Réponse attendue:**
```json
{
    "success": true,
    "data": {
        "token": "eyJ...",
        "user": { "id": "xxx", ... }
    }
}
```

---

## 2. Inscription à une Formation

### POST /formations/{formation_id}/enroll

**Réponse attendue:**
```json
{
    "success": true,
    "data": {
        "enrollment_id": "xxx",
        "progress": 0
    }
}
```

---

## 3. Récupérer les Séances

### GET /formations/{formation_id}/courses

**Réponse attendue:** Liste des cours avec séances

### GET /seances/{seance_id}

**Headers:**
- X-Student-ID: {student_id}

**Réponse attendue:**
```json
{
    "success": true,
    "data": {
        "id": "xxx",
        "title": "Séance 1",
        "status": "available",
        "is_completed": false,
        "progress_percentage": 0
    }
}
```

---

## 4. Marquer une Séance En Cours

### POST /seances/{seance_id}/progress
```json
{
    "status": "in_progress",
    "progress_percentage": 0
}
```

**Réponse attendue:**
```json
{
    "success": true,
    "data": {
        "seance_id": "xxx",
        "status": "in_progress",
        "progress_percentage": 0
    }
}
```

---

## 5. Marquer une Séance Complétée

### POST /seances/{seance_id}/progress
```json
{
    "status": "completed"
}
```

**Réponse attendue:**
```json
{
    "success": true,
    "data": {
        "seance_id": "xxx",
        "status": "completed",
        "progress_percentage": 100,
        "completed": true
    }
}
```

---

## 6. Vérifier la Progression Globale

### GET /progress/formation/{formation_id}

**Réponse attendue:**
```json
{
    "success": true,
    "data": {
        "formation_id": "xxx",
        "progress": 12.5,
        "is_completed": false
    }
}
```

---

## 7. Vérifier en Base de Données

### Table: v2_student_seance_progress
```sql
SELECT * FROM v2_student_seance_progress 
WHERE student_id = '{student_id}';
```

### Table: v2_enrollments
```sql
SELECT id, student_id, formation_id, progress, is_completed 
FROM v2_enrollments 
WHERE student_id = '{student_id}';
```

---

## Points de Vérification

| Étape | Table | Colonne | Valeur attendue |
|-------|-------|---------|-----------------|
| Inscription | v2_enrollments | progress | 0 |
| Séance en cours | v2_student_seance_progress | status | 'in_progress' |
| Séance complétée | v2_student_seance_progress | status | 'completed' |
| Après complétion | v2_enrollments | progress | > 0 |
