from rest_framework import viewsets
from core.apps.eggs.models import Broken
from core.apps.eggs.serializers import BrokenSerializer
from core.http.permissions import IsRole


class BrokenViewSet(viewsets.ModelViewSet):
    queryset = Broken.objects.all()
    serializer_class = BrokenSerializer
    http_method_names = ["get", "post", "put", "patch", "delete"]
    permission_classes = [IsRole(["admin", "sklad", "courier"])]
