from django.contrib import admin
from .models import Fanpage, Flow, Node, Edge, ChatSession, MessageLog

@admin.register(Fanpage)
class FanpageAdmin(admin.ModelAdmin):
    list_display = ('name', 'page_id', 'is_active', 'created_at')

@admin.register(Flow)
class FlowAdmin(admin.ModelAdmin):
    list_display = ('name', 'fanpage', 'is_default', 'created_at')

@admin.register(Node)
class NodeAdmin(admin.ModelAdmin):
    list_display = ('name', 'flow', 'node_type', 'is_start_node')

@admin.register(Edge)
class EdgeAdmin(admin.ModelAdmin):
    list_display = ('source_node', 'target_node', 'condition')

@admin.register(ChatSession)
class ChatSessionAdmin(admin.ModelAdmin):
    list_display = ('psid', 'fanpage', 'current_node', 'updated_at')

@admin.register(MessageLog)
class MessageLogAdmin(admin.ModelAdmin):
    list_display = ('session', 'sender_type', 'timestamp')