Skip to content

Releases: hyperbudget/hyperbudget-core

Version 2.6.0

02 Jul 20:32
Compare
Choose a tag to compare

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

18 Jun 00:14
Compare
Choose a tag to compare

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

17 Jun 23:28
Compare
Choose a tag to compare

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

17 Jun 23:09
Compare
Choose a tag to compare

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

24 May 19:36
Compare
Choose a tag to compare
  • 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