Migrate InvoiceService to dependency injection pattern
- Add INVOICE_SERVICE token to DI container - Register InvoiceService in base module with proper lifecycle - Update market store to use dependency injection instead of singleton - Remove exported singleton from InvoiceService class - Add comprehensive migration documentation with examples - Maintain type safety with proper TypeScript interfaces This migration eliminates the legacy singleton pattern and improves: - Testability through service injection - Modular architecture with clear boundaries - Single source of truth for service instances - Consistent dependency injection patterns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
6cb10a31db
commit
7a32085ee1
5 changed files with 383 additions and 6 deletions
|
|
@ -134,6 +134,9 @@ export const SERVICE_TOKENS = {
|
|||
|
||||
// Events services
|
||||
EVENTS_SERVICE: Symbol('eventsService'),
|
||||
|
||||
// Invoice services
|
||||
INVOICE_SERVICE: Symbol('invoiceService'),
|
||||
} as const
|
||||
|
||||
// Type-safe injection helpers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue