import ScanResultEntry from '~/models/scan-result-entry'; import {ScanResultStatus} from '~/models/scan-result-status'; export default class ScanResultEntryFlattened implements ScanResultEntry { readonly id: string; readonly status: ScanResultStatus; readonly duration: number; readonly threats: string[]; constructor(id: string, status: ScanResultStatus, duration: number, threats: string[]) { this.id = id; this.status = status; this.duration = duration; this.threats = threats; } get completed() { return this.status != ScanResultStatus.Queued } get succeeded() { return this.status === ScanResultStatus.Succeeded; } get failed() { return this.status === ScanResultStatus.Failed; } }