-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
223 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
[tool.ruff] | ||
extend-exclude = ["migrations", "dist", "build"] | ||
exclude = ["migrations", "dist", "build"] | ||
ignore-init-module-imports = true | ||
select = ["E", "F", "I", "B", "C4", "SIM", "N", "UP"] | ||
|
||
[tool.ruff.isort] | ||
[isort] | ||
force-single-line = false | ||
combine_as_imports = true | ||
line_length = 88 | ||
combine-as-imports = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ | |
"DATABASE_URL", | ||
"postgresql+asyncpg://postgres:postgres@localhost:5433/postgres", | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
from typing import Callable | ||
|
||
from fastapi import Depends | ||
from src.consents.repositories.consents_repository import ConsentsRepositorySQL, IConsentsRepository | ||
from src.consents.application.service import ConsentsService | ||
from src.consents.repositories.consents_repository import ( | ||
ConsentsRepositorySQL, | ||
IConsentsRepository, | ||
) | ||
from src.db_utils import db_context | ||
|
||
|
||
async def get_db_session() -> Callable: | ||
return db_context | ||
|
||
|
||
def get_consents_service(db: Callable = Depends(get_db_session)) -> ConsentsService: | ||
repo: IConsentsRepository = ConsentsRepositorySQL(db) | ||
return ConsentsService(repo=repo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import base64 | ||
import uuid | ||
|
||
|
||
def generate_uid() -> str: | ||
return base64.urlsafe_b64encode(uuid.uuid4().bytes).decode("utf8").rstrip("=") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
from typing import Callable | ||
|
||
from fastapi import Depends | ||
from sqlalchemy.ext.asyncio import AsyncSession | ||
from src.origins.repository import OriginsRepositorySQL, IOriginsRepository | ||
from src.origins.service import OriginsService | ||
from src.db_utils import db_context | ||
from src.origins.repository import IOriginsRepository, OriginsRepositorySQL | ||
from src.origins.service import OriginsService | ||
|
||
|
||
async def get_db_session() -> Callable: | ||
return db_context | ||
|
||
|
||
def get_origins_service(db: AsyncSession = Depends(get_db_session)) -> OriginsService: | ||
repo: IOriginsRepository = OriginsRepositorySQL(db) | ||
return OriginsService(repo=repo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.