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/utils/string-utils.js b/src/utils/string-utils.js index cf8d5d08..d051736a 100644 --- a/src/utils/string-utils.js +++ b/src/utils/string-utils.js @@ -3,6 +3,6 @@ export function isPluralized(name) { return name.endsWith('s'); } -export const genericFilterRegex = /(\w+):(.+):(in|eq|not|lt|gt|lte|gte)/; +export const genericFilterRegex = /(\w+):(.+):(in|eq|not|lt|gt|lte|gte|like)/; export const isArrayRegex = /\[.+\]/; export const genericSortColumnRegex = /(\w+):(ASC|DESC)/; 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(),