Skip to content

feat: implement yape code challenge - outbox, fraud and gateway - #620

Open
JAMESDEVKOI wants to merge 1 commit into
yaperos:mainfrom
JAMESDEVKOI:feat/yape-code-challenge
Open

JAMESDEVKOI wants to merge 1 commit into
yaperos:mainfrom
JAMESDEVKOI:feat/yape-code-challenge

Conversation

@JAMESDEVKOI

Copy link
Copy Markdown

Solución Yape Code Challenge

Flujo: POST /transactions (pending) -> Kafka transaction.created -> Anti-Fraud (>1000 rejected) -> Kafka transaction.status-updated -> Update DB

Implementación:

  • transaction-ms with Hexagonal, DDD, CQRS, Prisma, Transactional Outbox and Redis cache
  • anti-fraud-ms with Hexagonal, Rule Engine (Strategy) and deterministic events
  • client-gateway with Circuit Breaker, Throttler and Correlation-ID
  • shared contracts with zod validation

Cómo probar:

  • npm install
  • docker compose up -d
  • npm run build:contracts
  • npm run dev:tx / dev:fraud / dev:gateway
  • POST http://localhost:8080/api/v1/transactions -> GET /transactions/:id
  • Docs: http://localhost:8080/docs
  • Tests: npm 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.

- 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
@JAMESDEVKOI

Copy link
Copy Markdown
Author

Realizado por: James Daniel Capcha Flores

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant