sap-labs-france / ev-server

The Open e-Mobility Charging Station management backend server (check also ev-dashboard and ev-mobile)
https://open-e-mobility.fr/
Apache License 2.0
158 stars 147 forks source link

Getting siteAreas with parameter "WithChargingStations=true" doesn't work anymore #3558

Closed vladajanjanin closed 2 years ago

vladajanjanin commented 2 years ago

SiteAreas don't contain lists of ChargingStation objects anymore, and the paremeter WithChargingStations seems to be there still. This is the API call I've been successfully using for a year basically. Screenshot 2022-05-25 at 13 25 58 Thanks

LucasBrazi06 commented 2 years ago

Thanks for reporting the issue. I will have a look.

LucasBrazi06 commented 2 years ago

I fixed the issue, you should have the charging station IDs in an array tomorrow (after tonight's deployment)

vladajanjanin commented 2 years ago

I fixed the issue, you should have the charging station IDs in an array tomorrow (after tonight's deployment)

Hey Serge, thanks for a very fast response. The thing is - previously we could fetch all of the Charging Stations (complete objects) in a single call while fetching all existing Site Areas and it was extremely convenient. Being able to see ChargingStation IDs wouldn't provide much since we can fetch ChargingStations for a certain SiteArea ID already, but making an API call for each SiteArea isn't that great compared to how it was earlier. If it was an intentional change - ok, we can obviously work around it, but being able to fetch a whole SiteArea in every single charging station object while fetching charging stations, but not the other way around doesn't seem logical. Thanks once again

LucasBrazi06 commented 2 years ago

Hello, We've been enhancing the authorizations framework and we check and limit the number of fields you can fetch for a given endpoint according your role. If you have a 50 sites with 100 charging stations each could consume lots of bandwidth for nothing. It's a kind of master/details approach and you should only load the details when necessary. Moreover, getting the charging station's with the Site ID is not the same as getting all the Sites with all the Charging Stations. I hope this will help, let me know. Btw, the bug was there since a long time.

vladajanjanin commented 2 years ago

@LucasBrazi06 Thanks for the fast reply once again. It's fine, at least I know that it's working as intended and I should work around it :) Why I'm asking for all this if you're interested - I'm creating a map filter on our mobile app, and I want to exclude certain SiteAreas from showing based on the connector type of the ChargingStations in that SiteArea. It was extremely convenient to have all the information after a single API call instead of fetching all the SiteAreas and then fetching ChargingStations for each SiteArea separately.

LucasBrazi06 commented 2 years ago

@vladajanjanin Thanks for the explanation of your use case ! But this is a specific dev at server side to take into account the connector type and filter out the sites/site areas accordingly. It's a better solution that retrieving all the data and doing the filter in the front-end. If you have your mobile app then you should also have your own server and you can implement this feature very easily ;-).