-
Notifications
You must be signed in to change notification settings - Fork 421
Challenge-yape-Elxer #466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lucasvalentian
wants to merge
20
commits into
yaperos:main
Choose a base branch
from
lucasvalentian:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Challenge-yape-Elxer #466
Conversation
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
…jar y tambien se configuro kafka y zookeeper en local
…ones y tambien se agrego redis para almacenar en cache y las respuesta sean muchas más rapidas
…de antifraude y las respectivas validaciones de transacciones
… dos microservicios
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.
1. Antifraud Service
Funcionalidades Principales
Validación de Transacciones:
Implementación de la clase ValidateTransactionUseCase para validar transacciones basadas en su valor:
Transacciones con valor mayor a 1000 son rechazadas.
Transacciones con valor menor o igual a 1000 son aceptadas.
Publicación del estado de la transacción (ACCEPTED o REJECTED) en un topic de Kafka (transaction.status-updated).
Integración con Kafka:
Uso de KafkaProducerService para enviar eventos de estado de transacción a Kafka.
Configuración de reintentos automáticos para garantizar la resiliencia en el envío de mensajes.
Métricas y Monitoreo:
Integración con Prometheus para exponer métricas clave:
antifraud_kafka_messages_sent_total: Total de mensajes enviados exitosamente a Kafka.
antifraud_kafka_messages_failed_total: Total de mensajes fallidos al enviar a Kafka.
antifraud_transactions_validated_total: Total de transacciones validadas.
antifraud_transactions_validation_errors_total: Total de errores durante la validación de transacciones.
Pruebas Unitarias
Cobertura de pruebas para ValidateTransactionUseCase:
Validación de transacciones aceptadas y rechazadas.
Manejo de errores y verificación de métricas.
2. Transaction Service
Funcionalidades Principales
Gestión de Transacciones:
Implementación de la clase TransactionAplicationService para manejar la creación y consulta de transacciones.
Uso de TransactionDomianService para interactuar con el repositorio de transacciones y garantizar la separación de responsabilidades.
Publicación de Eventos:
Uso de TransactionProducer para publicar eventos de transacciones creadas en Kafka (transaction.created).
Reintentos Configurables:
Implementación de un mecanismo de reintentos en la creación de transacciones para manejar errores temporales.
Métricas y Monitoreo:
Integración con Prometheus para exponer métricas clave:
transactions_created_total: Total de transacciones creadas exitosamente.
transactions_creation_errors_total: Total de errores al intentar crear transacciones.
transactions_retrieved_total: Total de transacciones consultadas.
Validación de Datos
Uso de TransactionValidation para validar los datos de entrada antes de procesar las transacciones.
Pruebas Unitarias
Cobertura de pruebas para TransactionAplicationService:
Verificación de transacciones creadas exitosamente.
Manejo de errores durante la creación de transacciones.
Publicación de eventos en Kafka
Implementación:
Resiliencia:
Reintentos automáticos en la publicación de eventos en Kafka.
Retrasos configurables entre reintentos para evitar saturar el sistema.
Monitoreo:
Exposición de métricas clave para monitorear el rendimiento y los errores en ambos microservicios.
Logs Informativos:
Inclusión de logs detallados para facilitar la depuración y el seguimiento de las operaciones.
Configuración de Alias y Rutas:
Configuración de alias en tsconfig.json y jest.config.ts para facilitar las importaciones.
Ajustes para garantizar compatibilidad en entornos locales y Docker.