rwadurian/backend/services/blockchain-service/src/domain
hailin 075c9aaa48 feat(blockchain): implement Outbox Pattern for reliable event delivery
Implement Outbox Pattern with consumer ACK to ensure 100% reliable event
delivery between blockchain-service and wallet-service:

blockchain-service:
- Add OutboxEvent model to Prisma schema with status tracking
- Create outbox repository interface and implementation
- Modify deposit-detection.service to write events to outbox
- Add outbox-publisher.service with cron jobs for publishing/retry
- Add deposit-ack-consumer.service to receive ACK from wallet-service
- Add publishRaw method to event-publisher.service

wallet-service:
- Modify deposit-confirmed.handler to send ACK after successful processing
- Add wallet.deposit.credited topic mapping for ACK events

Event flow:
1. Deposit detected → written to outbox (status: PENDING)
2. Outbox publisher sends to Kafka → status: SENT
3. wallet-service processes and sends ACK → status: ACKED
4. Events without ACK are retried with exponential backoff

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 21:47:31 -08:00
..
aggregates feat(deposit): add accountSequence correlation and testnet support 2025-12-08 10:26:01 -08:00
enums feat: move address derivation from identity-service to blockchain-service 2025-12-06 21:08:21 -08:00
events feat(deposit): add accountSequence correlation and testnet support 2025-12-08 10:26:01 -08:00
repositories feat(blockchain): implement Outbox Pattern for reliable event delivery 2025-12-09 21:47:31 -08:00
services feat(deposit): add accountSequence correlation and testnet support 2025-12-08 10:26:01 -08:00
value-objects feat: move address derivation from identity-service to blockchain-service 2025-12-06 21:08:21 -08:00
domain.module.ts feat(blockchain-service): implement complete blockchain service with DDD + Hexagonal architecture 2025-12-06 20:54:58 -08:00