fix: update encounter payment method

This commit is contained in:
riefive
2025-12-06 04:32:08 +07:00
parent 41062a5805
commit 7c4f08780c
4 changed files with 47 additions and 98 deletions

No files matched your search

+3 -1
View File
@@ -1,3 +1,4 @@
import { isValid } from "date-fns"
import { z } from 'zod'
const ERROR_MESSAGES = {
@@ -16,6 +17,7 @@ const ERROR_MESSAGES = {
}
const ACCEPTED_UPLOAD_TYPES = ['image/jpeg', 'image/png', 'application/pdf']
const isValidationSep = false
const IntegrationEncounterSchema = z
.object({
@@ -116,7 +118,7 @@ const IntegrationEncounterSchema = z
.refine(
(data) => {
// If payment type is jkn and SEP type is selected, then SEP number is required
if (data.paymentMethod_code === 'jkn' && data.sepType && data.sepType.trim() !== '') {
if (isValidationSep && data.paymentMethod_code === 'jkn' && data.sepType && data.sepType.trim() !== '') {
return data.sepNumber && data.sepNumber.trim() !== ''
}
return true