-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pdct 312 Added endpoint for creating events (#24)
- Loading branch information
1 parent
cd8d332
commit 740548d
Showing
15 changed files
with
406 additions
and
21 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
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
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,20 +1,46 @@ | ||
from datetime import datetime | ||
from pydantic import BaseModel | ||
from typing import Optional | ||
from pydantic import BaseModel | ||
|
||
from app.clients.db.models.law_policy.family import ( | ||
EventStatus, | ||
) | ||
|
||
|
||
class EventReadDTO(BaseModel): | ||
"""JSON Representation of a Event for reading.""" | ||
""" | ||
JSON Representation of the DTO for reading an event. | ||
TODO: Add family document fields here including family title, | ||
family document title, maybe geography etc.? | ||
""" | ||
|
||
# From FamilyEvent | ||
import_id: str | ||
event_title: str | ||
date: datetime | ||
event_type_value: str | ||
event_status: EventStatus | ||
|
||
# From FamilyDocument | ||
family_import_id: str | ||
family_document_import_id: Optional[str] = None | ||
|
||
|
||
class EventCreateDTO(BaseModel): | ||
""" | ||
JSON Representation of the DTO for creating an event. | ||
We don't need to specify the import_id because this will be auto- | ||
generated. | ||
""" | ||
|
||
# From FamilyEvent | ||
event_title: str | ||
date: datetime | ||
event_type_value: str | ||
event_status: EventStatus | ||
|
||
# From FamilyDocument | ||
family_import_id: str | ||
family_document_import_id: Optional[str] = None |
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
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
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 |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
mock_rollback_document_repo, | ||
) | ||
from integration_tests.mocks.rollback_family_repo import mock_rollback_family_repo | ||
from integration_tests.mocks.rollback_event_repo import mock_rollback_event_repo | ||
|
||
|
||
def get_test_db_url() -> str: | ||
|
@@ -160,6 +161,13 @@ def rollback_document_repo(monkeypatch, mocker): | |
yield document_repo | ||
|
||
|
||
@pytest.fixture | ||
def rollback_event_repo(monkeypatch, mocker): | ||
"""Mocks the repository for a single test.""" | ||
mock_rollback_event_repo(event_repo, monkeypatch, mocker) | ||
yield event_repo | ||
|
||
|
||
@pytest.fixture | ||
def superuser_header_token() -> Dict[str, str]: | ||
a_token = token_service.encode("[email protected]", True, {}) | ||
|
Oops, something went wrong.