diff --git a/src/routes/v1/resources/projects.js b/src/routes/v1/resources/projects.js index ad43806e..385856e9 100644 --- a/src/routes/v1/resources/projects.js +++ b/src/routes/v1/resources/projects.js @@ -45,6 +45,11 @@ const baseSchema = { validationDate: Joi.string().required(), projectTag: Joi.string().required(), estimatedAnnualAverageEmissionReduction: Joi.number().required(), + projectLocations: Joi.array().min(1).optional(), + qualifications: Joi.array().min(1).optional(), + vintages: Joi.array().min(1).optional(), + coBenefits: Joi.array().min(1).optional(), + relatedProjects: Joi.array().min(1).optional(), }; const postSchema = Joi.object({ diff --git a/src/routes/v1/resources/units.js b/src/routes/v1/resources/units.js index 424765fd..611ef327 100644 --- a/src/routes/v1/resources/units.js +++ b/src/routes/v1/resources/units.js @@ -23,13 +23,14 @@ UnitRouter.get('/', validator.query(querySchema), (req, res) => { }); const bodySchema = Joi.object({ + orgUid: Joi.string().required(), buyer: Joi.string().required(), registry: Joi.string().required(), blockIdentifier: Joi.string().required(), identifier: Joi.string().required(), - qualificationId: Joi.number().required(), + qualifications: Joi.array().min(1).optional(), unitType: Joi.string().required(), - unitCount: Joi.number().required(), + unitCount: Joi.string().required(), unitStatus: Joi.string().required(), unitStatusDate: Joi.string().required(), transactionType: Joi.string().required(), @@ -37,7 +38,7 @@ const bodySchema = Joi.object({ unitLink: Joi.string().required(), correspondingAdjustment: Joi.string().required(), unitTag: Joi.string().required(), - vintageId: Joi.number().required(), + vintage: Joi.object().optional(), }); UnitRouter.post('/', validator.body(bodySchema), UnitController.create);