Update function names; remove not-used functions
MODIFY
src/server/rest/v1/service/SiteService.ts
src/server/rest/v1/service/SiteService.ts
@@ -116,7 +116,7 @@ export default class SiteService {
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.GENERAL_ERROR,
message: 'The Site Owner value must be provided',
- module: MODULE_NAME, method: 'handleUpdateSiteUserOwner',
+ module: MODULE_NAME, method: 'handleUpdateSiteOwner',
user: req.user
});
}
@@ -132,7 +132,7 @@ export default class SiteService {
await Logging.logSecurityInfo({
tenantID: req.user.tenantID,
user: req.user, actionOnUser: user,
- module: MODULE_NAME, method: 'handleUpdateSiteUserOwner',
+ module: MODULE_NAME, method: 'handleUpdateSiteOwner',
message: `The User has been granted Site Owner on Site '${site.name}'`,
action: action
});

MODIFY
src/server/rest/v1/service/UtilsService.ts
src/server/rest/v1/service/UtilsService.ts
@@ -94,7 +94,7 @@ export default class UtilsService {
errorCode: HTTPError.OBJECT_DOES_NOT_EXIST_ERROR,
message: `ChargingStation with ID '${chargingStation.id}' is logically deleted`,
module: MODULE_NAME,
- method: 'handleGetChargingStation',
+ method: 'checkAndGetChargingStationAuthorization',
user: userToken
});
}
@@ -260,13 +260,13 @@ export default class UtilsService {
public static async checkSiteUsersAuthorization(tenant: Tenant, userToken: UserToken, site: Site, userIDs: string[],
action: ServerAction, additionalFilters: Record<string, any>, applyProjectFields = false): Promise<User[]> {
// Check mandatory fields
- UtilsService.assertIdIsProvided(action, site.id, MODULE_NAME, 'handleAssignUsersToSite', userToken);
+ UtilsService.assertIdIsProvided(action, site.id, MODULE_NAME, 'checkSiteUsersAuthorization', userToken);
if (Utils.isEmptyArray(userIDs)) {
throw new AppError({
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.GENERAL_ERROR,
message: 'The User\'s IDs must be provided',
- module: MODULE_NAME, method: 'handleAssignUsersToSite',
+ module: MODULE_NAME, method: 'checkSiteUsersAuthorization',
user: userToken
});
}
@@ -801,7 +801,7 @@ export default class UtilsService {
errorCode: HTTPError.GENERAL_ERROR,
message: 'The Charging Profile ID is mandatory',
module: MODULE_NAME,
- method: 'checkIfOICPEndpointValid'
+ method: 'checkIfChargingProfileIsValid'
});
}
if (!Utils.objectHasProperty(filteredRequest, 'chargingStationID')) {

Update function names; remove not-used functions