udp-schema 1.1.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/helpers.d.ts +33 -0
  2. package/dist/helpers.d.ts.map +1 -0
  3. package/dist/helpers.js +60 -0
  4. package/dist/helpers.js.map +1 -0
  5. package/dist/index.d.ts +16 -4
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +21 -7
  8. package/dist/index.js.map +1 -1
  9. package/dist/onboarding-form.d.ts +485 -0
  10. package/dist/onboarding-form.d.ts.map +1 -0
  11. package/dist/onboarding-form.js +69 -0
  12. package/dist/onboarding-form.js.map +1 -0
  13. package/dist/profile-fields/01-profile.d.ts.map +1 -1
  14. package/dist/profile-fields/01-profile.js +168 -23
  15. package/dist/profile-fields/01-profile.js.map +1 -1
  16. package/dist/profile-fields/02-political.d.ts.map +1 -1
  17. package/dist/profile-fields/02-political.js +119 -28
  18. package/dist/profile-fields/02-political.js.map +1 -1
  19. package/dist/profile-fields/03-electoral.d.ts.map +1 -1
  20. package/dist/profile-fields/03-electoral.js +83 -13
  21. package/dist/profile-fields/03-electoral.js.map +1 -1
  22. package/dist/profile-fields/04-leadership.d.ts.map +1 -1
  23. package/dist/profile-fields/04-leadership.js +131 -14
  24. package/dist/profile-fields/04-leadership.js.map +1 -1
  25. package/dist/profile-fields/05-psychological.d.ts.map +1 -1
  26. package/dist/profile-fields/05-psychological.js +41 -12
  27. package/dist/profile-fields/05-psychological.js.map +1 -1
  28. package/dist/profile-fields/06-education.d.ts.map +1 -1
  29. package/dist/profile-fields/06-education.js +128 -15
  30. package/dist/profile-fields/06-education.js.map +1 -1
  31. package/dist/profile-fields/07-employment.d.ts.map +1 -1
  32. package/dist/profile-fields/07-employment.js +99 -19
  33. package/dist/profile-fields/07-employment.js.map +1 -1
  34. package/dist/profile-fields/08-neurodiversity.d.ts.map +1 -1
  35. package/dist/profile-fields/08-neurodiversity.js +128 -21
  36. package/dist/profile-fields/08-neurodiversity.js.map +1 -1
  37. package/dist/profile-fields/09-health.d.ts.map +1 -1
  38. package/dist/profile-fields/09-health.js +141 -19
  39. package/dist/profile-fields/09-health.js.map +1 -1
  40. package/dist/profile-fields/10-worldview.d.ts.map +1 -1
  41. package/dist/profile-fields/10-worldview.js +112 -13
  42. package/dist/profile-fields/10-worldview.js.map +1 -1
  43. package/dist/profile-fields/11-residence.d.ts.map +1 -1
  44. package/dist/profile-fields/11-residence.js +39 -5
  45. package/dist/profile-fields/11-residence.js.map +1 -1
  46. package/dist/profile-fields/12-household.d.ts.map +1 -1
  47. package/dist/profile-fields/12-household.js +175 -25
  48. package/dist/profile-fields/12-household.js.map +1 -1
  49. package/dist/profile-fields/index.d.ts +8 -8
  50. package/dist/profile-fields/index.d.ts.map +1 -1
  51. package/dist/profile-fields/index.js +8 -8
  52. package/dist/profile-fields/index.js.map +1 -1
  53. package/dist/validation.d.ts +18 -0
  54. package/dist/validation.d.ts.map +1 -0
  55. package/dist/validation.js +186 -0
  56. package/dist/validation.js.map +1 -0
  57. package/package.json +1 -1
@@ -1,37 +1,187 @@
1
1
  export const familyMemberOptions = [
2
- { value: 'father', label: 'Father' }, { value: 'mother', label: 'Mother' },
3
- { value: 'step_father', label: 'Step-father' }, { value: 'step_mother', label: 'Step-mother' },
4
- { value: 'wife_husband', label: 'Wife / Husband' }, { value: 'blood_brother', label: 'Blood Brother' },
5
- { value: 'blood_sister', label: 'Blood Sister' }, { value: 'half_brother', label: 'Half Brother' },
6
- { value: 'half_sister', label: 'Half Sister' }, { value: 'step_brother', label: 'Step Brother' },
7
- { value: 'step_sister', label: 'Step Sister' }, { value: 'son', label: 'Son' },
8
- { value: 'daughter', label: 'Daughter' }, { value: 'other', label: 'Other' },
2
+ { value: 'father', label: 'Father' },
3
+ { value: 'mother', label: 'Mother' },
4
+ { value: 'step_father', label: 'Step-father' },
5
+ { value: 'step_mother', label: 'Step-mother' },
6
+ { value: 'wife_husband', label: 'Wife / Husband' },
7
+ { value: 'blood_brother', label: 'Blood Brother' },
8
+ { value: 'blood_sister', label: 'Blood Sister' },
9
+ { value: 'half_brother', label: 'Half Brother' },
10
+ { value: 'half_sister', label: 'Half Sister' },
11
+ { value: 'step_brother', label: 'Step Brother' },
12
+ { value: 'step_sister', label: 'Step Sister' },
13
+ { value: 'son', label: 'Son' },
14
+ { value: 'daughter', label: 'Daughter' },
15
+ { value: 'other', label: 'Other' },
9
16
  ];
10
17
  export const digitalAccessOptions = [
11
- { value: 'smartphone', label: 'Smartphone' }, { value: 'feature_phone', label: 'Feature phone' },
12
- { value: 'computer_laptop', label: 'Computer / Laptop' }, { value: 'internet_at_home', label: 'Internet at home' },
13
- { value: 'no_internet', label: 'No internet access' }, { value: 'no_phone', label: 'No phone' },
18
+ { value: 'smartphone', label: 'Smartphone' },
19
+ { value: 'feature_phone', label: 'Feature phone' },
20
+ { value: 'computer_laptop', label: 'Computer / Laptop' },
21
+ { value: 'internet_at_home', label: 'Internet at home' },
22
+ { value: 'no_internet', label: 'No internet access' },
23
+ { value: 'no_phone', label: 'No phone' },
14
24
  ];
