api js
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user