-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschemas.py
More file actions
60 lines (40 loc) · 1.03 KB
/
schemas.py
File metadata and controls
60 lines (40 loc) · 1.03 KB
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
54
55
56
57
58
59
60
from pydantic import BaseModel, ConfigDict, Field
class BaseSchemaModel(BaseModel):
model_config = ConfigDict(from_attributes=True)
class UserBase(BaseSchemaModel):
name: str
email: str
class UserCreate(UserBase):
password: str
class UserResponseModel(UserBase):
id: int
class EmployeeResponseMode(BaseSchemaModel):
id: int
name: str
email: str
position: str
level: str
english_level: str
sales_campaign: str
other_skills: list[str]
team: str
attendance_link: str
last_interview: str
skills: list[str]
class ResourceBase(BaseSchemaModel):
name: str
description: str
class ResourceCreate(ResourceBase):
pass
class Resource(ResourceBase):
id: int
owner_id: int
class TeamResponseModel(BaseSchemaModel):
id: int
name: str
leader_id: int
employees: list[EmployeeResponseMode] | None = Field(default_factory=list)
class TeamCreate(BaseSchemaModel):
name: str
leader_id: int
employees: list[int] = Field(default_factory=list)