15
25
  export const householdIncomeOptions = [
16
- { value: 'below_5k', label: 'Below ₹5,000' }, { value: '5k_10k', label: '₹5,000 – ₹10,000' },
17
- { value: '10k_25k', label: '₹10,000 – ₹25,000' }, { value: '25k_50k', label: '₹25,000 – ₹50,000' },
18
- { value: '50k_1L', label: '₹50,000 – ₹1 Lakh' }, { value: '1L_2.5L', label: '₹1 Lakh – ₹2.5 Lakh' },
19
- { value: 'above_2.5L', label: 'Above 2.5 Lakh' }, { value: 'prefer_not_to_say', label: 'Prefer not to say' },
26
+ { value: 'below_5k', label: 'Below ₹5,000' },
27
+ { value: '5k_10k', label: '₹5,000 – ₹10,000' },
28
+ { value: '10k_25k', label: '₹10,000 – ₹25,000' },
29
+ { value: '25k_50k', label: '₹25,000 ₹50,000' },
30
+ { value: '50k_1L', label: '₹50,000 – ₹1 Lakh' },
31
+ { value: '1L_2.5L', label: '₹1 Lakh – ₹2.5 Lakh' },
32
+ { value: 'above_2.5L', label: 'Above ₹2.5 Lakh' },
33
+ { value: 'prefer_not_to_say', label: 'Prefer not to say' },
20
34
  ];
21
35
  export const household = {
22
- key: 'household', label: 'Household & Economic Profile', step: 12,
36
+ key: 'household',
37
+ label: 'Household & Economic Profile',
38
+ step: 12,
23
39
  description: 'Family, housing, income, and economic profile.',
24
40
  fields: [
25
- { order: 1, key: 'maritalStatus', label: 'Marital Status', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'single', label: 'Single' }, { value: 'married', label: 'Married' }, { value: 'divorced', label: 'Divorced' }, { value: 'widowed', label: 'Widowed' }, { value: 'separated', label: 'Separated' }, { value: 'prefer_not_to_say', label: 'Prefer not to say' }] },
26
- { order: 2, key: 'familyMembers', label: 'Family Members', type: 'multi_select', step: 12, isOnboarding: true, optional: true, options: [...familyMemberOptions] },
27
- { order: 3, key: 'numberOfDependents', label: 'Number of Dependents', type: 'number', step: 12, isOnboarding: true, optional: true, min: 0, max: 50 },
28
- { order: 4, key: 'housingType', label: 'Housing Type', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'own_house', label: 'Own house' }, { value: 'rented', label: 'Rented' }, { value: 'government_quarters', label: 'Government quarters' }, { value: 'shared', label: 'Shared housing' }, { value: 'homeless', label: 'Homeless' }, { value: 'other', label: 'Other' }] },
29
- { order: 5, key: 'householdIncome', label: 'Household Income', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [...householdIncomeOptions], sensitive: true },
30
- { order: 6, key: 'bplCard', label: 'BPL Card', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'yes', label: 'Yes' }, { value: 'no', label: 'No' }, { value: 'applied', label: 'Applied / Pending' }, { value: 'dont_know', label: "Don't know" }] },
31
- { order: 7, key: 'digitalAccess', label: 'Digital Access', type: 'multi_select', step: 12, isOnboarding: true, optional: true, options: [...digitalAccessOptions] },
32
- { order: 8, key: 'migrationStatus', label: 'Migration Status', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'native', label: 'Native (always lived here)' }, { value: 'within_district', label: 'Migrated within district' }, { value: 'within_state', label: 'Migrated within state' }, { value: 'inter_state', label: 'Inter-state migrant' }, { value: 'international', label: 'International migrant' }] },
33
- { order: 9, key: 'landOwnership', label: 'Land Ownership', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'own_agricultural', label: 'Own agricultural land' }, { value: 'own_residential', label: 'Own residential land' }, { value: 'government_allotted', label: 'Government allotted' }, { value: 'no_land', label: 'No land' }, { value: 'leased', label: 'Leased land' }, { value: 'other', label: 'Other' }] },
34
- { order: 10, key: 'primaryIncomeSource', label: 'Primary Income Source', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'agriculture', label: 'Agriculture' }, { value: 'government_job', label: 'Government job' }, { value: 'private_job', label: 'Private job' }, { value: 'business', label: 'Business' }, { value: 'daily_wage', label: 'Daily wage' }, { value: 'pension', label: 'Pension' }, { value: 'remittance', label: 'Remittance' }, { value: 'no_fixed_income', label: 'No fixed income' }, { value: 'other', label: 'Other' }] },
41
+ {
42
+ order: 1,
43
+ key: 'maritalStatus',
44
+ label: 'Marital Status',
45
+ type: 'single_select',
46
+ step: 12,
47
+ isOnboarding: true,
48
+ optional: true,
49
+ options: [
50
+ { value: 'single', label: 'Single' },
51
+ { value: 'married', label: 'Married' },
52
+ { value: 'divorced', label: 'Divorced' },
53
+ { value: 'widowed', label: 'Widowed' },
54
+ { value: 'separated', label: 'Separated' },
55
+ { value: 'prefer_not_to_say', label: 'Prefer not to say' },
56
+ ],
57
+ },
58
+ {
59
+ order: 2,
60
+ key: 'familyMembers',
61
+ label: 'Family Members',
62
+ type: 'multi_select',
63
+ step: 12,
64
+ isOnboarding: true,
65
+ optional: true,
66
+ options: [...familyMemberOptions],
67
+ },
68
+ {
69
+ order: 3,
70
+ key: 'numberOfDependents',
71
+ label: 'Number of Dependents',
72
+ type: 'number',
73
+ step: 12,
74
+ isOnboarding: true,
75
+ optional: true,
76
+ min: 0,
77
+ max: 50,
78
+ },
79
+ {
80
+ order: 4,
81
+ key: 'housingType',
82
+ label: 'Housing Type',
83
+ type: 'single_select',
84
+ step: 12,
85
+ isOnboarding: true,
86
+ optional: true,
87
+ options: [
88
+ { value: 'own_house', label: 'Own house' },
89
+ { value: 'rented', label: 'Rented' },
90
+ { value: 'government_quarters', label: 'Government quarters' },
91
+ { value: 'shared', label: 'Shared housing' },
92
+ { value: 'homeless', label: 'Homeless' },
93
+ { value: 'other', label: 'Other' },
94
+ ],
95
+ },
96
+ {
97
+ order: 5,
98
+ key: 'householdIncome',
99
+ label: 'Household Income',
100
+ type: 'single_select',
101
+ step: 12,
102
+ isOnboarding: true,
103
+ optional: true,
104
+ options: [...householdIncomeOptions],
105
+ sensitive: true,
106
+ },
107
+ {
108
+ order: 6,
109
+ key: 'bplCard',
110
+ label: 'BPL Card',
111
+ type: 'single_select',
112
+ step: 12,
113
+ isOnboarding: true,
114
+ optional: true,
115
+ options: [
116
+ { value: 'yes', label: 'Yes' },
117
+ { value: 'no', label: 'No' },
118
+ { value: 'applied', label: 'Applied / Pending' },
119
+ { value: 'dont_know', label: "Don't know" },
120
+ ],
121
+ },
122
+ {
123
+ order: 7,
124
+ key: 'digitalAccess',
125
+ label: 'Digital Access',
126
+ type: 'multi_select',
127
+ step: 12,
128
+ isOnboarding: true,
129
+ optional: true,
130
+ options: [...digitalAccessOptions],
131
+ },
132
+ {
133
+ order: 8,
134
+ key: 'migrationStatus',
135
+ label: 'Migration Status',
136
+ type: 'single_select',
137
+ step: 12,
138
+ isOnboarding: true,
139
+ optional: true,
140
+ options: [
141
+ { value: 'native', label: 'Native (always lived here)' },
142
+ { value: 'within_district', label: 'Migrated within district' },
143
+ { value: 'within_state', label: 'Migrated within state' },
144
+ { value: 'inter_state', label: 'Inter-state migrant' },
145
+ { value: 'international', label: 'International migrant' },
146
+ ],
147
+ },
148
+ {
149
+ order: 9,
150
+ key: 'landOwnership',
151
+ label: 'Land Ownership',
152
+ type: 'single_select',
153
+ step: 12,
154
+ isOnboarding: true,
155
+ optional: true,
156
+ options: [
157
+ { value: 'own_agricultural', label: 'Own agricultural land' },
158
+ { value: 'own_residential', label: 'Own residential land' },
159
+ { value: 'government_allotted', label: 'Government allotted' },
160
+ { value: 'no_land', label: 'No land' },
161
+ { value: 'leased', label: 'Leased land' },
162
+ { value: 'other', label: 'Other' },
163
+ ],
164
+ },
165
+ {
166
+ order: 10,
167
+ key: 'primaryIncomeSource',
168
+ label: 'Primary Income Source',
169
+ type: 'single_select',
170
+ step: 12,
171
+ isOnboarding: true,
172
+ optional: true,
173
+ options: [
174
+ { value: 'agriculture', label: 'Agriculture' },
175
+ { value: 'government_job', label: 'Government job' },
176
+ { value: 'private_job', label: 'Private job' },
177
+ { value: 'business', label: 'Business' },
178
+ { value: 'daily_wage', label: 'Daily wage' },
179
+ { value: 'pension', label: 'Pension' },
180
+ { value: 'remittance', label: 'Remittance' },
181
+ { value: 'no_fixed_income', label: 'No fixed income' },
182
+ { value: 'other', label: 'Other' },
183
+ ],
184
+ },
35
185
  ],
