feat: add encounterId handling in SEP entry and update validation logic in integration schema
This commit is contained in:
@@ -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
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user