ucprojects-backend / src /models /project.py
AdeshRathod
Add activity management to ProjectDAO and update models and routes
0701a12
Raw History Blame Contribute Delete
1.12 kB
from pydantic import BaseModel, Field
from typing import List, Optional
class Contact(BaseModel):
id: str
name: Optional[str]
phone: Optional[str]
email: Optional[str]
class Credential(BaseModel):
id: str
title: str
username: Optional[str]
password: Optional[str]
note: Optional[str]
class Activity(BaseModel):
id: str
date: Optional[str]
from_person: Optional[str]
to_person: Optional[str]
description: Optional[str]
type: Optional[str] # 'internal' or 'external'
class ProjectCreate(BaseModel):
name: str = Field(..., min_length=1)
description: Optional[str]
created_by: str
class ProjectInfo(BaseModel):
id: str
name: str
description: Optional[str]
created_by: str
contacts: List[Contact] = []
credentials: List[Credential] = []
platforms: List["Platform"] = []
activities: List[Activity] = []
class Platform(BaseModel):
id: str
name: Optional[str]
description: Optional[str]
credentials: List[Credential] = []
contacts: List[Contact] = []
activities: List[Activity] = []