36
186
  };
37
187
  //# sourceMappingURL=12-household.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"12-household.js","sourceRoot":"","sources":["../../src/profile-fields/12-household.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC1E,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9F,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,e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{ value: 'mother', label: 'Mother' },\n { value: 'step_father', label: 'Step-father' }, { value: 'step_mother', label: 'Step-mother' },\n { value: 'wife_husband', label: 'Wife / Husband' }, { value: 'blood_brother', label: 'Blood Brother' },\n { value: 'blood_sister', label: 'Blood Sister' }, { value: 'half_brother', label: 'Half Brother' },\n { value: 'half_sister', label: 'Half Sister' }, { value: 'step_brother', label: 'Step Brother' },\n { value: 'step_sister', label: 'Step Sister' }, { value: 'son', label: 'Son' },\n { value: 'daughter', label: 'Daughter' }, { value: 'other', label: 'Other' },\n] as const;\n\nexport const digitalAccessOptions = [\n { value: 'smartphone', label: 'Smartphone' }, { value: 'feature_phone', label: 'Feature phone' },\n { value: 'computer_laptop', label: 'Computer / Laptop' }, { value: 'internet_at_home', label: 'Internet at home' },\n { value: 'no_internet', label: 'No internet access' }, { value: 'no_phone', label: 'No phone' },\n] as const;\n\nexport const householdIncomeOptions = [\n { value: 'below_5k', label: 'Below ₹5,000' }, { value: '5k_10k', label: '₹5,000 – ₹10,000' },\n { value: '10k_25k', label: '₹10,000 – ₹25,000' }, { value: '25k_50k', label: '₹25,000 – ₹50,000' },\n { value: '50k_1L', label: '₹50,000 – ₹1 Lakh' }, { value: '1L_2.5L', label: '₹1 Lakh – ₹2.5 Lakh' },\n { value: 'above_2.5L', label: 'Above ₹2.5 Lakh' }, { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n] as const;\n\nexport const household: FieldGroup = {\n key: 'household', label: 'Household & Economic Profile', step: 12,\n description: 'Family, housing, income, and economic profile.',\n fields: [\n { order: 1, key: 'maritalStatus', label: 'Marital Status', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'single', label: 'Single' }, { value: 'married', label: 'Married' }, { value: 'divorced', label: 'Divorced' }, { value: 'widowed', label: 'Widowed' }, { value: 'separated', label: 'Separated' }, { value: 'prefer_not_to_say', label: 'Prefer not to say' }] },\n { order: 2, key: 'familyMembers', label: 'Family Members', type: 'multi_select', step: 12, isOnboarding: true, optional: true, options: [...familyMemberOptions] },\n { order: 3, key: 'numberOfDependents', label: 'Number of Dependents', type: 'number', step: 12, isOnboarding: true, optional: true, min: 0, max: 50 },\n { order: 4, key: 'housingType', label: 'Housing Type', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'own_house', label: 'Own house' }, { value: 'rented', label: 'Rented' }, { value: 'government_quarters', label: 'Government quarters' }, { value: 'shared', label: 'Shared housing' }, { value: 'homeless', label: 'Homeless' }, { value: 'other', label: 'Other' }] },\n { order: 5, key: 'householdIncome', label: 'Household Income', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [...householdIncomeOptions], sensitive: true },\n { order: 6, key: 'bplCard', label: 'BPL Card', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'yes', label: 'Yes' }, { value: 'no', label: 'No' }, { value: 'applied', label: 'Applied / Pending' }, { value: 'dont_know', label: \"Don't know\" }] },\n { order: 7, key: 'digitalAccess', label: 'Digital Access', type: 'multi_select', step: 12, isOnboarding: true, optional: true, options: [...digitalAccessOptions] },\n { order: 8, key: 'migrationStatus', label: 'Migration Status', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'native', label: 'Native (always lived here)' }, { value: 'within_district', label: 'Migrated within district' }, { value: 'within_state', label: 'Migrated within state' }, { value: 'inter_state', label: 'Inter-state migrant' }, { value: 'international', label: 'International migrant' }] },\n { order: 9, key: 'landOwnership', label: 'Land Ownership', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'own_agricultural', label: 'Own agricultural land' }, { value: 'own_residential', label: 'Own residential land' }, { value: 'government_allotted', label: 'Government allotted' }, { value: 'no_land', label: 'No land' }, { value: 'leased', label: 'Leased land' }, { value: 'other', label: 'Other' }] },\n { order: 10, key: 'primaryIncomeSource', label: 'Primary Income Source', type: 'single_select', step: 12, isOnboarding: true, optional: true, options: [{ value: 'agriculture', label: 'Agriculture' }, { value: 'government_job', label: 'Government job' }, { value: 'private_job', label: 'Private job' }, { value: 'business', label: 'Business' }, { value: 'daily_wage', label: 'Daily wage' }, { value: 'pension', label: 'Pension' }, { value: 'remittance', label: 'Remittance' }, { value: 'no_fixed_income', label: 'No fixed income' }, { value: 'other', label: 'Other' }] },\n ],\n};\n"]}
