import { Entity } from '@iqser/common-ui';
import { IDossierState } from './dossier-state';

export class DossierState extends Entity<IDossierState> {
    readonly description: string;
    readonly dossierStatusId: string;
    readonly dossierTemplateId: string;
    readonly name: string;
    readonly color: string;
    readonly rank?: number;
    readonly routerLink = undefined;
    readonly dossierCount: number;

    constructor(dossierState: IDossierState) {
        super(dossierState);
        this.description = dossierState.description;
        this.dossierStatusId = dossierState.dossierStatusId;
        this.dossierTemplateId = dossierState.dossierTemplateId;
        this.name = dossierState.name;
        this.color = dossierState.color;
        this.rank = dossierState.rank;
        this.dossierCount = dossierState.dossierCount || 0;
    }

    get id(): string {
        return this.dossierStatusId;
    }

    get searchKey(): string {
        return this.name;
    }
}
