refactoring-backend #3

Merged
lukas.pupkalipinski merged 403 commits from refactoring-backend into main 2026-05-20 20:23:46 +02:00
2 changed files with 6 additions and 11 deletions
Showing only changes of commit 21eabb1f0f - Show all commits

View File

@@ -292,6 +292,8 @@ Importing a private symbol from a peer service module is a layering violation. I
### Task 10 — Replace ban_service deferred local imports with top-level imports
**Status:** Completed
**Severity:** Medium
**Where:**

View File

@@ -36,6 +36,10 @@ from app.models.ban import (
JailBanCount as JailBanCountModel,
)
from app.repositories import fail2ban_db_repo
from app.repositories.history_archive_repo import (
get_all_archived_history,
get_archived_history,
)
from app.utils.fail2ban_db_utils import get_fail2ban_db_path, parse_data_json, ts_to_iso
if TYPE_CHECKING:
@@ -169,8 +173,6 @@ async def list_bans(
if app_db is None:
raise ValueError("app_db must be provided when source is 'archive'")
from app.repositories.history_archive_repo import get_archived_history
rows, total = await get_archived_history(
db=app_db,
since=since,
@@ -337,11 +339,6 @@ async def bans_by_country(
if app_db is None:
raise ValueError("app_db must be provided when source is 'archive'")
from app.repositories.history_archive_repo import (
get_all_archived_history,
get_archived_history,
)
all_rows = await get_all_archived_history(
db=app_db,
since=since,
@@ -593,8 +590,6 @@ async def ban_trend(
if app_db is None:
raise ValueError("app_db must be provided when source is 'archive'")
from app.repositories.history_archive_repo import get_all_archived_history
all_rows = await get_all_archived_history(
db=app_db,
since=since,
@@ -692,8 +687,6 @@ async def bans_by_jail(
if app_db is None:
raise ValueError("app_db must be provided when source is 'archive'")
from app.repositories.history_archive_repo import get_all_archived_history
all_rows = await get_all_archived_history(
db=app_db,
since=since,