tariffID in SiteArea (Read/Update)
MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -182,7 +182,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
resource: Entity.SITE_AREA, action: Action.READ,
attributes: [
'id', 'name', 'issuer', 'image', 'address', 'maximumPower', 'numberOfPhases',
- 'voltage', 'smartCharging', 'accessControl', 'connectorStats', 'siteID', 'site.name'
+ 'voltage', 'smartCharging', 'accessControl', 'connectorStats', 'siteID', 'site.name', 'site.public', 'tariffID'
]
},
{

MODIFY
src/server/rest/v1/service/SiteAreaService.ts
src/server/rest/v1/service/SiteAreaService.ts
@@ -357,6 +357,7 @@ export default class SiteAreaService {
}
}
siteArea.numberOfPhases = filteredRequest.numberOfPhases;
+ siteArea.tariffID = filteredRequest.tariffID;
let actionsResponse: ActionsResponse;
if (siteArea.smartCharging && !filteredRequest.smartCharging) {
actionsResponse = await OCPPUtils.clearAndDeleteChargingProfilesForSiteArea(

MODIFY
src/server/rest/v1/service/security/SiteAreaSecurity.ts
src/server/rest/v1/service/security/SiteAreaSecurity.ts
@@ -98,7 +98,8 @@ export default class SiteAreaSecurity {
voltage: sanitize(request.voltage),
smartCharging: UtilsSecurity.filterBoolean(request.smartCharging),
accessControl: UtilsSecurity.filterBoolean(request.accessControl),
- siteID: sanitize(request.siteID)
+ siteID: sanitize(request.siteID),
+ tariffID: sanitize(request.tariffID)
} as Partial<SiteArea>;
if (Utils.objectHasProperty(request, 'image')) {
filteredRequest.image = sanitize(request.image);

MODIFY
src/storage/mongodb/SiteAreaStorage.ts
src/storage/mongodb/SiteAreaStorage.ts
@@ -105,6 +105,7 @@ export default class SiteAreaStorage {
maximumPower: Utils.convertToFloat(siteAreaToSave.maximumPower),
voltage: Utils.convertToInt(siteAreaToSave.voltage),
numberOfPhases: Utils.convertToInt(siteAreaToSave.numberOfPhases),
+ tariffID: siteAreaToSave.tariffID,
};
if (siteAreaToSave.address) {
siteAreaMDB.address = {

MODIFY
src/types/SiteArea.ts
src/types/SiteArea.ts
@@ -41,4 +41,5 @@ export default interface SiteArea extends CreatedUpdatedProps, SiteAreaAuthoriza
values: Consumption[];
distanceMeters?: number;
openingTimes?: OpeningTimes;
+ tariffID?: string;
}

tariffID in SiteArea (Read/Update)