42 lines
633 B
Python
42 lines
633 B
Python
from typing import Union
|
|
from pydantic import BaseModel
|
|
from uuid import UUID
|
|
|
|
|
|
class ParticipantInfo(BaseModel):
|
|
total: int
|
|
remaining: int
|
|
|
|
|
|
class Queue(BaseModel):
|
|
name: str
|
|
description: Union[str, None] = None
|
|
|
|
|
|
class QueueInList(Queue):
|
|
participants: ParticipantInfo
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class QueueInDb(Queue):
|
|
id: UUID
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class QueueDetail(Queue):
|
|
id: UUID
|
|
participants: ParticipantInfo
|
|
|
|
|
|
class QueueUser(BaseModel):
|
|
id: UUID
|
|
position: int
|
|
passed: bool
|
|
|
|
class Config:
|
|
from_attributes = True
|