2020-10-27 19:26:16 +02:00
|
|
|
import ScanResultEntry from '~/models/scan-result-entry';
|
2020-11-01 22:25:48 +02:00
|
|
|
import {ScanResultStatus} from '~/models/scan-result-status';
|
2020-10-27 19:26:16 +02:00
|
|
|
|
|
|
|
export default class ScanResultEntryFlattened implements ScanResultEntry {
|
|
|
|
readonly id: string;
|
2020-11-01 22:25:48 +02:00
|
|
|
readonly status: ScanResultStatus;
|
2020-10-27 21:40:34 +02:00
|
|
|
readonly duration: number;
|
2020-10-27 19:26:16 +02:00
|
|
|
readonly threats: string[];
|
|
|
|
|
2020-11-01 22:25:48 +02:00
|
|
|
constructor(id: string, status: ScanResultStatus, duration: number, threats: string[]) {
|
2020-10-27 19:26:16 +02:00
|
|
|
this.id = id;
|
2020-11-01 22:25:48 +02:00
|
|
|
this.status = status;
|
2020-10-27 21:40:34 +02:00
|
|
|
this.duration = duration;
|
2020-10-27 19:26:16 +02:00
|
|
|
this.threats = threats;
|
|
|
|
}
|
2020-10-27 21:40:34 +02:00
|
|
|
|
2020-11-01 22:25:48 +02:00
|
|
|
get completed()
|
|
|
|
{
|
|
|
|
return this.status != ScanResultStatus.Queued
|
|
|
|
}
|
|
|
|
|
|
|
|
get succeeded()
|
|
|
|
{
|
|
|
|
return this.status === ScanResultStatus.Succeeded;
|
|
|
|
}
|
2020-10-27 21:40:34 +02:00
|
|
|
|
2020-11-01 22:25:48 +02:00
|
|
|
get failed()
|
|
|
|
{
|
|
|
|
return this.status === ScanResultStatus.Failed;
|
|
|
|
}
|
2020-10-27 19:26:16 +02:00
|
|
|
}
|