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