refactor: make compatibility exports ruff clean
This commit is contained in:
@@ -1 +1,4 @@
|
|||||||
from .server import main, mcp
|
from .server import main as main
|
||||||
|
from .server import mcp as mcp
|
||||||
|
|
||||||
|
__all__ = ["main", "mcp"]
|
||||||
|
|||||||
@@ -1,60 +1,121 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...service import (
|
from ...service import (
|
||||||
apply_categorization_rules,
|
annotations as annotations,
|
||||||
close_asset_snapshot,
|
apply_categorization_rules as apply_categorization_rules,
|
||||||
create_category_rule,
|
close_asset_snapshot as close_asset_snapshot,
|
||||||
create_ledger_account,
|
create_category_rule as create_category_rule,
|
||||||
create_ledger_backup,
|
create_ledger_account as create_ledger_account,
|
||||||
create_ledger_budget,
|
create_ledger_backup as create_ledger_backup,
|
||||||
create_ledger_category,
|
create_ledger_budget as create_ledger_budget,
|
||||||
create_ledger_transaction,
|
create_ledger_category as create_ledger_category,
|
||||||
create_manual_asset,
|
create_ledger_transaction as create_ledger_transaction,
|
||||||
deactivate_manual_asset,
|
create_manual_asset as create_manual_asset,
|
||||||
delete_category_rule,
|
deactivate_manual_asset as deactivate_manual_asset,
|
||||||
delete_ledger_category,
|
delete_category_rule as delete_category_rule,
|
||||||
delete_ledger_transaction,
|
delete_ledger_category as delete_ledger_category,
|
||||||
get_asset_liquidity_report,
|
delete_ledger_transaction as delete_ledger_transaction,
|
||||||
get_asset_snapshot_report,
|
get_asset_liquidity_report as get_asset_liquidity_report,
|
||||||
get_balance_reconciliation_report,
|
get_asset_snapshot_report as get_asset_snapshot_report,
|
||||||
get_budget_vs_actual_report,
|
get_balance_reconciliation_report as get_balance_reconciliation_report,
|
||||||
get_category_spending_report,
|
get_budget_vs_actual_report as get_budget_vs_actual_report,
|
||||||
get_fixed_cost_report,
|
get_category_spending_report as get_category_spending_report,
|
||||||
get_investable_cashflow_report,
|
get_fixed_cost_report as get_fixed_cost_report,
|
||||||
get_ledger_backup_status,
|
get_investable_cashflow_report as get_investable_cashflow_report,
|
||||||
get_ledger_db_status,
|
get_ledger_backup_status as get_ledger_backup_status,
|
||||||
get_monthly_cashflow_report,
|
get_ledger_db_status as get_ledger_db_status,
|
||||||
get_net_worth_timeseries,
|
get_monthly_cashflow_report as get_monthly_cashflow_report,
|
||||||
health_check,
|
get_net_worth_timeseries as get_net_worth_timeseries,
|
||||||
import_kb_bank_pdf,
|
get_uncategorized_merchant_summary as get_uncategorized_merchant_summary,
|
||||||
import_seoulpay_xlsx,
|
health_check as health_check,
|
||||||
import_toss_bank_pdf,
|
import_kb_bank_pdf as import_kb_bank_pdf,
|
||||||
import_toss_securities_pdf,
|
import_seoulpay_xlsx as import_seoulpay_xlsx,
|
||||||
list_category_rules,
|
import_toss_bank_pdf as import_toss_bank_pdf,
|
||||||
list_cross_transfer_review_queue,
|
import_toss_securities_pdf as import_toss_securities_pdf,
|
||||||
list_ledger_accounts,
|
list_category_rules as list_category_rules,
|
||||||
list_ledger_backups,
|
list_cross_transfer_review_queue as list_cross_transfer_review_queue,
|
||||||
list_ledger_budgets,
|
list_ledger_accounts as list_ledger_accounts,
|
||||||
list_ledger_categories,
|
list_ledger_backups as list_ledger_backups,
|
||||||
list_ledger_import_batches,
|
list_ledger_budgets as list_ledger_budgets,
|
||||||
list_ledger_transactions,
|
list_ledger_categories as list_ledger_categories,
|
||||||
list_manual_assets,
|
list_ledger_import_batches as list_ledger_import_batches,
|
||||||
list_uncategorized_transactions,
|
list_ledger_transactions as list_ledger_transactions,
|
||||||
preview_asset_snapshot_close,
|
list_manual_assets as list_manual_assets,
|
||||||
preview_categorization,
|
list_uncategorized_transactions as list_uncategorized_transactions,
|
||||||
preview_cross_account_transfers,
|
preview_asset_snapshot_close as preview_asset_snapshot_close,
|
||||||
preview_kb_bank_pdf_import,
|
preview_categorization as preview_categorization,
|
||||||
preview_ledger_csv_import,
|
preview_cross_account_transfers as preview_cross_account_transfers,
|
||||||
preview_seoulpay_xlsx_import,
|
preview_kb_bank_pdf_import as preview_kb_bank_pdf_import,
|
||||||
preview_toss_bank_pdf_import,
|
preview_ledger_csv_import as preview_ledger_csv_import,
|
||||||
preview_toss_securities_pdf_import,
|
preview_seoulpay_xlsx_import as preview_seoulpay_xlsx_import,
|
||||||
rollback_ledger_import_batch,
|
preview_toss_bank_pdf_import as preview_toss_bank_pdf_import,
|
||||||
run_cross_account_transfer_match,
|
preview_toss_securities_pdf_import as preview_toss_securities_pdf_import,
|
||||||
seed_default_category_rules,
|
rollback_ledger_import_batch as rollback_ledger_import_batch,
|
||||||
seed_default_ledger_categories,
|
run_cross_account_transfer_match as run_cross_account_transfer_match,
|
||||||
update_category_rule,
|
seed_default_category_rules as seed_default_category_rules,
|
||||||
update_ledger_account,
|
seed_default_ledger_categories as seed_default_ledger_categories,
|
||||||
update_ledger_transaction,
|
update_category_rule as update_category_rule,
|
||||||
update_manual_asset,
|
update_ledger_account as update_ledger_account,
|
||||||
get_uncategorized_merchant_summary,
|
update_ledger_transaction as update_ledger_transaction,
|
||||||
|
update_manual_asset as update_manual_asset,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"annotations",
|
||||||
|
"apply_categorization_rules",
|
||||||
|
"close_asset_snapshot",
|
||||||
|
"create_category_rule",
|
||||||
|
"create_ledger_account",
|
||||||
|
"create_ledger_backup",
|
||||||
|
"create_ledger_budget",
|
||||||
|
"create_ledger_category",
|
||||||
|
"create_ledger_transaction",
|
||||||
|
"create_manual_asset",
|
||||||
|
"deactivate_manual_asset",
|
||||||
|
"delete_category_rule",
|
||||||
|
"delete_ledger_category",
|
||||||
|
"delete_ledger_transaction",
|
||||||
|
"get_asset_liquidity_report",
|
||||||
|
"get_asset_snapshot_report",
|
||||||
|
"get_balance_reconciliation_report",
|
||||||
|
"get_budget_vs_actual_report",
|
||||||
|
"get_category_spending_report",
|
||||||
|
"get_fixed_cost_report",
|
||||||
|
"get_investable_cashflow_report",
|
||||||
|
"get_ledger_backup_status",
|
||||||
|
"get_ledger_db_status",
|
||||||
|
"get_monthly_cashflow_report",
|
||||||
|
"get_net_worth_timeseries",
|
||||||
|
"get_uncategorized_merchant_summary",
|
||||||
|
"health_check",
|
||||||
|
"import_kb_bank_pdf",
|
||||||
|
"import_seoulpay_xlsx",
|
||||||
|
"import_toss_bank_pdf",
|
||||||
|
"import_toss_securities_pdf",
|
||||||
|
"list_category_rules",
|
||||||
|
"list_cross_transfer_review_queue",
|
||||||
|
"list_ledger_accounts",
|
||||||
|
"list_ledger_backups",
|
||||||
|
"list_ledger_budgets",
|
||||||
|
"list_ledger_categories",
|
||||||
|
"list_ledger_import_batches",
|
||||||
|
"list_ledger_transactions",
|
||||||
|
"list_manual_assets",
|
||||||
|
"list_uncategorized_transactions",
|
||||||
|
"preview_asset_snapshot_close",
|
||||||
|
"preview_categorization",
|
||||||
|
"preview_cross_account_transfers",
|
||||||
|
"preview_kb_bank_pdf_import",
|
||||||
|
"preview_ledger_csv_import",
|
||||||
|
"preview_seoulpay_xlsx_import",
|
||||||
|
"preview_toss_bank_pdf_import",
|
||||||
|
"preview_toss_securities_pdf_import",
|
||||||
|
"rollback_ledger_import_batch",
|
||||||
|
"run_cross_account_transfer_match",
|
||||||
|
"seed_default_category_rules",
|
||||||
|
"seed_default_ledger_categories",
|
||||||
|
"update_category_rule",
|
||||||
|
"update_ledger_account",
|
||||||
|
"update_ledger_transaction",
|
||||||
|
"update_manual_asset",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,11 +1,21 @@
|
|||||||
from . import (
|
from . import accounts_gateway as accounts_gateway
|
||||||
accounts_gateway,
|
from . import assets_gateway as assets_gateway
|
||||||
assets_gateway,
|
from . import categorization_gateway as categorization_gateway
|
||||||
categorization_gateway,
|
from . import imports_gateway as imports_gateway
|
||||||
imports_gateway,
|
from . import overview_gateway as overview_gateway
|
||||||
overview_gateway,
|
from . import reconciliation_gateway as reconciliation_gateway
|
||||||
reconciliation_gateway,
|
from . import service_gateway as service_gateway
|
||||||
service_gateway,
|
from . import transactions_gateway as transactions_gateway
|
||||||
transactions_gateway,
|
from . import transfers_gateway as transfers_gateway
|
||||||
transfers_gateway,
|
|
||||||
)
|
__all__ = [
|
||||||
|
"accounts_gateway",
|
||||||
|
"assets_gateway",
|
||||||
|
"categorization_gateway",
|
||||||
|
"imports_gateway",
|
||||||
|
"overview_gateway",
|
||||||
|
"reconciliation_gateway",
|
||||||
|
"service_gateway",
|
||||||
|
"transactions_gateway",
|
||||||
|
"transfers_gateway",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...service import (
|
from ...service import (
|
||||||
list_ledger_accounts,
|
list_ledger_accounts as list_ledger_accounts,
|
||||||
update_ledger_account,
|
update_ledger_account as update_ledger_account,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"list_ledger_accounts",
|
||||||
|
"update_ledger_account",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...service import (
|
from ...service import (
|
||||||
close_asset_snapshot,
|
close_asset_snapshot as close_asset_snapshot,
|
||||||
create_manual_asset,
|
create_manual_asset as create_manual_asset,
|
||||||
deactivate_manual_asset,
|
deactivate_manual_asset as deactivate_manual_asset,
|
||||||
list_manual_assets,
|
list_manual_assets as list_manual_assets,
|
||||||
preview_asset_snapshot_close,
|
preview_asset_snapshot_close as preview_asset_snapshot_close,
|
||||||
update_manual_asset,
|
update_manual_asset as update_manual_asset,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"close_asset_snapshot",
|
||||||
|
"create_manual_asset",
|
||||||
|
"deactivate_manual_asset",
|
||||||
|
"list_manual_assets",
|
||||||
|
"preview_asset_snapshot_close",
|
||||||
|
"update_manual_asset",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,20 +1,39 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...service import (
|
from ...service import (
|
||||||
apply_categorization_rules,
|
apply_categorization_rules as apply_categorization_rules,
|
||||||
apply_category_rule,
|
apply_category_rule as apply_category_rule,
|
||||||
apply_uncategorized_group_recommendation,
|
apply_uncategorized_group_recommendation as apply_uncategorized_group_recommendation,
|
||||||
apply_uncategorized_recommendation,
|
apply_uncategorized_recommendation as apply_uncategorized_recommendation,
|
||||||
create_category_rule,
|
create_category_rule as create_category_rule,
|
||||||
create_ledger_category,
|
create_ledger_category as create_ledger_category,
|
||||||
delete_ledger_category,
|
delete_ledger_category as delete_ledger_category,
|
||||||
get_uncategorized_merchant_summary,
|
get_uncategorized_merchant_summary as get_uncategorized_merchant_summary,
|
||||||
get_uncategorized_workbench,
|
get_uncategorized_workbench as get_uncategorized_workbench,
|
||||||
list_category_rules,
|
list_category_rules as list_category_rules,
|
||||||
list_ledger_categories,
|
list_ledger_categories as list_ledger_categories,
|
||||||
list_uncategorized_transactions,
|
list_uncategorized_transactions as list_uncategorized_transactions,
|
||||||
preview_categorization,
|
preview_categorization as preview_categorization,
|
||||||
preview_category_rule_matches,
|
preview_category_rule_matches as preview_category_rule_matches,
|
||||||
seed_default_category_rules,
|
seed_default_category_rules as seed_default_category_rules,
|
||||||
seed_default_ledger_categories,
|
seed_default_ledger_categories as seed_default_ledger_categories,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"apply_categorization_rules",
|
||||||
|
"apply_category_rule",
|
||||||
|
"apply_uncategorized_group_recommendation",
|
||||||
|
"apply_uncategorized_recommendation",
|
||||||
|
"create_category_rule",
|
||||||
|
"create_ledger_category",
|
||||||
|
"delete_ledger_category",
|
||||||
|
"get_uncategorized_merchant_summary",
|
||||||
|
"get_uncategorized_workbench",
|
||||||
|
"list_category_rules",
|
||||||
|
"list_ledger_categories",
|
||||||
|
"list_uncategorized_transactions",
|
||||||
|
"preview_categorization",
|
||||||
|
"preview_category_rule_matches",
|
||||||
|
"seed_default_category_rules",
|
||||||
|
"seed_default_ledger_categories",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...service import (
|
from ...service import (
|
||||||
import_toss_bank_pdf,
|
import_toss_bank_pdf as import_toss_bank_pdf,
|
||||||
import_toss_securities_pdf,
|
import_toss_securities_pdf as import_toss_securities_pdf,
|
||||||
list_ledger_import_batches,
|
list_ledger_import_batches as list_ledger_import_batches,
|
||||||
preview_toss_bank_pdf_import,
|
preview_toss_bank_pdf_import as preview_toss_bank_pdf_import,
|
||||||
preview_toss_securities_pdf_import,
|
preview_toss_securities_pdf_import as preview_toss_securities_pdf_import,
|
||||||
rollback_ledger_import_batch,
|
rollback_ledger_import_batch as rollback_ledger_import_batch,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"import_toss_bank_pdf",
|
||||||
|
"import_toss_securities_pdf",
|
||||||
|
"list_ledger_import_batches",
|
||||||
|
"preview_toss_bank_pdf_import",
|
||||||
|
"preview_toss_securities_pdf_import",
|
||||||
|
"rollback_ledger_import_batch",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,13 +1,25 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...service import (
|
from ...service import (
|
||||||
get_asset_liquidity_report,
|
get_asset_liquidity_report as get_asset_liquidity_report,
|
||||||
get_balance_reconciliation_report,
|
get_balance_reconciliation_report as get_balance_reconciliation_report,
|
||||||
get_budget_vs_actual_report,
|
get_budget_vs_actual_report as get_budget_vs_actual_report,
|
||||||
get_monthly_cashflow_report,
|
get_monthly_cashflow_report as get_monthly_cashflow_report,
|
||||||
health_check,
|
health_check as health_check,
|
||||||
list_cross_transfer_review_queue,
|
list_cross_transfer_review_queue as list_cross_transfer_review_queue,
|
||||||
list_ledger_backups,
|
list_ledger_backups as list_ledger_backups,
|
||||||
list_ledger_import_batches,
|
list_ledger_import_batches as list_ledger_import_batches,
|
||||||
list_uncategorized_transactions,
|
list_uncategorized_transactions as list_uncategorized_transactions,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"get_asset_liquidity_report",
|
||||||
|
"get_balance_reconciliation_report",
|
||||||
|
"get_budget_vs_actual_report",
|
||||||
|
"get_monthly_cashflow_report",
|
||||||
|
"health_check",
|
||||||
|
"list_cross_transfer_review_queue",
|
||||||
|
"list_ledger_backups",
|
||||||
|
"list_ledger_import_batches",
|
||||||
|
"list_uncategorized_transactions",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...service import get_balance_reconciliation_report
|
from ...service import get_balance_reconciliation_report as get_balance_reconciliation_report
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"get_balance_reconciliation_report",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,10 +1,28 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .accounts_gateway import *
|
from . import accounts_gateway as _accounts_gateway
|
||||||
from .assets_gateway import *
|
from . import assets_gateway as _assets_gateway
|
||||||
from .categorization_gateway import *
|
from . import categorization_gateway as _categorization_gateway
|
||||||
from .imports_gateway import *
|
from . import imports_gateway as _imports_gateway
|
||||||
from .overview_gateway import *
|
from . import overview_gateway as _overview_gateway
|
||||||
from .reconciliation_gateway import *
|
from . import reconciliation_gateway as _reconciliation_gateway
|
||||||
from .transactions_gateway import *
|
from . import transactions_gateway as _transactions_gateway
|
||||||
from .transfers_gateway import *
|
from . import transfers_gateway as _transfers_gateway
|
||||||
|
|
||||||
|
_GATEWAY_MODULES = (
|
||||||
|
_accounts_gateway,
|
||||||
|
_assets_gateway,
|
||||||
|
_categorization_gateway,
|
||||||
|
_imports_gateway,
|
||||||
|
_overview_gateway,
|
||||||
|
_reconciliation_gateway,
|
||||||
|
_transactions_gateway,
|
||||||
|
_transfers_gateway,
|
||||||
|
)
|
||||||
|
|
||||||
|
__all__: list[str] = []
|
||||||
|
for _module in _GATEWAY_MODULES:
|
||||||
|
for _name in getattr(_module, "__all__", []):
|
||||||
|
globals().setdefault(_name, getattr(_module, _name))
|
||||||
|
if _name not in __all__:
|
||||||
|
__all__.append(_name)
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...service import update_ledger_transaction
|
from ...service import update_ledger_transaction as update_ledger_transaction
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"update_ledger_transaction",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,11 +1,21 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...service import (
|
from ...service import (
|
||||||
find_cancel_original_candidates,
|
find_cancel_original_candidates as find_cancel_original_candidates,
|
||||||
find_self_transfer_candidates,
|
find_self_transfer_candidates as find_self_transfer_candidates,
|
||||||
link_cancel_to_original,
|
link_cancel_to_original as link_cancel_to_original,
|
||||||
link_self_transfer_pair,
|
link_self_transfer_pair as link_self_transfer_pair,
|
||||||
list_cross_transfer_review_queue,
|
list_cross_transfer_review_queue as list_cross_transfer_review_queue,
|
||||||
preview_cross_account_transfers,
|
preview_cross_account_transfers as preview_cross_account_transfers,
|
||||||
run_cross_account_transfer_match,
|
run_cross_account_transfer_match as run_cross_account_transfer_match,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"find_cancel_original_candidates",
|
||||||
|
"find_self_transfer_candidates",
|
||||||
|
"link_cancel_to_original",
|
||||||
|
"link_self_transfer_pair",
|
||||||
|
"list_cross_transfer_review_queue",
|
||||||
|
"preview_cross_account_transfers",
|
||||||
|
"run_cross_account_transfer_match",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,15 +1,44 @@
|
|||||||
from . import shared
|
from __future__ import annotations
|
||||||
from .accounts_write_services import *
|
|
||||||
from .asset_account_services import *
|
from . import accounts_write_services as _accounts_write_services
|
||||||
from .assets_service import *
|
from . import asset_account_services as _asset_account_services
|
||||||
from .budgets_write_services import *
|
from . import assets_service as _assets_service
|
||||||
from .category_rules_write_services import *
|
from . import budgets_write_services as _budgets_write_services
|
||||||
from .categorization_services import *
|
from . import category_rules_write_services as _category_rules_write_services
|
||||||
from .cross_transfer_service import *
|
from . import categorization_services as _categorization_services
|
||||||
from .imports_service import *
|
from . import cross_transfer_service as _cross_transfer_service
|
||||||
from .import_transfer_services import *
|
from . import imports_service as _imports_service
|
||||||
from .reconciliation_service import *
|
from . import import_transfer_services as _import_transfer_services
|
||||||
from .system_services import *
|
from . import reconciliation_service as _reconciliation_service
|
||||||
from .transactions_write_services import *
|
from . import shared as shared
|
||||||
from .transaction_report_services import *
|
from . import system_services as _system_services
|
||||||
from .uncategorized_workbench_service import *
|
from . import transactions_write_services as _transactions_write_services
|
||||||
|
from . import transaction_report_services as _transaction_report_services
|
||||||
|
from . import uncategorized_workbench_service as _uncategorized_workbench_service
|
||||||
|
|
||||||
|
_EXPORT_MODULES = (
|
||||||
|
shared,
|
||||||
|
_accounts_write_services,
|
||||||
|
_asset_account_services,
|
||||||
|
_assets_service,
|
||||||
|
_budgets_write_services,
|
||||||
|
_category_rules_write_services,
|
||||||
|
_categorization_services,
|
||||||
|
_cross_transfer_service,
|
||||||
|
_imports_service,
|
||||||
|
_import_transfer_services,
|
||||||
|
_reconciliation_service,
|
||||||
|
_system_services,
|
||||||
|
_transactions_write_services,
|
||||||
|
_transaction_report_services,
|
||||||
|
_uncategorized_workbench_service,
|
||||||
|
)
|
||||||
|
|
||||||
|
__all__: list[str] = ["shared"]
|
||||||
|
for _module in _EXPORT_MODULES:
|
||||||
|
for _name in dir(_module):
|
||||||
|
if _name.startswith("_"):
|
||||||
|
continue
|
||||||
|
globals().setdefault(_name, getattr(_module, _name))
|
||||||
|
if _name not in __all__:
|
||||||
|
__all__.append(_name)
|
||||||
|
|||||||
@@ -1,6 +1,17 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
|
Any,
|
||||||
|
VALID_ACCOUNT_TYPES,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
new_id,
|
||||||
|
normalize_liquidity_bucket,
|
||||||
|
normalize_statement_status,
|
||||||
|
now_iso,
|
||||||
|
ok,
|
||||||
|
row_to_dict,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def create_ledger_account(name: str, type: str = "bank", institution: str = "", currency: str = "KRW", active: bool = True, memo: str = "", account_number_masked: str = "", holder_name: str = "", last_balance: int | None = None, last_synced_at: str = "", statement_status: str = "unknown", liquidity_bucket: str = "other", db_path: str | None = None) -> dict[str, Any]:
|
def create_ledger_account(name: str, type: str = "bank", institution: str = "", currency: str = "KRW", active: bool = True, memo: str = "", account_number_masked: str = "", holder_name: str = "", last_balance: int | None = None, last_synced_at: str = "", statement_status: str = "unknown", liquidity_bucket: str = "other", db_path: str | None = None) -> dict[str, Any]:
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .assets_service import (
|
from .assets_service import (
|
||||||
close_asset_snapshot,
|
close_asset_snapshot as close_asset_snapshot,
|
||||||
create_asset_snapshot,
|
create_asset_snapshot as create_asset_snapshot,
|
||||||
create_manual_asset,
|
create_manual_asset as create_manual_asset,
|
||||||
deactivate_manual_asset,
|
deactivate_manual_asset as deactivate_manual_asset,
|
||||||
get_asset_liquidity_report,
|
get_asset_liquidity_report as get_asset_liquidity_report,
|
||||||
get_asset_snapshot_report,
|
get_asset_snapshot_report as get_asset_snapshot_report,
|
||||||
get_net_worth_timeseries,
|
get_net_worth_timeseries as get_net_worth_timeseries,
|
||||||
list_manual_assets,
|
list_manual_assets as list_manual_assets,
|
||||||
preview_asset_snapshot_close,
|
preview_asset_snapshot_close as preview_asset_snapshot_close,
|
||||||
update_manual_asset,
|
update_manual_asset as update_manual_asset,
|
||||||
)
|
)
|
||||||
from .accounts_write_services import update_ledger_account
|
from .accounts_write_services import update_ledger_account as update_ledger_account
|
||||||
|
|||||||
@@ -1,6 +1,22 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
|
ASSET_BUCKETS,
|
||||||
|
ASSET_BUCKET_ORDER,
|
||||||
|
Any,
|
||||||
|
LIABILITY_BUCKETS,
|
||||||
|
current_kst_date,
|
||||||
|
date,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
new_id,
|
||||||
|
normalize_date,
|
||||||
|
normalize_liquidity_bucket,
|
||||||
|
now_iso,
|
||||||
|
ok,
|
||||||
|
row_to_dict,
|
||||||
|
sqlite3,
|
||||||
|
)
|
||||||
|
|
||||||
def _valuation_policy() -> dict[str, Any]:
|
def _valuation_policy() -> dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
|
Any,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
new_id,
|
||||||
|
normalize_month,
|
||||||
|
now_iso,
|
||||||
|
ok,
|
||||||
|
row_to_dict,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def create_ledger_budget(month: str, category: str, amount: int | float, subcategory: str = "", person: str = "", currency: str = "KRW", memo: str = "", db_path: str | None = None) -> dict[str, Any]:
|
def create_ledger_budget(month: str, category: str, amount: int | float, subcategory: str = "", person: str = "", currency: str = "KRW", memo: str = "", db_path: str | None = None) -> dict[str, Any]:
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
from __future__ import annotations
|
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_FIELDS = {"merchant", "counterparty", "description", "payment_method", "raw_summary", "branch", "memo"}
|
||||||
RULE_MATCH_TYPES = {"contains", "equals", "regex", "starts_with", "ends_with"}
|
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 (
|
from .category_rules_write_services import (
|
||||||
create_category_rule,
|
create_category_rule as create_category_rule,
|
||||||
create_ledger_category,
|
create_ledger_category as create_ledger_category,
|
||||||
delete_category_rule,
|
delete_category_rule as delete_category_rule,
|
||||||
delete_ledger_category,
|
delete_ledger_category as delete_ledger_category,
|
||||||
update_category_rule,
|
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)
|
return ok(applied_count=applied, preview=preview)
|
||||||
|
|
||||||
from .uncategorized_workbench_service import (
|
from .uncategorized_workbench_service import (
|
||||||
apply_uncategorized_group_recommendation,
|
apply_uncategorized_group_recommendation as apply_uncategorized_group_recommendation,
|
||||||
apply_uncategorized_recommendation,
|
apply_uncategorized_recommendation as apply_uncategorized_recommendation,
|
||||||
get_uncategorized_merchant_summary,
|
get_uncategorized_merchant_summary as get_uncategorized_merchant_summary,
|
||||||
get_uncategorized_workbench,
|
get_uncategorized_workbench as get_uncategorized_workbench,
|
||||||
list_uncategorized_transactions,
|
list_uncategorized_transactions as list_uncategorized_transactions,
|
||||||
)
|
)
|
||||||
|
|
||||||
DEFAULT_LEDGER_CATEGORIES: list[dict[str, Any]] = [
|
DEFAULT_LEDGER_CATEGORIES: list[dict[str, Any]] = [
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
|
Any,
|
||||||
|
VALID_CASHFLOW_KINDS,
|
||||||
|
VALID_TRANSACTION_TYPES,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
new_id,
|
||||||
|
now_iso,
|
||||||
|
ok,
|
||||||
|
row_to_dict,
|
||||||
|
)
|
||||||
|
|
||||||
RULE_FIELDS = {"merchant", "counterparty", "description", "payment_method", "raw_summary", "branch", "memo"}
|
RULE_FIELDS = {"merchant", "counterparty", "description", "payment_method", "raw_summary", "branch", "memo"}
|
||||||
RULE_MATCH_TYPES = {"contains", "equals", "regex", "starts_with", "ends_with"}
|
RULE_MATCH_TYPES = {"contains", "equals", "regex", "starts_with", "ends_with"}
|
||||||
|
|||||||
@@ -1,7 +1,24 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
from .shared import _append_memo_tag, _memo_has_tag, _normalize_counterparty_for_match, _party_match_score
|
Any,
|
||||||
|
CROSS_TRANSFER_MATCH_TAG,
|
||||||
|
CROSS_TRANSFER_REVIEW_TAG,
|
||||||
|
_append_memo_tag,
|
||||||
|
_memo_has_tag,
|
||||||
|
_normalize_counterparty_for_match,
|
||||||
|
_party_match_score,
|
||||||
|
current_kst_date,
|
||||||
|
date,
|
||||||
|
datetime,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
normalize_date,
|
||||||
|
now_iso,
|
||||||
|
ok,
|
||||||
|
re,
|
||||||
|
row_to_dict,
|
||||||
|
)
|
||||||
|
|
||||||
def _build_cross_transfer_index(transactions: list[dict[str, Any]]) -> dict[tuple[str, int, str], list[dict[str, Any]]]:
|
def _build_cross_transfer_index(transactions: list[dict[str, Any]]) -> dict[tuple[str, int, str], list[dict[str, Any]]]:
|
||||||
index: dict[tuple[str, int, str], list[dict[str, Any]]] = {}
|
index: dict[tuple[str, int, str], list[dict[str, Any]]] = {}
|
||||||
|
|||||||
@@ -1,27 +1,25 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
|
||||||
from .shared import _append_memo_tag, _memo_has_tag, _normalize_counterparty_for_match, _party_match_score
|
|
||||||
|
|
||||||
from .imports_service import (
|
from .imports_service import (
|
||||||
import_kb_bank_pdf,
|
import_kb_bank_pdf as import_kb_bank_pdf,
|
||||||
import_seoulpay_xlsx,
|
import_seoulpay_xlsx as import_seoulpay_xlsx,
|
||||||
import_toss_bank_pdf,
|
import_toss_bank_pdf as import_toss_bank_pdf,
|
||||||
import_toss_securities_pdf,
|
import_toss_securities_pdf as import_toss_securities_pdf,
|
||||||
list_ledger_import_batches,
|
list_ledger_import_batches as list_ledger_import_batches,
|
||||||
preview_kb_bank_pdf_import,
|
preview_kb_bank_pdf_import as preview_kb_bank_pdf_import,
|
||||||
preview_ledger_csv_import,
|
preview_ledger_csv_import as preview_ledger_csv_import,
|
||||||
preview_seoulpay_xlsx_import,
|
preview_seoulpay_xlsx_import as preview_seoulpay_xlsx_import,
|
||||||
preview_toss_bank_pdf_import,
|
preview_toss_bank_pdf_import as preview_toss_bank_pdf_import,
|
||||||
preview_toss_securities_pdf_import,
|
preview_toss_securities_pdf_import as preview_toss_securities_pdf_import,
|
||||||
rollback_ledger_import_batch,
|
rollback_ledger_import_batch as rollback_ledger_import_batch,
|
||||||
)
|
)
|
||||||
from .cross_transfer_service import (
|
from .cross_transfer_service import (
|
||||||
find_cancel_original_candidates,
|
find_cancel_original_candidates as find_cancel_original_candidates,
|
||||||
find_self_transfer_candidates,
|
find_self_transfer_candidates as find_self_transfer_candidates,
|
||||||
link_cancel_to_original,
|
link_cancel_to_original as link_cancel_to_original,
|
||||||
link_self_transfer_pair,
|
link_self_transfer_pair as link_self_transfer_pair,
|
||||||
list_cross_transfer_review_queue,
|
list_cross_transfer_review_queue as list_cross_transfer_review_queue,
|
||||||
preview_cross_account_transfers,
|
preview_cross_account_transfers as preview_cross_account_transfers,
|
||||||
run_cross_account_transfer_match,
|
run_cross_account_transfer_match as run_cross_account_transfer_match,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,27 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
from .shared import _append_memo_tag, _memo_has_tag, _normalize_counterparty_for_match, _party_match_score
|
Any,
|
||||||
|
Path,
|
||||||
|
csv,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
json,
|
||||||
|
make_dedupe_key,
|
||||||
|
new_id,
|
||||||
|
normalize_tags,
|
||||||
|
now_iso,
|
||||||
|
ok,
|
||||||
|
parse_kb_bank_pdf,
|
||||||
|
parse_seoulpay_xlsx,
|
||||||
|
parse_toss_bank_pdf,
|
||||||
|
parse_toss_securities_pdf,
|
||||||
|
row_to_dict,
|
||||||
|
seoulpay_transaction_preview,
|
||||||
|
toss_bank_transaction_preview,
|
||||||
|
toss_transaction_preview,
|
||||||
|
transaction_preview,
|
||||||
|
)
|
||||||
|
|
||||||
def preview_ledger_csv_import(file_path: str, source: str = "generic", db_path: str | None = None) -> dict[str, Any]:
|
def preview_ledger_csv_import(file_path: str, source: str = "generic", db_path: str | None = None) -> dict[str, Any]:
|
||||||
path=Path(file_path).expanduser()
|
path=Path(file_path).expanduser()
|
||||||
|
|||||||
@@ -1,6 +1,18 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
|
Any,
|
||||||
|
BALANCE_RECONCILIATION_REFERENCE_RATIO,
|
||||||
|
BALANCE_RECONCILIATION_TOLERANCE_KRW,
|
||||||
|
RECONCILIATION_TARGET_STATUSES,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
normalize_date,
|
||||||
|
normalize_snapshot_at,
|
||||||
|
now_iso,
|
||||||
|
ok,
|
||||||
|
sqlite3,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _transaction_signed_amount(tx_type: str, amount: int) -> int:
|
def _transaction_signed_amount(tx_type: str, amount: int) -> int:
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import csv
|
import csv as csv
|
||||||
|
import sqlite3 as sqlite3
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import sqlite3
|
|
||||||
from datetime import date, datetime, timedelta
|
from datetime import date, datetime, timedelta
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@@ -12,16 +12,18 @@ from uuid import uuid4
|
|||||||
from zoneinfo import ZoneInfo
|
from zoneinfo import ZoneInfo
|
||||||
|
|
||||||
from ..infrastructure.parsers import (
|
from ..infrastructure.parsers import (
|
||||||
parse_kb_bank_pdf,
|
parse_kb_bank_pdf as parse_kb_bank_pdf,
|
||||||
parse_seoulpay_xlsx,
|
parse_seoulpay_xlsx as parse_seoulpay_xlsx,
|
||||||
parse_toss_bank_pdf,
|
parse_toss_bank_pdf as parse_toss_bank_pdf,
|
||||||
parse_toss_securities_pdf,
|
parse_toss_securities_pdf as parse_toss_securities_pdf,
|
||||||
seoulpay_transaction_preview,
|
seoulpay_transaction_preview as seoulpay_transaction_preview,
|
||||||
toss_bank_transaction_preview,
|
toss_bank_transaction_preview as toss_bank_transaction_preview,
|
||||||
toss_transaction_preview,
|
toss_transaction_preview as toss_transaction_preview,
|
||||||
transaction_preview,
|
transaction_preview as transaction_preview,
|
||||||
)
|
)
|
||||||
from ..infrastructure.sqlite import db, init_db, resolve_db_path
|
from ..infrastructure.sqlite import db as db
|
||||||
|
from ..infrastructure.sqlite import init_db as init_db
|
||||||
|
from ..infrastructure.sqlite import resolve_db_path as resolve_db_path
|
||||||
|
|
||||||
VALID_TRANSACTION_TYPES = {"income", "expense", "transfer", "refund", "adjustment"}
|
VALID_TRANSACTION_TYPES = {"income", "expense", "transfer", "refund", "adjustment"}
|
||||||
VALID_ACCOUNT_TYPES = {"bank", "card", "cash", "investment", "loan", "other"}
|
VALID_ACCOUNT_TYPES = {"bank", "card", "cash", "investment", "loan", "other"}
|
||||||
|
|||||||
@@ -1,6 +1,24 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
|
Any,
|
||||||
|
BACKUP_RESTORE_POLICY,
|
||||||
|
CASHFLOW_KIND_SQL,
|
||||||
|
DEFAULT_LEDGER_BACKUP_DIR,
|
||||||
|
KST,
|
||||||
|
Path,
|
||||||
|
current_kst_month,
|
||||||
|
datetime,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
hashlib,
|
||||||
|
init_db,
|
||||||
|
ok,
|
||||||
|
resolve_db_path,
|
||||||
|
row_to_dict,
|
||||||
|
sqlite3,
|
||||||
|
timedelta,
|
||||||
|
)
|
||||||
from .shared import _current_kst_datetime, _month_range
|
from .shared import _current_kst_datetime, _month_range
|
||||||
|
|
||||||
def health_check(db_path: str | None = None) -> dict[str, Any]:
|
def health_check(db_path: str | None = None) -> dict[str, Any]:
|
||||||
@@ -166,7 +184,7 @@ def get_ledger_backup_status(file_path: str, include_hash: bool = True, include_
|
|||||||
return fail("not_found", f"backup file not found: {path}", path=str(path), exists=False)
|
return fail("not_found", f"backup file not found: {path}", path=str(path), exists=False)
|
||||||
return ok(backup=_ledger_db_status_for_path(path, include_hash=include_hash, include_integrity=include_integrity), restore_policy=BACKUP_RESTORE_POLICY)
|
return ok(backup=_ledger_db_status_for_path(path, include_hash=include_hash, include_integrity=include_integrity), restore_policy=BACKUP_RESTORE_POLICY)
|
||||||
|
|
||||||
from .accounts_write_services import create_ledger_account
|
from .accounts_write_services import create_ledger_account as create_ledger_account
|
||||||
|
|
||||||
def list_ledger_accounts(active_only: bool = True, db_path: str | None = None) -> dict[str, Any]:
|
def list_ledger_accounts(active_only: bool = True, db_path: str | None = None) -> dict[str, Any]:
|
||||||
sql = "SELECT * FROM accounts" + (" WHERE active=1" if active_only else "") + " ORDER BY name"
|
sql = "SELECT * FROM accounts" + (" WHERE active=1" if active_only else "") + " ORDER BY name"
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
|
Any,
|
||||||
|
CASHFLOW_KIND_SQL,
|
||||||
|
date,
|
||||||
|
db,
|
||||||
|
normalize_date,
|
||||||
|
normalize_month,
|
||||||
|
ok,
|
||||||
|
row_to_dict,
|
||||||
|
)
|
||||||
|
|
||||||
from .budgets_write_services import create_ledger_budget
|
from .budgets_write_services import create_ledger_budget as create_ledger_budget
|
||||||
from .transactions_write_services import create_ledger_transaction, delete_ledger_transaction, update_ledger_transaction
|
from .transactions_write_services import create_ledger_transaction as create_ledger_transaction
|
||||||
|
from .transactions_write_services import delete_ledger_transaction as delete_ledger_transaction
|
||||||
|
from .transactions_write_services import update_ledger_transaction as update_ledger_transaction
|
||||||
|
|
||||||
def list_ledger_transactions(start_date: str = "", end_date: str = "", type: str = "", category: str = "", person: str = "", account_id: str = "", include_deleted: bool = False, limit: int = 100, db_path: str | None = None) -> dict[str, Any]:
|
def list_ledger_transactions(start_date: str = "", end_date: str = "", type: str = "", category: str = "", person: str = "", account_id: str = "", include_deleted: bool = False, limit: int = 100, db_path: str | None = None) -> dict[str, Any]:
|
||||||
clauses=[]; params=[]
|
clauses=[]; params=[]
|
||||||
@@ -23,7 +34,7 @@ def list_ledger_transactions(start_date: str = "", end_date: str = "", type: str
|
|||||||
rows = conn.execute(sql, params).fetchall()
|
rows = conn.execute(sql, params).fetchall()
|
||||||
return ok(transactions=[row_to_dict(r) for r in rows], count=len(rows))
|
return ok(transactions=[row_to_dict(r) for r in rows], count=len(rows))
|
||||||
|
|
||||||
from .reconciliation_service import get_balance_reconciliation_report
|
from .reconciliation_service import get_balance_reconciliation_report as get_balance_reconciliation_report
|
||||||
|
|
||||||
def list_ledger_budgets(month: str = "", db_path: str | None = None) -> dict[str, Any]:
|
def list_ledger_budgets(month: str = "", db_path: str | None = None) -> dict[str, Any]:
|
||||||
clauses=[]; params=[]
|
clauses=[]; params=[]
|
||||||
|
|||||||
@@ -1,6 +1,18 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
|
Any,
|
||||||
|
VALID_TRANSACTION_TYPES,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
make_dedupe_key,
|
||||||
|
new_id,
|
||||||
|
normalize_date,
|
||||||
|
normalize_tags,
|
||||||
|
now_iso,
|
||||||
|
ok,
|
||||||
|
row_to_dict,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def create_ledger_transaction(transaction_date: str = "", type: str = "expense", amount: int | float = 0, category: str = "", subcategory: str = "", merchant: str = "", description: str = "", account_id: str = "", payment_method: str = "", person: str = "", project: str = "", tags: Any = None, is_fixed: bool = False, currency: str = "KRW", posted_date: str = "", source: str = "manual", external_id: str = "", memo: str = "", dedupe: bool = True, transaction_datetime: str = "", counterparty: str = "", balance_after: int | None = None, branch: str = "", raw_summary: str = "", raw_payload: str = "", db_path: str | None = None) -> dict[str, Any]:
|
def create_ledger_transaction(transaction_date: str = "", type: str = "expense", amount: int | float = 0, category: str = "", subcategory: str = "", merchant: str = "", description: str = "", account_id: str = "", payment_method: str = "", person: str = "", project: str = "", tags: Any = None, is_fixed: bool = False, currency: str = "KRW", posted_date: str = "", source: str = "manual", external_id: str = "", memo: str = "", dedupe: bool = True, transaction_datetime: str = "", counterparty: str = "", balance_after: int | None = None, branch: str = "", raw_summary: str = "", raw_payload: str = "", db_path: str | None = None) -> dict[str, Any]:
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .shared import *
|
from .shared import (
|
||||||
|
Any,
|
||||||
|
datetime,
|
||||||
|
db,
|
||||||
|
fail,
|
||||||
|
now_iso,
|
||||||
|
ok,
|
||||||
|
re,
|
||||||
|
row_to_dict,
|
||||||
|
)
|
||||||
|
|
||||||
def _rule_matches(rule: dict[str, Any], tx: dict[str, Any]) -> bool:
|
def _rule_matches(rule: dict[str, Any], tx: dict[str, Any]) -> bool:
|
||||||
if rule.get("transaction_type") and rule.get("transaction_type") != tx.get("type", ""):
|
if rule.get("transaction_type") and rule.get("transaction_type") != tx.get("type", ""):
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .infrastructure.sqlite import *
|
from .infrastructure.sqlite import DEFAULT_DB_PATH as DEFAULT_DB_PATH
|
||||||
|
from .infrastructure.sqlite import connect as connect
|
||||||
|
from .infrastructure.sqlite import db as db
|
||||||
|
from .infrastructure.sqlite import init_db as init_db
|
||||||
|
from .infrastructure.sqlite import migrate_db as migrate_db
|
||||||
|
from .infrastructure.sqlite import resolve_db_path as resolve_db_path
|
||||||
|
|
||||||
|
__all__ = ["DEFAULT_DB_PATH", "connect", "db", "init_db", "migrate_db", "resolve_db_path"]
|
||||||
|
|||||||
@@ -1,4 +1,19 @@
|
|||||||
from .kb_bank_pdf import parse_kb_bank_pdf, transaction_preview
|
from .kb_bank_pdf import parse_kb_bank_pdf as parse_kb_bank_pdf
|
||||||
from .toss_bank_pdf import parse_toss_bank_pdf, transaction_preview as toss_bank_transaction_preview
|
from .kb_bank_pdf import transaction_preview as transaction_preview
|
||||||
from .toss_securities_pdf import parse_toss_securities_pdf, transaction_preview as toss_transaction_preview
|
from .seoulpay_xlsx import parse_seoulpay_xlsx as parse_seoulpay_xlsx
|
||||||
from .seoulpay_xlsx import parse_seoulpay_xlsx, transaction_preview as seoulpay_transaction_preview
|
from .seoulpay_xlsx import transaction_preview as seoulpay_transaction_preview
|
||||||
|
from .toss_bank_pdf import parse_toss_bank_pdf as parse_toss_bank_pdf
|
||||||
|
from .toss_bank_pdf import transaction_preview as toss_bank_transaction_preview
|
||||||
|
from .toss_securities_pdf import parse_toss_securities_pdf as parse_toss_securities_pdf
|
||||||
|
from .toss_securities_pdf import transaction_preview as toss_transaction_preview
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"parse_kb_bank_pdf",
|
||||||
|
"parse_seoulpay_xlsx",
|
||||||
|
"parse_toss_bank_pdf",
|
||||||
|
"parse_toss_securities_pdf",
|
||||||
|
"seoulpay_transaction_preview",
|
||||||
|
"toss_bank_transaction_preview",
|
||||||
|
"toss_transaction_preview",
|
||||||
|
"transaction_preview",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
from ...kb_bank_pdf import parse_kb_bank_pdf, transaction_preview
|
from ...kb_bank_pdf import parse_kb_bank_pdf as parse_kb_bank_pdf
|
||||||
|
from ...kb_bank_pdf import transaction_preview as transaction_preview
|
||||||
|
|
||||||
|
__all__ = ["parse_kb_bank_pdf", "transaction_preview"]
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
from ...seoulpay_xlsx import parse_seoulpay_xlsx, transaction_preview
|
from ...seoulpay_xlsx import parse_seoulpay_xlsx as parse_seoulpay_xlsx
|
||||||
|
from ...seoulpay_xlsx import transaction_preview as transaction_preview
|
||||||
|
|
||||||
|
__all__ = ["parse_seoulpay_xlsx", "transaction_preview"]
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
from ...toss_bank_pdf import parse_toss_bank_pdf, transaction_preview
|
from ...toss_bank_pdf import parse_toss_bank_pdf as parse_toss_bank_pdf
|
||||||
|
from ...toss_bank_pdf import transaction_preview as transaction_preview
|
||||||
|
|
||||||
|
__all__ = ["parse_toss_bank_pdf", "transaction_preview"]
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
from ...toss_securities_pdf import parse_toss_securities_pdf, transaction_preview
|
from ...toss_securities_pdf import parse_toss_securities_pdf as parse_toss_securities_pdf
|
||||||
|
from ...toss_securities_pdf import transaction_preview as transaction_preview
|
||||||
|
|
||||||
|
__all__ = ["parse_toss_securities_pdf", "transaction_preview"]
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
from .connection import DEFAULT_DB_PATH, connect, db, resolve_db_path
|
from .connection import DEFAULT_DB_PATH as DEFAULT_DB_PATH
|
||||||
from .migrations import init_db, migrate_db
|
from .connection import connect as connect
|
||||||
from .schema import ACCOUNT_ADDITIVE_COLUMNS, SCHEMA_SQL, SCHEMA_VERSION, TRANSACTION_ADDITIVE_COLUMNS
|
from .connection import db as db
|
||||||
|
from .connection import resolve_db_path as resolve_db_path
|
||||||
|
from .migrations import init_db as init_db
|
||||||
|
from .migrations import migrate_db as migrate_db
|
||||||
|
from .schema import ACCOUNT_ADDITIVE_COLUMNS as ACCOUNT_ADDITIVE_COLUMNS
|
||||||
|
from .schema import SCHEMA_SQL as SCHEMA_SQL
|
||||||
|
from .schema import SCHEMA_VERSION as SCHEMA_VERSION
|
||||||
|
from .schema import TRANSACTION_ADDITIVE_COLUMNS as TRANSACTION_ADDITIVE_COLUMNS
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"ACCOUNT_ADDITIVE_COLUMNS",
|
||||||
|
"DEFAULT_DB_PATH",
|
||||||
|
"SCHEMA_SQL",
|
||||||
|
"SCHEMA_VERSION",
|
||||||
|
"TRANSACTION_ADDITIVE_COLUMNS",
|
||||||
|
"connect",
|
||||||
|
"db",
|
||||||
|
"init_db",
|
||||||
|
"migrate_db",
|
||||||
|
"resolve_db_path",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from .connection import connect, resolve_db_path
|
from .connection import connect, resolve_db_path
|
||||||
from .schema import ACCOUNT_ADDITIVE_COLUMNS, SCHEMA_SQL, SCHEMA_VERSION, TRANSACTION_ADDITIVE_COLUMNS
|
from .schema import ACCOUNT_ADDITIVE_COLUMNS, SCHEMA_SQL, SCHEMA_VERSION, TRANSACTION_ADDITIVE_COLUMNS
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .adapters.mcp.server import main, mcp
|
from .adapters.mcp.server import main as main
|
||||||
|
from .adapters.mcp.server import mcp as mcp
|
||||||
|
|
||||||
|
__all__ = ["main", "mcp"]
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
+15
-11
@@ -18,17 +18,6 @@ from .application import system_services as _system_services
|
|||||||
from .application import transactions_write_services as _transactions_write_services
|
from .application import transactions_write_services as _transactions_write_services
|
||||||
from .application import transaction_report_services as _transaction_report_services
|
from .application import transaction_report_services as _transaction_report_services
|
||||||
from .application import uncategorized_workbench_service as _uncategorized_workbench_service
|
from .application import uncategorized_workbench_service as _uncategorized_workbench_service
|
||||||
from .application.asset_account_services import *
|
|
||||||
from .application.assets_service import *
|
|
||||||
from .application.categorization_services import *
|
|
||||||
from .application.cross_transfer_service import *
|
|
||||||
from .application.imports_service import *
|
|
||||||
from .application.import_transfer_services import *
|
|
||||||
from .application.reconciliation_service import *
|
|
||||||
from .application.shared import *
|
|
||||||
from .application.system_services import *
|
|
||||||
from .application.transaction_report_services import *
|
|
||||||
from .application.uncategorized_workbench_service import *
|
|
||||||
|
|
||||||
# Keep compatibility for tests/monkeypatches that reach into service internals.
|
# Keep compatibility for tests/monkeypatches that reach into service internals.
|
||||||
_current_kst_datetime = _shared._current_kst_datetime
|
_current_kst_datetime = _shared._current_kst_datetime
|
||||||
@@ -52,6 +41,21 @@ _PROXY_MODULES = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _export_public_names() -> list[str]:
|
||||||
|
exported: set[str] = set()
|
||||||
|
module_globals = globals()
|
||||||
|
for module in _PROXY_MODULES:
|
||||||
|
for name in dir(module):
|
||||||
|
if name.startswith("_"):
|
||||||
|
continue
|
||||||
|
module_globals.setdefault(name, getattr(module, name))
|
||||||
|
exported.add(name)
|
||||||
|
return sorted(exported)
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = _export_public_names()
|
||||||
|
|
||||||
|
|
||||||
class _ServiceModule(ModuleType):
|
class _ServiceModule(ModuleType):
|
||||||
def __setattr__(self, name: str, value) -> None:
|
def __setattr__(self, name: str, value) -> None:
|
||||||
super().__setattr__(name, value)
|
super().__setattr__(name, value)
|
||||||
|
|||||||
Reference in New Issue
Block a user