refactor(models): remove verbose comments and docstrings from enums

This commit is contained in:
Fanilo-Nantenaina 2026-01-06 09:13:57 +03:00
parent e3f7090935
commit ab25443f99

View file

@ -15,48 +15,35 @@ from enum import Enum
from database.models.generic_model import Base
# ========================================
# ENUMS DE STATUTS
# ========================================
class UniversignTransactionStatus(str, Enum):
"""Statuts de transaction Universign (exhaustifs)"""
DRAFT = "draft" # Transaction créée, non démarrée
READY = "ready" # Prête à démarrer
STARTED = "started" # Démarrée, en cours
COMPLETED = "completed" # Tous signés ✓
REFUSED = "refused" # Refusé par un signataire
EXPIRED = "expired" # Délai expiré
CANCELED = "canceled" # Annulée manuellement
FAILED = "failed" # Erreur technique
DRAFT = "draft"
READY = "ready"
STARTED = "started"
COMPLETED = "completed"
REFUSED = "refused"
EXPIRED = "expired"
CANCELED = "canceled"
FAILED = "failed"
class UniversignSignerStatus(str, Enum):
"""Statuts d'un signataire individuel"""
WAITING = "waiting" # En attente
VIEWED = "viewed" # Document ouvert
SIGNED = "signed" # Signé ✓
REFUSED = "refused" # Refusé
EXPIRED = "expired" # Expiré
WAITING = "waiting"
VIEWED = "viewed"
SIGNED = "signed"
REFUSED = "refused"
EXPIRED = "expired"
class LocalDocumentStatus(str, Enum):
"""Statuts métier locaux (simplifié pour l'UI)"""
PENDING = "EN_ATTENTE" # Transaction non démarrée ou en attente
IN_PROGRESS = "EN_COURS" # Envoyé, en cours de signature
SIGNED = "SIGNE" # Signé avec succès
REJECTED = "REFUSE" # Refusé ou annulé
EXPIRED = "EXPIRE" # Expiré
ERROR = "ERREUR" # Erreur technique
PENDING = "EN_ATTENTE"
IN_PROGRESS = "EN_COURS"
SIGNED = "SIGNE"
REJECTED = "REFUSE"
EXPIRED = "EXPIRE"
ERROR = "ERREUR"
class SageDocumentType(int, Enum):
"""Types de documents Sage (synchronisé avec Sage)"""
DEVIS = 0
BON_COMMANDE = 10
PREPARATION = 20
@ -66,16 +53,7 @@ class SageDocumentType(int, Enum):
FACTURE = 60
# ========================================
# TABLE PRINCIPALE : TRANSACTIONS UNIVERSIGN
# ========================================
class UniversignTransaction(Base):
"""
Table centrale : synchronisation bidirectionnelle Universign Local
"""
__tablename__ = "universign_transactions"
# === IDENTIFIANTS ===
@ -189,11 +167,6 @@ class UniversignTransaction(Base):
)
# ========================================
# TABLE SECONDAIRE : SIGNATAIRES
# ========================================
class UniversignSigner(Base):
"""
Détail de chaque signataire d'une transaction
@ -242,11 +215,6 @@ class UniversignSigner(Base):
return f"<UniversignSigner {self.email} status={self.status.value}>"
# ========================================
# TABLE DE LOGS : SYNCHRONISATION
# ========================================
class UniversignSyncLog(Base):
"""
Journal de toutes les synchronisations (audit trail)
@ -284,16 +252,7 @@ class UniversignSyncLog(Base):
return f"<SyncLog {self.sync_type} at {self.sync_timestamp}>"
# ========================================
# TABLE DE CONFIGURATION
# ========================================
class UniversignConfig(Base):
"""
Configuration Universign par environnement/utilisateur
"""
__tablename__ = "universign_configs"
id = Column(String(36), primary_key=True)