Customer Service
Purpose
Customer lifecycle management including profiles, KYC status, and contact information.
Responsibilities
- Customer CRUD
- KYC status tracking
- Address and contact management
- Customer search
- Publish customer events
Non-Responsibilities
- Authentication (Auth Service)
- Account creation (Account Service)
- Payment processing
APIs
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/v1/customers | ADMIN | Create customer |
| GET | /api/v1/customers/{id} | Bearer | Get customer |
| PUT | /api/v1/customers/{id} | Bearer | Update customer |
| GET | /api/v1/customers/{id}/kyc | RISK_ANALYST | KYC status |
| PUT | /api/v1/customers/{id}/kyc | RISK_ANALYST | Update KYC |
Database
| Table | Key Columns | Description |
|---|---|---|
| customers | id, user_id, first_name, last_name, email, status | Customer profiles |
| addresses | id, customer_id, type, line1, city, country | Addresses |
| kyc_records | id, customer_id, status, verified_at, documents | KYC data |
Kafka
Produces: CustomerCreated, CustomerUpdated, KycStatusChanged
Consumes: None
Dependencies
Sync: Auth Service Async: Publishes customer events
Failure Handling
- Duplicate email → 409 Conflict
- KYC rejection → status update + notification
Scaling
Read-heavy. Use read replicas. Cache customer profiles in Redis.
Security
Customers access own data only. ADMIN/RISK_ANALYST for KYC operations.
Observability
Metrics: customer_created_total, kyc_status_changes. Logs: PII masked.