from django.contrib import admin
from .models import (
    Contract,
    Employee,
    ChargeNumber,
    TimeCard,
    TimeCardCell,
    UserProfile,
    BillingCustomer,
    Invoice,
    RecurringSubscription,
)

class ContractAdmin(admin.ModelAdmin):
    pass

class EmployeeAdmin(admin.ModelAdmin):
    pass

class UserProfileAdmin(admin.ModelAdmin):
    list_display = ("user", "user_type")
    list_filter = ("user_type",)

class ChargeNumberAdmin(admin.ModelAdmin):
    pass

class TimeCardAdmin(admin.ModelAdmin):
    pass

class TimeCardCellAdmin(admin.ModelAdmin):
    pass

class BillingCustomerAdmin(admin.ModelAdmin):
    list_display = ("name", "email", "company", "stripe_customer_id")
    search_fields = ("name", "email", "company")

class InvoiceAdmin(admin.ModelAdmin):
    list_display = ("id", "customer", "description", "amount_cents", "status", "created")
    list_filter = ("status",)
    search_fields = ("description", "stripe_invoice_id", "customer__email")

class RecurringSubscriptionAdmin(admin.ModelAdmin):
    list_display = ("id", "customer", "description", "amount_cents", "interval", "status")
    list_filter = ("status", "interval")

admin.site.register(Contract, ContractAdmin)
admin.site.register(Employee, EmployeeAdmin)
admin.site.register(UserProfile, UserProfileAdmin)
admin.site.register(ChargeNumber, ChargeNumberAdmin)
admin.site.register(TimeCard, TimeCardAdmin)
admin.site.register(TimeCardCell, TimeCardCellAdmin)
admin.site.register(BillingCustomer, BillingCustomerAdmin)
admin.site.register(Invoice, InvoiceAdmin)
admin.site.register(RecurringSubscription, RecurringSubscriptionAdmin)
