refactor: make compatibility exports ruff clean

This commit is contained in:
Jarca
2026-07-07 23:27:19 +09:00
parent 2ccfc9c064
commit 7c420e498f
38 changed files with 641 additions and 234 deletions
@@ -1,6 +1,15 @@
from __future__ import annotations
from .shared import *
from .shared import (
Any,
datetime,
db,
fail,
now_iso,
ok,
re,
row_to_dict,
)
RULE_FIELDS = {"merchant", "counterparty", "description", "payment_method", "raw_summary", "branch", "memo"}
RULE_MATCH_TYPES = {"contains", "equals", "regex", "starts_with", "ends_with"}
@@ -68,11 +77,11 @@ def _rule_matches(rule: dict[str, Any], tx: dict[str, Any]) -> bool:
from .category_rules_write_services import (
create_category_rule,
create_ledger_category,
delete_category_rule,
delete_ledger_category,
update_category_rule,
create_category_rule as create_category_rule,
create_ledger_category as create_ledger_category,
delete_category_rule as delete_category_rule,
delete_ledger_category as delete_ledger_category,
update_category_rule as update_category_rule,
)
@@ -275,11 +284,11 @@ def apply_categorization_rules(limit: int = 1000, only_uncategorized: bool = Tru
return ok(applied_count=applied, preview=preview)
from .uncategorized_workbench_service import (
apply_uncategorized_group_recommendation,
apply_uncategorized_recommendation,
get_uncategorized_merchant_summary,
get_uncategorized_workbench,
list_uncategorized_transactions,
apply_uncategorized_group_recommendation as apply_uncategorized_group_recommendation,
apply_uncategorized_recommendation as apply_uncategorized_recommendation,
get_uncategorized_merchant_summary as get_uncategorized_merchant_summary,
get_uncategorized_workbench as get_uncategorized_workbench,
list_uncategorized_transactions as list_uncategorized_transactions,
)
DEFAULT_LEDGER_CATEGORIES: list[dict[str, Any]] = [