from rest_framework import status
from rest_framework.response import Response


class SoftDeleteMixin:
    def destroy(self, request, *args, **kwargs):
        """ override destroy -> soft delete """

        instance = self.get_object()  # noqa
        instance.soft_delete()
        return Response(
            {"detail": "رکورد با موفقیت حذف شد (Soft Delete)."},
            status=status.HTTP_200_OK
        )
