from django_filters import rest_framework as filters

from LiveStock.models import LiveStockAllocations, CooperativeProductsShare


class LiveStockAllocationsFilterSet(filters.FilterSet):
    class Meta:
        model = LiveStockAllocations
        fields = [
            'product__name',
            'jahad__user__mobile',
            'jahad__user__first_name',
            'jahad__user__last_name',
            'jahad__user__fullname',
            'union__user__mobile',
            'union__user__first_name',
            'union__user__last_name',
            'union__user__fullname',
            'cooperative__user__mobile',
            'cooperative__user__first_name',
            'cooperative__user__last_name',
            'cooperative__user__fullname'
        ]


class CooperativeProductsShareFilterSet(filters.FilterSet):
    class Meta:
        model = CooperativeProductsShare
        fields = [
            'product__name',
            'cooperative__user__mobile',
            'cooperative__user__first_name',
            'cooperative__user__last_name',
            'cooperative__user__fullname'
        ]
