first use of tariffID (missing tenant)
MODIFY
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/OCPIUtilsService.ts
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/OCPIUtilsService.ts
@@ -936,6 +936,27 @@ export default class OCPIUtilsService {
private static buildTariffID(tenant: Tenant, chargingStation: ChargingStation, connector: Connector): string {
const defaultTariff = 'Default';
+ // Connector?
+ if (connector.tariffID) {
+ return connector.tariffID;
+ }
+ // Charging Station?
+ if (chargingStation.tariffID) {
+ return chargingStation.tariffID;
+ }
+ // Site Area?
+ if (chargingStation.siteArea && chargingStation.siteArea.tariffID) {
+ return chargingStation.siteArea.tariffID;
+ }
+ // Site?
+ if (chargingStation.site && chargingStation.site.tariffID) {
+ chargingStation.site.tariffID;
+ }
+ // Tenant?
+ // TODO: Get TariffID from SettingStorage (pending prerequisite PR).
+ // Default.
+ return defaultTariff;
+ // OLD rules (for setting them into the proper objects)
switch (tenant?.id) {
// Station-e
case '60633bb1834fed0016310189':

MODIFY
src/types/ChargingStation.ts
src/types/ChargingStation.ts
@@ -170,6 +170,7 @@ export interface Connector {
currentType?: CurrentType;
chargePointID?: number;
phaseAssignmentToGrid?: PhaseAssignmentToGrid;
+ tariffID?: string;
}
export interface PhaseAssignmentToGrid {

MODIFY
src/types/Site.ts
src/types/Site.ts
@@ -20,6 +20,7 @@ export default interface Site extends CreatedUpdatedProps, SiteAuthorizationActi
distanceMeters?: number;
public?: boolean;
openingTimes?: OpeningTimes;
+ tariffID?: string;
}
export interface SiteUser {

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;
}

first use of tariffID (missing tenant)