feat: implement yape code challenge - outbox, fraud and gateway - #620
Open
JAMESDEVKOI wants to merge 1 commit into
Open
JAMESDEVKOI wants to merge 1 commit into
JAMESDEVKOI wants to merge 1 commit into
Conversation
- transaction-ms with CQRS, DDD, Prisma, Outbox Relay and Redis cache - anti-fraud-ms with rule engine and deterministic events - client-gateway with circuit breaker and throttler - shared contracts with zod validation
Author
|
Realizado por: James Daniel Capcha Flores |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solución Yape Code Challenge
Flujo:
POST /transactions (pending) -> Kafka transaction.created -> Anti-Fraud (>1000 rejected) -> Kafka transaction.status-updated -> Update DBImplementación:
Cómo probar:
npm installdocker compose up -dnpm run build:contractsnpm run dev:tx/dev:fraud/dev:gatewayPOST http://localhost:8080/api/v1/transactions->GET /transactions/:idhttp://localhost:8080/docsnpm test(100% passing)Decisiones clave: Hexagonal para desacoplar dominio de infra, Transactional Outbox para atomicidad DB+Kafka, Cache-Aside (5s pending / 3600s final), deterministic GUID para idempotencia, DLQ para poison messages.