added ability to revert (#21)

This commit is contained in:
undergroundwires
2020-07-15 19:04:56 +01:00
parent 57028987f1
commit 9c063d59de
58 changed files with 1448 additions and 265 deletions

View File

@@ -1,18 +1,34 @@
import { BaseEntity } from '@/infrastructure/Entity/BaseEntity';
import { IScript } from './../../../src/domain/IScript';
import { IScript } from '@/domain/IScript';
export class ScriptStub extends BaseEntity<string> implements IScript {
public readonly name = `name${this.id}`;
public readonly code = `name${this.id}`;
public name = `name${this.id}`;
public code = `REM code${this.id}`;
public revertCode = `REM revertCode${this.id}`;
public readonly documentationUrls = new Array<string>();
public isRecommended = false;
constructor(public readonly id: string) {
super(id);
}
public canRevert(): boolean {
return Boolean(this.revertCode);
}
public withIsRecommended(value: boolean): ScriptStub {
this.isRecommended = value;
return this;
}
public withCode(value: string): ScriptStub {
this.code = value;
return this;
}
public withName(name: string): ScriptStub {
this.name = name;
return this;
}
public withRevertCode(revertCode: string): ScriptStub {
this.revertCode = revertCode;
return this;
}
}