Renamed vars
MODIFY
src/server/rest/service/SiteAreaService.ts
src/server/rest/service/SiteAreaService.ts
@@ -299,7 +299,7 @@ export default class SiteAreaService {
search: filteredRequest.Search,
withSite: filteredRequest.WithSite,
withChargingStations: filteredRequest.WithChargeBoxes,
- withAvailableChargers: filteredRequest.WithAvailableChargers,
+ withAvailableChargingStations: filteredRequest.WithAvailableChargers,
siteIDs: Authorizations.getAuthorizedSiteIDs(req.user, filteredRequest.SiteID ? filteredRequest.SiteID.split('|') : null),
},
{ limit: filteredRequest.Limit, skip: filteredRequest.Skip, sort: filteredRequest.Sort, onlyRecordCount: filteredRequest.OnlyRecordCount },

MODIFY
src/server/rest/service/SiteService.ts
src/server/rest/service/SiteService.ts
@@ -382,7 +382,7 @@ export default class SiteService {
siteIDs: Authorizations.getAuthorizedSiteIDs(req.user, filteredRequest.SiteID ? filteredRequest.SiteID.split('|') : null),
withCompany: filteredRequest.WithCompany,
excludeSitesOfUserID: filteredRequest.ExcludeSitesOfUserID,
- withAvailableChargers: filteredRequest.WithAvailableChargers
+ withAvailableChargingStations: filteredRequest.WithAvailableChargers
},
{
limit: filteredRequest.Limit,

MODIFY
src/storage/mongodb/SiteAreaStorage.ts
src/storage/mongodb/SiteAreaStorage.ts
@@ -92,7 +92,7 @@ export default class SiteAreaStorage {
siteAreaID: id,
withSite: params.withSite,
withChargingStations: params.withChargingStations,
- withAvailableChargers: true
+ withAvailableChargingStations: true
},
Constants.DB_PARAMS_SINGLE_RECORD
);
@@ -144,7 +144,7 @@ export default class SiteAreaStorage {
public static async getSiteAreas(tenantID: string,
params: {
siteAreaID?: string; search?: string; siteIDs?: string[]; withSite?: boolean; issuer?: boolean;
- withChargingStations?: boolean; smartCharging?: boolean; withAvailableChargers?: boolean;
+ withChargingStations?: boolean; smartCharging?: boolean; withAvailableChargingStations?: boolean;
} = {},
dbParams: DbParams, projectFields?: string[]): Promise<DataResult<SiteArea>> {
// Debug
@@ -228,7 +228,7 @@ export default class SiteAreaStorage {
});
}
// Charging Stations
- if (params.withChargingStations || params.withAvailableChargers) {
+ if (params.withChargingStations || params.withAvailableChargingStations) {
DatabaseUtils.pushChargingStationLookupInAggregation({
tenantID, aggregation, localField: '_id', foreignField: 'siteAreaID',
asField: 'chargingStations'
@@ -259,7 +259,7 @@ export default class SiteAreaStorage {
// Create
for (const siteAreaMDB of siteAreasMDB) {
// Count Available/Occupied Chargers/Connectors
- if (params.withAvailableChargers) {
+ if (params.withAvailableChargingStations) {
// Set the Charging Stations' Connector statuses
siteAreaMDB.connectorStats = Utils.getConnectorStatusesFromChargingStations(siteAreaMDB.chargingStations);
}

MODIFY
src/storage/mongodb/SiteStorage.ts
src/storage/mongodb/SiteStorage.ts
@@ -297,7 +297,7 @@ export default class SiteStorage {
params: {
search?: string; companyIDs?: string[]; withAutoUserAssignment?: boolean; siteIDs?: string[];
userID?: string; excludeSitesOfUserID?: boolean; issuer?: boolean;
- withAvailableChargers?: boolean; withChargingStations?: boolean; withCompany?: boolean;
+ withAvailableChargingStations?: boolean; withChargingStations?: boolean; withCompany?: boolean;
} = {},
dbParams: DbParams, projectFields?: string[]): Promise<DataResult<Site>> {
// Debug
@@ -413,7 +413,7 @@ export default class SiteStorage {
if (sitesMDB && sitesMDB.length > 0) {
// Create
for (const siteMDB of sitesMDB) {
- if (params.withChargingStations || params.withAvailableChargers) {
+ if (params.withChargingStations || params.withAvailableChargingStations) {
// Get the chargers
const chargingStations = await ChargingStationStorage.getChargingStations(tenantID,
{ siteIDs: [siteMDB.id], includeDeleted: false }, Constants.DB_PARAMS_MAX_LIMIT);
@@ -422,7 +422,7 @@ export default class SiteStorage {
continue;
}
// Add counts of Available/Occupied Chargers/Connectors
- if (params.withAvailableChargers) {
+ if (params.withAvailableChargingStations) {
// Set the Charging Stations' Connector statuses
siteMDB.connectorStats = Utils.getConnectorStatusesFromChargingStations(chargingStations.result);
}

Renamed vars