25 lines
465 B
Python
25 lines
465 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from typing import Optional, List
|
|
|
|
class ListCreate(BaseModel):
|
|
name: str
|
|
|
|
class ListUpdate(BaseModel):
|
|
name: str
|
|
|
|
class ListResponse(BaseModel):
|
|
id: int
|
|
name: str
|
|
created_at: datetime
|
|
member_count: int = 0
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class ListMemberAdd(BaseModel):
|
|
contact_ids: List[int]
|
|
|
|
class ListMemberRemove(BaseModel):
|
|
contact_ids: List[int]
|