Skip to content

feat(#28): add ServiceRegistry — centralise enrichment/classify/dedup/sort pipeline#44

Merged
longieirl merged 5 commits intomainfrom
feat/28-service-registry
Mar 25, 2026
Merged

feat(#28): add ServiceRegistry — centralise enrichment/classify/dedup/sort pipeline#44
longieirl merged 5 commits intomainfrom
feat/28-service-registry

Conversation

@longieirl
Copy link
Copy Markdown
Owner

Summary

Introduces `ServiceRegistry` as the single wiring point for all transaction processing services (enrichment, classification, duplicate detection, sorting). Consolidates logic that was previously spread across `BankStatementProcessor` and `TransactionProcessingOrchestrator`, and trims the orchestrator to IBAN grouping only.

Changes

  • Add `services/service_registry.py` — `_ServiceContext` dataclass + `ServiceRegistry` class with `from_config()` factory, `process_transaction_group()`, `group_by_iban()`, and escape-hatch getters
  • Wire `processor.py` to use `self._registry.process_transaction_group()` and `self._registry.group_by_iban()`
  • Update `ProcessorFactory.create_custom` and `BankStatementProcessorBuilder.build()` to construct `ServiceRegistry` and inject via `registry=` kwarg
  • Trim `TransactionProcessingOrchestrator` to `group_by_iban` only — enrichment/classification/dedup/sort moved to `ServiceRegistry`
  • Fix wrong import of `ChronologicalSortingStrategy` (`patterns.strategies` → `services.sorting_service`)
  • Add `tests/services/test_service_registry.py` (boundary tests: `from_config` wiring, pipeline, delegation, escape hatches)
  • Trim `test_transaction_processing_orchestrator.py` to `group_by_iban` delegation test only

Note: `TransactionProcessingOrchestrator` is retained for backward compatibility — a follow-up issue will track its complete removal.

Type

  • New feature
  • Refactoring

Testing

  • Tests pass (coverage ≥ 91%)
  • Manually tested

Checklist

  • Code follows project style
  • Self-reviewed
  • Documentation updated (if needed)
  • No new warnings

…fy/dedup/sort pipeline now centralised in ServiceRegistry; TransactionProcessingOrchestrator trimmed to group_by_iban only
…dary tests

- ProcessorFactory.create_custom and BankStatementProcessorBuilder.build() now
  construct ServiceRegistry.from_config() and inject it via registry= kwarg,
  so the processor no longer builds its own registry internally
- Fix wrong import of ChronologicalSortingStrategy (patterns.strategies →
  services.sorting_service) in service_registry.py
- Add tests/services/test_service_registry.py with boundary tests covering
  from_config wiring, process_transaction_group pipeline, group_by_iban
  delegation, and escape hatches
- Trim test_transaction_processing_orchestrator.py to group_by_iban only;
  removed tests for methods that moved to ServiceRegistry
@longieirl longieirl self-assigned this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants