-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #592 from vselvarajijay/hexagonal
+ wip: unit tests
- Loading branch information
Showing
7 changed files
with
87 additions
and
5 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
26 changes: 26 additions & 0 deletions
26
.../domain/command_handlers/registry_management_handlers/update_registry_command_handlers.py
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,26 @@ | ||
from datetime import datetime, timezone | ||
import uuid | ||
|
||
from mbc.domain.commands.registry_management.update_registry_command import UpdateRegistryCommand | ||
from mbc.adapters.dynamodb_query_service import DynamoDBRegistryQueryService | ||
from mbc.domain.model.registry import RegistryUser, Registry | ||
|
||
from decimal import Decimal | ||
|
||
|
||
def handle_update_registry_command( | ||
command: UpdateRegistryCommand, | ||
patient_query_service: DynamoDBRegistryQueryService, | ||
) -> bool: | ||
timestamp = Decimal(datetime.now(timezone.utc).timestamp()) | ||
registry = patient_query_service.update_registry( | ||
Registry( | ||
id=uuid.uuid4().hex, | ||
name=command.name, | ||
description=command.description, | ||
created_at=timestamp | ||
) | ||
) | ||
|
||
|
||
return registry |
6 changes: 6 additions & 0 deletions
6
...measurement-based-care/mbc/domain/commands/registry_management/update_registry_command.py
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,6 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class UpdateRegistryCommand(BaseModel): | ||
name: str | ||
description: str |
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
8 changes: 8 additions & 0 deletions
8
...es/clinical-model-measurement-based-care/mbc/entrypoints/api/v1/models/update_registry.py
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,8 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
|
||
class UpdateRegistry(BaseModel): | ||
name: str | ||
description: str | ||
|