ddd-shared-domain 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: ddd-shared-domain
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: ddd-value-objects==0.1.7
8
+
9
+ # ddd-shared-domain
@@ -0,0 +1 @@
1
+ # ddd-shared-domain
@@ -0,0 +1,28 @@
1
+ [project]
2
+ name = "ddd-shared-domain"
3
+ version = "0.1.0"
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ dependencies = [
8
+ "ddd-value-objects==0.1.7",
9
+ ]
10
+
11
+ [build-system]
12
+ requires = ["setuptools>=68", "wheel"]
13
+ build-backend = "setuptools.build_meta"
14
+
15
+ [tool.setuptools]
16
+ package-dir = {"" = "src"}
17
+
18
+ [tool.setuptools.packages.find]
19
+ where = ["src"]
20
+
21
+ [dependency-groups]
22
+ dev = [
23
+ "pytest==9.0.2",
24
+ "pytest-cov",
25
+ ]
26
+
27
+ [tool.pytest.ini_options]
28
+ addopts = "--cov=src --cov-report=term-missing --cov-fail-under=90"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,12 @@
1
+ from ddd_value_objects import UuidValueObject
2
+
3
+
4
+ class Entity:
5
+ def __init__(self, entity_id: str):
6
+ self.id = UuidValueObject(value=entity_id)
7
+
8
+ def equals(self, other: 'Entity') -> bool:
9
+ if not isinstance(other, Entity):
10
+ return False
11
+
12
+ return self.id.equals(other.id)
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: ddd-shared-domain
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: ddd-value-objects==0.1.7
8
+
9
+ # ddd-shared-domain
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/ddd_shared_domain/entity.py
4
+ src/ddd_shared_domain.egg-info/PKG-INFO
5
+ src/ddd_shared_domain.egg-info/SOURCES.txt
6
+ src/ddd_shared_domain.egg-info/dependency_links.txt
7
+ src/ddd_shared_domain.egg-info/requires.txt
8
+ src/ddd_shared_domain.egg-info/top_level.txt
9
+ tests/test_entity.py
@@ -0,0 +1 @@
1
+ ddd-value-objects==0.1.7
@@ -0,0 +1 @@
1
+ ddd_shared_domain
@@ -0,0 +1,20 @@
1
+ from ddd_shared_domain.entity import Entity
2
+
3
+
4
+ def test_entity_creation_and_id():
5
+ entity_id = "550e8400-e29b-41d4-a716-446655440000"
6
+ entity = Entity(entity_id)
7
+ assert entity.id.value == entity_id
8
+
9
+
10
+ def test_entity_equality():
11
+ id1 = "550e8400-e29b-41d4-a716-446655440000"
12
+ id2 = "550e8400-e29b-41d4-a716-446655440001"
13
+
14
+ entity1 = Entity(id1)
15
+ entity2 = Entity(id1)
16
+ entity3 = Entity(id2)
17
+
18
+ assert entity1.equals(entity2)
19
+ assert not entity1.equals(entity3)
20
+ assert not entity1.equals("not an entity")