feat: add encounterId handling in SEP entry and update validation logic in integration schema

This commit is contained in:
riefive
2025-12-02 13:31:17 +07:00
parent 32a6c27375
commit 38ecb5fa08
3 changed files with 10 additions and 5 deletions
+4 -3
View File
@@ -14,6 +14,7 @@ const ERROR_MESSAGES = {
}
const ACCEPTED_UPLOAD_TYPES = ['image/jpeg', 'image/png', 'application/pdf']
const isRequiredSep = false;
const IntegrationEncounterSchema = z
.object({
@@ -115,9 +116,9 @@ const IntegrationEncounterSchema = z
.refine(
(data) => {
// If payment type is jkn and SEP type is selected, then SEP number is required
// if (data.paymentType === 'jkn' && data.sepType && data.sepType.trim() !== '') {
// return data.sepNumber && data.sepNumber.trim() !== ''
// }
if (isRequiredSep && data.paymentType === 'jkn' && data.sepType && data.sepType.trim() !== '') {
return data.sepNumber && data.sepNumber.trim() !== ''
}
return true
},
{