Files
medusa-store/packages/medusa-interfaces/src/notification-service.js
Sebastian Rindom 7308946e56 feat: notifications (#172)
The Notifications API allows plugins to register Notification Providers which have `sendNotification` and `resendNotification`.

Each plugin can listen to any events transmittet over the event bus and the result of the notification send will be persisted in the database to allow for clear communications timeline + ability to resend notifications.
2021-02-15 11:59:37 +01:00

29 lines
559 B
JavaScript

import BaseService from "./base-service"
/**
* Interface for Notification Providers
* @interface
*/
class BaseNotificationService extends BaseService {
constructor() {
super()
}
getIdentifier() {
return this.constructor.identifier
}
/**
* Used to retrieve documents related to a shipment.
*/
sendNotification(event, data) {
throw new Error("Must be overridden by child")
}
resendNotification(notification, config = {}) {
throw new Error("Must be overridden by child")
}
}
export default BaseNotificationService