from django.contrib import admin
from .models import Business, Service, Contact, Call, Booking

@admin.register(Business)
class BusinessAdmin(admin.ModelAdmin):
    list_display = ('business_name', 'industry', 'phone_number', 'status')
    list_filter = ('industry', 'status')
    search_fields = ('business_name', 'phone_number')

@admin.register(Service)
class ServiceAdmin(admin.ModelAdmin):
    list_display = ('name', 'business', 'duration', 'price')
    list_filter = ('business',)
    search_fields = ('name', 'description')

@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
    list_display = ('name', 'phone_number')
    search_fields = ('name', 'phone_number')

@admin.register(Call)
class CallAdmin(admin.ModelAdmin):
    list_display = ('contact', 'business', 'start_time', 'end_time')
    list_filter = ('business', 'start_time')
    search_fields = ('contact__name', 'contact__phone_number')

@admin.register(Booking)
class BookingAdmin(admin.ModelAdmin):
    list_display = ('service', 'contact', 'start_time', 'status')
    list_filter = ('status', 'service__business')
    search_fields = ('contact__name', 'contact__phone_number', 'service__name')