diff --git a/packages/component-manuscript-manager/index.js b/packages/component-manuscript-manager/index.js index 63ee7dbde1665993000139f654d8669b7465f8cb..d309d1a8e942a0946e7896365de9e1a5fbac4f68 100644 --- a/packages/component-manuscript-manager/index.js +++ b/packages/component-manuscript-manager/index.js @@ -2,5 +2,6 @@ module.exports = { backend: () => app => { require('./src/FragmentsRecommendations')(app) require('./src/Fragments')(app) + require('./src/TechnicalChecks')(app) }, } diff --git a/packages/component-manuscript-manager/src/routes/fragments/post.js b/packages/component-manuscript-manager/src/routes/fragments/post.js index 97ad2389943da68a469015f21cf483f465cdd1ff..43c0953657e5c1145ce50dd35c5c4a20842ab4c4 100644 --- a/packages/component-manuscript-manager/src/routes/fragments/post.js +++ b/packages/component-manuscript-manager/src/routes/fragments/post.js @@ -1,5 +1,6 @@ +const { v4 } = require('uuid') const config = require('config') -const { get } = require('lodash') +const { get, set } = require('lodash') const { Email, Fragment, @@ -54,7 +55,8 @@ module.exports = models => async (req, res) => { }) email.setupManuscriptSubmittedEmail() - collection.status = 'submitted' + collection.status = 'technicalChecks' + set(collection, 'technicalChecks.token', v4()) collection.save() const { journal, xmlParser, ftp } = mtsConfig diff --git a/packages/component-manuscript-manager/src/routes/technicalChecks/patch.js b/packages/component-manuscript-manager/src/routes/technicalChecks/patch.js index e569f8a7a07c7066eb32866a054280ed70a6df3e..f415d8e1edacc5d521294974d3755d38807ccd7d 100644 --- a/packages/component-manuscript-manager/src/routes/technicalChecks/patch.js +++ b/packages/component-manuscript-manager/src/routes/technicalChecks/patch.js @@ -38,6 +38,8 @@ module.exports = ({ Collection }) => async (req, res) => { collection.status = setNewStatus(step, agree) await collection.save() + // TODO: send email to EiC here + return res.status(200).json(collection) } catch (e) { const notFoundError = await services.handleNotFoundError(e, 'Item') diff --git a/packages/xpub-faraday/config/validations.js b/packages/xpub-faraday/config/validations.js index b376584a5ddaaee1104667a0e08eedf0b19c1b86..9a7f4c1086c437975da17e976f21e72f8c75f688 100644 --- a/packages/xpub-faraday/config/validations.js +++ b/packages/xpub-faraday/config/validations.js @@ -11,6 +11,9 @@ module.exports = { customId: Joi.string(), invitations: Joi.array(), handlingEditor: Joi.object(), + technicalChecks: Joi.object({ + token: Joi.string(), + }), }, fragment: [ {