from django.http import JsonResponse
from rest_framework.views import APIView

from core.apps.eggs.models import Party


class MonthlyBenefitView(APIView):

    def get(self, request, *args, **kwargs):
        monthly_benefit = Party.get_total_benefit()
        return JsonResponse(list(monthly_benefit), safe=False)
