Skip to content

refactor(kyp): improve KYP

Sahasra Reddy requested to merge feat-kyp into develop

This MR enhances the Know Your Patient (KYP) form by improving user feedback, simplifying default handling, and transitioning the API payload to descriptive question-based keys while maintaining backward compatibility with legacy data.

  1. User Experience & Notifications

Replaced success modal with toast notification using useAlertReplacement Added change detection for Next and Submit Shows error toast when user attempts to proceed without real changes (whitespace ignored)

  1. Form Logic & Defaults

Removed NA (if unknown) checkboxes Form now initializes empty for new patients Blank fields automatically submitted as "NA" Legacy values ("Not provided", "NA") rendered as empty in UI Added automatic trimming to prevent phantom changes

  1. API Payload Refactor

Updated payload to use full question text as keys Replaced shorthand IDs like q1, q2 Centralized all KYP questions in src/constants/kyp.ts Maintained backward compatibility when reading existing records

Merge request reports

Loading