Closed daniel-hauser closed 5 months ago
Max's new currency pocket / ארנק מטח feature added a new planType, causing the scraper to fail with the following message:
planType
Unknown transaction type חיוב ארנק מטח
This PR adds the missing plan type to getTransactionType, as well as a fallback using the planTypeId field (for future new plans).
getTransactionType
planTypeId
When looking on the transactions from my account we can see that plans 2 is Installment, and 5 is Normal
Installment
Normal
Array.from(new Set(rawTransactions.map(t => [t.planName, t.planTypeId].join(':'))))
[ "רגילה:5", "חיוב עסקות מיידי:5", "תשלומים:2", "חיוב חודשי:5", "חיוב ארנק מטח:5" ]
Looking at the code in max, we can see that 2 and 3 are treated the same
<li *ngIf=" (transaction.planTypeId === 2 || transaction.planTypeId === 3) && transaction.dealData.amountLeft "> יתרה לתשלום: <span class="ltr-sum"> {{ transaction.dealData.amountLeft | maxCurrency: transaction.paymentCurrency }} </span> </li>
With this change, i also:
txnType
planName
lint --fix
:tada: This PR is included in version 4.3.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Problem
Max's new currency pocket / ארנק מטח feature added a new
planType
, causing the scraper to fail with the following message:Solution
This PR adds the missing plan type to
getTransactionType
, as well as a fallback using theplanTypeId
field (for future new plans).planTypeId
When looking on the transactions from my account we can see that plans 2 is
Installment
, and 5 isNormal
Looking at the code in max, we can see that 2 and 3 are treated the same
Other changes
With this change, i also:
txnType
toplanName
to align to the field in the max transaction object.lint --fix
(causing the changes in visa-cal)