Architecture
Overview
The Customer360 Lifecycle Management feature introduces a new microservice that centralizes customer lifecycle tracking across CRM, Billing, and Support systems. The architecture follows an event-driven, modular, and secure-by-default approach.
Components
customer-lifecycle-service (New Microservice)
Responsible for:
Managing lifecycle state transitions
Serving API requests related to customer status
Listening to domain events (e.g. customer created, contract renewed)
Built with: Node.js (Express) or Java Spring Boot
Connected to a PostgreSQL database and Redis for caching
Message Queue Integration
Uses Kafka topics for event-driven communication:
customer.created
customer.updated
contract.renewed
support.issue.closed
Redis Cache
Stores recent lifecycle data for fast retrieval in UI
TTL: 5 minutes for summary views, 24 hours for full profiles
Audit & Logging Layer
Centralized logging using ELK stack
Lifecycle changes are sent to an audit.lifecycle.updated Kafka topic
Diagram (ASCII-friendly)
┌────────────────────┐ │ CRM Service │ └────────┬───────────┘ │ ▼ ┌────────────────────┐ │ Kafka: customer.* │◄──── Support / Billing └────────┬───────────┘ ▼ ┌─────────────────────────────┐ │ customer-lifecycle-service │ ├─────────────────────────────┤ │ REST API │ │ Kafka Consumer │ │ Postgres (state store) │ │ Redis (summary cache) │ └────────┬────────────────────┘ ▼ ┌──────────────────────┐ │ Audit Service / ELK │ └──────────────────────┘ ▲ │ ┌──────────────────────────────┐ │ WiseApp UI - Customer360 Tab │ └──────────────────────────────┘
API Specifications
Update Lifecycle Stage
Endpoint:
PATCH /api/v1/customers/{id}/lifecycle
Request Payload:
{ "stage": "At-Risk", "updated_by": "user-42" }
Response:
{ "success": true, "updated_at": "2025-07-28T12:34:00Z" }
Errors:
400 Bad Request (invalid stage)
403 Forbidden (insufficient permissions)
500 Internal Server Error