Releases: hyperbudget/hyperbudget-core
v10.0.0
[REVERTED] Categories: now with better categorising
THIS RELEASE HAS BEEN REVERTED due to not really working properly.
The below information is kept for historical reasons. Please do not use this release
You can finally have multiple category_rules
for categories, using the familiar FLEX
/STRICT
modes.
strict (the default) requires all the below to be true:
{
"category_rules": {
"type": {"rules":[["=","DD"]]},
"creditAmount": { "rules": [[">",500]]}
}
}
FLEX will be type='DD' OR 'creditAmount' > 500
{
"category_rules": {
"type": {"rules":[["=","DD"]]},
"creditAmount": { "rules": [[">",500]]},
"mode": "FLEX"
}
}
8.0.1
v8.0.0
v7.2.0
v7.1.0
groupByType
functionality for transactions
Creates a hash of { 'transaction_type' : transactions: [{ description: 'blah' , creditAmount: 100, ... }] }
. They are unique by description.
const transactions: Transaction[] = [
{
description: 'Virgin Media',
debitAmount: 40,
type: 'DD',
date: '2018-01-01T00:00:00Z',
},
{
description: 'Virgin Media',
debitAmount: 77,
type: 'DD',
date: '2018-02-01T00:00:00Z',
},
{
description: 'Virgin Media',
debitAmount: 77,
type: 'DD',
date: '2018-02-02T00:00:00Z',
},
{
description: 'TFL',
debitAmount: 130,
type: 'DD',
date: '2018-03-01T00:00:00Z',
},
{
description: 'Rent',
debitAmount: 1000,
type: 'SO',
date: '2018-03-07T00:00:00Z',
},
{
description: 'Salary',
creditAmount: 2000,
type: 'FPI',
date: '2018-03-30T00:00:00Z',
},
{
description: 'Some random spends',
debitAmount: 12,
type: 'DEB',
date: '2018-04-01T00:00:00Z'
},
].map(t => new Transaction(t));
let groups = reportManager.groupByType(transactions, ['DD', 'SO']);
expect(Object.keys(groups)).to.deep.equal(['DD', 'SO']);
expect(groups['DD']).to.have.property('transactions').with.lengthOf(2);
expect(groups['DD'].transactions[0].description).to.equal('Virgin Media');
expect(groups['DD'].transactions[0].debitAmount).to.equal(77);
expect(groups['DD'].transactions[1].description).to.equal('TFL');
expect(groups['DD'].transactions[1].debitAmount).to.equal(130);
expect(groups['SO']).to.have.property('transactions').with.lengthOf(1);
expect(groups['SO'].transactions[0].description).to.equal('Rent');
expect(groups['SO'].transactions[0].debitAmount).to.equal(1000);
v5.0.1
v5.0.0
Revert validation to native JS code
Reverts validating transactions & categories to native JS code instead of jsonschema. Clients can still use JSONschema for their own validation if they wish, but the core code will now use custom JS code. The reason for this is that it appears validating big amounts of data with jsonschema was extremely slow in the backend
v4.0.0
Version 3.0.0
Breaking changes: (I can haz doing semver correctly)
- JSON Schemas available for
Category
andTransaction
objects. -
- These are available in the exported
JSONSchema
object.
- These are available in the exported
- Validation now uses these JSON Schemas.
- Category mode enums are now changed to strings
"STRICT"
and"FLEX"
instead of numbers.