refactor: Restructure workers to work with services

This commit is contained in:
Faruk AYDIN
2022-10-14 22:33:26 +02:00
parent 628f872180
commit 237ab48d33
10 changed files with 81 additions and 114 deletions

View File

@@ -102,6 +102,14 @@ class Step extends Base {
return await App.findOneByKey(this.appKey);
}
async getNextStep() {
const flow = await this.$relatedQuery('flow');
return await flow
.$relatedQuery('steps')
.findOne({ position: this.position + 1 });
}
async getTriggerCommand() {
const { appKey, key, isTrigger } = this;
if (!isTrigger || !appKey || !key) return null;