from django.utils.translation import gettext_lazy as _
from rest_framework.viewsets import ReadOnlyModelViewSet

from core.permissions import EvibesPermission, IsOwner
from payments.serializers import TransactionSerializer


class TransactionViewSet(ReadOnlyModelViewSet):  # type: ignore
    __doc__ = _(  # type: ignore [assignment]
        "ViewSet for handling read-only operations on the Transaction model. "
        "This class provides a read-only interface for interacting with transaction data. "
        "It uses the TransactionSerializer for serializing and deserializing "
        "the data. The class ensures that only authorized users, who meet specific "
        "permissions, can access the transactions."
    )

    serializer_class = TransactionSerializer
    permission_classes = (EvibesPermission, IsOwner)
