From 5c9fd0cea54944fdfdcbbc1880d5f61f78ea087b Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Tue, 10 Jan 2023 10:26:50 -0500 Subject: [PATCH] feat: add unit split to unit status --- src/controllers/units.controller.js | 4 ++++ src/validations/units.validations.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/controllers/units.controller.js b/src/controllers/units.controller.js index 4feb930a..6bdde914 100644 --- a/src/controllers/units.controller.js +++ b/src/controllers/units.controller.js @@ -484,6 +484,10 @@ export const split = async (req, res) => { newRecord.unitOwner = record.unitOwner; } + if (record.unitStatus) { + newRecord.unitStatus = record.unitStatus; + } + if (record.countryJurisdictionOfOwner) { newRecord.countryJurisdictionOfOwner = record.countryJurisdictionOfOwner; diff --git a/src/validations/units.validations.js b/src/validations/units.validations.js index b4693bc0..a0037898 100644 --- a/src/validations/units.validations.js +++ b/src/validations/units.validations.js @@ -92,6 +92,9 @@ export const unitsSplitSchema = Joi.object({ unitBlockStart: Joi.string().required(), unitBlockEnd: Joi.string().required(), unitOwner: Joi.string().optional(), + unitStatus: Joi.string() + .custom(pickListValidation('unitStatus')) + .optional(), countryJurisdictionOfOwner: Joi.string() .custom(pickListValidation('countries', 'countryJurisdictionOfOwner')) .optional(),