MalwareMultiScan/MalwareMultiScan.Ui/models/scan-result-entry-flattened.ts
2020-11-01 22:25:48 +02:00

32 lines
750 B
TypeScript

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