File size: 1,116 Bytes
272199f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0990fd5
272199f
 
0701a12
 
 
 
 
 
 
 
 
272199f
 
 
 
 
 
 
 
 
 
 
 
 
0990fd5
0701a12
0990fd5
 
 
 
 
 
 
 
0701a12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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] = []