from rest_framework import status
from rest_framework.exceptions import APIException


class SpeciesNumberCheckException(APIException):
    status_code = status.HTTP_403_FORBIDDEN
    default_detail = 'Entered species number is more than user free tags'
    default_code = 'more than free tags'


class TagException(APIException):
    status_code = status.HTTP_400_BAD_REQUEST
    default_detail = "خطا در اطلاعات پلاک"  # noqa
    default_code = 'error'

    def __init__(self, message=None, status_code=None, code=None):
        if status_code is not None:
            self.status_code = status_code

        detail = {
            "message": message,
            "status_code": status_code
        }

        super().__init__(detail)
