from django.views.generic import ListView, DetailView
from .models import Service, WorkProcess

class ServiceListView(ListView):
    """
    Page principale des services.
    Affiche la grille des services ET le workflow.
    """
    model = Service
    template_name = 'services/service_list.html'
    context_object_name = 'services'

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        # On ajoute le Workflow (Processus) au contexte de la page
        context['processes'] = WorkProcess.objects.all()
        return context


class ServiceDetailView(DetailView):
    """
    Page détail d'un service spécifique (si besoin d'une page dédiée).
    """
    model = Service
    template_name = 'services/service_detail.html'
    context_object_name = 'service'