]>
Commit | Line | Data |
---|---|---|
d26836cd C |
1 | import { MUserWithNotificationSetting, UserNotificationModelForApi } from '@server/types/models' |
2 | import { EmailPayload, UserNotificationSettingValue } from '@shared/models' | |
3 | ||
4 | export abstract class AbstractNotification <T, U = MUserWithNotificationSetting> { | |
5 | ||
6 | constructor (protected readonly payload: T) { | |
7 | ||
8 | } | |
9 | ||
10 | abstract prepare (): Promise<void> | |
11 | abstract log (): void | |
12 | ||
13 | abstract getSetting (user: U): UserNotificationSettingValue | |
14 | abstract getTargetUsers (): U[] | |
15 | ||
785f1897 | 16 | abstract createNotification (user: U): UserNotificationModelForApi |
d26836cd C |
17 | abstract createEmail (to: string): EmailPayload | Promise<EmailPayload> |
18 | ||
19 | isDisabled (): boolean | Promise<boolean> { | |
20 | return false | |
21 | } | |
22 | ||
23 | } |