Skip to content

Conversation

@alvarezrrj
Copy link
Collaborator

Description

Por hacer

Falta implementar lo de buscar hasta 30 dias en el pasado cuando el depósito no se encuentra. Esto es en FinanceServices.verifyPayment()

Cambios

HttpService

Separé la logica del HttpService a ExternalApiService, que es una clase base que solo se encarga de pedirle los tokens al TokenService y hacer el retry, y HttpService que extiende a la anterior y le pasa el TokenService correspondiente dependiendo de que API se quiera usar. Esto pasa al momento de llamar al getter authed*Api.

Puede que me haya sebado con el uso de clases acá. Vos habías dicho que querias migrar a funciones, pero parece que tengo el cerebro seteado en OOP y usar clases es lo único que se me occurre cuando tengo que evitar duplicar código. Si querés en algún momento, cuando no estemos tan hasta las manos, nos ponemos un día a refactorizar esto.

TransferRequest

Antes los pedidos para hacer un deposito o un retiro eran los mismos: TransferRequest, ahora están separados en DepositRequest y CashoutRequest.

Transfer Result

En la respuesta TransferResult no confundir el status, que puede ser "COMPLETED" o "INCOMPLETE", y se refiere a la transferencia de fichas, con el deposit.status, que puede ser "pending", "rejected", "confirmed", "cancelled" o"deleted" y se refiere a la transferencia de plata.

Base de Datos

La estructura de la base de datos ha cambiado, te recomiendo que borres los datos de todas las tablas menos USER_ROOT y uses el nuevo seed.sql para volver a poblarla. El usuario que uso para testear normalmente es test19. Si no borras USER_ROOT no hace falta que corras yarn seed.

@AlphaDev87 AlphaDev87 merged commit 606d757 into develop Mar 24, 2024
@AlphaDev87 AlphaDev87 deleted the alquimia branch March 24, 2024 02:27
AlphaDev87 added a commit that referenced this pull request Apr 9, 2024
* Bot (#20) * Add chatbot flows, Add bot.qr.png to .gitignore * Fetch bot menus and answers from DB * Auth fix (#22) * Fix double refresh hanging the server * 🧹 Clean up * Add console.error() to exitLog * Testing (#24) * Add role to player on PlayersDAO.upsert * Add tests * Alquimia (#25) * Add alquimia payment verification * Update seed.sql * Comment out services.old.ts * Remove Player from DepositDAO.create() * Remove Player from DepositDAO.create() * Alquimia (#26) * Fix deposit test * Look for deposits 24 hours into the past * Fix tests * Update deposit on /transactions/deposit/:id (#27) * Alquimia sync (#28) * Update deposit on /transactions/deposit/:id * Sync deposits from Alquimia DB to local on FinanceServices.verifyPayment() * Set deposit status to rejected if not found * Change integer incremental IDs to string UUIDs * Modify endpoints to use only GET and POST methods (#29) * Modify endpoints to use only GET and POST methods * Misc (#30) * Add endpoint to show Alquimia bank details, Configure cors for development, Update deposit instead of create when existing tracking key found in request * Add ALLOWED_ORIGIN to .env * origin source * lint --------- Co-authored-by: Alpha Dev <alphadev@MacBook-Pro-de-Gonzalo.local> --------- Co-authored-by: Alpha Dev <alphadev@MacBook-Pro-de-Gonzalo.local> --------- Co-authored-by: Alpha Dev <alphadev@MacBook-Pro-de-Gonzalo.local> * Deposit flow (#31) * Create CasinoCoinsService to handle coin transfers, Improve FinanceService.confirmDeposit error handling, Remove paid_at and coins_transfered from Deposit model, add casinoTokenService.login() call to seed.ts, Improve Notify error handling, Improve TransactionsDAO error handling, Turn Player.balance_currency into a required field, Swap Transaction.status with Transaction.ok * Update .gitignore * Fix bug in FinanceServices.alquimiaDepositLookup (#32) * Fix bug in FinanceServices.alquimiaDepositLookup * Improve bank-account request validator * Fix bank-account test * fix cashout validation * Add rate limiter to POST /transactions/deposit/:id? (#33) * Deposit (#34) * Improve DepositDAO.authorizeConfirmation, Give agent role permission to confirm deposit, Remove TransactionsController.deleteDeposit, Fixed finalizeDeposit logic to not send coins on confirmed deposits, Add optional id to GET /agent/depoists to retreive individual depoist, Rename /agent/deposits/complete to /agent/pending/depoists * Update README * Payment throttling (#35) * Update dependecies, Restrict withdrawals to 1 every 24 hours * Update CHANGELOG * update bankNumber validation * Logging (#36) * Add logtailLogger, Fix bug in AuthServices.refresh * Update CHANGELOG * Update CONFIG.LOG.CODES * Bot (#37) * Add logtailLogger, Fix bug in AuthServices.refresh * Update CHANGELOG * Update CONFIG.LOG.CODES * Update USER_ALREADY_EXISTS error description * Add on call bot flows, Add endpoint to set on call status on/off * Rename table BOT_MESSAGES to BOT_FLOWS * Update REAMDE, Update CHANGELOG * Improve seed.ts * Update CHANGELOG * Add GET /agent/on-call endpoint * Update README with on call endpoints * Add tests for on-call endpoints * Move test agent creds to .env --------- Co-authored-by: AlphaDev87 <155021991+AlphaDev87@users.noreply.github.com> --------- Co-authored-by: Rodrigo Alvarez <65652568+alvarezrrj@users.noreply.github.com> Co-authored-by: Alpha Dev <alphadev@MacBook-Pro-de-Gonzalo.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants