27 lines
424 B
Python
27 lines
424 B
Python
"""VoteMod models."""
|
|
from typing import Optional
|
|
|
|
from beanie import Document
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class Vote(BaseModel):
|
|
user: int
|
|
score: int
|
|
|
|
|
|
class Karma(Document):
|
|
user: int
|
|
karma: int = 1
|
|
revoked: bool = False
|
|
|
|
|
|
class VoteMod(Document):
|
|
initiator: int
|
|
target: int
|
|
origin: str
|
|
message: int
|
|
content: str
|
|
attachments: list[str]
|
|
score: int
|
|
votes: list[Vote]
|