from django.utils.translation import gettext_lazy as _
from drf_spectacular.utils import extend_schema
from rest_framework import status

from engine.blog.serializers import PostSerializer
from engine.core.docs.drf import BASE_ERRORS

POST_SCHEMA = {
    "list": extend_schema(
        tags=[
            "blog",
        ],
        summary=_("list all posts (read-only)"),
        responses={status.HTTP_200_OK: PostSerializer(many=True), **BASE_ERRORS},
    ),
    "retrieve": extend_schema(
        tags=[
            "blog",
        ],
        summary=_("retrieve a single post (read-only)"),
        responses={status.HTTP_200_OK: PostSerializer(), **BASE_ERRORS},
    ),
}
