feat: Implement execution step serializer

This commit is contained in:
Faruk AYDIN
2024-03-06 17:10:06 +01:00
parent 3a9dfe339a
commit e40d6c5ef0
3 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import stepSerializer from './step.js';
const executionStepSerializer = (executionStep) => {
let executionStepData = {
id: executionStep.id,
dataIn: executionStep.dataIn,
dataOut: executionStep.dataOut,
errorDetails: executionStep.errorDetails,
status: executionStep.status,
createdAt: executionStep.createdAt.getTime(),
updatedAt: executionStep.updatedAt.getTime(),
};
if (executionStep.step) {
executionStepData.step = stepSerializer(executionStep.step);
}
return executionStepData;
};
export default executionStepSerializer;