# -*- coding: utf-8 -*-

from django.contrib import admin
from django_admin import ReadOnlyModelAdmin

from statistic.models import (ConsumeDistributorSaleStatisticInfo, ConsumeModelSaleStatisticInfo,
                              ConsumeProvinceSaleStatisticInfo, ConsumeSaleStatisticInfo, DistributorSaleStatisticInfo,
                              ModelSaleStatisticInfo, ProvinceSaleStatisticInfo, RegisterStatisticInfo,
                              SaleStatisticInfo)


class RegisterStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('brand_id', 'ymd', 'num', 'status', 'created_at', 'updated_at')
    list_filter = ('brand_id', 'status')
    search_fields = ('brand_id', 'ymd')


class SaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('brand_id', 'ymd', 'num', 'status', 'created_at', 'updated_at')
    list_filter = ('brand_id', 'status')
    search_fields = ('brand_id', 'ymd')


class ModelSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('brand_id', 'model_id', 'model_name', 'ymd', 'num', 'status', 'created_at', 'updated_at')
    list_filter = ('brand_id', 'model_name', 'status')
    search_fields = ('brand_id', 'model_id', 'model_name', 'ymd')


class DistributorSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('brand_id', 'distributor_id', 'distributor_name', 'ymd', 'num', 'status', 'created_at', 'updated_at')
    list_filter = ('brand_id', 'distributor_name', 'status')
    search_fields = ('brand_id', 'distributor_id', 'distributor_name', 'ymd')


class ProvinceSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('brand_id', 'province_code', 'province_name', 'ymd', 'num', 'position', 'status', 'created_at', 'updated_at')
    list_filter = ('brand_id', 'province_code', 'province_name', 'status')
    search_fields = ('brand_id', 'province_code', 'province_name', 'ymd')


class ConsumeSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('brand_id', 'ymd', 'num', 'status', 'created_at', 'updated_at')
    list_filter = ('brand_id', 'status')
    search_fields = ('brand_id', 'ymd')


class ConsumeModelSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('brand_id', 'model_id', 'model_name', 'ymd', 'num', 'status', 'created_at', 'updated_at')
    list_filter = ('brand_id', 'model_name', 'status')
    search_fields = ('brand_id', 'model_id', 'model_name', 'ymd')


class ConsumeDistributorSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('brand_id', 'distributor_id', 'distributor_name', 'ymd', 'num', 'status', 'created_at', 'updated_at')
    list_filter = ('brand_id', 'distributor_name', 'status')
    search_fields = ('brand_id', 'distributor_id', 'distributor_name', 'ymd')


class ConsumeProvinceSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('brand_id', 'province_code', 'province_name', 'ymd', 'num', 'position', 'status', 'created_at', 'updated_at')
    list_filter = ('brand_id', 'province_code', 'province_name', 'status')
    search_fields = ('brand_id', 'province_code', 'province_name', 'ymd')


admin.site.register(RegisterStatisticInfo, RegisterStatisticInfoAdmin)

admin.site.register(SaleStatisticInfo, SaleStatisticInfoAdmin)
admin.site.register(ModelSaleStatisticInfo, ModelSaleStatisticInfoAdmin)
admin.site.register(DistributorSaleStatisticInfo, DistributorSaleStatisticInfoAdmin)
admin.site.register(ProvinceSaleStatisticInfo, ProvinceSaleStatisticInfoAdmin)

admin.site.register(ConsumeSaleStatisticInfo, ConsumeSaleStatisticInfoAdmin)
admin.site.register(ConsumeModelSaleStatisticInfo, ConsumeModelSaleStatisticInfoAdmin)
admin.site.register(ConsumeDistributorSaleStatisticInfo, ConsumeDistributorSaleStatisticInfoAdmin)
admin.site.register(ConsumeProvinceSaleStatisticInfo, ConsumeProvinceSaleStatisticInfoAdmin)
