__init__.py (removed)

Last source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Package defining the ``Repository`` entity."""

from isshub.domain.contexts.code_repository.entities.namespace import Namespace
from isshub.domain.utils.entity import BaseModelWithId, required_field, validated


@validated()  # type: ignore
class Repository(BaseModelWithId):
    """A repository holds code, issues, code requests...

    Attributes
    ----------
    id : int
        The unique identifier of the repository
    name : str
        The name of the repository. Unique in its namespace.
    namespace : Namespace
        Where the repository can be found.

    """

    name: str = required_field(str)  # type: ignore
    namespace: Namespace = required_field(Namespace)  # type: ignore

Changes

refactor(core): Rename core domain context to code_repository

Commit
Hash

07e279b370c0924f2b2cf32aea016b307001dfa0

Date

2019-08-15 23:31:33 +0200

Type

Renamed

New path

isshub/domain/contexts/code_repository/entities/repository/__init__.py

Stats

+1 -1

@@ -1,6 +1,6 @@
 """Package defining the ``Repository`` entity."""

-from isshub.domain.contexts.core.entities.namespace import Namespace
+from isshub.domain.contexts.code_repository.entities.namespace import Namespace
 from isshub.domain.utils.entity import BaseModelWithId, required_field, validated

feat(namespace): Add Namespace entity in core domain context

Commit
Hash

3a2dd3cc6f6de1fa1b03db95eaa357628824f075

Date

2019-06-07 21:03:50 +0200

Type

Modified

Stats

+3 -2

@@ -1,5 +1,6 @@
 """Package defining the ``Repository`` entity."""

+from isshub.domain.contexts.core.entities.namespace import Namespace
 from isshub.domain.utils.entity import BaseModelWithId, required_field, validated


@@ -13,10 +14,10 @@ class Repository(BaseModelWithId):
         The unique identifier of the repository
     name : str
         The name of the repository. Unique in its namespace.
-    namespace : str
+    namespace : Namespace
         Where the repository can be found.

     """

     name: str = required_field(str)  # type: ignore
-    namespace: str = required_field(str)  # type: ignore
+    namespace: Namespace = required_field(Namespace)  # type: ignore

feat(repository): Introduce entities validation (for Repository entity)

Commit
Hash

86ad505796b742a391684e2ef93695fdfb077abb

Date

2019-06-07 21:03:50 +0200

Type

Modified

Stats

+5 -8

@@ -1,10 +1,10 @@
 """Package defining the ``Repository`` entity."""

-from dataclasses import dataclass
+from isshub.domain.utils.entity import BaseModelWithId, required_field, validated


-@dataclass
-class Repository:
+@validated()  # type: ignore
+class Repository(BaseModelWithId):
     """A repository holds code, issues, code requests...

     Attributes
@@ -18,8 +18,5 @@ class Repository:

     """

-    __slots__ = ["id", "name", "namespace"]
-
-    id: int
-    name: str
-    namespace: str
+    name: str = required_field(str)  # type: ignore
+    namespace: str = required_field(str)  # type: ignore

feat(repository): Add 1st domain context (core) and entity (Repository)

Commit
Hash

37d8930e4da80b776842d3834d6bf81f860c5692

Date

2019-06-07 21:03:50 +0200

Type

Added

Stats

+25 -0

@@ -0,0 +1,25 @@
+"""Package defining the ``Repository`` entity."""
+
+from dataclasses import dataclass
+
+
+@dataclass
+class Repository:
+    """A repository holds code, issues, code requests...
+
+    Attributes
+    ----------
+    id : int
+        The unique identifier of the repository
+    name : str
+        The name of the repository. Unique in its namespace.
+    namespace : str
+        Where the repository can be found.
+
+    """
+
+    __slots__ = ["id", "name", "namespace"]
+
+    id: int
+    name: str
+    namespace: str