From 08caebe22e18005e41bd2664cf0f9cf28e01b6ce Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 6 Oct 2023 16:08:13 +0100 Subject: [PATCH] fix(cb2-9269): auto promote the missing test types --- src/validators/statusUpdate.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/validators/statusUpdate.ts b/src/validators/statusUpdate.ts index 55423ec8..477efb9d 100644 --- a/src/validators/statusUpdate.ts +++ b/src/validators/statusUpdate.ts @@ -7,11 +7,12 @@ export const validateUpdateStatus = ( && (testResult === 'pass' || testResult === 'prs') && (isTestTypeFirstTest(testTypeId) || isTestTypeNotifiableAlteration(testTypeId) - || isTestTypeCOIF(testTypeId)) + || isTestTypeCOIF(testTypeId) + || isTestTypeIVA(testTypeId)) ); function isTestTypeFirstTest(testTypeId: string): boolean { - const firstTestIds = ['41', '95', '65', '66', '67', '103', '104', '82', '83', '119', '120', '186', '188', '192', '194']; + const firstTestIds = ['41', '95', '65', '66', '67', '103', '104', '82', '83', '119', '120']; return firstTestIds.includes(testTypeId); } @@ -24,3 +25,10 @@ function isTestTypeCOIF(testTypeId: string): boolean { const coifIds = ['142', '143', '175', '176']; return coifIds.includes(testTypeId); } + +function isTestTypeIVA(testTypeId: string): boolean { + const ivaIds = ['133', '134', '138', '139', '140', '165', '169', '167', '170', '135', '172', '173', '439', '449', + '136', '187', '126', '186', '193', '192', '195', '162', '191', '128', '188', '189', '125', '161', '158', '159', + '154', '190', '129', '196', '194', '197', '185', '420', '438', '163', '153', '184', '130', '183']; + return ivaIds.includes(testTypeId); +}