Files
conference-room-booking-system/backend/tests/types.py
2025-09-30 09:01:42 -04:00

109 lines
2.8 KiB
Python

"""TypedDicts for booking data used in tests."""
from typing import NotRequired
from typing import TypedDict
class BookingData(TypedDict):
"""TypedDict for booking data.
Attributes:
id: The unique identifier for the booking.
room_id: The ID of the room to be booked.
start_time: The start time of the booking in ISO format.
end_time: The end time of the booking in ISO format.
title: An optional title for the booking.
invitees: List of invitee email addresses.
"""
id: int
room_id: int
start_time: str # ISO format
end_time: str # ISO format
title: str | None
invitees: list[str]
class BookingCreateData(TypedDict):
"""TypedDict for booking creation data.
Attributes:
room_id: The ID of the room to be booked.
start_time: The start time of the booking in ISO format.
end_time: The end time of the booking in ISO format.
title: An optional title for the booking.
invitees: List of invitee email addresses.
"""
room_id: int
start_time: str # ISO format
end_time: str # ISO format
title: str | None
invitees: list[str]
class BookingUpdateData(TypedDict):
"""TypedDict for booking update data.
Attributes:
id: The unique identifier for the booking to be updated.
room_id: (Optional) The ID of the room to be booked.
start_time: (Optional) The start time of the booking in ISO format.
end_time: (Optional) The end time of the booking in ISO format.
title: (Optional) An optional title for the booking.
invitees: (Optional) List of invitee email addresses.
"""
id: int
room_id: NotRequired[int]
start_time: NotRequired[str] # ISO format
end_time: NotRequired[str] # ISO format
title: NotRequired[str | None]
invitees: NotRequired[list[str]]
class RoomData(TypedDict):
"""TypedDict for room data.
Attributes:
id: The unique identifier for the room.
name: The name of the room.
location: The physical location of the room.
equipment: The equipment available in the room.
capacity: The maximum number of occupants the room can hold.
"""
id: int
name: str
location: str
equipment: str
capacity: int
class RoomUpdateData(TypedDict):
"""TypedDict for room update data.
Attributes:
name: The name of the room.
location: The physical location of the room.
equipment: The equipment available in the room.
capacity: The maximum number of occupants the room can hold.
"""
name: str
location: str
equipment: str
capacity: int
class UserData(TypedDict):
"""TypedDict for user data.
Attributes:
email: The user's email address.
name: The user's name.
"""
email: str
name: str