Releases: hyperbudget/hyperbudget-core
Releases · hyperbudget/hyperbudget-core
Version 2.6.0
Transaction validator
You can now validate that an object matches the Transaction
API.
import { transaction_validator } from '@hyperbudget/hyperbudget-core';
let errors = transaction_validator.validate_transaction(txn);
expect(errors).to.deep.equal([]); // no errors
// or
expect(errors).to.deep.equal([ 'transaction.txn_date', 'transaction.org_month', 'fields_with_errors']);
Version 2.5.0
Extended validate_category
to support multiple categories with the validate_categories
API. Returns
[{
id: 'the_id_of_the_failed_category',
idx: index_of_array_where_the_issue_was,
errors: ['array_of_errors_eg', 'category.category_rules.txn_desc', 'category.id']
}]
an empty array means no issues.
Fix bugs from previous release
Basically, you can't cheat the validator by sticking extra characters around the rule comparison bit.
e.g.:
['!=', 'text']
should work, but ['!!=', 'text']
shouldn't.
Additionally, we're exporting the enums now.
Version 2.4.1
Category validator
You can now validate that categories fit the format explained in the wiki
The API is validator.validate_category(input)
, which returns an array of incorrect fields. If the array is empty, all fields fit the Category API.
See the examples here
Version 2.3.0
Categoriser.categorise_transactions
will no longer throw an error if given 0 transactions.- HSBC ATM withdrawals made on the VISA network will still show up as ATM withdrawals rather than as regular debits