Deleted unused methods
MODIFY
src/client/oicp/CpoOICPClient.ts
src/client/oicp/CpoOICPClient.ts
@@ -864,114 +864,6 @@ export default class CpoOICPClient extends OICPClient {
return pushCdrResponse;
}
- /**
- * Push EVSE Pricing
- */
- public async pushEvsePricing(evsePricing: OICPEVSEPricing[], actionType: OICPActionType): Promise<OICPAcknowledgment> {
- let pushEvsePricingResponse: OICPAcknowledgment = {} as OICPAcknowledgment;
- let requestError: any;
- // Check for input parameter
- if (!evsePricing) {
- throw new BackendError({
- action: ServerAction.OICP_PUSH_EVSE_PRICING,
- message: 'Invalid parameters',
- module: MODULE_NAME, method: 'pushEvsePricing',
- });
- }
- // Get pricing endpoint url
- const fullUrl = this.getEndpointUrl('pricing', ServerAction.OICP_PUSH_EVSE_PRICING);
- // Build payload
- const payload: OICPPushEVSEPricingCpoSend = {} as OICPPushEVSEPricingCpoSend;
- payload.ActionType = actionType;
- payload.EVSEPricing = evsePricing;
- // Log
- Logging.logDebug({
- tenantID: this.tenant.id,
- action: ServerAction.OICP_PUSH_EVSE_PRICING,
- message: `Push EVSE pricing from tenant: ${this.tenant.id}`,
- module: MODULE_NAME, method: 'pushEvsePricing',
- detailedMessages: { payload }
- });
- // Call Hubject
- try {
- const response = await this.axiosInstance.post(fullUrl, payload);
- console.log('Success! pushEvsePricing: ', response); // Will be removed
- pushEvsePricingResponse = response.data as OICPAcknowledgment;
- } catch (error) {
- console.log('Error! pushEvsePricing: ', error.response); // Will be removed
- pushEvsePricingResponse = error.response?.data as OICPAcknowledgment;
- requestError = error;
- }
- if (!pushEvsePricingResponse?.Result || pushEvsePricingResponse?.Result !== true) {
- throw new BackendError({
- action: ServerAction.OICP_PUSH_EVSE_PRICING,
- message: `'pushEvsePricing' Error: '${pushEvsePricingResponse?.StatusCode?.AdditionalInfo ? pushEvsePricingResponse?.StatusCode?.AdditionalInfo : pushEvsePricingResponse?.StatusCode?.Description}' '${String(requestError?.message)}`,
- module: MODULE_NAME, method: 'pushEvsePricing',
- detailedMessages: {
- response: pushEvsePricingResponse,
- error: requestError?.message,
- stack: requestError?.stack,
- payload: payload
- }
- });
- }
- return pushEvsePricingResponse;
- }
-
- /**
- * Push Pricing Product Data
- */
- public async pushPricingProductData(pricingProductData: OICPPricingProductData, actionType: OICPActionType): Promise<OICPAcknowledgment> {
- let pushPricingProductDataResponse: OICPAcknowledgment = {} as OICPAcknowledgment;
- let requestError: any;
- // Check for input parameter
- if (!pricingProductData) {
- throw new BackendError({
- action: ServerAction.OICP_PUSH_PRICING_PRODUCT_DATA,
- message: 'Invalid parameters',
- module: MODULE_NAME, method: 'pushPricingProductData',
- });
- }
- // Get pricing product endpoint url
- const fullUrl = this.getEndpointUrl('pricingProducts', ServerAction.OICP_PUSH_PRICING_PRODUCT_DATA);
- // Build payload
- const payload: OICPPushPricingProductDataCpoSend = {} as OICPPushPricingProductDataCpoSend;
- payload.ActionType = actionType;
- payload.PricingProductData = pricingProductData;
- // Log
- Logging.logDebug({
- tenantID: this.tenant.id,
- action: ServerAction.OICP_PUSH_PRICING_PRODUCT_DATA,
- message: `Push pricing product data from tenant: ${this.tenant.id}`,
- module: MODULE_NAME, method: 'pushPricingProductData',
- detailedMessages: { payload }
- });
- // Call Hubject
- try {
- const response = await this.axiosInstance.post(fullUrl, payload);
- console.log('Success! pushPricingProductData: ', response); // Will be removed
- pushPricingProductDataResponse = response.data as OICPAcknowledgment;
- } catch (error) {
- console.log('Error! pushPricingProductData: ', error.response); // Will be removed
- pushPricingProductDataResponse = error.response?.data as OICPAcknowledgment;
- requestError = error;
- }
- if (!pushPricingProductDataResponse?.Result || pushPricingProductDataResponse?.Result !== true) {
- throw new BackendError({
- action: ServerAction.OICP_PUSH_PRICING_PRODUCT_DATA,
- message: `'pushPricingProductData' Error: '${pushPricingProductDataResponse?.StatusCode?.AdditionalInfo ? pushPricingProductDataResponse?.StatusCode?.AdditionalInfo : pushPricingProductDataResponse?.StatusCode?.Description}' '${String(requestError?.message)}`,
- module: MODULE_NAME, method: 'pushPricingProductData',
- detailedMessages: {
- response: pushPricingProductDataResponse,
- error: requestError?.message,
- stack: requestError?.stack,
- payload: payload
- }
- });
- }
- return pushPricingProductDataResponse;
- }
-
/**
* Send Charging Notification Start
*/

MODIFY
src/client/oicp/OICPClient.ts
src/client/oicp/OICPClient.ts
@@ -137,40 +137,6 @@ export default abstract class OICPClient {
});
}
- private getPrivateKeyFromConfig(action: ServerAction): Buffer {
- if (!this.settings[this.role]) {
- throw new BackendError({
- action, message: `OICP Settings are missing for role ${this.role}`,
- module: MODULE_NAME, method: 'getPrivateKey',
- });
- }
- const key = fs.readFileSync(this.oicpConfig['ssl-key']);
- if (!key) {
- throw new BackendError({
- action, message: `OICP private Key setting is missing for role ${this.role}`,
- module: MODULE_NAME, method: 'getPrivateKey',
- });
- }
- return key;
- }
-
- private getClientCertificateFromConfig(action: ServerAction): Buffer {
- if (!this.settings[this.role]) {
- throw new BackendError({
- action, message: `OICP Settings are missing for role ${this.role}`,
- module: MODULE_NAME, method: 'getClientCertificate',
- });
- }
- const cert = fs.readFileSync(this.oicpConfig['ssl-cert']);
- if (!cert) {
- throw new BackendError({
- action, message: `OICP client certificate setting is missing for role ${this.role}`,
- module: MODULE_NAME, method: 'getClientCertificate',
- });
- }
- return cert;
- }
-
private getPrivateKeyFromDB(action: ServerAction): string {
if (!this.settings[this.role]) {
throw new BackendError({

Deleted unused methods