red-ui/libs/red-domain/src/lib/notifications/notification.model.ts
2021-10-29 12:58:18 +03:00

34 lines
1.2 KiB
TypeScript

import { IListable } from '@iqser/common-ui';
import { INotification } from './notification';
import { INotificationTarget } from './notification-target';
export class Notification implements INotification, IListable {
readonly creationDate: string;
readonly issuerId?: string;
readonly notificationDetails?: string;
readonly notificationType: string;
readonly readDate?: string;
readonly seenDate?: string;
readonly softDeleted?: string;
readonly target: INotificationTarget;
readonly userId: string;
readonly id: string;
constructor(notification: INotification, readonly message: string, readonly time: string) {
this.creationDate = notification.creationDate;
this.issuerId = notification.issuerId;
this.notificationDetails = notification.notificationDetails;
this.notificationType = notification.notificationType;
this.seenDate = notification.seenDate;
this.readDate = notification.readDate;
this.softDeleted = notification.softDeleted;
this.target = notification.target;
this.userId = notification.userId;
this.id = notification.id;
}
get searchKey(): string {
return this.id;
}
}