feature change type to boolean
MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
-import { ActionsResponse, KeyValue } from '../../../types/GlobalType';
-import { ChargingProfile, ChargingProfilePurposeType } from '../../../types/ChargingProfile';
-import ChargingStation, { ChargingStationCapabilities, ChargingStationOcppParameters, ChargingStationTemplate, ConnectorCurrentLimitSource, CurrentType, OcppParameter, SiteAreaLimitSource, TemplateUpdateResult } from '../../../types/ChargingStation';
-import { OCPPChangeConfigurationCommandParam, OCPPChangeConfigurationCommandResult, OCPPChargingProfileStatus, OCPPConfigurationStatus, OCPPGetConfigurationCommandParam, OCPPGetConfigurationCommandResult, OCPPTypeConfigurationParam, OCPPTypeConfigurationResult } from '../../../types/ocpp/OCPPClient';
-import { OCPPMeasurand, OCPPNormalizedMeterValue, OCPPPhase, OCPPReadingContext, OCPPStopTransactionRequestExtended, OCPPUnitOfMeasure } from '../../../types/ocpp/OCPPServer';
-import Transaction, { InactivityStatus, TransactionAction, TransactionStop } from '../../../types/Transaction';
+import moment from 'moment';
+import ChargingStationClientFactory from '../../../client/ocpp/ChargingStationClientFactory';
import BackendError from '../../../exception/BackendError';
-import { BillingDataTransactionStop } from '../../../types/Billing';
import BillingFactory from '../../../integration/billing/BillingFactory';
-import ChargingStationClientFactory from '../../../client/ocpp/ChargingStationClientFactory';
-import ChargingStationStorage from '../../../storage/mongodb/ChargingStationStorage';
import ChargingStationVendorFactory from '../../../integration/charging-station-vendor/ChargingStationVendorFactory';
-import Constants from '../../../utils/Constants';
-import Consumption from '../../../types/Consumption';
+import PricingFactory from '../../../integration/pricing/PricingFactory';
+import ChargingStationStorage from '../../../storage/mongodb/ChargingStationStorage';
import ConsumptionStorage from '../../../storage/mongodb/ConsumptionStorage';
-import Logging from '../../../utils/Logging';
import OCPPStorage from '../../../storage/mongodb/OCPPStorage';
+import SiteAreaStorage from '../../../storage/mongodb/SiteAreaStorage';
+import TenantStorage from '../../../storage/mongodb/TenantStorage';
+import TransactionStorage from '../../../storage/mongodb/TransactionStorage';
+import { BillingDataTransactionStop } from '../../../types/Billing';
+import { ChargingProfile, ChargingProfilePurposeType } from '../../../types/ChargingProfile';
+import ChargingStation, { ChargingStationCapabilities, ChargingStationOcppParameters, ChargingStationTemplate, ConnectorCurrentLimitSource, CurrentType, OcppParameter, SiteAreaLimitSource, TemplateUpdateResult } from '../../../types/ChargingStation';
+import Consumption from '../../../types/Consumption';
+import { ActionsResponse, KeyValue } from '../../../types/GlobalType';
+import { OCPPChangeConfigurationCommandParam, OCPPChangeConfigurationCommandResult, OCPPChargingProfileStatus, OCPPConfigurationStatus, OCPPCustomConfigurationParam, OCPPGetConfigurationCommandParam, OCPPGetConfigurationCommandResult, OCPPTypeConfigurationResult } from '../../../types/ocpp/OCPPClient';
+import { OCPPMeasurand, OCPPNormalizedMeterValue, OCPPPhase, OCPPReadingContext, OCPPStopTransactionRequestExtended, OCPPUnitOfMeasure } from '../../../types/ocpp/OCPPServer';
import { PricedConsumption } from '../../../types/Pricing';
-import PricingFactory from '../../../integration/pricing/PricingFactory';
-import { PricingSettingsType } from '../../../types/Setting';
import { ServerAction } from '../../../types/Server';
+import { PricingSettingsType } from '../../../types/Setting';
import SiteArea from '../../../types/SiteArea';
-import SiteAreaStorage from '../../../storage/mongodb/SiteAreaStorage';
import Tenant from '../../../types/Tenant';
import TenantComponents from '../../../types/TenantComponents';
-import TenantStorage from '../../../storage/mongodb/TenantStorage';
-import TransactionStorage from '../../../storage/mongodb/TransactionStorage';
+import Transaction, { InactivityStatus, TransactionAction, TransactionStop } from '../../../types/Transaction';
import User from '../../../types/User';
import UserToken from '../../../types/UserToken';
+import Constants from '../../../utils/Constants';
+import Logging from '../../../utils/Logging';
import Utils from '../../../utils/Utils';
-import moment from 'moment';
const MODULE_NAME = 'OCPPUtils';
@@ -1331,7 +1331,7 @@ export default class OCPPUtils {
}
public static async requestAndSaveChargingStationOcppParameters(tenantID: string,
- chargingStation: ChargingStation, forceUpdateOcppParametersWithTemplate = false, typedParameter?: OCPPTypeConfigurationParam): Promise<OCPPChangeConfigurationCommandResult> {
+ chargingStation: ChargingStation, forceUpdateOcppParametersWithTemplate = false, typedParameter?: OCPPCustomConfigurationParam): Promise<OCPPChangeConfigurationCommandResult> {
try {
// Get the OCPP Client
const chargingStationClient = await ChargingStationClientFactory.getChargingStationClient(tenantID, chargingStation);

MODIFY
src/server/rest/service/ChargingStationService.ts
src/server/rest/service/ChargingStationService.ts
-import { Action, Entity } from '../../../types/Authorization';
-import ChargingStation, { Command, OCPPParams, StaticLimitAmps } from '../../../types/ChargingStation';
-import { HTTPAuthError, HTTPError } from '../../../types/HTTPError';
+import fs from 'fs';
+
import { NextFunction, Request, Response } from 'express';
-import { OCPPConfigurationStatus, OCPPGetCompositeScheduleCommandResult, OCPPStatus } from '../../../types/ocpp/OCPPClient';
+import Authorizations from '../../../authorization/Authorizations';
+import CpoOCPIClient from '../../../client/ocpi/CpoOCPIClient';
+import OCPIClientFactory from '../../../client/ocpi/OCPIClientFactory';
+import ChargingStationClientFactory from '../../../client/ocpp/ChargingStationClientFactory';
import AppAuthError from '../../../exception/AppAuthError';
import AppError from '../../../exception/AppError';
-import Authorizations from '../../../authorization/Authorizations';
import BackendError from '../../../exception/BackendError';
-import { ChargingProfile } from '../../../types/ChargingProfile';
-import ChargingStationClientFactory from '../../../client/ocpp/ChargingStationClientFactory';
-import { ChargingStationInErrorType } from '../../../types/InError';
-import ChargingStationSecurity from './security/ChargingStationSecurity';
-import ChargingStationStorage from '../../../storage/mongodb/ChargingStationStorage';
import ChargingStationVendorFactory from '../../../integration/charging-station-vendor/ChargingStationVendorFactory';
-import Constants from '../../../utils/Constants';
-import CpoOCPIClient from '../../../client/ocpi/CpoOCPIClient';
-import { DataResult } from '../../../types/DataResult';
-import { HttpChargingStationCommandRequest } from '../../../types/requests/HttpChargingStationRequest';
-import I18nManager from '../../../utils/I18nManager';
+import SmartChargingFactory from '../../../integration/smart-charging/SmartChargingFactory';
import LockingHelper from '../../../locking/LockingHelper';
import LockingManager from '../../../locking/LockingManager';
-import Logging from '../../../utils/Logging';
-import OCPIClientFactory from '../../../client/ocpi/OCPIClientFactory';
-import { OCPIRole } from '../../../types/ocpi/OCPIRole';
+import ChargingStationStorage from '../../../storage/mongodb/ChargingStationStorage';
import OCPPStorage from '../../../storage/mongodb/OCPPStorage';
-import OCPPUtils from '../../ocpp/utils/OCPPUtils';
-import { ServerAction } from '../../../types/Server';
-import SiteArea from '../../../types/SiteArea';
import SiteAreaStorage from '../../../storage/mongodb/SiteAreaStorage';
import SiteStorage from '../../../storage/mongodb/SiteStorage';
-import SmartChargingFactory from '../../../integration/smart-charging/SmartChargingFactory';
-import TenantComponents from '../../../types/TenantComponents';
import TenantStorage from '../../../storage/mongodb/TenantStorage';
import TransactionStorage from '../../../storage/mongodb/TransactionStorage';
+import { Action, Entity } from '../../../types/Authorization';
+import { ChargingProfile } from '../../../types/ChargingProfile';
+import ChargingStation, { Command, OCPPParams, StaticLimitAmps } from '../../../types/ChargingStation';
+import { DataResult } from '../../../types/DataResult';
+import { HTTPAuthError, HTTPError } from '../../../types/HTTPError';
+import { ChargingStationInErrorType } from '../../../types/InError';
+import { OCPIRole } from '../../../types/ocpi/OCPIRole';
+import { OCPPConfigurationStatus, OCPPGetCompositeScheduleCommandResult, OCPPStatus } from '../../../types/ocpp/OCPPClient';
+import { HttpChargingStationCommandRequest } from '../../../types/requests/HttpChargingStationRequest';
+import { ServerAction } from '../../../types/Server';
+import SiteArea from '../../../types/SiteArea';
+import TenantComponents from '../../../types/TenantComponents';
import UserToken from '../../../types/UserToken';
+import Constants from '../../../utils/Constants';
+import I18nManager from '../../../utils/I18nManager';
+import Logging from '../../../utils/Logging';
import Utils from '../../../utils/Utils';
+import OCPPUtils from '../../ocpp/utils/OCPPUtils';
+import ChargingStationSecurity from './security/ChargingStationSecurity';
import UtilsService from './UtilsService';
-import fs from 'fs';
const MODULE_NAME = 'ChargingStationService';
@@ -1284,7 +1285,7 @@ export default class ChargingStationService {
await OCPPUtils.requestAndSaveChargingStationOcppParameters(tenantID, chargingStation, false, {
key: params.key,
value: params.value,
- type: params.type
+ isCustom: params.isCustom
});
} else {
await OCPPUtils.requestAndSaveChargingStationOcppParameters(tenantID, chargingStation);

MODIFY
src/types/ocpp/OCPPClient.ts
src/types/ocpp/OCPPClient.ts
import { ChargingProfile, ChargingRateUnitType, ChargingSchedule, Profile } from '../../types/ChargingProfile';
-
import { OcppParameter } from '../ChargingStation';
// eslint-disable-next-line @typescript-eslint/no-empty-interface
@@ -29,7 +28,7 @@ export enum OCPPResetType {
SOFT = 'Soft'
}
-export enum OCPPTypeStatus {
+export enum OCPPCustomStatus {
ACCEPTED = 'Accepted',
REJECTED = 'Rejected'
}
@@ -61,14 +60,14 @@ export interface OCPPChangeConfigurationCommandResult {
status: OCPPConfigurationStatus;
}
-export interface OCPPTypeConfigurationParam extends OCPPCommandParam {
+export interface OCPPCustomConfigurationParam extends OCPPCommandParam {
key: string;
value: string;
- type: string;
+ isCustom: boolean;
}
-export interface OCPPTypeConfigurationResult {
- status: OCPPTypeStatus;
+export interface OCPPCustomConfigurationResult {
+ status: OCPPCustomStatus;
}
export enum OCPPConfigurationStatus {

feature change type to boolean