Minor tweaks to sign up on frontend and database structure
This commit is contained in:
1 parent
d0690f2f06
commit
260bef98cd
10 files changed
+56
-1037
No files matched your search
@@ -1,14 +1,27 @@
|
||||
|
||||
from pydantic import EmailStr
|
||||
from sqlmodel import Field, SQLModel
|
||||
from datetime import datetime
|
||||
from pydantic import EmailStr, BaseModel, Field
|
||||
from sqlmodel import SQLModel
|
||||
|
||||
from app.database.models.shop_model import ShopAddress
|
||||
from app.database.models.shop_model import ShopAddress, ShopStatus, ShopBusinessHours, ShopLinks
|
||||
|
||||
|
||||
class ShopCreate(SQLModel):
|
||||
class ShopCreate(BaseModel):
|
||||
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}$'})
|
||||
contact_phone_number: str = Field(min_length=2, max_length=16, pattern=r'^\+[1-9]\d{1,14}$')
|
||||
address: ShopAddress
|
||||
|
||||
|
||||
class ShopPublic(BaseModel):
|
||||
name: str
|
||||
description: str
|
||||
currency: str
|
||||
contact_email: EmailStr
|
||||
contact_phone_number: str
|
||||
address: ShopAddress
|
||||
business_hours: ShopBusinessHours
|
||||
links: ShopLinks
|
||||
status: ShopStatus
|
||||
Reference in new issue
Block a user