From 2a581caaf2cf320c913979361783a82146b46dcf Mon Sep 17 00:00:00 2001 From: aidangannon Date: Sun, 7 Jul 2024 15:26:04 +0100 Subject: [PATCH] fix property schema, use added by --- backend/src/core.py | 2 +- backend/src/domain/commands.py | 2 +- backend/tests/unit/test_commands.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/core.py b/backend/src/core.py index a504fb1..e0cfbf0 100644 --- a/backend/src/core.py +++ b/backend/src/core.py @@ -34,7 +34,7 @@ class Property(Entity): url: str = None title: str = None price: Decimal = None - full_name: str = None + added_by: str = None @dataclass(unsafe_hash=True) diff --git a/backend/src/domain/commands.py b/backend/src/domain/commands.py index f0f6e84..e45c8f5 100644 --- a/backend/src/domain/commands.py +++ b/backend/src/domain/commands.py @@ -148,7 +148,7 @@ def run(self, context: ApplicationContext): property = Property(url=property_request.url, title=property_request.title, price=property_request.price, - full_name=user_groups.name) + added_by=user_groups.name) self.__property_repo.create(group_id=group.id, property=property) context.response = PropertyCreatedResponse(property=property) diff --git a/backend/tests/unit/test_commands.py b/backend/tests/unit/test_commands.py index 3ecdbac..832fe9d 100644 --- a/backend/tests/unit/test_commands.py +++ b/backend/tests/unit/test_commands.py @@ -378,7 +378,7 @@ def test_run(self, _): expected_property = Property(url=property.url, title=property.title, price=property.price, - full_name=user_groups.name) + added_by=user_groups.name) self.__property_repo.create = MagicMock() # act