Not tested yet

This commit is contained in:
corrado.mulas
2026-05-08 00:03:06 +02:00
parent 0e7b9ef4c1
commit 9c714af9c0
35 changed files with 2948 additions and 0 deletions

31
src/api/schemas.py Normal file
View File

@@ -0,0 +1,31 @@
from typing import List, Optional
from pydantic import BaseModel, Field
class CommandResponse(BaseModel):
"""Generic envelope returned for command-style endpoints — mirrors the
string the Telegram handler would have replied with, plus a parsed flag."""
ok: bool
message: str
class AddUserRequest(BaseModel):
username: str = Field(..., min_length=1)
class CreateGroupRequest(BaseModel):
name: str = Field(..., min_length=1)
user_ids: Optional[List[int]] = None
full_admin: Optional[bool] = None
class AddUsersToGroupRequest(BaseModel):
user_ids: List[int] = Field(..., min_items=1)
class UserIdsRequest(BaseModel):
user_ids: List[int] = Field(..., min_items=1)
class QrBackupRequest(BaseModel):
qr_data: str = Field(..., min_length=1)