14 lines
449 B
Python
14 lines
449 B
Python
from typing import Optional
|
|
from pydantic import BaseModel, EmailStr, Field
|
|
|
|
|
|
class UserRegisterSchema(BaseModel):
|
|
username: str = Field(..., min_length=3, max_length=64)
|
|
email: EmailStr = Field(...)
|
|
phone_number: str = Field(..., min_length=10, max_length=15, pattern=r'^\+[0-9]{1,3} [0-9]{1,9}$')
|
|
password: str = Field(..., min_length=6, max_length=128)
|
|
shop_id: Optional[int] = None
|
|
|
|
class Config:
|
|
orm_mode = True
|