Expose energy communities services info
In this MR, we will implement the an endpoint that will expose all energy services that offer an energy community from the energy community perspective:
* [GET] /api/communities/community/community_services
* [GET] /api/communities/community/community_services/int:service_id
Headers: CompanyID=<company_id>; Authorization: Bearer token
Query params: from_date=2024-01-01; to_date=2024-02-01
Energy services offered by an energy community. For each service, the following information is provided:
-
id: service identifier -
type: type of service, photovoltaic, car sharing... -
name: service name -
status: service status, in activation, active.. -
power: if the service is photovoltaic, power of the installation -
inscriptions: number of people - entities attached to the service -
address: service address If the service identifier is specified, only the information for that service is returned
* [GET] /api/communities/community/community_services/metrics
* [GET] /api/communities/community/community_services/int:service_id/metrics
Headers: CompanyID: <company_id>; Authorization: Bearer token
Query params: from_date=2024-01-01; to_date=2024-02-01
Metrics for all active services that an energy community has. If the identifier of a service is specified, only the metrics for this service are returned.
-
id: service identifier -
type: service type, photovoltaic, car sharing... -
name: service name -
energy_consumption: if the project is self-consumption, total energy consumed -
energy_production: if the project is self-consumption, total energy produced -
surplus_ratio: if the project is self-consumption, ratio between energy produced and exported -
gridconsumption_ratio: if the project is self-consumption, ratio between total energy consumed and energy consumed from the grid -
selfconsumption_ratio: if the project is self-consumption, ratio between total energy consumed and energy consumed from the grid -
environment_saves: CO2 savings
* [GET] /api/communities/community/community_services/int:service_id/metrics/energy_production
Headers: CompanyID=<company_id>; Authorization: Bearer token
Query params: from_date=2024-01-01; to_date=2024-02-01
If the service is self-consumption, daily production of the service. [{"value": 3.4, "date": "2024-01-01}, {"value": 5.4, "date": "2024-01-02"}...]
* [GET] /api/communities/community/community_services/int:service_id/metrics/energy_selfconsumption
Headers: CompanyID=<company_id>; Authorization: Bearer token
Query params: from_date=2024-01-01; to_date=2024-02-01
If the service is self-consumption, daily self-consumption energy of the service. [{"value": 1.4, "date": "2024-01-01}, {"value": 2.4, "date": "2024-01-02"}...]
* [GET] /api/communities/community/community_services/int:service_id/metrics/energy_exported
Headers: CompanyID=<company_id>; Authorization: Bearer token
Query params: from_date=2024-01-01; to_date=2024-02-01
If the service is self-consumption, energy exported to the daily network of the service. [{"value": 2.0, "date": "2024-01-01}, {"value": 3.0, "date": "2024-01-02"}...]
* [GET] /api/communities/community/community_services/int:service_id/metrics/energy_consumption
Headers: CompanyID=<company_id>; Authorization: Bearer token
Query params: from_date=2024-01-01; to_date=2024-02-01
If the service is self-consumption, total daily energy consumed by the service. [{"value": 2.0, "date": "2024-01-01}, {"value": 3.0, "date": "2024-01-02"}...]
Implements:
- OP#314
- OP#351
- OP#450
- OP#451
- OP#470
- OP#471
- OP#1024