1
+ {"version":3,"file":"12-household.js","sourceRoot":"","sources":["../../src/profile-fields/12-household.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9C,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9C,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,EAAE;IAClD,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;IAClD,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAChD,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAChD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9C,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAChD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9C,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC9B,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACxC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;CAC1B,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAA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a,EAAE;gBAC9C,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;gBACpD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;gBAC9C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;gBACxC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;gBAC5C,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;gBACtC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;gBAC5C,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBACtD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;aACnC;SACF;KACF;CACF,CAAC","sourcesContent":["import type { FieldGroup } from './types.js';\n\nexport const familyMemberOptions = [\n { value: 'father', label: 'Father' },\n { value: 'mother', label: 'Mother' },\n { value: 'step_father', label: 'Step-father' },\n { value: 'step_mother', label: 'Step-mother' },\n { value: 'wife_husband', label: 'Wife / Husband' },\n { value: 'blood_brother', label: 'Blood Brother' },\n { value: 'blood_sister', label: 'Blood Sister' },\n { value: 'half_brother', label: 'Half Brother' },\n { value: 'half_sister', label: 'Half Sister' },\n { value: 'step_brother', label: 'Step Brother' },\n { value: 'step_sister', label: 'Step Sister' },\n { value: 'son', label: 'Son' },\n { value: 'daughter', label: 'Daughter' },\n { value: 'other', label: 'Other' },\n] as const;\n\nexport const digitalAccessOptions = [\n { value: 'smartphone', label: 'Smartphone' },\n { value: 'feature_phone', label: 'Feature phone' },\n { value: 'computer_laptop', label: 'Computer / Laptop' },\n { value: 'internet_at_home', label: 'Internet at home' },\n { value: 'no_internet', label: 'No internet access' },\n { value: 'no_phone', label: 'No phone' },\n] as const;\n\nexport const householdIncomeOptions = [\n { value: 'below_5k', label: 'Below ₹5,000' },\n { value: '5k_10k', label: '₹5,000 – ₹10,000' },\n { value: '10k_25k', label: '₹10,000 – ₹25,000' },\n { value: '25k_50k', label: '₹25,000 – ₹50,000' },\n { value: '50k_1L', label: '₹50,000 – ₹1 Lakh' },\n { value: '1L_2.5L', label: '₹1 Lakh – ₹2.5 Lakh' },\n { value: 'above_2.5L', label: 'Above ₹2.5 Lakh' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n] as const;\n\nexport const household: FieldGroup = {\n key: 'household',\n label: 'Household & Economic Profile',\n step: 12,\n description: 'Family, housing, income, and economic profile.',\n fields: [\n {\n order: 1,\n key: 'maritalStatus',\n label: 'Marital Status',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'single', label: 'Single' },\n { value: 'married', label: 'Married' },\n { value: 'divorced', label: 'Divorced' },\n { value: 'widowed', label: 'Widowed' },\n { value: 'separated', label: 'Separated' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n ],\n },\n {\n order: 2,\n key: 'familyMembers',\n label: 'Family Members',\n type: 'multi_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [...familyMemberOptions],\n },\n {\n order: 3,\n key: 'numberOfDependents',\n label: 'Number of Dependents',\n type: 'number',\n step: 12,\n isOnboarding: true,\n optional: true,\n min: 0,\n max: 50,\n },\n {\n order: 4,\n key: 'housingType',\n label: 'Housing Type',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'own_house', label: 'Own house' },\n { value: 'rented', label: 'Rented' },\n { value: 'government_quarters', label: 'Government quarters' },\n { value: 'shared', label: 'Shared housing' },\n { value: 'homeless', label: 'Homeless' },\n { value: 'other', label: 'Other' },\n ],\n },\n {\n order: 5,\n key: 'householdIncome',\n label: 'Household Income',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [...householdIncomeOptions],\n sensitive: true,\n },\n {\n order: 6,\n key: 'bplCard',\n label: 'BPL Card',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'yes', label: 'Yes' },\n { value: 'no', label: 'No' },\n { value: 'applied', label: 'Applied / Pending' },\n { value: 'dont_know', label: \"Don't know\" },\n ],\n },\n {\n order: 7,\n key: 'digitalAccess',\n label: 'Digital Access',\n type: 'multi_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [...digitalAccessOptions],\n },\n {\n order: 8,\n key: 'migrationStatus',\n label: 'Migration Status',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'native', label: 'Native (always lived here)' },\n { value: 'within_district', label: 'Migrated within district' },\n { value: 'within_state', label: 'Migrated within state' },\n { value: 'inter_state', label: 'Inter-state migrant' },\n { value: 'international', label: 'International migrant' },\n ],\n },\n {\n order: 9,\n key: 'landOwnership',\n label: 'Land Ownership',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'own_agricultural', label: 'Own agricultural land' },\n { value: 'own_residential', label: 'Own residential land' },\n { value: 'government_allotted', label: 'Government allotted' },\n { value: 'no_land', label: 'No land' },\n { value: 'leased', label: 'Leased land' },\n { value: 'other', label: 'Other' },\n ],\n },\n {\n order: 10,\n key: 'primaryIncomeSource',\n label: 'Primary Income Source',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'agriculture', label: 'Agriculture' },\n { value: 'government_job', label: 'Government job' },\n { value: 'private_job', label: 'Private job' },\n { value: 'business', label: 'Business' },\n { value: 'daily_wage', label: 'Daily wage' },\n { value: 'pension', label: 'Pension' },\n { value: 'remittance', label: 'Remittance' },\n { value: 'no_fixed_income', label: 'No fixed income' },\n { value: 'other', label: 'Other' },\n ],\n },\n ],\n};\n"]}
@@ -5,18 +5,18 @@
5
5
  * Each file defines a FieldGroup with rich field metadata and options.
6
6
  */
7
7
  export type { BaseField, FieldGroup, FieldOption, MultiSelectField, NumberField, ProfileField, SelectField, TextField, } from './types.js';
8
- export { profile, genderOptions, religionOptions, languageOptions, reservationOptions, minorityOptions } from './01-profile.js';
9
- export { politicalAssociation, politicalSpectrumOptions, partyOptions, civicEngagementOptions } from './02-political.js';
8
+ export { genderOptions, languageOptions, minorityOptions, profile, religionOptions, reservationOptions, } from './01-profile.js';
9
+ export { civicEngagementOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, } from './02-political.js';
10
10
  export { electoralBehaviour, votingIssueOptions } from './03-electoral.js';
11
11
  export { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';
12
- export { psychologicalAssessment, mbtiOptions } from './05-psychological.js';
12
+ export { mbtiOptions, psychologicalAssessment } from './05-psychological.js';
13
13
  export { education, qualificationOptions } from './06-education.js';
14
- export { employment, employmentStatusOptions, shiftOptions, incomeRangeOptions } from './07-employment.js';
15
- export { neurodiversity, neurodiversityConditionOptions, sensoryPreferenceOptions, supportNeedOptions } from './08-neurodiversity.js';
16
- export { healthLifestyle, disabilityOptions, substanceUseOptions, dietOptions } from './09-health.js';
17
- export { worldView, lgbtqStatementOptions, transgenderStatementOptions, casteDiscriminationPlaceOptions } from './10-worldview.js';
14
+ export { employment, employmentStatusOptions, incomeRangeOptions, shiftOptions, } from './07-employment.js';
15
+ export { neurodiversity, neurodiversityConditionOptions, sensoryPreferenceOptions, supportNeedOptions, } from './08-neurodiversity.js';
16
+ export { dietOptions, disabilityOptions, healthLifestyle, substanceUseOptions, } from './09-health.js';
17
+ export { casteDiscriminationPlaceOptions, lgbtqStatementOptions, transgenderStatementOptions, worldView, } from './10-worldview.js';
18
18
  export { residence } from './11-residence.js';
19
- export { household, familyMemberOptions, digitalAccessOptions, householdIncomeOptions } from './12-household.js';
19
+ export { digitalAccessOptions, familyMemberOptions, household, householdIncomeOptions, } from './12-household.js';
20
20
  import type { FieldGroup } from './types.js';
21
21
  export declare const allFieldGroups: readonly FieldGroup[];
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/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,MAAM,cAAc,EAAE,SAAS,UAAU,EAa/C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profile-fields/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,GACV,MAAM,YAAY,CAAC;AAIpB,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,OAAO,EACP,eAAe,EACf,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EACL,UAAU,EACV,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,8BAA8B,EAC9B,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,EACrB,2BAA2B,EAC3B,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAgB3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,cAAc,EAAE,SAAS,UAAU,EAa/C,CAAC"}
@@ -5,18 +5,18 @@
5
5
  * Each file defines a FieldGroup with rich field metadata and options.
6
6
  */
7
7
  // ── Field groups ────────────────────────────────────────────────────────────
8
- export { profile, genderOptions, religionOptions, languageOptions, reservationOptions, minorityOptions } from './01-profile.js';
9
- export { politicalAssociation, politicalSpectrumOptions, partyOptions, civicEngagementOptions } from './02-political.js';
8
+ export { genderOptions, languageOptions, minorityOptions, profile, religionOptions, reservationOptions, } from './01-profile.js';
9
+ export { civicEngagementOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, } from './02-political.js';
10
10
  export { electoralBehaviour, votingIssueOptions } from './03-electoral.js';
11
11
  export { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';
12
- export { psychologicalAssessment, mbtiOptions } from './05-psychological.js';
12
+ export { mbtiOptions, psychologicalAssessment } from './05-psychological.js';
13
13
  export { education, qualificationOptions } from './06-education.js';
14
- export { employment, employmentStatusOptions, shiftOptions, incomeRangeOptions } from './07-employment.js';
15
- export { neurodiversity, neurodiversityConditionOptions, sensoryPreferenceOptions, supportNeedOptions } from './08-neurodiversity.js';
16
- export { healthLifestyle, disabilityOptions, substanceUseOptions, dietOptions } from './09-health.js';
17
- export { worldView, lgbtqStatementOptions, transgenderStatementOptions, casteDiscriminationPlaceOptions } from './10-worldview.js';
14
+ export { employment, employmentStatusOptions, incomeRangeOptions, shiftOptions, } from './07-employment.js';
15
+ export { neurodiversity, neurodiversityConditionOptions, sensoryPreferenceOptions, supportNeedOptions, } from './08-neurodiversity.js';
16
+ export { dietOptions, disabilityOptions, healthLifestyle, substanceUseOptions, } from './09-health.js';
17
+ export { casteDiscriminationPlaceOptions, lgbtqStatementOptions, transgenderStatementOptions, worldView, } from './10-worldview.js';
18
18
  export { residence } from './11-residence.js';
19
- export { household, familyMemberOptions, digitalAccessOptions, householdIncomeOptions } from './12-household.js';
19
+ export { digitalAccessOptions, familyMemberOptions, household, householdIncomeOptions, } from './12-household.js';
20
20
  // ── All field groups (for building lookup maps) ─────────────────────────────
21
21
  import { profile } from './01-profile.js';
22
22
  import { politicalAssociation } from './02-political.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile-fields/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,+EAA+E;AAE/E,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChI,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzH,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACtI,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACtG,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACnI,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEjH,+EAA+E;AAE/E,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,MAAM,CAAC,MAAM,cAAc,GAA0B;IACnD,OAAO;IACP,oBAAoB;IACpB,kBAAkB;IAClB,mBAAmB;IACnB,uBAAuB;IACvB,SAAS;IACT,UAAU;IACV,cAAc;IACd,eAAe;IACf,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC","sourcesContent":["/**\n * UDP Profile Fields — barrel export.\n *\n * Mirrors the dating-schema profile-fields pattern.\n * Each file defines a FieldGroup with rich field metadata and options.\n */\n\nexport type {\n BaseField,\n FieldGroup,\n FieldOption,\n MultiSelectField,\n NumberField,\n ProfileField,\n SelectField,\n TextField,\n} from './types.js';\n\n// ── Field groups ────────────────────────────────────────────────────────────\n\nexport { profile, genderOptions, religionOptions, languageOptions, reservationOptions, minorityOptions } from './01-profile.js';\nexport { politicalAssociation, politicalSpectrumOptions, partyOptions, civicEngagementOptions } from './02-political.js';\nexport { electoralBehaviour, votingIssueOptions } from './03-electoral.js';\nexport { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';\nexport { psychologicalAssessment, mbtiOptions } from './05-psychological.js';\nexport { education, qualificationOptions } from './06-education.js';\nexport { employment, employmentStatusOptions, shiftOptions, incomeRangeOptions } from './07-employment.js';\nexport { neurodiversity, neurodiversityConditionOptions, sensoryPreferenceOptions, supportNeedOptions } from './08-neurodiversity.js';\nexport { healthLifestyle, disabilityOptions, substanceUseOptions, dietOptions } from './09-health.js';\nexport { worldView, lgbtqStatementOptions, transgenderStatementOptions, casteDiscriminationPlaceOptions } from './10-worldview.js';\nexport { residence } from './11-residence.js';\nexport { household, familyMemberOptions, digitalAccessOptions, householdIncomeOptions } from './12-household.js';\n\n// ── All field groups (for building lookup maps) ─────────────────────────────\n\nimport { profile } from './01-profile.js';\nimport { politicalAssociation } from './02-political.js';\nimport { electoralBehaviour } from './03-electoral.js';\nimport { leadershipAmbitions } from './04-leadership.js';\nimport { psychologicalAssessment } from './05-psychological.js';\nimport { education } from './06-education.js';\nimport { employment } from './07-employment.js';\nimport { neurodiversity } from './08-neurodiversity.js';\nimport { healthLifestyle } from './09-health.js';\nimport { worldView } from './10-worldview.js';\nimport { residence } from './11-residence.js';\nimport { household } from './12-household.js';\nimport type { FieldGroup } from './types.js';\n\nexport const allFieldGroups: readonly FieldGroup[] = [\n profile,\n politicalAssociation,\n electoralBehaviour,\n leadershipAmbitions,\n psychologicalAssessment,\n education,\n employment,\n neurodiversity,\n healthLifestyle,\n worldView,\n residence,\n household,\n];\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile-fields/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,+EAA+E;AAE/E,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,OAAO,EACP,eAAe,EACf,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ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c,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,MAAM,CAAC,MAAM,cAAc,GAA0B;IACnD,OAAO;IACP,oBAAoB;IACpB,kBAAkB;IAClB,mBAAmB;IACnB,uBAAuB;IACvB,SAAS;IACT,UAAU;IACV,cAAc;IACd,eAAe;IACf,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC","sourcesContent":["/**\n * UDP Profile Fields — barrel export.\n *\n * Mirrors the dating-schema profile-fields pattern.\n * Each file defines a FieldGroup with rich field metadata and options.\n */\n\nexport type {\n BaseField,\n FieldGroup,\n FieldOption,\n MultiSelectField,\n NumberField,\n ProfileField,\n SelectField,\n TextField,\n} from './types.js';\n\n// ── Field groups ────────────────────────────────────────────────────────────\n\nexport {\n genderOptions,\n languageOptions,\n minorityOptions,\n profile,\n religionOptions,\n reservationOptions,\n} from './01-profile.js';\nexport {\n civicEngagementOptions,\n partyOptions,\n politicalAssociation,\n politicalSpectrumOptions,\n} from './02-political.js';\nexport { electoralBehaviour, votingIssueOptions } from './03-electoral.js';\nexport { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';\nexport { mbtiOptions, psychologicalAssessment } from './05-psychological.js';\nexport { education, qualificationOptions } from './06-education.js';\nexport {\n employment,\n employmentStatusOptions,\n incomeRangeOptions,\n shiftOptions,\n} from './07-employment.js';\nexport {\n neurodiversity,\n neurodiversityConditionOptions,\n sensoryPreferenceOptions,\n supportNeedOptions,\n} from './08-neurodiversity.js';\nexport {\n dietOptions,\n disabilityOptions,\n healthLifestyle,\n substanceUseOptions,\n} from './09-health.js';\nexport {\n casteDiscriminationPlaceOptions,\n lgbtqStatementOptions,\n transgenderStatementOptions,\n worldView,\n} from './10-worldview.js';\nexport { residence } from './11-residence.js';\nexport {\n digitalAccessOptions,\n familyMemberOptions,\n household,\n householdIncomeOptions,\n} from './12-household.js';\n\n// ── All field groups (for building lookup maps) ─────────────────────────────\n\nimport { profile } from './01-profile.js';\nimport { politicalAssociation } from './02-political.js';\nimport { electoralBehaviour } from './03-electoral.js';\nimport { leadershipAmbitions } from './04-leadership.js';\nimport { psychologicalAssessment } from './05-psychological.js';\nimport { education } from './06-education.js';\nimport { employment } from './07-employment.js';\nimport { neurodiversity } from './08-neurodiversity.js';\nimport { healthLifestyle } from './09-health.js';\nimport { worldView } from './10-worldview.js';\nimport { residence } from './11-residence.js';\nimport { household } from './12-household.js';\nimport type { FieldGroup } from './types.js';\n\nexport const allFieldGroups: readonly FieldGroup[] = [\n profile,\n politicalAssociation,\n electoralBehaviour,\n leadershipAmbitions,\n psychologicalAssessment,\n education,\n employment,\n neurodiversity,\n healthLifestyle,\n worldView,\n residence,\n household,\n];\n"]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * UDP Onboarding Validation — single source of truth.
3
+ *
4
+ * Pure functions, no framework dependencies (no React hooks, no DOM).
5
+ * Used by both frontend (canProceed check) and backend (submission validation).
6
+ *
7
+ * @module udp-schema/validation
8
+ */
9
+ /**
10
+ * Check if the user can proceed from the current sub-step.
11
+ *
12
+ * @param fieldKey - Current field being filled
13
+ * @param required - Whether the field is required
14
+ * @param form - Current form data (flat key-value object)
15
+ * @returns true if the user can proceed
16
+ */
17
+ export declare function canProceed(fieldKey: string, required: boolean, form: Record<string, unknown>): boolean;
18
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAoLT"}
@@ -0,0 +1,186 @@
1
+ /**
2
+ * UDP Onboarding Validation — single source of truth.
3
+ *
4
+ * Pure functions, no framework dependencies (no React hooks, no DOM).
5
+ * Used by both frontend (canProceed check) and backend (submission validation).
6
+ *
7
+ * @module udp-schema/validation
8
+ */
9
+ import { calcAge } from './helpers.js';
10
+ /**
11
+ * Check if the user can proceed from the current sub-step.
12
+ *
13
+ * @param fieldKey - Current field being filled
14
+ * @param required - Whether the field is required
15
+ * @param form - Current form data (flat key-value object)
16
+ * @returns true if the user can proceed
17
+ */
18
+ export function canProceed(fieldKey, required, form) {
19
+ if (!required)
20
+ return true;
21
+ const value = form[fieldKey];
22
+ switch (fieldKey) {
23
+ // ── Names: minimum 1 char trimmed ──
24
+ case 'firstName':
25
+ case 'lastName':
26
+ return typeof value === 'string' && value.trim().length >= 1;
27
+ // ── Date of birth: must exist AND user must be 18+ ──
28
+ case 'dateOfBirth': {
29
+ if (!value)
30
+ return false;
31
+ const age = calcAge(String(value));
32
+ return age !== null && age >= 18;
33
+ }
34
+ // ── Phone: digits only, 7-15 chars ──
35
+ case 'whatsappNumber': {
36
+ if (!value)
37
+ return false;
38
+ const digits = String(value).replace(/\D/g, '');
39
+ return digits.length >= 7 && digits.length <= 15;
40
+ }
41
+ // ── Single-select enums: must be non-empty string ──
42
+ case 'gender':
43
+ case 'familyReligion':
44
+ case 'personalReligion':
45
+ case 'reservationStatus':
46
+ case 'minorityStatus':
47
+ case 'primaryLanguage':
48
+ case 'highestQualification':
49
+ case 'politicalSpectrum':
50
+ case 'employmentStatus':
51
+ case 'maritalStatus':
52
+ case 'willVoteThisTime':
53
+ case 'didVoteLastTime':
54
+ case 'votingFrequency':
55
+ case 'participateInRevolution':
56
+ case 'desiredPoliticalPosition':
57
+ case 'politicalExposure':
58
+ case 'comfortWithVisibility':
59
+ case 'socialInfluenceLevel':
60
+ case 'pastExperience':
61
+ case 'neurodiverseIdentity':
62
+ case 'generalHealth':
63
+ case 'healthInsurance':
64
+ case 'physicalActivity':
65
+ case 'sleepQuality':
66
+ case 'stressLevel':
67
+ case 'workShift':
68
+ case 'comfortableWithShift':
69
+ case 'desiredShift':
70
+ case 'learningStyle':
71
+ case 'communicationPreference':
72
+ case 'viewOnAnimalCruelty':
73
+ case 'facingCasteDiscrimination':
74
+ case 'viewOnGenderEquality':
75
+ case 'housingType':
76
+ case 'bplCard':
77
+ case 'migrationStatus':
78
+ case 'landOwnership':
79
+ case 'primaryIncomeSource':
80
+ case 'diet':
81
+ return typeof value === 'string' && value.length > 0;
82
+ // ── Multi-select arrays: at least 1 selection ──
83
+ case 'secondaryLanguages':
84
+ case 'primaryVotingIssues':
85
+ case 'leadershipSkillset':
86
+ case 'networkAndCivicEngagement':
87
+ case 'conditions':
88
+ case 'sensoryPreferences':
89
+ case 'supportNeeds':
90
+ case 'disabilityStatus':
91
+ case 'substanceUse':
92
+ case 'viewOnLgbtqStatements':
93
+ case 'viewOnTransgenderInclusion':
94
+ case 'casteDiscriminationPlaces':
95
+ case 'familyMembers':
96
+ case 'digitalAccess':
97
+ return Array.isArray(value) && value.length > 0;
98
+ // ── Text inputs: non-empty trimmed string ──
99
+ case 'epicNumber':
100
+ case 'selfPartyAssociation':
101
+ case 'familyPartyAssociation':
102
+ case 'occupation':
103
+ case 'incomeRange':
104
+ case 'householdIncome':
105
+ return typeof value === 'string' && value.trim().length > 0;
106
+ // ── Free text: at least 5 chars ──
107
+ case 'changesYouWantToBring':
108
+ case 'dreamOccupation':
109
+ return typeof value === 'string' && value.trim().length >= 5;
110
+ // ── Number fields ──
111
+ case 'numberOfDependents':
112
+ return typeof value === 'number' && value >= 0;
113
+ // ── Address: at least state and district ──
114
+ case 'currentAddress':
115
+ case 'permanentAddress':
116
+ case 'homeNativePlace':
117
+ case 'ancestralPlace': {
118
+ if (!value || typeof value !== 'object')
119
+ return false;
120
+ const addr = value;
121
+ return !!addr.state && !!addr.district;
122
+ }
123
+ // ── MBTI type ──
124
+ case 'mbtiType':
125
+ return typeof value === 'string' && value.length > 0;
126
+ // ── OCEAN: at least one dimension set ──
127
+ case 'oceanScores': {
128
+ if (!value || typeof value !== 'object')
129
+ return false;
130
+ const scores = value;
131
+ return Object.values(scores).some((v) => typeof v === 'number' && v >= 1 && v <= 100);
132
+ }
133
+ // ── Compound: publicOfficeAndElections ──
134
+ case 'publicOfficeAndElections': {
135
+ if (!value || typeof value !== 'object')
136
+ return false;
137
+ const office = value;
138
+ return !!office.hasHeldOffice;
139
+ }
140
+ // ── Education multi-field: at least one field filled ──
141
+ case 'education10th':
142
+ case 'education12th': {
143
+ if (!value || typeof value !== 'object')
144
+ return false;
145
+ return Object.values(value).some((v) => typeof v === 'string' && v.trim().length > 0);
146
+ }
147
+ // ── Degree repeaters ──
148
+ case 'diplomas':
149
+ case 'graduations':
150
+ case 'postGraduations':
151
+ case 'doctorates':
152
+ case 'postDoctorates': {
153
+ if (!Array.isArray(value) || value.length === 0)
154
+ return false;
155
+ return value.some((entry) => typeof entry.degreeName === 'string' && entry.degreeName.trim().length > 0);
156
+ }
157
+ // ── Certificate repeater ──
158
+ case 'otherCertificates': {
159
+ if (!Array.isArray(value) || value.length === 0)
160
+ return false;
161
+ return value.some((entry) => typeof entry.certificateName === 'string' &&
162
+ entry.certificateName.trim().length > 0);
163
+ }
164
+ // ── Text opinions ──
165
+ case 'educationNotes':
166
+ case 'viewOnLgbtqOpinion':
167
+ case 'viewOnTransgenderOpinion':
168
+ return typeof value === 'string' && value.trim().length > 0;
169
+ // ── Default: strict (not permissive) ──
170
+ default:
171
+ if (value === null || value === undefined)
172
+ return false;
173
+ if (typeof value === 'string')
174
+ return value.trim().length > 0;
175
+ if (typeof value === 'number')
176
+ return true;
177
+ if (typeof value === 'boolean')
178
+ return true;
179
+ if (Array.isArray(value))
180
+ return value.length > 0;
181
+ if (typeof value === 'object')
182
+ return Object.keys(value).length > 0;
183
+ return false;
184
+ }
185
+ }
186
+ //# source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CAAC;IACjB,CAAC;AACH,CAAC","sourcesContent":["/**\n * UDP Onboarding Validation — single source of truth.\n *\n * Pure functions, no framework dependencies (no React hooks, no DOM).\n * Used by both frontend (canProceed check) and backend (submission validation).\n *\n * @module udp-schema/validation\n */\n\nimport { calcAge } from './helpers.js';\n\n/**\n * Check if the user can proceed from the current sub-step.\n *\n * @param fieldKey - Current field being filled\n * @param required - Whether the field is required\n * @param form - Current form data (flat key-value object)\n * @returns true if the user can proceed\n */\nexport function canProceed(\n fieldKey: string,\n required: boolean,\n form: Record<string, unknown>,\n): boolean {\n if (!required) return true;\n\n const value = form[fieldKey];\n\n switch (fieldKey) {\n // ── Names: minimum 1 char trimmed ──\n case 'firstName':\n case 'lastName':\n return typeof value === 'string' && value.trim().length >= 1;\n\n // ── Date of birth: must exist AND user must be 18+ ──\n case 'dateOfBirth': {\n if (!value) return false;\n const age = calcAge(String(value));\n return age !== null && age >= 18;\n }\n\n // ── Phone: digits only, 7-15 chars ──\n case 'whatsappNumber': {\n if (!value) return false;\n const digits = String(value).replace(/\\D/g, '');\n return digits.length >= 7 && digits.length <= 15;\n }\n\n // ── Single-select enums: must be non-empty string ──\n case 'gender':\n case 'familyReligion':\n case 'personalReligion':\n case 'reservationStatus':\n case 'minorityStatus':\n case 'primaryLanguage':\n case 'highestQualification':\n case 'politicalSpectrum':\n case 'employmentStatus':\n case 'maritalStatus':\n case 'willVoteThisTime':\n case 'didVoteLastTime':\n case 'votingFrequency':\n case 'participateInRevolution':\n case 'desiredPoliticalPosition':\n case 'politicalExposure':\n case 'comfortWithVisibility':\n case 'socialInfluenceLevel':\n case 'pastExperience':\n case 'neurodiverseIdentity':\n case 'generalHealth':\n case 'healthInsurance':\n case 'physicalActivity':\n case 'sleepQuality':\n case 'stressLevel':\n case 'workShift':\n case 'comfortableWithShift':\n case 'desiredShift':\n case 'learningStyle':\n case 'communicationPreference':\n case 'viewOnAnimalCruelty':\n case 'facingCasteDiscrimination':\n case 'viewOnGenderEquality':\n case 'housingType':\n case 'bplCard':\n case 'migrationStatus':\n case 'landOwnership':\n case 'primaryIncomeSource':\n case 'diet':\n return typeof value === 'string' && value.length > 0;\n\n // ── Multi-select arrays: at least 1 selection ──\n case 'secondaryLanguages':\n case 'primaryVotingIssues':\n case 'leadershipSkillset':\n case 'networkAndCivicEngagement':\n case 'conditions':\n case 'sensoryPreferences':\n case 'supportNeeds':\n case 'disabilityStatus':\n case 'substanceUse':\n case 'viewOnLgbtqStatements':\n case 'viewOnTransgenderInclusion':\n case 'casteDiscriminationPlaces':\n case 'familyMembers':\n case 'digitalAccess':\n return Array.isArray(value) && value.length > 0;\n\n // ── Text inputs: non-empty trimmed string ──\n case 'epicNumber':\n case 'selfPartyAssociation':\n case 'familyPartyAssociation':\n case 'occupation':\n case 'incomeRange':\n case 'householdIncome':\n return typeof value === 'string' && value.trim().length > 0;\n\n // ── Free text: at least 5 chars ──\n case 'changesYouWantToBring':\n case 'dreamOccupation':\n return typeof value === 'string' && value.trim().length >= 5;\n\n // ── Number fields ──\n case 'numberOfDependents':\n return typeof value === 'number' && value >= 0;\n\n // ── Address: at least state and district ──\n case 'currentAddress':\n case 'permanentAddress':\n case 'homeNativePlace':\n case 'ancestralPlace': {\n if (!value || typeof value !== 'object') return false;\n const addr = value as Record<string, unknown>;\n return !!addr.state && !!addr.district;\n }\n\n // ── MBTI type ──\n case 'mbtiType':\n return typeof value === 'string' && value.length > 0;\n\n // ── OCEAN: at least one dimension set ──\n case 'oceanScores': {\n if (!value || typeof value !== 'object') return false;\n const scores = value as Record<string, unknown>;\n return Object.values(scores).some(\n (v) => typeof v === 'number' && v >= 1 && v <= 100,\n );\n }\n\n // ── Compound: publicOfficeAndElections ──\n case 'publicOfficeAndElections': {\n if (!value || typeof value !== 'object') return false;\n const office = value as Record<string, unknown>;\n return !!office.hasHeldOffice;\n }\n\n // ── Education multi-field: at least one field filled ──\n case 'education10th':\n case 'education12th': {\n if (!value || typeof value !== 'object') return false;\n return Object.values(value as Record<string, unknown>).some(\n (v) => typeof v === 'string' && v.trim().length > 0,\n );\n }\n\n // ── Degree repeaters ──\n case 'diplomas':\n case 'graduations':\n case 'postGraduations':\n case 'doctorates':\n case 'postDoctorates': {\n if (!Array.isArray(value) || value.length === 0) return false;\n return value.some(\n (entry: Record<string, unknown>) =>\n typeof entry.degreeName === 'string' && entry.degreeName.trim().length > 0,\n );\n }\n\n // ── Certificate repeater ──\n case 'otherCertificates': {\n if (!Array.isArray(value) || value.length === 0) return false;\n return value.some(\n (entry: Record<string, unknown>) =>\n typeof entry.certificateName === 'string' &&\n entry.certificateName.trim().length > 0,\n );\n }\n\n // ── Text opinions ──\n case 'educationNotes':\n case 'viewOnLgbtqOpinion':\n case 'viewOnTransgenderOpinion':\n return typeof value === 'string' && value.trim().length > 0;\n\n // ── Default: strict (not permissive) ──\n default:\n if (value === null || value === undefined) return false;\n if (typeof value === 'string') return value.trim().length > 0;\n if (typeof value === 'number') return true;\n if (typeof value === 'boolean') return true;\n if (Array.isArray(value)) return value.length > 0;\n if (typeof value === 'object') return Object.keys(value).length > 0;\n return false;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "udp-schema",
3
- "version": "1.1.0",
3
+ "version": "2.1.0",
4
4
  "description": "Shared Zod schemas for User Detailed Profile (frontend + backend).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",