gmao/app_new/constants.py

128 lines
5.9 KiB
Python
Raw Normal View History

2026-08-14 18:02:25 +02:00
"""
Constantes de l'application GMAO Collège
Statuts, types, configurations globales
"""
# Statuts des interventions
INTERVENTION_STATUSES = {
"brouillon": {"label": "Brouillon", "color": "secondary", "icon": "pencil"},
"planifiee": {"label": "Planifiée", "color": "info", "icon": "calendar"},
2026-08-14 18:02:25 +02:00
"en_attente": {"label": "En attente", "color": "secondary", "icon": "clock"},
"en_cours": {"label": "En cours", "color": "primary", "icon": "play-circle"},
"en_attente_pieces": {"label": "En attente pièces", "color": "warning", "icon": "box"},
"en_attente_entreprise": {"label": "En attente entreprise", "color": "orange", "icon": "truck"},
"en_attente_facture": {"label": "En attente facture", "color": "orange", "icon": "file-invoice"},
"terminee": {"label": "Terminée", "color": "success", "icon": "check-circle"},
"cloturee": {"label": "Clôturée", "color": "dark", "icon": "archive"},
"annulee": {"label": "Annulée", "color": "danger", "icon": "times-circle"},
"refusee": {"label": "Refusée", "color": "danger", "icon": "ban"},
2026-08-14 18:02:25 +02:00
"reportee": {"label": "Reportée", "color": "info", "icon": "calendar-alt"},
"ignoree": {"label": "Ignorée", "color": "secondary", "icon": "dash-circle"},
# Étapes détaillées d'une demande de travaux (dans la fiche intervention)
"attente_chef": {"label": "Validation du chef", "color": "warning", "icon": "person-check"},
"demande_departement": {"label": "Demande au Département", "color": "info", "icon": "building"},
"attente_devis": {"label": "Devis attendu", "color": "orange", "icon": "file-earmark-text"},
"devis_a_valider": {"label": "Devis à valider", "color": "warning", "icon": "file-check"},
"devis_accepte": {"label": "Devis accepté", "color": "success", "icon": "check2-circle"},
"entreprise_mandatee": {"label": "Entreprise mandatée", "color": "info", "icon": "truck"},
"travaux_planifies": {"label": "Travaux planifiés", "color": "primary", "icon": "calendar-check"},
"travaux_en_cours": {"label": "Travaux en cours", "color": "primary", "icon": "tools"},
"travaux_termines": {"label": "Travaux terminés", "color": "success", "icon": "check-circle"},
"reception": {"label": "Réception", "color": "success", "icon": "clipboard-check"},
2026-08-14 18:02:25 +02:00
}
INTERVENTION_TRANSITIONS = {
"brouillon": {"en_attente", "planifiee", "attente_chef", "demande_departement", "attente_devis", "en_cours", "annulee", "refusee"},
"en_attente": {"planifiee", "en_cours", "annulee", "refusee"},
"planifiee": {"en_cours", "reportee", "annulee", "ignoree", "refusee"},
"reportee": {"planifiee", "annulee"},
"en_cours": {"en_attente_pieces", "en_attente_entreprise", "terminee", "annulee", "refusee"},
"en_attente_pieces": {"en_cours", "annulee", "refusee"},
"en_attente_entreprise": {"en_cours", "annulee", "refusee"},
"terminee": {"cloturee", "en_cours"},
"cloturee": set(),
"annulee": {"brouillon"},
"ignoree": {"planifiee"},
"attente_chef": {"en_cours", "demande_departement", "attente_devis", "annulee"},
"demande_departement": {"attente_devis", "devis_a_valider", "annulee"},
"attente_devis": {"devis_a_valider", "travaux_en_cours", "annulee"},
"devis_a_valider": {"devis_accepte", "attente_devis", "annulee"},
"devis_accepte": {"entreprise_mandatee", "travaux_planifies", "annulee"},
"entreprise_mandatee": {"travaux_planifies", "travaux_en_cours", "annulee"},
"travaux_planifies": {"travaux_en_cours", "reportee", "annulee"},
"travaux_en_cours": {"travaux_termines", "en_attente_pieces", "annulee"},
"travaux_termines": {"reception", "cloturee"},
"reception": {"cloturee", "travaux_en_cours"},
"refusee": {"brouillon"},
}
2026-08-14 18:02:25 +02:00
# Statuts équipements
EQUIPMENT_STATUSES = {
"en_service": {"label": "En service", "color": "success", "icon": "power"},
"en_panne": {"label": "En panne", "color": "danger", "icon": "exclamation-triangle"},
"en_maintenance": {"label": "En maintenance", "color": "warning", "icon": "tools"},
2026-08-14 18:02:25 +02:00
"hors_service": {"label": "Hors service", "color": "secondary", "icon": "ban"},
"hs": {"label": "Hors service", "color": "secondary", "icon": "ban"},
"a_jeter": {"label": "À jeter", "color": "danger", "icon": "trash"},
"jete": {"label": "Jeté", "color": "dark", "icon": "archive"},
2026-08-14 18:02:25 +02:00
}
# Services GIMA
GIMA_SERVICES = {
"entretien": "Service Entretien",
"securite": "Service Sécurité",
}
# Types de pièces
PART_TYPES = {
"consommable": {"label": "Consommable", "reutilisable": False},
"rechange": {"label": "Pièce de rechange", "reutilisable": True},
"outillage": {"label": "Outillage", "reutilisable": True},
}
# Jours de la semaine
WEEKDAYS = {
1: "Lundi",
2: "Mardi",
3: "Mercredi",
4: "Jeudi",
5: "Vendredi",
6: "Samedi",
7: "Dimanche",
}
# Types d'alertes
ALERT_TYPES = {
"intervention_overdue": {"label": "Intervention en retard", "priority": "high"},
"equipment_maintenance": {"label": "Maintenance équipement due", "priority": "medium"},
"low_stock": {"label": "Stock faible", "priority": "medium"},
"contract_expiry": {"label": "Expiration contrat", "priority": "low"},
"training_due": {"label": "Formation à renouveler", "priority": "low"},
}
# Priorités
PRIORITIES = {
"basse": {"label": "Basse", "color": "secondary"},
"normale": {"label": "Normale", "color": "primary"},
"haute": {"label": "Haute", "color": "warning"},
"urgente": {"label": "Urgente", "color": "danger"},
}
# Types de travaux
WORK_TYPES = {
"preventive": "Maintenance préventive",
"corrective": "Maintenance corrective",
"amelioration": "Amélioration",
"curative": "Intervention curative",
}
# Rôles utilisateurs
ROLES = {
"admin": "Administrateur",
"responsable_gmao": "Responsable GMAO",
"technicien": "Technicien",
"assistant_prevention": "Assistant de prévention",
"demandeur": "Demandeur",
"lecture": "Lecture seule",
}