improvement: new prosthesis type data structure implemented and finally working!

This commit is contained in:
2026-09-01 21:03:04 +03:30
parent dc71c73ced
commit a3c14a18c1
51 changed files with 3306 additions and 1117 deletions

View File

@@ -32,5 +32,16 @@ export function assertCompleteToothProsthesisMap(labCase: {
throw new AppException(ErrorCode.TREATMENT_TOOTH_PROSTHESIS_INCOMPLETE, HttpStatus.BAD_REQUEST);
}
}
if (teeth.length === 0) {
const hasArchJob = labCase.toothProsthesis.some(
(tp) =>
tp.treatmentDetailId === link.treatmentDetailId &&
(tp.tooth === 'UA' || tp.tooth === 'LA') &&
Boolean(tp.prosthesisTypeCode),
);
if (!hasArchJob) {
throw new AppException(ErrorCode.TREATMENT_TOOTH_PROSTHESIS_INCOMPLETE, HttpStatus.BAD_REQUEST);
}
}
}
}