tariffID for ChargingStation (start connector)
MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingstation-parameters-update.json
src/assets/server/rest/v1/schemas/chargingstation/chargingstation-parameters-update.json
"items": {
"$ref": "chargingstation#/definitions/chargePoint"
}
+ },
+ "tariffID": {
+ "type": "string",
+ "sanitize": "mongo"
}
},
"required": [

MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -175,14 +175,14 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
attributes: [
'id', 'name', 'siteID', 'maximumPower', 'voltage', 'numberOfPhases', 'accessControl', 'smartCharging',
'address.address1', 'address.address2', 'address.postalCode', 'address.city', 'address.country',
- 'address.coordinates', 'site.id', 'site.name', 'issuer', 'distanceMeters', 'createdOn', 'createdBy', 'lastChangedOn', 'lastChangedBy'
+ 'address.coordinates', 'site.id', 'site.name', 'site.public', 'issuer', 'distanceMeters', 'createdOn', 'createdBy', 'lastChangedOn', 'lastChangedBy'
]
},
{
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/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -470,7 +470,7 @@ export default class AuthorizationService {
projectFields: [
'id', 'inactive', 'public', 'chargingStationURL', 'issuer', 'maximumPower', 'excludeFromSmartCharging', 'lastReboot',
'siteAreaID', 'siteArea.id', 'siteArea.name', 'siteArea.smartCharging', 'siteArea.siteID',
- 'site.id', 'site.name', 'siteID', 'voltage', 'coordinates', 'forceInactive', 'manualConfiguration', 'firmwareUpdateStatus',
+ 'site.id', 'site.public', 'site.name', 'siteID', 'voltage', 'coordinates', 'forceInactive', 'manualConfiguration', 'firmwareUpdateStatus', 'tariffID',
'capabilities', 'endpoint', 'chargePointVendor', 'chargePointModel', 'ocppVersion', 'ocppProtocol', 'lastSeen',
'firmwareVersion', 'currentIPAddress', 'ocppStandardParameters', 'ocppVendorParameters', 'connectors', 'chargePoints',
'createdOn', 'chargeBoxSerialNumber', 'chargePointSerialNumber', 'powerLimitUnit'

MODIFY
src/server/rest/v1/service/ChargingStationService.ts
src/server/rest/v1/service/ChargingStationService.ts
@@ -169,6 +169,11 @@ export default class ChargingStationService {
}
}
chargingStation.public = filteredRequest.public;
+ if (filteredRequest.public) {
+ chargingStation.tariffID = filteredRequest.tariffID;
+ } else if (chargingStation.tariffID) {
+ delete chargingStation.tariffID;
+ }
}
if (Utils.objectHasProperty(filteredRequest, 'excludeFromSmartCharging')) {
chargingStation.excludeFromSmartCharging = filteredRequest.excludeFromSmartCharging;

MODIFY
src/storage/mongodb/ChargingStationStorage.ts
src/storage/mongodb/ChargingStationStorage.ts
@@ -567,6 +567,7 @@ export default class ChargingStationStorage {
capabilities: chargingStationToSave.capabilities,
ocppStandardParameters: chargingStationToSave.ocppStandardParameters,
ocppVendorParameters: chargingStationToSave.ocppVendorParameters,
+ tariffID: chargingStationToSave.tariffID,
};
// Add Created/LastChanged By
DatabaseUtils.addLastChangedCreatedProps(chargingStationMDB, chargingStationToSave);

MODIFY
src/types/ChargingStation.ts
src/types/ChargingStation.ts
@@ -65,6 +65,7 @@ export default interface ChargingStation extends CreatedUpdatedProps, Authorizat
distanceMeters?: number;
ocpiData?: ChargingStationOcpiData;
oicpData?: ChargingStationOicpData;
+ tariffID?: string;
}
export interface ChargingStationOcpiData {

MODIFY
src/types/requests/HttpChargingStationRequest.ts
src/types/requests/HttpChargingStationRequest.ts
@@ -80,6 +80,7 @@ export interface HttpChargingStationParamsUpdateRequest {
numberOfConnectedPhase: number;
phaseAssignmentToGrid: PhaseAssignmentToGrid;
}[];
+ tariffID?: string;
}
export interface HttpChargingStationRequest extends HttpByIDRequest {

tariffID for ChargingStation (start connector)