feat: Create execution step model
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
82e1f345d4
commit
b6494ea1c4
39
packages/backend/src/models/execution-step.ts
Normal file
39
packages/backend/src/models/execution-step.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import Base from './base';
|
||||
import Execution from './execution';
|
||||
|
||||
class ExecutionStep extends Base {
|
||||
id!: string;
|
||||
executionId!: number;
|
||||
stepId!: number;
|
||||
dataIn!: any;
|
||||
dataOut!: any;
|
||||
status: string;
|
||||
|
||||
static tableName = 'execution_steps';
|
||||
|
||||
static jsonSchema = {
|
||||
type: 'object',
|
||||
|
||||
properties: {
|
||||
id: { type: 'string' },
|
||||
executionId: { type: 'integer' },
|
||||
stepId: { type: 'integer' },
|
||||
dataIn: { type: 'object' },
|
||||
dataOut: { type: 'object' },
|
||||
status: { type: 'string', enum: ['success', 'failure'] },
|
||||
},
|
||||
};
|
||||
|
||||
static relationMappings = () => ({
|
||||
execution: {
|
||||
relation: Base.BelongsToOneRelation,
|
||||
modelClass: Execution,
|
||||
join: {
|
||||
from: 'execution_steps.execution_id',
|
||||
to: 'executions.id',
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export default ExecutionStep;
|
Reference in New Issue
Block a user