Closed pferrariuy closed 7 months ago
Tested integration with new endpoints from: https://github.com/Renovus-Tech/solarec-python/issues/17
{
"chart" : {
"from" : "2024/01/01 00:00:00",
"to" : "2024/04/17 23:59:59",
"resultCode" : 200,
"resultText" : "",
"groupBy" : null
},
"data" : [ {
"from" : "2024/01/01 00:00:00",
"to" : "2024/04/17 23:59:59",
"co2Avoided" : 32.10401,
"certGenerated" : 25.279,
"certSold" : 12.639
} ]
}
{
"chart" : {
"from" : "2024/01/01 00:00:00",
"to" : "2024/04/17 23:59:59",
"resultCode" : 200,
"resultText" : "",
"groupBy" : null
},
"data" : [ {
"from" : "2024/01/01 00:00:00",
"to" : "2024/04/17 23:59:59",
"co2Avoided" : 32.10401,
"certGenerated" : 25.279,
"certPrice" : 505.575,
"certSold" : 12.639,
"certIncome" : 252.787
} ]
}
{
"chart" : {
"from" : "2024/04/17 00:00:00",
"to" : "2024/04/17 23:59:59",
"resultCode" : 200,
"resultText" : "",
"groupBy" : null
},
"data" : [ {
"from" : "2024/04/17 00:00:00",
"to" : "2024/04/17 23:59:59",
"co2Avoided" : 0.00684,
"co2PerKwh" : 0.044
} ]
}
Since the calculation of certificates sales, certificates and emission is now being moved to Python ( issue .....), there is the need to update the current endpoint controllers to avoid the calculation and, instead, call the Python corresponding enpoints.
The current endpoints that need to be updated to call a Python endpoint are:
/api/rest/chart/revenue/sales
-->/solar/sales
/api/rest/chart/revenue/
-->/solar/certificates
/api/rest/solar/overview/co2
-->/solar/emissions
The payload will be the same as the rest of the endpoints, the
ChartFilter
, that will be passthrought the Python endpoint. The result of calling the new code will be the JSON returned by the Python code.The new code will require an update to the current configuration, in order to indicate the corresponding Python server that will answer the requests:
An issue to have created the required
stat_definition
records in the database, has been create at: https://github.com/Renovus-Tech/solarec-db/issues/13