Correspondence Service
NestJS:8008Core
The Correspondence Service handles the complete lifecycle of correspondence including creation, routing, tracking, and archival. It supports both HTTP API and RabbitMQ worker mode.
Key Features
- Correspondence Lifecycle — Create, route, track, and archive correspondence
- Access Control — Permission-based correspondence access
- Task Integration — Automatic task creation for correspondence actions
- Failed Delivery Tracking — Monitor and retry failed deliveries
- Fuzzy Search — Levenshtein distance matching for search
- Dual Mode — HTTP server + RabbitMQ worker
API Endpoints
GET
/api/correspondenceList correspondence with pagination and filters
POST
/api/correspondenceCreate new correspondence
GET
/api/correspondence/:idGet correspondence details
PUT
/api/correspondence/:idUpdate correspondence
POST
/api/correspondence/:id/routeRoute correspondence to recipients
GET
/api/correspondence/:id/historyGet correspondence routing history
POST
/api/correspondence/:id/archiveArchive correspondence
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| PORT | number | 8008 | Service listening port |
| DB_HOST | string | localhost | MSSQL server host |
| DB_USERNAME | string | - | Database username |
| DB_PASSWORD | string | - | Database password |
| RABBITMQ_URIS | string | - | RabbitMQ connection URIs |
| REDIS_HOST | string | localhost | Redis host |
RabbitMQ Integration
Publishes to:
- Notification events for routing and status changes
- Search indexing events
Consumes from:
- Correspondence-related events from other services
Dependencies
- Media Service — File attachments
- CMS Service — Task updates and content management
- Identity Service — User authentication and authorization