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) {
        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;
    }
}
