Skip to content

Commit 322d189

Browse files
committed
update
1 parent 30d330c commit 322d189

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+621
-162
lines changed

poetry.lock

Lines changed: 30 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ pyjwt = "^2.10.1"
1515
pytest = "^8.3.4"
1616
bcrypt = "^4.2.1"
1717
uvicorn = "^0.34.0"
18+
dishka = "^1.4.2"
19+
pytest-asyncio = "^0.25.0"
1820

1921

2022
[build-system]
File renamed without changes.

src/__main__.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/application/common/command.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from abc import ABC, abstractmethod
2+
from dataclasses import dataclass
3+
from typing import Any, Generic, TypeVar
4+
5+
6+
CR = TypeVar("CR", bound=Any)
7+
8+
9+
@dataclass(frozen=True)
10+
class Command(ABC, Generic[CR]): ...
11+
12+
13+
CT = TypeVar("CT", bound=Command[Any])
14+
15+
16+
@dataclass(frozen=True)
17+
class CommandHandler(ABC, Generic[CT, CR]):
18+
@abstractmethod
19+
async def __call__(self, command: CT) -> CR: ...

src/application/common/dto.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from abc import ABC
2+
3+
4+
class DTO(ABC):
5+
pass

src/application/common/event.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from abc import ABC, abstractmethod
2+
from dataclasses import dataclass
3+
from typing import Any, Generic, TypeVar
4+
5+
from domain.common import Event as DomainEvent
6+
7+
8+
ER = TypeVar("ER", bound=Any)
9+
10+
11+
@dataclass
12+
class Event(DomainEvent, ABC, Generic[ER]): ...
13+
14+
15+
ET = TypeVar("ET", bound=Event[Any])
16+
17+
18+
@dataclass
19+
class EventHandler(ABC, Generic[ET, ER]):
20+
@abstractmethod
21+
def __call__(self, event: ET) -> ER: ...
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from domain.common import AppError
2+
3+
4+
class ApplicationError(AppError):
5+
@property
6+
def detail(self) -> str:
7+
return "An application error occurred"
File renamed without changes.

0 commit comments

Comments
 (0)