Removed OCPI logo when empty and non standard properties
MODIFY
src/client/ocpi/CpoOCPIClient.ts
src/client/ocpi/CpoOCPIClient.ts
@@ -589,7 +589,7 @@ export default class CpoOCPIClient extends OCPIClient {
const startTime = new Date().getTime();
// Define get option
const options: OCPILocationOptions = {
- addChargeBoxID: true,
+ addChargeBoxAndOrgIDs: true,
countryID: this.getLocalCountryCode(ServerAction.OCPI_CHECK_LOCATIONS),
partyID: this.getLocalPartyID(ServerAction.OCPI_CHECK_LOCATIONS)
};
@@ -687,7 +687,7 @@ export default class CpoOCPIClient extends OCPIClient {
const startTime = new Date().getTime();
// Define get option
const options: OCPILocationOptions = {
- addChargeBoxID: true,
+ addChargeBoxAndOrgIDs: true,
countryID: this.getLocalCountryCode(ServerAction.OCPI_PATCH_STATUS),
partyID: this.getLocalPartyID(ServerAction.OCPI_PATCH_STATUS)
};
@@ -730,7 +730,7 @@ export default class CpoOCPIClient extends OCPIClient {
if (location.id && evse?.uid) {
try {
const chargingStationDetails : any = {
- id: evse.chargeBoxId,
+ id: evse.chargingStationID,
siteID: evse.siteID,
siteAreaID: evse.siteAreaID,
companyID: evse.companyID,
@@ -739,7 +739,7 @@ export default class CpoOCPIClient extends OCPIClient {
result.success++;
} catch (error) {
result.failure++;
- result.objectIDsInFailure.push(evse.chargeBoxId);
+ result.objectIDsInFailure.push(evse.chargingStationID);
result.logs.push(
`Update status failed on Location '${location.name}' with ID '${location.id}', Charging Station ID '${evse.evse_id}': ${error.message}`
);

MODIFY
src/client/oicp/CpoOICPClient.ts
src/client/oicp/CpoOICPClient.ts
@@ -55,7 +55,7 @@ export default class CpoOICPClient extends OICPClient {
const options: OCPILocationOptions = {
countryID: this.getLocalCountryCode(ServerAction.OICP_PUSH_SESSIONS),
partyID: this.getLocalPartyID(ServerAction.OICP_PUSH_SESSIONS),
- addChargeBoxID: true
+ addChargeBoxAndOrgIDs: true
};
// Get Site Area
const siteArea = chargingStation.siteArea;
@@ -199,7 +199,7 @@ export default class CpoOICPClient extends OICPClient {
const startTime = new Date().getTime();
// Define get option
const options: OCPILocationOptions = {
- addChargeBoxID: true,
+ addChargeBoxAndOrgIDs: true,
countryID: this.getLocalCountryCode(ServerAction.OICP_PUSH_EVSE_DATA),
partyID: this.getLocalPartyID(ServerAction.OICP_PUSH_EVSE_DATA)
};
@@ -347,7 +347,7 @@ export default class CpoOICPClient extends OICPClient {
const startTime = new Date().getTime();
// Define get option
const options: OCPILocationOptions = {
- addChargeBoxID: true,
+ addChargeBoxAndOrgIDs: true,
countryID: this.getLocalCountryCode(ServerAction.OICP_PUSH_EVSE_STATUSES),
partyID: this.getLocalPartyID(ServerAction.OICP_PUSH_EVSE_STATUSES)
};
@@ -490,7 +490,7 @@ export default class CpoOICPClient extends OICPClient {
}
// Define get option
const options: OCPILocationOptions = {
- addChargeBoxID: true,
+ addChargeBoxAndOrgIDs: true,
countryID: this.getLocalCountryCode(ServerAction.OICP_PUSH_EVSE_STATUSES),
partyID: this.getLocalPartyID(ServerAction.OICP_PUSH_EVSE_STATUSES)
};

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
@@ -801,7 +801,24 @@ export default class OCPIUtilsService {
}
private static async getOperatorBusinessDetails(tenant: Tenant): Promise<OCPIBusinessDetails> {
- return (await SettingStorage.getOCPISettings(tenant)).ocpi.businessDetails;
+ const businessDetails = (await SettingStorage.getOCPISettings(tenant)).ocpi.businessDetails;
+ if (businessDetails) {
+ for (const key in businessDetails.logo) {
+ const data = businessDetails.logo[key];
+ if (!data) {
+ delete businessDetails.logo[key];
+ }
+ }
+ if (!businessDetails.logo?.url &&
+ !businessDetails.logo?.thumbnail &&
+ !businessDetails.logo?.category &&
+ !businessDetails.logo?.type &&
+ !businessDetails.logo?.width &&
+ !businessDetails.logo?.height) {
+ delete businessDetails.logo;
+ }
+ }
+ return businessDetails;
}
private static convertChargingStation2MultipleEvses(tenant: Tenant, chargingStation: ChargingStation,
@@ -829,8 +846,8 @@ export default class OCPIUtilsService {
}
};
// Check addChargeBoxID flag
- if (options?.addChargeBoxID) {
- evse.chargeBoxId = chargingStation.id;
+ if (options?.addChargeBoxAndOrgIDs) {
+ evse.chargingStationID = chargingStation.id;
evse.siteID = chargingStation.siteID;
evse.siteAreaID = chargingStation.siteAreaID;
evse.companyID = chargingStation.companyID;
@@ -870,8 +887,8 @@ export default class OCPIUtilsService {
}
};
// Check addChargeBoxID flag
- if (options?.addChargeBoxID) {
- evse.chargeBoxId = chargingStation.id;
+ if (options?.addChargeBoxAndOrgIDs) {
+ evse.chargingStationID = chargingStation.id;
evse.siteID = chargingStation.siteID;
evse.siteAreaID = chargingStation.siteAreaID;
evse.companyID = chargingStation.companyID;

MODIFY
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/cpo/CPOLocationsEndpoint.ts
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/cpo/CPOLocationsEndpoint.ts
@@ -48,7 +48,7 @@ export default class CPOLocationsEndpoint extends AbstractEndpoint {
const ocpiClient = await OCPIClientFactory.getOcpiClient(tenant, ocpiEndpoint);
// Define get option
const options: OCPILocationOptions = {
- addChargeBoxID: true,
+ addChargeBoxAndOrgIDs: false,
countryID: ocpiClient.getLocalCountryCode(ServerAction.OCPI_GET_LOCATIONS),
partyID: ocpiClient.getLocalPartyID(ServerAction.OCPI_GET_LOCATIONS)
};

MODIFY
src/types/ocpi/OCPIEvse.ts
src/types/ocpi/OCPIEvse.ts
@@ -12,7 +12,7 @@ export interface OCPIEvse {
longitude: string;
};
last_updated: Date;
- chargeBoxId?: string;
+ chargingStationID?: string;
siteID?: string;
siteAreaID?: string;
companyID?: string;

MODIFY
src/types/ocpi/OCPILocation.ts
src/types/ocpi/OCPILocation.ts
@@ -55,7 +55,7 @@ export enum OCPILocationType {
export interface OCPILocationOptions {
countryID: string;
partyID: string;
- addChargeBoxID?: boolean;
+ addChargeBoxAndOrgIDs?: boolean;
}
export interface OCPILocationReference {

Removed OCPI logo when empty and non standard properties