swag-shop/backend/app/schemas/shop_schemas.py

15 lines
516 B
Python

from pydantic import EmailStr
from sqlmodel import Field, SQLModel
from app.database.models.shop_model import ShopAddress
class ShopCreate(SQLModel):
name: str = Field(max_length=100, nullable=False, unique=True)
description: str = Field(max_length=500, nullable=False)
currency: str = Field(max_length=3, nullable=False)
contact_email: EmailStr = Field()
contact_phone_number: str = Field(min_length=2, max_length=16, schema_extra={"pattern": r'^\+[1-9]\d{1,14}$'})
address: ShopAddress