PR - Technical Solution - Transaction System with Anti-Fraud#605
Open
Luisgam94 wants to merge 7 commits intoyaperos:mainfrom
Open
PR - Technical Solution - Transaction System with Anti-Fraud#605Luisgam94 wants to merge 7 commits intoyaperos:mainfrom
Luisgam94 wants to merge 7 commits intoyaperos:mainfrom
Conversation
PR: move solution to main branch
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 Técnica - Sistema de Transacciones con Anti-Fraude
La estructura del proyecto es hexagonal, con dos microservicios principales:
TransactionyAntifraud.📋 Stack Tecnológico
🏗️ Arquitectura
Gestión de Concurrencia
Tipos de Transacción
1= Depósito2= Retiro🔄 Flujo de Comunicación
Servicio de Transacciones (Transaction)
Produce a:
anti-fraud-topicPENDING)Consume de:
transaction-topicAPPROVED/REJECTED)Servicio Anti-Fraude (Antifraud)
Consume de:
anti-fraud-topicProduce a:
transaction-topic🚀 Cómo Ejecutar
Se tiene 2 modos de ejecución: Local (Infraestructura con docker y microservicios corriendo en tu máquina) o Automatizado (con todo el sistema dockerizado).
💻 MODO LOCAL
1. Levantar infraestructura
Incluye:
2. Ejecutar microservicios desde el IDE
Requisitos Previos
Java 17
Este proyecto requiere Java 17. Asegúrate de tener instalado JDK 17 y configurado en tu variable de entorno
JAVA_HOME.Windows
Mac
Opción A - Terminal:
Opción B - IntelliJ IDEA:
AntifraudApplication.java→ RunTransactionApplication.java→ Run🐳 MODO AUTOMATIZADO (Docker Completo)
Levantar todo el sistema
Incluye:
Detener
docker-compose down📍 Puertos y Servicios
📮 Pruebas con POSTMAN
1️⃣ Crear Transacción
POST
http://localhost:8080/transactionsBody (JSON):
{ "accountExternalIdDebit": "6085462b-f1da-48a0-8f11-72ee428b2a32", "accountExternalIdCredit": "1cb43a09-01a7-4019-b683-589b6b00ea58", "tranferTypeId": 1, "value": 900 }Response (201 CREATED):
{ "transactionExternalId": "47f62081-95c7-483b-a000-91c0e391f696" }2️⃣ Obtener Transacción
GET
http://localhost:8080/transactions/{transactionExternalId}Parámetro:
transactionExternalId: ID de la transacción a consultarResponse (200 OK):
{ "transactionExternalId": "47f62081-95c7-483b-a000-91c0e391f696", "transactionType": { "name": "DEPOSIT" }, "transactionStatus": { "name": "APPROVED" }, "value": 900.00, "createdAt": "2026-03-01T19:11:52.070044" }📌 Notas Importantes
1= Depósito,2= Retiro