fase(5): findings module complete
Some checks failed
ABE Exploratory Testing / explore (push) Has been cancelled
Some checks failed
ABE Exploratory Testing / explore (push) Has been cancelled
This commit is contained in:
33
src/modules/findings/domain/value-objects/Evidence.ts
Normal file
33
src/modules/findings/domain/value-objects/Evidence.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { ValueObject } from '../../../../shared/domain/ValueObject';
|
||||
import { IHttpResponse } from '../../../../core/interfaces';
|
||||
|
||||
interface EvidenceProps {
|
||||
screenshotPath?: string;
|
||||
domSnapshotPath?: string;
|
||||
httpLog?: IHttpResponse[];
|
||||
rawErrors?: string[];
|
||||
}
|
||||
|
||||
export class Evidence extends ValueObject<EvidenceProps> {
|
||||
static create(props: EvidenceProps): Evidence {
|
||||
return new Evidence(props);
|
||||
}
|
||||
|
||||
static empty(): Evidence {
|
||||
return new Evidence({});
|
||||
}
|
||||
|
||||
get screenshotPath(): string | undefined { return this.props.screenshotPath; }
|
||||
get domSnapshotPath(): string | undefined { return this.props.domSnapshotPath; }
|
||||
get httpLog(): IHttpResponse[] { return this.props.httpLog ?? []; }
|
||||
get rawErrors(): string[] { return this.props.rawErrors ?? []; }
|
||||
|
||||
toJSON(): EvidenceProps {
|
||||
return {
|
||||
screenshotPath: this.props.screenshotPath,
|
||||
domSnapshotPath: this.props.domSnapshotPath,
|
||||
httpLog: this.props.httpLog,
|
||||
rawErrors: this.props.rawErrors,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user