Skip to content

Commit 2e178c3

Browse files
Rename layers (#104)
* Infrastructure -> Outbound * Presentation -> Inbound
1 parent 9d9f7f6 commit 2e178c3

88 files changed

Lines changed: 169 additions & 171 deletions

File tree

Some content is hidden

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

alembic.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# this is typically a path given in POSIX (e.g. forward slashes)
66
# format, relative to the token %(here)s which refers to the location of this
77
# ini file
8-
script_location = src/app/infrastructure/persistence_sqla/alembic
8+
script_location = src/app/outbound/persistence_sqla/alembic
99

1010
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
1111
# Uncomment the line below if you want the files to be prepended with date and time

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ type = "layers"
9696
containers = ["app"]
9797
layers = [
9898
"(main)",
99-
"presentation",
100-
"infrastructure",
99+
"inbound",
100+
"outbound",
101101
"core",
102102
]
103103
ignore_imports = [
104-
"app.infrastructure.persistence_sqla.alembic.env -> app.main.config.loader",
105-
"app.infrastructure.persistence_sqla.alembic.env -> app.main.config.settings",
104+
"app.outbound.persistence_sqla.alembic.env -> app.main.config.loader",
105+
"app.outbound.persistence_sqla.alembic.env -> app.main.config.settings",
106106
]
107107

108108
[[tool.importlinter.contracts]]
@@ -137,8 +137,8 @@ forbidden_modules = ["app.core.commands"]
137137
id = "auth-ctx"
138138
name = "auth-ctx must use its own adapters"
139139
type = "forbidden"
140-
source_modules = ["app.infrastructure.auth_ctx"]
141-
forbidden_modules = ["app.infrastructure.adapters"]
140+
source_modules = ["app.outbound.auth_ctx"]
141+
forbidden_modules = ["app.outbound.adapters"]
142142

143143
[tool.mypy]
144144
mypy_path = ["src"]
@@ -247,7 +247,7 @@ split-on-trailing-comma = true
247247

248248
[tool.ruff.lint.per-file-ignores]
249249
"scripts/dishka/plot_dependencies_data.py" = ["T201"] # print
250-
"src/app/infrastructure/persistence_sqla/alembic/**" = ["ALL"]
250+
"src/app/outbound/persistence_sqla/alembic/**" = ["ALL"]
251251
"tests/**" = [
252252
"ARG002", # unused-method-argument
253253
"PLC2801", # unnecessary-dunder-call
@@ -263,7 +263,7 @@ split-on-trailing-comma = true
263263
[tool.slotscheck]
264264
strict-imports = true
265265
exclude-modules = '''
266-
^app\.infrastructure\.persistence_sqla\.alembic
266+
^app\.outbound\.persistence_sqla\.alembic
267267
'''
268268

269269
[tool.typos.files]
File renamed without changes.
File renamed without changes.

src/app/presentation/http/account/change_password.py renamed to src/app/inbound/http/account/change_password.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
from app.core.common.authorization.exceptions import AuthorizationError
1111
from app.core.common.exceptions import BusinessTypeError
12-
from app.infrastructure.adapters.exceptions import PasswordHasherBusyError
13-
from app.infrastructure.auth_ctx.exceptions import AuthenticationChangeError, AuthenticationError, ReAuthenticationError
14-
from app.infrastructure.auth_ctx.handlers.change_password import ChangePassword, ChangePasswordRequest
15-
from app.infrastructure.exceptions import StorageError
16-
from app.presentation.http.errors.callbacks import log_info
17-
from app.presentation.http.errors.rules import HTTP_503_SERVICE_UNAVAILABLE_RULE
12+
from app.inbound.http.errors.callbacks import log_info
13+
from app.inbound.http.errors.rules import HTTP_503_SERVICE_UNAVAILABLE_RULE
14+
from app.outbound.adapters.exceptions import PasswordHasherBusyError
15+
from app.outbound.auth_ctx.exceptions import AuthenticationChangeError, AuthenticationError, ReAuthenticationError
16+
from app.outbound.auth_ctx.handlers.change_password import ChangePassword, ChangePasswordRequest
17+
from app.outbound.exceptions import StorageError
1818

1919

2020
class ChangePasswordRequestSchema(BaseModel):

src/app/presentation/http/account/log_in.py renamed to src/app/inbound/http/account/log_in.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
from app.core.common.authorization.exceptions import AuthorizationError
99
from app.core.common.exceptions import BusinessTypeError
10-
from app.infrastructure.adapters.exceptions import PasswordHasherBusyError
11-
from app.infrastructure.auth_ctx.exceptions import AlreadyAuthenticatedError, AuthenticationError
12-
from app.infrastructure.auth_ctx.handlers.log_in import LogIn, LogInRequest
13-
from app.infrastructure.exceptions import StorageError
14-
from app.presentation.http.errors.callbacks import log_info
15-
from app.presentation.http.errors.rules import HTTP_503_SERVICE_UNAVAILABLE_RULE
10+
from app.inbound.http.errors.callbacks import log_info
11+
from app.inbound.http.errors.rules import HTTP_503_SERVICE_UNAVAILABLE_RULE
12+
from app.outbound.adapters.exceptions import PasswordHasherBusyError
13+
from app.outbound.auth_ctx.exceptions import AlreadyAuthenticatedError, AuthenticationError
14+
from app.outbound.auth_ctx.handlers.log_in import LogIn, LogInRequest
15+
from app.outbound.exceptions import StorageError
1616

1717

1818
def make_log_in_router() -> APIRouter:

src/app/presentation/http/account/log_out.py renamed to src/app/inbound/http/account/log_out.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
from fastapi_error_map import ErrorAwareRouter
88

99
from app.core.common.authorization.exceptions import AuthorizationError
10-
from app.infrastructure.auth_ctx.exceptions import AuthenticationError
11-
from app.infrastructure.auth_ctx.handlers.log_out import LogOut
12-
from app.infrastructure.exceptions import StorageError
13-
from app.presentation.http.errors.callbacks import log_info
14-
from app.presentation.http.errors.rules import HTTP_503_SERVICE_UNAVAILABLE_RULE
10+
from app.inbound.http.errors.callbacks import log_info
11+
from app.inbound.http.errors.rules import HTTP_503_SERVICE_UNAVAILABLE_RULE
12+
from app.outbound.auth_ctx.exceptions import AuthenticationError
13+
from app.outbound.auth_ctx.handlers.log_out import LogOut
14+
from app.outbound.exceptions import StorageError
1515

1616

1717
def make_log_out_router(*, cookie_name: str) -> APIRouter:

src/app/presentation/http/account/router.py renamed to src/app/inbound/http/account/router.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from fastapi import APIRouter
22

3-
from app.presentation.http.account.change_password import make_change_password_router
4-
from app.presentation.http.account.log_in import make_log_in_router
5-
from app.presentation.http.account.log_out import make_log_out_router
6-
from app.presentation.http.account.sign_up import make_sign_up_router
3+
from app.inbound.http.account.change_password import make_change_password_router
4+
from app.inbound.http.account.log_in import make_log_in_router
5+
from app.inbound.http.account.log_out import make_log_out_router
6+
from app.inbound.http.account.sign_up import make_sign_up_router
77

88

99
def make_account_router(*, cookie_name: str) -> APIRouter:

src/app/presentation/http/account/sign_up.py renamed to src/app/inbound/http/account/sign_up.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
from app.core.commands.exceptions import UsernameAlreadyExistsError
99
from app.core.common.authorization.exceptions import AuthorizationError
1010
from app.core.common.exceptions import BusinessTypeError
11-
from app.infrastructure.adapters.exceptions import PasswordHasherBusyError
12-
from app.infrastructure.auth_ctx.exceptions import AlreadyAuthenticatedError
13-
from app.infrastructure.auth_ctx.handlers.sign_up import SignUp, SignUpRequest
14-
from app.infrastructure.exceptions import StorageError
15-
from app.presentation.http.errors.callbacks import log_info
16-
from app.presentation.http.errors.rules import HTTP_503_SERVICE_UNAVAILABLE_RULE
11+
from app.inbound.http.errors.callbacks import log_info
12+
from app.inbound.http.errors.rules import HTTP_503_SERVICE_UNAVAILABLE_RULE
13+
from app.outbound.adapters.exceptions import PasswordHasherBusyError
14+
from app.outbound.auth_ctx.exceptions import AlreadyAuthenticatedError
15+
from app.outbound.auth_ctx.handlers.sign_up import SignUp, SignUpRequest
16+
from app.outbound.exceptions import StorageError
1717

1818

1919
def make_sign_up_router() -> APIRouter:

0 commit comments

Comments
 (0)