from datetime import datetime, timezone
from uuid import uuid4

from v1.inbox_messages.schemas import (
    InboxMessageAcceptRequest,
    InboxMessageResponse,
    InboxMessageStatus,
    InboxMessageType,
)


def test_inbox_message_response_schema() -> None:
    msg_id = uuid4()
    response = InboxMessageResponse(
        id=msg_id,
        recipient_id=uuid4(),
        sender_id=uuid4(),
        message_type=InboxMessageType.CALENDAR,
        schedule_item_id=uuid4(),
        content="Join my calendar",
        is_read=False,
        status=InboxMessageStatus.PENDING,
        created_at=datetime.now(timezone.utc),
    )

    assert response.message_type.value == "calendar"
    assert response.status.value == "pending"


def test_inbox_message_accept_request_schema() -> None:
    request = InboxMessageAcceptRequest(
        permission_view=True,
        permission_edit=False,
        permission_invite=False,
    )

    assert request.permission_view is True
    assert request.permission_edit is False
