refactor folders to move "/state" (IApplicationState) inside "/context" (IApplicationContext)
This commit is contained in:
14
src/application/Context/State/Selection/SelectedScript.ts
Normal file
14
src/application/Context/State/Selection/SelectedScript.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { BaseEntity } from '@/infrastructure/Entity/BaseEntity';
|
||||
import { IScript } from '@/domain/IScript';
|
||||
|
||||
export class SelectedScript extends BaseEntity<string> {
|
||||
constructor(
|
||||
public readonly script: IScript,
|
||||
public readonly revert: boolean,
|
||||
) {
|
||||
super(script.id);
|
||||
if (revert && !script.canRevert()) {
|
||||
throw new Error('cannot revert an irreversible script');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user