Conversation
ALEGATOR1209
left a comment
There was a problem hiding this comment.
Where is implementation of Bank Data Source
src/model/Card.js
Outdated
| * @property {number} cardId - Card's id in Lemon DB. | ||
| * @property {string} bank - Name of the bank card belongs to | ||
| * @property {number} cardNum - Card number (can be either all number or last 4 digits only) | ||
| * @property {number} cardNum - Card number (must be full number) |
There was a problem hiding this comment.
Because Privat API needs full number of card (check data sample in privat24.js)
There was a problem hiding this comment.
But other API's don't. And don't provide it.
| @@ -1,5 +1,3 @@ | |||
| 'use strict'; | |||
There was a problem hiding this comment.
It can't be an ESLint error...
src/datasources/privat24/privat24.js
Outdated
| merchantPassword: '55x3Ft9C96yx7s1cAMO2KVn1apuDA0X6', | ||
| merchantId: 123456, |
There was a problem hiding this comment.
Don't commit things like this!
There was a problem hiding this comment.
Move it to some sort of config file maybe?
src/datasources/privat24/privat24.js
Outdated
| // example of using | ||
| (async () => { | ||
| const tranData = await getTransactionsData(dataForTransactionsRequest); | ||
| const balanceData = await getBalanceData([dataForBalanceRequest]); | ||
| // dataForBalanceRequest is array of data objects | ||
| console.log(tranData); | ||
| console.log(balanceData); | ||
| })(); |
There was a problem hiding this comment.
Move it to another file, it shouldn't been executed every time we use this file
There was a problem hiding this comment.
Ok, i will just put this in comment
src/datasources/privat24/privat24.js
Outdated
| class PrivatDataSource extends BankDataSource { | ||
| constructor() { | ||
| super(); | ||
| } | ||
| // conf is similar to dataForTransactionsRequest | ||
| async getTransactions(card, conf) { | ||
| conf.cardNumber = card.cardNum + ''; | ||
| return await getTransactionsData(conf); | ||
| } | ||
| // additional method for getting balances of cards array | ||
| // conf is array of objects similar to dataForBalanceRequest | ||
| async getBalance(conf) { | ||
| return await getBalanceData(conf); | ||
| } |
There was a problem hiding this comment.
Why don't you put declarations of these functions inside class methods?
src/datasources/privat24/privat24.js
Outdated
| merchantPassword: '55x3Ft9C96yx7s1cAMO2KVn1apuDA0X6', | ||
| merchantId: 123456, |
There was a problem hiding this comment.
Move it to some sort of config file maybe?
| } | ||
|
|
||
| module.exports = BankDataSource; | ||
|
|
There was a problem hiding this comment.
Why delete newline?
It was a mistake

No description provided.