Files
old-new-wiaas/frontend/src/helpers/ProcessHelper.js

44 lines
1.4 KiB
JavaScript
Raw Normal View History

import moment from "moment";
2018-11-07 03:05:54 +01:00
import {getDocumentIcon} from "./DocumentHelper";
export const fromWiaasProcessStep = (step) => {
return {
actionCode: step.action_code,
fullDesc: step.full_desc,
idOrder: step.order_id,
2018-10-30 17:20:56 +01:00
idProcess: step.process_id, //not sure about this
idProcessStep: step.step_id, //not sure about this
isNewCommentVisible: 1, //TODO : get this from backend
isVisibleForCustomer: 1, //TODO : get this from backend
now: moment().format("Do MMM YY"),
shortDesc: step.short_desc,
status: step.status,
}
2018-11-07 03:05:54 +01:00
};
export const fromWiaasCustomerAcceptance = cData => {
return {
actionId: cData['action_id'],
expiration: cData.expiration,
declineReason: cData['decline_reason'],
status: cData.status,
documents: cData.documents ? cData.documents.map(document => {
document.icon = getDocumentIcon(document.extension);
return document;
}) : []
};
};
export const fromWiaasCustomerQuestionnaire = cData => {
const document = cData.document;
document.icon = getDocumentIcon(document.extension);
return {
actionId: cData['action_id'],
orderItemId: cData['item_id'],
document,
status: cData.status,
orderId: cData['order_id'],
comments: cData.comments
};
};