implemented push notification
MODIFY
src/assets/i18n/de.json
src/assets/i18n/de.json
"billingInvoiceSynchronizationFailed": {
"title": "Invoice Synchro Failed",
"body": "Unable to synchronize {{nbrInvoicesInError}} invoice(s) with the billing service provider in organization '{{tenantName}}'"
+ },
+ "endUserErrorNotification": {
+ "title": "Ein Nutzer hat einen Fehler gemeldet",
+ "body": "Der Nutzer '{{userName}}' hat foglenden Fehler: '{{errorTitle}}' mit der Beschreibung: '{{errorDescription}}' in Organisaion {{tenantName}} gemeldet"
}
},
"billing": {

MODIFY
src/assets/i18n/en.json
src/assets/i18n/en.json
"billingInvoiceSynchronizationFailed": {
"title": "Invoice Synchro Failed",
"body": "Unable to synchronize {{nbrInvoicesInError}} invoice(s) with the billing service provider in organization '{{tenantName}}'"
+ },
+ "endUserErrorNotification": {
+ "title": "A User reported an error",
+ "body": "The user '{{userName}}' reported the following error: '{{errorTitle}}' with the description: '{{errorDescription}}' in organization {{tenantName}}"
}
},
"billing": {

MODIFY
src/assets/i18n/es.json
src/assets/i18n/es.json
"billingInvoiceSynchronizationFailed": {
"title": "Invoice Synchro Failed",
"body": "Unable to synchronize {{nbrInvoicesInError}} invoice(s) with the billing service provider in organization '{{tenantName}}'"
+ },
+ "endUserErrorNotification": {
+ "title": "A User reported an error",
+ "body": "The user '{{userName}}' reported the following error: '{{errorTitle}}' with the description: '{{errorDescription}}' in organization {{tenantName}}"
}
},
"billing": {

MODIFY
src/assets/i18n/fr.json
src/assets/i18n/fr.json
"billingInvoiceSynchronizationFailed": {
"title": "Synchro Factures",
"body": "Impossible de synchronizer {{nbrInvoicesInError}} facture(s) avec le service de facturation dans l'organisation '{{tenantName}}'"
+ },
+ "endUserErrorNotification": {
+ "title": "A User reported an error",
+ "body": "The user '{{userName}}' reported the following error: '{{errorTitle}}' with the description: '{{errorDescription}}' in organization {{tenantName}}"
}
},
"billing": {

MODIFY
src/notification/remote-push-notification/RemotePushNotificationTask.ts
src/notification/remote-push-notification/RemotePushNotificationTask.ts
@@ -174,8 +174,16 @@ export default class RemotePushNotificationTask implements NotificationTask {
}
public async sendEndUserErrorNotification(data: EndUserErrorNotification, user: User, tenant: Tenant, severity: NotificationSeverity): Promise<void> {
- // Nothing to send
- return Promise.resolve();
+ // Set the locale
+ const i18nManager = new I18nManager(user.locale);
+ // Get Message Text
+ const title = i18nManager.translate('notifications.endUserErrorNotification.title');
+ const body = i18nManager.translate('notifications.endUserErrorNotification.body',
+ { userName: data.name, errorTitle: data.errorTitle, errorDescription: data.errorDescription ,tenantName: tenant.name });
+ // Send Notification
+ return this.sendRemotePushNotificationToUser(tenant, UserNotificationType.END_USER_ERROR_NOTIFICATION, title, body, user, null,
+ severity
+ );
}
public async sendChargingStationStatusError(data: ChargingStationStatusErrorNotification, user: User, tenant: Tenant, severity: NotificationSeverity): Promise<void> {

MODIFY
src/types/UserNotifications.ts
src/types/UserNotifications.ts
@@ -59,7 +59,8 @@ export enum UserNotificationType {
BILLING_USER_SYNCHRONIZATION_FAILED = 'BillingUserSynchronizationFailed',
BILLING_INVOICE_SYNCHRONIZATION_FAILED = 'BillingInvoiceSynchronizationFailed',
CAR_CATALOG_SYNCHRONIZATION_FAILED = 'CarCatalogSynchronizationFailed',
- SESSION_NOT_STARTED_AFTER_AUTHORIZE = 'SessionNotStartedAfterAuthorize'
+ SESSION_NOT_STARTED_AFTER_AUTHORIZE = 'SessionNotStartedAfterAuthorize',
+ END_USER_ERROR_NOTIFICATION = 'EndUserErrorNotification'
}
export enum NotificationSeverity {
@@ -251,12 +252,11 @@ export interface SessionNotStartedNotification extends BaseNotification {
}
export interface EndUserErrorNotification extends BaseNotification {
- email: string,
- name: string,
- errorTitle: string,
- errorDescription: string,
- phone: string,
+ email: string;
+ name: string;
+ errorTitle: string;
+ errorDescription: string;
+ phone: string;
evseDashboardURL: string;
}
-

implemented push notification