Update modular design documentation and workspace configuration
- Change the active file in workspace.json to point to the new modular-design.md. - Revise modular-design.md to enhance clarity and structure, including a new table of contents and updated sections on design philosophy, architecture components, and service abstractions. - Remove outdated content and improve the overall presentation of modular design patterns and best practices. These updates aim to streamline the documentation for better accessibility and understanding of the modular architecture.
This commit is contained in:
parent
670a42dd9b
commit
a373fa714d
5 changed files with 620 additions and 515 deletions
|
|
@ -260,24 +260,37 @@ const invoiceService = injectService(SERVICE_TOKENS.INVOICE_SERVICE) as InvoiceS
|
|||
const invoice = await invoiceService.createInvoice(order, adminKey)
|
||||
```
|
||||
|
||||
### 🔄 In Progress
|
||||
#### 2. NostrmarketService (Completed)
|
||||
- **Status**: ✅ Successfully migrated
|
||||
- **Token**: `SERVICE_TOKENS.NOSTRMARKET_SERVICE`
|
||||
- **Registration**: Market module (`src/modules/market/index.ts`)
|
||||
- **Usage**: Market module composables and stores
|
||||
|
||||
#### 2. NostrmarketService (Pending)
|
||||
- **Status**: 🔄 Ready for migration
|
||||
- **File**: `src/modules/market/services/nostrmarketService.ts`
|
||||
- **Token**: Need to add `NOSTRMARKET_SERVICE`
|
||||
- **Registration**: Market module
|
||||
**Before:**
|
||||
```typescript
|
||||
// ❌ Legacy singleton pattern
|
||||
import { nostrmarketService } from '@/modules/market/services/nostrmarketService'
|
||||
await nostrmarketService.publishOrder(orderData)
|
||||
```
|
||||
|
||||
#### 3. PaymentMonitorService (Partially Migrated)
|
||||
- **Status**: 🔄 Token exists, needs completion
|
||||
- **Token**: `SERVICE_TOKENS.PAYMENT_MONITOR` (already exists)
|
||||
- **Registration**: Market module
|
||||
**After:**
|
||||
```typescript
|
||||
// ✅ Dependency injection pattern
|
||||
const nostrmarketService = injectService(SERVICE_TOKENS.NOSTRMARKET_SERVICE) as NostrmarketService
|
||||
await nostrmarketService.publishOrder(orderData)
|
||||
```
|
||||
|
||||
#### 4. LnbitsAPI (Pending)
|
||||
- **Status**: 🔄 Ready for migration
|
||||
- **File**: `src/lib/api/lnbits.ts`
|
||||
- **Token**: Need to add `LNBITS_API`
|
||||
- **Registration**: Base module
|
||||
#### 3. PaymentMonitorService (Completed)
|
||||
- **Status**: ✅ Successfully migrated
|
||||
- **Token**: `SERVICE_TOKENS.PAYMENT_MONITOR`
|
||||
- **Registration**: Market module (`src/modules/market/index.ts`)
|
||||
- **Usage**: Market store for payment status monitoring
|
||||
|
||||
#### 4. LnbitsAPI (Completed)
|
||||
- **Status**: ✅ Successfully migrated
|
||||
- **Token**: `SERVICE_TOKENS.LNBITS_API`
|
||||
- **Registration**: Base module (`src/modules/base/index.ts`)
|
||||
- **Usage**: AuthService and events API integration
|
||||
|
||||
## Practical Example: Market Module Using InvoiceService
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue