Skip to content

Commit

Permalink
Patch: Transactions of a balance added to sealed balances.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoernert committed Jan 19, 2024
1 parent 93efb97 commit 0c4f1fb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
16 changes: 16 additions & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## [0.5.3](https://github.com/energychain/ZSG_DynamischeStromtarife/compare/v0.5.2...v0.5.3) (2024-01-19)


### Features

* auto sealing of simple meter reading based addSettlement calls to balancing. ([f4bd29d](https://github.com/energychain/ZSG_DynamischeStromtarife/commit/f4bd29d0b94380089f4c3c9337743c21fb33bde9))
* Re-implemented auto seal. Auto Seal is an optional parameter to the addSettlement method of balancing. The epoch n-value will be automatically sealed. Useful for meter readings - might be used with other balancing points in the future, but not implemented so far. ([93efb97](https://github.com/energychain/ZSG_DynamischeStromtarife/commit/93efb975c9523055d0f7f75c30d467b8dd8c5ec3))


### Bug Fixes

* Add counter partner for closed balances ([983cdd0](https://github.com/energychain/ZSG_DynamischeStromtarife/commit/983cdd0b2ca5752b9c98fae6b879a349d5c1c258))
* Handling of closing booking in energy balancing. ([dafc569](https://github.com/energychain/ZSG_DynamischeStromtarife/commit/dafc5693cb5ff6c29bfaa818f55173fb90996c38))
* Handling of sealed balances. In case addSettlement is performed with a partner having a sealed balance a null will be returned instead of a transaction statement. ([139e252](https://github.com/energychain/ZSG_DynamischeStromtarife/commit/139e25273e1e4db04b1bb08e5d19d4cf94beca4a))
* Missing parameter in counter statement ([99e2984](https://github.com/energychain/ZSG_DynamischeStromtarife/commit/99e298446e4f8e4a3993274d492456e126f13caf))

## [0.5.2](https://github.com/energychain/ZSG_DynamischeStromtarife/compare/v0.5.1...v0.5.2) (2024-01-17)


Expand Down
4 changes: 2 additions & 2 deletions framework/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion framework/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stromdao-eaf",
"version": "0.5.2",
"version": "0.5.3",
"description": "STROMDAO Energy Application Framework - Referenzimplementierung für dynamische Stromtarife",
"scripts": {
"dev": "node ./run-eaf",
Expand Down
2 changes: 1 addition & 1 deletion framework/services/balances_sealed_model.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
* Settings
*/
settings: {
fields: ["_id", "assetId", "epoch","in","out","energy","upstream","seal"]
fields: ["_id", "assetId", "epoch","in","out","energy","upstream","seal","transactions"]
},
/**
* Dependencies
Expand Down
5 changes: 4 additions & 1 deletion framework/services/balancing.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ module.exports = {
energy: 0,
upstream: "",
upstreamenergy:0,
clearing: {}
clearing: {},
transactions: []
}

const settlements = await ctx.call("balance_settlements_active_model.find", {
Expand All @@ -357,6 +358,7 @@ module.exports = {
balance.upstreamenergy -= settlements[i].energy * 1;
}
balance.energy = balance.out - balance.in;
balance.transactions.push(settlements[i]);
}
const energybalance = balance.energy + balance.upstreamenergy;
balance.clearing = {
Expand Down Expand Up @@ -415,6 +417,7 @@ module.exports = {
const signOptions = JSON.parse(process.env.JWT_OPTIONS);
const res = jwt.sign(seal_content, process.env.JWT_PRIVATEKEY,signOptions);
seal_content.seal = res;
seal_content.transactions = intermediateBalance.transactions;
await ctx.call("balances_sealed_model.insert",{entity:seal_content});
return seal_content;
} else {
Expand Down

0 comments on commit 0c4f1fb

Please sign in to comment.