Skip to content

Conversation

@gabogth
Copy link

@gabogth gabogth commented Oct 14, 2024

Descripción

En este commit se implementaron 2 servicios:

  1. yape-transaction-service: Responsable de mostrar los endpoints

    • createTransaction: crea una transacción.
    • retrieveTransaction: obtiene una trasacción por su id.
  2. anti-fraud: Responsable de validar las transacciones

    • processAntifraud: Valida la transacción recibida por el tópico de kafka

Las pruebas unitarias se ejecutan en el archivo docker antes del build

Resumen de cambios:

  1. Se agregó el servicio yape-transaction-service (NestJS)
  2. Se agregó el swagger
  3. Se agregó validaciones con ClassValidator
  4. Se agregó conexión a bbdd postgres con Prisma
  5. Se agregó envio a kafka
  6. Se agregó pruebas unitarias
  7. Se agregó pruebas e2e
  8. Se agregó el servicio anti-fraud (NestJS)
  9. Se agrego conexión a bbdd postgres con Prisma
  10. Se agregó pruebas unitarias

Ejecución

ejecutar el comando

docker-compose up -d --build

El puerto expuesto por defecto es:

http://localhost:3000

un flujo de ejemplo es:

POST http://localhost:3000/transactions
body: 
 {
    "accountExternalIdDebit": "314025cc-2dd9-4627-97e2-cc3ad0bfd9b2",
    "accountExternalIdCredit": "370ff967-572e-478a-839b-5fb549158b9b",
    "transferTypeId": 3,
    "value": 900
}
--------------------------------------------
La respuesta esperada seria:
{
    "transactionExternalId": "cdc29e77-3cca-4698-b678-6ccaa5b18415",
    "transactionType": {
        "name": "Yape!"
    },
    "transactionStatus": {
        "name": "approved"
    },
    "value": 1000,
    "createdAt": "2024-10-14T21:44:51.430Z"
}
GET http://localhost:3000/transactions/<transactionExternalId_del_post_anterior>
La respuesta esperada seria:
{
    "transactionExternalId": "cdc29e77-3cca-4698-b678-6ccaa5b18415",
    "transactionType": {
        "name": "Yape!"
    },
    "transactionStatus": {
        "name": "approved"
    },
    "value": 1000,
    "createdAt": "2024-10-14T21:44:51.430Z"
}

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.

2 participants