Added OICP admin notification setting
MODIFY
docker/initdb/002_createSuperAdmin.js
docker/initdb/002_createSuperAdmin.js
@@ -42,6 +42,7 @@ db.getCollection('default.users').insert({
sendChargingStationStatusError: false,
sendChargingStationRegistered: false,
sendOcpiPatchStatusError: false,
+ sendOicpPatchStatusError: false,
sendSmtpAuthError: false,
sendOfflineChargingStations: false
},

MODIFY
docker/initdb/003_createSlfAdmin.js
docker/initdb/003_createSlfAdmin.js
@@ -42,6 +42,7 @@ db.getCollection('5c866e81a2d9593de43efdb4.users').insert({
sendChargingStationStatusError: false,
sendChargingStationRegistered: false,
sendOcpiPatchStatusError: false,
+ sendOicpPatchStatusError: false,
sendSmtpAuthError: false,
sendOfflineChargingStations: false
},

MODIFY
src/migration/tasks/AddNotificationsFlagsToUsersTask.ts
src/migration/tasks/AddNotificationsFlagsToUsersTask.ts
@@ -62,6 +62,7 @@ export default class AddNotificationsFlagsToUsersTask extends MigrationTask {
sendChargingStationStatusError: user.notifications?.sendChargingStationStatusError ? user.notifications.sendChargingStationStatusError : false,
sendChargingStationRegistered: user.notifications?.sendChargingStationRegistered ? user.notifications.sendChargingStationRegistered : false,
sendOcpiPatchStatusError: user.notifications?.sendOcpiPatchStatusError ? user.notifications.sendOcpiPatchStatusError : false,
+ sendOicpPatchStatusError: user.notifications?.sendOicpPatchStatusError ? user.notifications.sendOicpPatchStatusError : false,
sendSmtpAuthError: user.notifications?.sendSmtpAuthError ? user.notifications.sendSmtpAuthError : false,
sendOfflineChargingStations: user.notifications?.sendOfflineChargingStations ? user.notifications.sendOfflineChargingStations : false,
sendBillingSynchronizationFailed: user.notifications?.sendBillingSynchronizationFailed ? user.notifications.sendBillingSynchronizationFailed : false,

MODIFY
src/notification/NotificationHandler.ts
src/notification/NotificationHandler.ts
@@ -651,7 +651,7 @@ export default class NotificationHandler {
// Get the Tenant
const tenant = await TenantStorage.getTenant(tenantID);
// Enrich with admins
- const adminUsers = await NotificationHandler.getAdminUsers(tenantID, 'sendOicpPatchEvseError');
+ const adminUsers = await NotificationHandler.getAdminUsers(tenantID, 'sendOicpPatchStatusError');
if (adminUsers && adminUsers.length > 0) {
// For each Sources
for (const notificationSource of NotificationHandler.notificationSources) {

MODIFY
src/server/rest/v1/service/security/UserSecurity.ts
src/server/rest/v1/service/security/UserSecurity.ts
@@ -114,6 +114,7 @@ export default class UserSecurity {
sendChargingStationStatusError: false,
sendChargingStationRegistered: false,
sendOcpiPatchStatusError: false,
+ sendOicpPatchStatusError: false,
sendSmtpAuthError: false,
sendOfflineChargingStations: false,
sendEndUserErrorNotification: false,
@@ -129,6 +130,7 @@ export default class UserSecurity {
sendChargingStationStatusError: notifications ? UtilsSecurity.filterBoolean(notifications.sendChargingStationStatusError) : false,
sendChargingStationRegistered: notifications ? UtilsSecurity.filterBoolean(notifications.sendChargingStationRegistered) : false,
sendOcpiPatchStatusError: notifications ? UtilsSecurity.filterBoolean(notifications.sendOcpiPatchStatusError) : false,
+ sendOicpPatchStatusError: notifications ? UtilsSecurity.filterBoolean(notifications.sendOicpPatchStatusError) : false,
sendSmtpAuthError: notifications ? UtilsSecurity.filterBoolean(notifications.sendSmtpAuthError) : false,
sendOfflineChargingStations: notifications ? UtilsSecurity.filterBoolean(notifications.sendOfflineChargingStations) : false,
sendEndUserErrorNotification: notifications ? UtilsSecurity.filterBoolean(notifications.sendEndUserErrorNotification) : false,

MODIFY
src/storage/mongodb/UserStorage.ts
src/storage/mongodb/UserStorage.ts
@@ -252,6 +252,7 @@ export default class UserStorage {
sendChargingStationStatusError: userToSave.notifications ? Utils.convertToBoolean(userToSave.notifications.sendChargingStationStatusError) : false,
sendChargingStationRegistered: userToSave.notifications ? Utils.convertToBoolean(userToSave.notifications.sendChargingStationRegistered) : false,
sendOcpiPatchStatusError: userToSave.notifications ? Utils.convertToBoolean(userToSave.notifications.sendOcpiPatchStatusError) : false,
+ sendOicpPatchStatusError: userToSave.notifications ? Utils.convertToBoolean(userToSave.notifications.sendOicpPatchStatusError) : false,
sendSmtpAuthError: userToSave.notifications ? Utils.convertToBoolean(userToSave.notifications.sendSmtpAuthError) : false,
sendUserAccountInactivity: userToSave.notifications ? Utils.convertToBoolean(userToSave.notifications.sendUserAccountInactivity) : false,
sendPreparingSessionNotStarted: userToSave.notifications ? Utils.convertToBoolean(userToSave.notifications.sendPreparingSessionNotStarted) : false,
@@ -909,6 +910,7 @@ export default class UserStorage {
sendChargingStationStatusError: false,
sendChargingStationRegistered: false,
sendOcpiPatchStatusError: false,
+ sendOicpPatchStatusError: false,
sendSmtpAuthError: false,
sendUserAccountInactivity: false,
sendPreparingSessionNotStarted: false,

MODIFY
src/types/UserNotifications.ts
src/types/UserNotifications.ts
@@ -13,6 +13,7 @@ export default interface UserNotifications {
sendChargingStationStatusError: boolean;
sendChargingStationRegistered: boolean;
sendOcpiPatchStatusError: boolean;
+ sendOicpPatchStatusError: boolean;
sendSmtpAuthError: boolean;
sendUserAccountInactivity: boolean;
sendPreparingSessionNotStarted: boolean;
@@ -36,7 +37,6 @@ export type UserNotificationKeys =
'sendChargingStationRegistered' |
'sendOcpiPatchStatusError' |
'sendOicpPatchStatusError' |
- 'sendOicpPatchEvseError' |
'sendSmtpAuthError' |
'sendUserAccountInactivity' |
'sendPreparingSessionNotStarted' |

MODIFY
test/factories/UserFactory.ts
test/factories/UserFactory.ts
@@ -24,6 +24,7 @@ const userFactory = Factory.define('user')
sendChargingStationStatusError: false,
sendChargingStationRegistered: false,
sendOcpiPatchStatusError: false,
+ sendOicpPatchStatusError: false,
sendSmtpAuthError: false,
sendUserAccountInactivity: false,
sendPreparingSessionNotStarted: false,

Added OICP admin notification setting