Phase 1C: Frontend unified contact UI
This commit is contained in:
@@ -6,7 +6,7 @@ from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class AddressCreate(BaseModel):
|
||||
entity_type: str = Field(..., pattern="^(company|contact)$", description="'company' or 'contact'")
|
||||
entity_type: str = Field(..., pattern="^contact$", description="'contact'")
|
||||
entity_id: str = Field(..., description="UUID of the parent entity")
|
||||
label: str = Field(..., min_length=1, max_length=100)
|
||||
address_type: str = Field(
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
"""Company schemas — create, update, read, list, pagination, search, filter."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class CompanyCreate(BaseModel):
|
||||
name: str = Field(..., min_length=1, max_length=100)
|
||||
account_number: str | None = Field(None, max_length=40)
|
||||
industry: str | None = Field(None, max_length=50)
|
||||
phone: str | None = Field(None, max_length=30)
|
||||
email: str | None = Field(None, max_length=255)
|
||||
website: str | None = Field(None, max_length=500)
|
||||
description: str | None = None
|
||||
|
||||
|
||||
class CompanyUpdate(BaseModel):
|
||||
name: str | None = Field(None, min_length=1, max_length=100)
|
||||
account_number: str | None = Field(None, max_length=40)
|
||||
industry: str | None = Field(None, max_length=50)
|
||||
phone: str | None = Field(None, max_length=30)
|
||||
email: str | None = Field(None, max_length=255)
|
||||
website: str | None = Field(None, max_length=500)
|
||||
description: str | None = None
|
||||
|
||||
|
||||
class CompanyResponse(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
account_number: str | None = None
|
||||
industry: str | None = None
|
||||
phone: str | None = None
|
||||
email: str | None = None
|
||||
website: str | None = None
|
||||
description: str | None = None
|
||||
created_at: str | None = None
|
||||
updated_at: str | None = None
|
||||
|
||||
|
||||
class CompanyDetailResponse(CompanyResponse):
|
||||
contacts: list[dict] = Field(default_factory=list)
|
||||
|
||||
|
||||
class CompanyListResponse(BaseModel):
|
||||
items: list[CompanyResponse]
|
||||
total: int
|
||||
page: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class CompanyExportRequest(BaseModel):
|
||||
format: str = Field("csv", pattern="^(csv|xlsx)$")
|
||||
industry: str | None = None
|
||||
search: str | None = None
|
||||
Reference in New Issue
Block a user