import { Entity } from '@iqser/common-ui';
import { IViewedPage } from '.';

export class ViewedPage extends Entity<IViewedPage, number> {
    readonly fileId: string;
    readonly page: number;
    readonly userId?: string;
    readonly viewedTime?: string;

    override readonly routerLink = undefined;
    override readonly searchKey = '';

    constructor(viewedPage: IViewedPage) {
        super(viewedPage);
        this.fileId = viewedPage.fileId;
        this.page = viewedPage.page;
        this.userId = viewedPage.userId;
        this.viewedTime = viewedPage.viewedTime;
    }

    override get id() {
        return this.page;
    }
}
