2024-10-30 15:55:25 +00:00
|
|
|
import { UpdateProcess } from '../processes';
|
|
|
|
import { DefaultExecutor } from './default.executor';
|
|
|
|
|
|
|
|
// @TODO: This executor should be able to extend from ReadExecutor and CreateExecutor
|
|
|
|
export class UpdateExecutor extends DefaultExecutor {
|
|
|
|
constructor(process: UpdateProcess, id, data) {
|
|
|
|
super(process);
|
|
|
|
// Set the id and data to process
|
2024-11-01 17:51:57 +00:00
|
|
|
process.identity = id;
|
|
|
|
process.payload = data;
|
2024-10-30 15:55:25 +00:00
|
|
|
}
|
|
|
|
|
2024-11-01 18:22:14 +00:00
|
|
|
static async bootstrap(process: UpdateProcess, id, data) {
|
2024-10-30 15:55:25 +00:00
|
|
|
const executor = new UpdateExecutor(process, id, data);
|
|
|
|
await executor.execute();
|
|
|
|
return executor.getOutput();
|
|
|
|
}
|
|
|
|
}
|