from django.contrib import admin
from .models import Customer, Material, Operation

@admin.register(Customer)
class CustomerAdmin(admin.ModelAdmin):
    list_display = ('name', 'email', 'phone_number')
    search_fields = ('name', 'email')
    list_filter = ('name',)

@admin.register(Material)
class MaterialAdmin(admin.ModelAdmin):
    list_display = ('material_name', 'description')
    search_fields = ('material_name',)
    list_filter = ('material_name',)

@admin.register(Operation)
class OperationAdmin(admin.ModelAdmin):
    list_display = ('customer', 'material', 'quantity', 'operation_date')
    search_fields = ('customer__name', 'material__material_name')
    list_filter = ('operation_date',)
