✨ Changements majeurs: - Suppression complète du code Flask legacy - Migration backend FastAPI vers racine /backend - Migration frontend Vue.js vers racine /frontend - Suppression de notytex-v2/ (code monté à la racine) ✅ Validations: - Backend démarre correctement (port 8000) - API /api/v2/health répond healthy - 99/99 tests unitaires passent - Frontend configuré avec proxy Vite 📝 Documentation: - README.md réécrit pour v2 - Instructions de démarrage mises à jour - .gitignore adapté pour backend/frontend/ 🎯 Architecture finale: notytex/ ├── backend/ # FastAPI + SQLAlchemy + Pydantic ├── frontend/ # Vue 3 + Vite + TailwindCSS ├── docs/ # Documentation └── school_management.db # Base de données (inchangée) Jalon 6 complété: Application v2 prête pour utilisation!
66 lines
1.7 KiB
Python
66 lines
1.7 KiB
Python
"""
|
|
Value Objects pour la progression des évaluations.
|
|
"""
|
|
from dataclasses import dataclass
|
|
from enum import Enum
|
|
|
|
|
|
class ProgressStatus(str, Enum):
|
|
"""Statuts possibles de progression."""
|
|
NOT_STARTED = "not_started"
|
|
IN_PROGRESS = "in_progress"
|
|
COMPLETED = "completed"
|
|
NO_STUDENTS = "no_students"
|
|
NO_ELEMENTS = "no_elements"
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ProgressResult:
|
|
"""
|
|
Résultat du calcul de progression de correction.
|
|
|
|
Attributes:
|
|
percentage: Pourcentage de complétion (0-100)
|
|
completed: Nombre de notes saisies
|
|
total: Nombre total de notes à saisir
|
|
status: Statut de la progression
|
|
students_count: Nombre d'élèves concernés
|
|
"""
|
|
percentage: int
|
|
completed: int
|
|
total: int
|
|
status: ProgressStatus
|
|
students_count: int
|
|
|
|
def to_dict(self) -> dict:
|
|
"""Convertit en dictionnaire pour la sérialisation."""
|
|
return {
|
|
"percentage": self.percentage,
|
|
"completed": self.completed,
|
|
"total": self.total,
|
|
"status": self.status.value,
|
|
"students_count": self.students_count
|
|
}
|
|
|
|
@classmethod
|
|
def empty(cls) -> "ProgressResult":
|
|
"""Crée un résultat vide (pas d'éléments)."""
|
|
return cls(
|
|
percentage=0,
|
|
completed=0,
|
|
total=0,
|
|
status=ProgressStatus.NO_ELEMENTS,
|
|
students_count=0
|
|
)
|
|
|
|
@classmethod
|
|
def no_students(cls) -> "ProgressResult":
|
|
"""Crée un résultat pour une classe sans élèves."""
|
|
return cls(
|
|
percentage=0,
|
|
completed=0,
|
|
total=0,
|
|
status=ProgressStatus.NO_STUDENTS,
|
|
students_count=0
|
|
)
|