Remove SAP Concur from sub-module
MODIFY
.gitmodules
.gitmodules
path = src/integration/pricing/convergent-charging
url = ../../sap-labs-france/ev-sap-pricing-convergent-charging.git
branch = master
-[submodule "src/integration/refund/concur"]
- path = src/integration/refund/concur
- url = ../../sap-labs-france/ev-sap-refund-concur.git
- branch = master
[submodule "src/assets/charging-station-templates"]
path = src/assets/charging-station-templates
url = ../../sap-labs-france/ev-sap-charging-station-templates.git

MODIFY
src/integration/refund/RefundFactory.ts
src/integration/refund/RefundFactory.ts
import { RefundSetting, RefundSettingsType } from '../../types/Setting';
+import Tenant, { TenantComponents } from '../../types/Tenant';
-import ConcurRefundIntegration from './export/concur';
-import DummyRefundIntegration from './dummy/DummyRefundIntegration';
import Logging from '../../utils/Logging';
import RefundIntegration from './RefundIntegration';
+import SapConcurRefundIntegration from './sap-concur/SapConcurRefundIntegration';
import { ServerAction } from '../../types/Server';
import SettingStorage from '../../storage/mongodb/SettingStorage';
-import Tenant from '../../types/Tenant';
-import { TenantComponents } from '../../types/Tenant';
import Utils from '../../utils/Utils';
const MODULE_NAME = 'RefundFactory';
export default class RefundFactory {
static async getRefundImpl(tenant: Tenant): Promise<RefundIntegration<RefundSetting>> {
- // Check if refund component is active
+ // Check if Refund component is active
if (Utils.isTenantComponentActive(tenant, TenantComponents.REFUND)) {
const setting = await SettingStorage.getRefundSettings(tenant);
- // Check
if (setting) {
let refundIntegrationImpl = null;
switch (setting.type) {
+ // SAP Concur
case RefundSettingsType.CONCUR:
- refundIntegrationImpl = new ConcurRefundIntegration(tenant, setting[RefundSettingsType.CONCUR]);
+ refundIntegrationImpl = new SapConcurRefundIntegration(tenant, setting[RefundSettingsType.CONCUR]);
break;
}
- // Check if missing implementation
- if (refundIntegrationImpl instanceof DummyRefundIntegration) {
- return null;
- }
- // Return the Refund implementation
return refundIntegrationImpl;
}
await Logging.logDebug({
@@ -40,7 +33,6 @@ export default class RefundFactory {
message: 'Refund settings are not configured'
});
}
- // Refund is not active
return null;
}
}

DELETE
src/integration/refund/concur
-Subproject commit 0efb7d5ebb4d5fa021fe675b47744c7c23fb79ba

DELETE
src/integration/refund/dummy/DummyRefundIntegration.ts
-/* eslint-disable @typescript-eslint/no-unused-vars */
-import Connection from '../../../types/Connection';
-import RefundIntegration from '../RefundIntegration';
-import { RefundSetting } from '../../../types/Setting';
-import { RefundStatus } from '../../../types/Refund';
-import Tenant from '../../../types/Tenant';
-import Transaction from '../../../types/Transaction';
-
-export default class DummyRefundIntegration extends RefundIntegration<RefundSetting> {
- constructor(tenant: Tenant, setting: RefundSetting) {
- super(tenant, setting);
- }
-
- public async refund(userID: string, transactions: Transaction[]): Promise<Transaction[]> {
- return null;
- }
-
- public canBeDeleted(transaction: Transaction): boolean {
- return false;
- }
-
- public async updateRefundStatus(tenant: Tenant, transaction: Transaction): Promise<RefundStatus> {
- return null;
- }
-
- public async createConnection(userID: string, data: unknown): Promise<Connection> {
- return null;
- }
-
- public async checkConnection(userID: string): Promise<void> {
- }
-}

DELETE
src/integration/refund/export/concur/.gitkeep
src/integration/refund/export/concur/.gitkeep
Remove SAP Concur from sub-module