20 lines
459 B
Python
20 lines
459 B
Python
from datetime import datetime
|
|
from typing import Literal
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
ProductType = Literal["web", "desktop", "msp"]
|
|
|
|
|
|
class ProjectCreate(BaseModel):
|
|
name: str = Field(min_length=1, max_length=120)
|
|
description: str = Field(default="", max_length=2000)
|
|
product: ProductType = "web"
|
|
|
|
|
|
class ProjectRead(ProjectCreate):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: int
|
|
created_at: datetime
|