-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1773e73
commit 69cfa68
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
from src.database.document import Document | ||
from src.database.models.user_models import UserModel | ||
from src.database.models.project_models import ProjectModel | ||
from src.database.models.case_models import CaseModel | ||
|
||
|
||
def project_document() -> Document: | ||
"""Get project document.""" | ||
return Document(collection="projects", model=ProjectModel, unique_field="name") | ||
|
||
|
||
def case_document() -> Document: | ||
"""Get case document.""" | ||
return Document(collection="cases", model=CaseModel, unique_field="name") | ||
|
||
|
||
def user_document() -> Document: | ||
"""Get user document.""" | ||
return Document(collection="users", model=UserModel, unique_field="email") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from typing import Any | ||
from src.database.models import BaseDBModel | ||
|
||
|
||
class CaseModel(BaseDBModel): | ||
"""Case Model.""" | ||
|
||
name: str | ||
project_id: str | ||
diagram_data: dict[Any, Any] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class CaseModel(BaseModel): | ||
"""Case model.""" | ||
|
||
name: str |