from django.contrib import admin
from .models import ApprovalFlow, ApprovalAction


class ApprovalActionInline(admin.TabularInline):
    model = ApprovalAction
    extra = 0
    readonly_fields = ['stage', 'actor', 'action', 'comment', 'timestamp']

@admin.register(ApprovalFlow)
class ApprovalFlowAdmin(admin.ModelAdmin):
    list_display = ['lead', 'current_stage', 'overall_status', 'submitted_by', 'submitted_at']
    list_filter = ['current_stage', 'overall_status']
    inlines = [ApprovalActionInline]
