This commit is contained in:
2026-03-14 00:11:21 +03:00
parent b2139ed440
commit 468bdf817a
70 changed files with 337 additions and 47 deletions

View File

@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field, field_validator
from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic.types import StringConstraints
from typing_extensions import Annotated
from typing import Optional
import re
NameStr = Annotated[
@@ -23,16 +24,18 @@ class UserOut(BaseModel):
name: NameStr = Field(..., description="Name of the guest")
surname: NameStr = Field(..., description="Surname of the guest")
class UserUpdate(UserAccess):
name: NameStr = Field(..., description="Name of the guest")
surname: NameStr = Field(..., description="Surname of the guest")
text_field: str = Field("", max_length=500, description="what the guest wants")
activated: bool = Field(False, description="activation of the guest")
food: bool = Field(False, description="Options meat or fish")
alco: bool = Field(False, description="if the guest will drink alco or not")
types_of_alco: str = Field("", description="types of alco")
class UserUpdate(BaseModel):
code: Optional[str] = Field(None, min_length=6, max_length=6, description="Code of the guest")
name: Optional[NameStr] = Field(None, description="Name of the guest")
middlename: Optional[NameStr] = Field(None, description="Middlename of the guest")
surname: Optional[NameStr] = Field(None, description="Surname of the guest")
text_field: Optional[str] = Field(None, max_length=500, description="what the guest wants")
activated: Optional[bool] = Field(None, description="activation of the guest")
type_of_food: Optional[str] = Field(None, description="meat or fish")
types_of_alco: Optional[str] = Field(None, description="types of alco")
class UserCreate(UserUpdate):
code: str = Field(..., min_length=6, max_length=6, description="Code of the guest")
admin:bool = Field(False, description="Admin privilegies")
class Settings(BaseSettings):
DIR:str