-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemas.py
45 lines (36 loc) · 1.22 KB
/
schemas.py
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
from pydantic import BaseModel
"""
Contains all schemas alias domain models of the application.
For domain modelling, the library pydantic is used.
Pydantic allows to create versatile domain models and ensures data integrity and much more.
"""
class ContactBase(BaseModel):
"""
Contact base schema
"""
FullName: str = None
EmailAdressExternal: str = None
FirstName: str = None
LastName: str = None
isExternalAccount: str = None
Company: str = None
class Config:
fields = {
"FullName": {"description": "Full name of the contact"},
"EmailAdressExternal": {
"description": "External email address of the contact"
},
"FirstName": {"description": "First name of the contact"},
"LastName": {"description": "Last name of the contact"},
"isExternalAccount": {"description": "Is the contact an external account?"},
"Company": {"description": "Company of the contact"},
}
class Contact(ContactBase):
"""
Contact schema, database representation
"""
Contact_Id: str
class Config:
fields = {
"Contact_Id": {"description": "Unique ID of the contact"},
}