udp-schema 2.7.0 → 2.9.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.
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +10 -3
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/onboarding-config.d.ts.map +1 -1
- package/dist/onboarding-config.js +14 -0
- package/dist/onboarding-config.js.map +1 -1
- package/dist/onboarding-form.d.ts +64 -6
- package/dist/onboarding-form.d.ts.map +1 -1
- package/dist/profile-fields/01-profile.d.ts +81 -9
- package/dist/profile-fields/01-profile.d.ts.map +1 -1
- package/dist/profile-fields/01-profile.js +107 -12
- package/dist/profile-fields/01-profile.js.map +1 -1
- package/dist/profile-fields/02-political.d.ts +188 -2
- package/dist/profile-fields/02-political.d.ts.map +1 -1
- package/dist/profile-fields/02-political.js +146 -4
- package/dist/profile-fields/02-political.js.map +1 -1
- package/dist/profile-fields/index.d.ts +1 -1
- package/dist/profile-fields/index.d.ts.map +1 -1
- package/dist/profile-fields/index.js +1 -1
- package/dist/profile-fields/index.js.map +1 -1
- package/dist/profile-fields/types.d.ts +9 -1
- package/dist/profile-fields/types.d.ts.map +1 -1
- package/dist/profile-fields/types.js.map +1 -1
- package/dist/progress-fields.d.ts.map +1 -1
- package/dist/progress-fields.js +2 -0
- package/dist/progress-fields.js.map +1 -1
- package/dist/step-01.schema.d.ts +15 -4
- package/dist/step-01.schema.d.ts.map +1 -1
- package/dist/step-01.schema.js +31 -4
- package/dist/step-01.schema.js.map +1 -1
- package/dist/step-02.schema.d.ts +47 -0
- package/dist/step-02.schema.d.ts.map +1 -1
- package/dist/step-02.schema.js +56 -4
- package/dist/step-02.schema.js.map +1 -1
- package/dist/step-10.schema.d.ts +1 -1
- package/dist/step-12.schema.d.ts +1 -1
- package/package.json +1 -1
|
@@ -46,6 +46,11 @@ export const politicalSpectrumOptions = [
|
|
|
46
46
|
},
|
|
47
47
|
{ value: 'prefer_not_to_say', label: 'Prefer not to say' },
|
|
48
48
|
];
|
|
49
|
+
/**
|
|
50
|
+
* Indian political parties — exhaustive list of nationally- or state-recognized
|
|
51
|
+
* parties active as of 2026. Ordered roughly by national visibility; state /
|
|
52
|
+
* regional parties follow. Includes post-2023 splits (NCP-SP, Shiv Sena UBT).
|
|
53
|
+
*/
|
|
49
54
|
export const partyOptions = [
|
|
50
55
|
{ value: 'bjp', label: 'BJP' },
|
|
51
56
|
{ value: 'inc', label: 'Indian National Congress (INC)' },
|
|
@@ -55,33 +60,145 @@ export const partyOptions = [
|
|
|
55
60
|
{ value: 'tmc', label: 'Trinamool Congress (TMC)' },
|
|
56
61
|
{ value: 'dmk', label: 'DMK' },
|
|
57
62
|
{ value: 'aiadmk', label: 'AIADMK' },
|
|
58
|
-
{ value: 'ncp', label: 'NCP' },
|
|
59
|
-
{ value: '
|
|
63
|
+
{ value: 'ncp', label: 'NCP (Ajit Pawar)' },
|
|
64
|
+
{ value: 'ncp_sp', label: 'NCP (Sharad Pawar)' },
|
|
65
|
+
{ value: 'shiv_sena', label: 'Shiv Sena (Shinde)' },
|
|
66
|
+
{ value: 'shiv_sena_ubt', label: 'Shiv Sena (UBT)' },
|
|
67
|
+
{ value: 'aimim', label: 'AIMIM' },
|
|
60
68
|
{ value: 'jdu', label: 'JD(U)' },
|
|
69
|
+
{ value: 'jds', label: 'JD(S)' },
|
|
61
70
|
{ value: 'rjd', label: 'RJD' },
|
|
62
71
|
{ value: 'cpim', label: 'CPI(M)' },
|
|
63
72
|
{ value: 'cpi', label: 'CPI' },
|
|
64
73
|
{ value: 'ysrcp', label: 'YSRCP' },
|
|
65
74
|
{ value: 'tdp', label: 'TDP' },
|
|
75
|
+
{ value: 'brs', label: 'BRS (Bharat Rashtra Samithi)' },
|
|
66
76
|
{ value: 'bjd', label: 'BJD' },
|
|
67
77
|
{ value: 'jmm', label: 'JMM' },
|
|
78
|
+
{ value: 'sad', label: 'Shiromani Akali Dal (SAD)' },
|
|
79
|
+
{ value: 'rld', label: 'Rashtriya Lok Dal (RLD)' },
|
|
80
|
+
{ value: 'aiudf', label: 'AIUDF' },
|
|
81
|
+
{ value: 'jkn', label: 'J&K National Conference' },
|
|
82
|
+
{ value: 'inld', label: 'Indian National Lok Dal (INLD)' },
|
|
83
|
+
{ value: 'iuml', label: 'Indian Union Muslim League (IUML)' },
|
|
84
|
+
{ value: 'mns', label: 'Maharashtra Navnirman Sena (MNS)' },
|
|
85
|
+
{ value: 'agp', label: 'Asom Gana Parishad (AGP)' },
|
|
86
|
+
{ value: 'independent', label: 'Independent candidate' },
|
|
68
87
|
{ value: 'none', label: 'No party affiliation' },
|
|
69
88
|
{ value: 'other', label: 'Other' },
|
|
70
89
|
{ value: 'prefer_not_to_say', label: 'Prefer not to say' },
|
|
71
90
|
];
|
|
91
|
+
/**
|
|
92
|
+
* Civic-engagement categories — expanded to cover organizational forms
|
|
93
|
+
* common in Indian political/social life, including ideological networks
|
|
94
|
+
* (RSS / Sangh), farmers' bodies, women's collectives, student unions,
|
|
95
|
+
* and party youth wings.
|
|
96
|
+
*/
|
|
72
97
|
export const civicEngagementOptions = [
|
|
73
98
|
{ value: 'ngo', label: 'NGO / Non-profit' },
|
|
74
99
|
{ value: 'trade_union', label: 'Trade Union' },
|
|
100
|
+
{ value: 'farmers_organization', label: "Farmers' Organization / Kisan Sangathan" },
|
|
75
101
|
{ value: 'cooperative', label: 'Cooperative Society' },
|
|
76
102
|
{ value: 'resident_association', label: 'Resident Welfare Association' },
|
|
77
103
|
{ value: 'self_help_group', label: 'Self Help Group (SHG)' },
|
|
104
|
+
{ value: 'womens_collective', label: "Women's Collective / Mahila Mandal" },
|
|
78
105
|
{ value: 'youth_club', label: 'Youth Club' },
|
|
106
|
+
{ value: 'student_union', label: 'Student Union' },
|
|
107
|
+
{ value: 'political_party_youth_wing', label: 'Political Party Youth Wing (BJYM / IYC / etc.)' },
|
|
108
|
+
{ value: 'rss_swayamsevak', label: 'RSS / Swayamsevak (Sangh network)' },
|
|
79
109
|
{ value: 'religious_organization', label: 'Religious Organization' },
|
|
80
110
|
{ value: 'caste_association', label: 'Caste Association' },
|
|
81
111
|
{ value: 'professional_body', label: 'Professional Body' },
|
|
112
|
+
{ value: 'environmental_group', label: 'Environmental Group' },
|
|
113
|
+
{ value: 'cultural_association', label: 'Cultural Association' },
|
|
114
|
+
{ value: 'alumni_association', label: 'Alumni Association' },
|
|
82
115
|
{ value: 'none', label: 'None' },
|
|
83
116
|
{ value: 'other', label: 'Other' },
|
|
84
117
|
];
|
|
118
|
+
/**
|
|
119
|
+
* Nature of the respondent's association with their political party.
|
|
120
|
+
* Differentiates card-carrying members from sympathizers and office-bearers.
|
|
121
|
+
*/
|
|
122
|
+
export const partyAssociationRoleOptions = [
|
|
123
|
+
{
|
|
124
|
+
value: 'member',
|
|
125
|
+
label: 'Member',
|
|
126
|
+
description: 'Primary / card-carrying member of the party',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
value: 'active_worker',
|
|
130
|
+
label: 'Active Worker',
|
|
131
|
+
description: 'Campaigning, organizing, and on-ground work',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
value: 'office_bearer',
|
|
135
|
+
label: 'Office Bearer',
|
|
136
|
+
description: 'Hold an official post in the party',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
value: 'candidate',
|
|
140
|
+
label: 'Candidate',
|
|
141
|
+
description: 'Contested or planning to contest on this party ticket',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
value: 'spokesperson',
|
|
145
|
+
label: 'Spokesperson',
|
|
146
|
+
description: 'Represent the party publicly or in media',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
value: 'volunteer',
|
|
150
|
+
label: 'Volunteer',
|
|
151
|
+
description: 'Occasional volunteer work without formal membership',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
value: 'sympathizer',
|
|
155
|
+
label: 'Sympathizer',
|
|
156
|
+
description: 'Support the party but no formal role',
|
|
157
|
+
},
|
|
158
|
+
{ value: 'none', label: 'None', description: 'No formal association' },
|
|
159
|
+
{ value: 'prefer_not_to_say', label: 'Prefer not to say' },
|
|
160
|
+
];
|
|
161
|
+
/**
|
|
162
|
+
* Family / relatives in politics — captures intergenerational political
|
|
163
|
+
* involvement that shapes political consciousness in India.
|
|
164
|
+
*/
|
|
165
|
+
export const relativesInPoliticsOptions = [
|
|
166
|
+
{ value: 'none', label: 'No one', description: 'No relatives are in politics' },
|
|
167
|
+
{
|
|
168
|
+
value: 'immediate_family',
|
|
169
|
+
label: 'Immediate family',
|
|
170
|
+
description: 'Parents, siblings, spouse, or children',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
value: 'extended_family',
|
|
174
|
+
label: 'Extended family',
|
|
175
|
+
description: 'Uncles, aunts, cousins, or in-laws',
|
|
176
|
+
},
|
|
177
|
+
{ value: 'both', label: 'Both immediate and extended' },
|
|
178
|
+
{ value: 'dont_know', label: "Don't know" },
|
|
179
|
+
{ value: 'prefer_not_to_say', label: 'Prefer not to say' },
|
|
180
|
+
];
|
|
181
|
+
/**
|
|
182
|
+
* Levels of elected / appointed office — used for both office held and
|
|
183
|
+
* election contested, so the two use the same enum.
|
|
184
|
+
*/
|
|
185
|
+
export const officeElectionLevelOptions = [
|
|
186
|
+
{ value: 'panchayat', label: 'Panchayat / Gram' },
|
|
187
|
+
{ value: 'ward', label: 'Ward / Nagar Palika' },
|
|
188
|
+
{ value: 'municipality', label: 'Municipality' },
|
|
189
|
+
{ value: 'block', label: 'Block / Tehsil' },
|
|
190
|
+
{ value: 'district', label: 'District / Zila Parishad' },
|
|
191
|
+
{ value: 'assembly', label: 'State Assembly (MLA)' },
|
|
192
|
+
{ value: 'parliament', label: 'Parliament (MP)' },
|
|
193
|
+
{ value: 'other', label: 'Other' },
|
|
194
|
+
];
|
|
195
|
+
/** Outcome of an election the respondent contested. */
|
|
196
|
+
export const electionResultOptions = [
|
|
197
|
+
{ value: 'won', label: 'Won' },
|
|
198
|
+
{ value: 'lost', label: 'Lost' },
|
|
199
|
+
{ value: 'withdrew', label: 'Withdrew before voting' },
|
|
200
|
+
{ value: 'ongoing', label: 'Currently contesting' },
|
|
201
|
+
];
|
|
85
202
|
export const politicalAssociation = {
|
|
86
203
|
key: 'political_association',
|
|
87
204
|
label: 'Political Association & History',
|
|
@@ -109,7 +226,22 @@ export const politicalAssociation = {
|
|
|
109
226
|
options: [...partyOptions],
|
|
110
227
|
},
|
|
111
228
|
{
|
|
229
|
+
// Only ask about role if the respondent has a party association.
|
|
112
230
|
order: 3,
|
|
231
|
+
key: 'partyAssociationRole',
|
|
232
|
+
label: 'Your Role in the Party',
|
|
233
|
+
type: 'single_select',
|
|
234
|
+
step: 2,
|
|
235
|
+
isOnboarding: true,
|
|
236
|
+
optional: true,
|
|
237
|
+
options: [...partyAssociationRoleOptions],
|
|
238
|
+
conditionalOn: {
|
|
239
|
+
field: 'selfPartyAssociation',
|
|
240
|
+
notIn: ['none', 'prefer_not_to_say'],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
order: 4,
|
|
113
245
|
key: 'familyPartyAssociation',
|
|
114
246
|
label: 'Family Party Association',
|
|
115
247
|
type: 'single_select',
|
|
@@ -119,7 +251,17 @@ export const politicalAssociation = {
|
|
|
119
251
|
options: [...partyOptions],
|
|
120
252
|
},
|
|
121
253
|
{
|
|
122
|
-
order:
|
|
254
|
+
order: 5,
|
|
255
|
+
key: 'relativesInPolitics',
|
|
256
|
+
label: 'Relatives in Politics',
|
|
257
|
+
type: 'single_select',
|
|
258
|
+
step: 2,
|
|
259
|
+
isOnboarding: true,
|
|
260
|
+
optional: true,
|
|
261
|
+
options: [...relativesInPoliticsOptions],
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
order: 6,
|
|
123
265
|
key: 'publicOfficeAndElections',
|
|
124
266
|
label: 'Public Office & Elections',
|
|
125
267
|
type: 'object',
|
|
@@ -129,7 +271,7 @@ export const politicalAssociation = {
|
|
|
129
271
|
description: 'Have you held public office or contested elections?',
|
|
130
272
|
},
|
|
131
273
|
{
|
|
132
|
-
order:
|
|
274
|
+
order: 7,
|
|
133
275
|
key: 'networkAndCivicEngagement',
|
|
134
276
|
label: 'Civic Engagement',
|
|
135
277
|
type: 'multi_select',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"02-political.js","sourceRoot":"","sources":["../../src/profile-fields/02-political.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC;QACE,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,wEAAwE;KACtF;IACD;QACE,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,8DAA8D;KAC5E;IACD;QACE,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,gEAAgE;KAC9E;IACD;QACE,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,mEAAmE;KACjF;IACD;QACE,KAAK,EAAE,cAAc;QACrB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,qFAAqF;KACxF;IACD;QACE,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,qEAAqE;KACnF;IACD;QACE,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,2EAA2E;KACzF;IACD;QACE,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,gFAAgF;KAC9F;IACD;QACE,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,qDAAqD;KACnE;IACD,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,EAAE;CA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AC,GAAG,wBAAwB,CAAC;SACvC;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,sBAAsB;YAC3B,KAAK,EAAE,wBAAwB;YAC/B,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,GAAG,YAAY,CAAC;SAC3B;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,wBAAwB;YAC7B,KAAK,EAAE,0BAA0B;YACjC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,GAAG,YAAY,CAAC;SAC3B;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,0BAA0B;YAC/B,KAAK,EAAE,2BAA2B;YAClC,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,qDAAqD;SACnE;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,2BAA2B;YAChC,KAAK,EAAE,kBAAkB;YACzB,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,GAAG,sBAAsB,CAAC;SACrC;KACF;CACF,CAAC","sourcesContent":["import type { FieldGroup } from './types.js';\n\nexport const politicalSpectrumOptions = [\n {\n value: 'far_left',\n label: 'Far Left',\n description: 'Radical progressive — systemic change, social justice, anti-capitalist',\n },\n {\n value: 'left',\n label: 'Left',\n description: 'Progressive — strong social safety net, equality, regulation',\n },\n {\n value: 'centre_left',\n label: 'Centre-Left',\n description: 'Liberal — social freedoms, moderate reform, inclusive policies',\n },\n {\n value: 'centrist',\n label: 'Centrist',\n description: 'Pragmatic middle — picks issues over ideology, open to both sides',\n },\n {\n value: 'centre_right',\n label: 'Centre-Right',\n description:\n 'Moderate conservative — fiscal discipline, traditional institutions, gradual change',\n },\n {\n value: 'right',\n label: 'Right',\n description: 'Conservative — limited government, free markets, cultural tradition',\n },\n {\n value: 'far_right',\n label: 'Far Right',\n description: 'Nationalist — strong borders, traditional values, national identity first',\n },\n {\n value: 'libertarian',\n label: 'Libertarian',\n description: 'Maximum personal freedom — minimal government in both social and economic life',\n },\n {\n value: 'apolitical',\n label: 'Apolitical',\n description: 'Not interested in politics — focus on personal life',\n },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n] as const;\n\nexport const partyOptions = [\n { value: 'bjp', label: 'BJP' },\n { value: 'inc', label: 'Indian National Congress (INC)' },\n { value: 'aap', label: 'Aam Aadmi Party (AAP)' },\n { value: 'bsp', label: 'Bahujan Samaj Party (BSP)' },\n { value: 'sp', label: 'Samajwadi Party (SP)' },\n { value: 'tmc', label: 'Trinamool Congress (TMC)' },\n { value: 'dmk', label: 'DMK' },\n { value: 'aiadmk', label: 'AIADMK' },\n { value: 'ncp', label: 'NCP' },\n { value: 'shiv_sena', label: 'Shiv Sena' },\n { value: 'jdu', label: 'JD(U)' },\n { value: 'rjd', label: 'RJD' },\n { value: 'cpim', label: 'CPI(M)' },\n { value: 'cpi', label: 'CPI' },\n { value: 'ysrcp', label: 'YSRCP' },\n { value: 'tdp', label: 'TDP' },\n { value: 'bjd', label: 'BJD' },\n { value: 'jmm', label: 'JMM' },\n { value: 'none', label: 'No party affiliation' },\n { value: 'other', label: 'Other' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n] as const;\n\nexport const civicEngagementOptions = [\n { value: 'ngo', label: 'NGO / Non-profit' },\n { value: 'trade_union', label: 'Trade Union' },\n { value: 'cooperative', label: 'Cooperative Society' },\n { value: 'resident_association', label: 'Resident Welfare Association' },\n { value: 'self_help_group', label: 'Self Help Group (SHG)' },\n { value: 'youth_club', label: 'Youth Club' },\n { value: 'religious_organization', label: 'Religious Organization' },\n { value: 'caste_association', label: 'Caste Association' },\n { value: 'professional_body', label: 'Professional Body' },\n { value: 'none', label: 'None' },\n { value: 'other', label: 'Other' },\n] as const;\n\nexport const politicalAssociation: FieldGroup = {\n key: 'political_association',\n label: 'Political Association & History',\n step: 2,\n description: 'Your political spectrum, party associations, and civic engagement.',\n fields: [\n {\n order: 1,\n key: 'politicalSpectrum',\n label: 'Political Spectrum',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...politicalSpectrumOptions],\n },\n {\n order: 2,\n key: 'selfPartyAssociation',\n label: 'Your Party Association',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...partyOptions],\n },\n {\n order: 3,\n key: 'familyPartyAssociation',\n label: 'Family Party Association',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...partyOptions],\n },\n {\n order: 4,\n key: 'publicOfficeAndElections',\n label: 'Public Office & Elections',\n type: 'object',\n step: 2,\n isOnboarding: true,\n optional: true,\n description: 'Have you held public office or contested elections?',\n },\n {\n order: 5,\n key: 'networkAndCivicEngagement',\n label: 'Civic Engagement',\n type: 'multi_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...civicEngagementOptions],\n },\n ],\n};\n"]}
|
|
1
|
+
{"version":3,"file":"02-political.js","sourceRoot":"","sources":["../../src/profile-fields/02-political.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC;QACE,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,wEAAwE;KACtF;IACD;QACE,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,8DAA8D;KAC5E;IACD;QACE,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,gEAAgE;KAC9E;IACD;QACE,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,UAAU;QACj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O,EAAE,CAAC,GAAG,YAAY,CAAC;SAC3B;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,qBAAqB;YAC1B,KAAK,EAAE,uBAAuB;YAC9B,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,GAAG,0BAA0B,CAAC;SACzC;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,0BAA0B;YAC/B,KAAK,EAAE,2BAA2B;YAClC,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,qDAAqD;SACnE;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,2BAA2B;YAChC,KAAK,EAAE,kBAAkB;YACzB,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,GAAG,sBAAsB,CAAC;SACrC;KACF;CACF,CAAC","sourcesContent":["import type { FieldGroup } from './types.js';\n\nexport const politicalSpectrumOptions = [\n {\n value: 'far_left',\n label: 'Far Left',\n description: 'Radical progressive — systemic change, social justice, anti-capitalist',\n },\n {\n value: 'left',\n label: 'Left',\n description: 'Progressive — strong social safety net, equality, regulation',\n },\n {\n value: 'centre_left',\n label: 'Centre-Left',\n description: 'Liberal — social freedoms, moderate reform, inclusive policies',\n },\n {\n value: 'centrist',\n label: 'Centrist',\n description: 'Pragmatic middle — picks issues over ideology, open to both sides',\n },\n {\n value: 'centre_right',\n label: 'Centre-Right',\n description:\n 'Moderate conservative — fiscal discipline, traditional institutions, gradual change',\n },\n {\n value: 'right',\n label: 'Right',\n description: 'Conservative — limited government, free markets, cultural tradition',\n },\n {\n value: 'far_right',\n label: 'Far Right',\n description: 'Nationalist — strong borders, traditional values, national identity first',\n },\n {\n value: 'libertarian',\n label: 'Libertarian',\n description: 'Maximum personal freedom — minimal government in both social and economic life',\n },\n {\n value: 'apolitical',\n label: 'Apolitical',\n description: 'Not interested in politics — focus on personal life',\n },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n] as const;\n\n/**\n * Indian political parties — exhaustive list of nationally- or state-recognized\n * parties active as of 2026. Ordered roughly by national visibility; state /\n * regional parties follow. Includes post-2023 splits (NCP-SP, Shiv Sena UBT).\n */\nexport const partyOptions = [\n { value: 'bjp', label: 'BJP' },\n { value: 'inc', label: 'Indian National Congress (INC)' },\n { value: 'aap', label: 'Aam Aadmi Party (AAP)' },\n { value: 'bsp', label: 'Bahujan Samaj Party (BSP)' },\n { value: 'sp', label: 'Samajwadi Party (SP)' },\n { value: 'tmc', label: 'Trinamool Congress (TMC)' },\n { value: 'dmk', label: 'DMK' },\n { value: 'aiadmk', label: 'AIADMK' },\n { value: 'ncp', label: 'NCP (Ajit Pawar)' },\n { value: 'ncp_sp', label: 'NCP (Sharad Pawar)' },\n { value: 'shiv_sena', label: 'Shiv Sena (Shinde)' },\n { value: 'shiv_sena_ubt', label: 'Shiv Sena (UBT)' },\n { value: 'aimim', label: 'AIMIM' },\n { value: 'jdu', label: 'JD(U)' },\n { value: 'jds', label: 'JD(S)' },\n { value: 'rjd', label: 'RJD' },\n { value: 'cpim', label: 'CPI(M)' },\n { value: 'cpi', label: 'CPI' },\n { value: 'ysrcp', label: 'YSRCP' },\n { value: 'tdp', label: 'TDP' },\n { value: 'brs', label: 'BRS (Bharat Rashtra Samithi)' },\n { value: 'bjd', label: 'BJD' },\n { value: 'jmm', label: 'JMM' },\n { value: 'sad', label: 'Shiromani Akali Dal (SAD)' },\n { value: 'rld', label: 'Rashtriya Lok Dal (RLD)' },\n { value: 'aiudf', label: 'AIUDF' },\n { value: 'jkn', label: 'J&K National Conference' },\n { value: 'inld', label: 'Indian National Lok Dal (INLD)' },\n { value: 'iuml', label: 'Indian Union Muslim League (IUML)' },\n { value: 'mns', label: 'Maharashtra Navnirman Sena (MNS)' },\n { value: 'agp', label: 'Asom Gana Parishad (AGP)' },\n { value: 'independent', label: 'Independent candidate' },\n { value: 'none', label: 'No party affiliation' },\n { value: 'other', label: 'Other' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n] as const;\n\n/**\n * Civic-engagement categories — expanded to cover organizational forms\n * common in Indian political/social life, including ideological networks\n * (RSS / Sangh), farmers' bodies, women's collectives, student unions,\n * and party youth wings.\n */\nexport const civicEngagementOptions = [\n { value: 'ngo', label: 'NGO / Non-profit' },\n { value: 'trade_union', label: 'Trade Union' },\n { value: 'farmers_organization', label: \"Farmers' Organization / Kisan Sangathan\" },\n { value: 'cooperative', label: 'Cooperative Society' },\n { value: 'resident_association', label: 'Resident Welfare Association' },\n { value: 'self_help_group', label: 'Self Help Group (SHG)' },\n { value: 'womens_collective', label: \"Women's Collective / Mahila Mandal\" },\n { value: 'youth_club', label: 'Youth Club' },\n { value: 'student_union', label: 'Student Union' },\n { value: 'political_party_youth_wing', label: 'Political Party Youth Wing (BJYM / IYC / etc.)' },\n { value: 'rss_swayamsevak', label: 'RSS / Swayamsevak (Sangh network)' },\n { value: 'religious_organization', label: 'Religious Organization' },\n { value: 'caste_association', label: 'Caste Association' },\n { value: 'professional_body', label: 'Professional Body' },\n { value: 'environmental_group', label: 'Environmental Group' },\n { value: 'cultural_association', label: 'Cultural Association' },\n { value: 'alumni_association', label: 'Alumni Association' },\n { value: 'none', label: 'None' },\n { value: 'other', label: 'Other' },\n] as const;\n\n/**\n * Nature of the respondent's association with their political party.\n * Differentiates card-carrying members from sympathizers and office-bearers.\n */\nexport const partyAssociationRoleOptions = [\n {\n value: 'member',\n label: 'Member',\n description: 'Primary / card-carrying member of the party',\n },\n {\n value: 'active_worker',\n label: 'Active Worker',\n description: 'Campaigning, organizing, and on-ground work',\n },\n {\n value: 'office_bearer',\n label: 'Office Bearer',\n description: 'Hold an official post in the party',\n },\n {\n value: 'candidate',\n label: 'Candidate',\n description: 'Contested or planning to contest on this party ticket',\n },\n {\n value: 'spokesperson',\n label: 'Spokesperson',\n description: 'Represent the party publicly or in media',\n },\n {\n value: 'volunteer',\n label: 'Volunteer',\n description: 'Occasional volunteer work without formal membership',\n },\n {\n value: 'sympathizer',\n label: 'Sympathizer',\n description: 'Support the party but no formal role',\n },\n { value: 'none', label: 'None', description: 'No formal association' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n] as const;\n\n/**\n * Family / relatives in politics — captures intergenerational political\n * involvement that shapes political consciousness in India.\n */\nexport const relativesInPoliticsOptions = [\n { value: 'none', label: 'No one', description: 'No relatives are in politics' },\n {\n value: 'immediate_family',\n label: 'Immediate family',\n description: 'Parents, siblings, spouse, or children',\n },\n {\n value: 'extended_family',\n label: 'Extended family',\n description: 'Uncles, aunts, cousins, or in-laws',\n },\n { value: 'both', label: 'Both immediate and extended' },\n { value: 'dont_know', label: \"Don't know\" },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n] as const;\n\n/**\n * Levels of elected / appointed office — used for both office held and\n * election contested, so the two use the same enum.\n */\nexport const officeElectionLevelOptions = [\n { value: 'panchayat', label: 'Panchayat / Gram' },\n { value: 'ward', label: 'Ward / Nagar Palika' },\n { value: 'municipality', label: 'Municipality' },\n { value: 'block', label: 'Block / Tehsil' },\n { value: 'district', label: 'District / Zila Parishad' },\n { value: 'assembly', label: 'State Assembly (MLA)' },\n { value: 'parliament', label: 'Parliament (MP)' },\n { value: 'other', label: 'Other' },\n] as const;\n\n/** Outcome of an election the respondent contested. */\nexport const electionResultOptions = [\n { value: 'won', label: 'Won' },\n { value: 'lost', label: 'Lost' },\n { value: 'withdrew', label: 'Withdrew before voting' },\n { value: 'ongoing', label: 'Currently contesting' },\n] as const;\n\nexport const politicalAssociation: FieldGroup = {\n key: 'political_association',\n label: 'Political Association & History',\n step: 2,\n description: 'Your political spectrum, party associations, and civic engagement.',\n fields: [\n {\n order: 1,\n key: 'politicalSpectrum',\n label: 'Political Spectrum',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...politicalSpectrumOptions],\n },\n {\n order: 2,\n key: 'selfPartyAssociation',\n label: 'Your Party Association',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...partyOptions],\n },\n {\n // Only ask about role if the respondent has a party association.\n order: 3,\n key: 'partyAssociationRole',\n label: 'Your Role in the Party',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...partyAssociationRoleOptions],\n conditionalOn: {\n field: 'selfPartyAssociation',\n notIn: ['none', 'prefer_not_to_say'],\n },\n },\n {\n order: 4,\n key: 'familyPartyAssociation',\n label: 'Family Party Association',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...partyOptions],\n },\n {\n order: 5,\n key: 'relativesInPolitics',\n label: 'Relatives in Politics',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...relativesInPoliticsOptions],\n },\n {\n order: 6,\n key: 'publicOfficeAndElections',\n label: 'Public Office & Elections',\n type: 'object',\n step: 2,\n isOnboarding: true,\n optional: true,\n description: 'Have you held public office or contested elections?',\n },\n {\n order: 7,\n key: 'networkAndCivicEngagement',\n label: 'Civic Engagement',\n type: 'multi_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...civicEngagementOptions],\n },\n ],\n};\n"]}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export type { BaseField, FieldGroup, FieldOption, MultiSelectField, NumberField, ProfileField, SelectField, TextField, } from './types.js';
|
|
8
8
|
export { genderOptions, languageOptions, minorityOptions, profile, religionOptions, reservationOptions, } from './01-profile.js';
|
|
9
|
-
export { civicEngagementOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, } from './02-political.js';
|
|
9
|
+
export { civicEngagementOptions, electionResultOptions, officeElectionLevelOptions, partyAssociationRoleOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, relativesInPoliticsOptions, } from './02-political.js';
|
|
10
10
|
export { electoralBehaviour, votingIssueOptions } from './03-electoral.js';
|
|
11
11
|
export { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';
|
|
12
12
|
export { mbtiOptions, psychologicalAssessment } from './05-psychological.js';
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,GAC3B,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"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
// ── Field groups ────────────────────────────────────────────────────────────
|
|
8
8
|
export { genderOptions, languageOptions, minorityOptions, profile, religionOptions, reservationOptions, } from './01-profile.js';
|
|
9
|
-
export { civicEngagementOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, } from './02-political.js';
|
|
9
|
+
export { civicEngagementOptions, electionResultOptions, officeElectionLevelOptions, partyAssociationRoleOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, relativesInPoliticsOptions, } from './02-political.js';
|
|
10
10
|
export { electoralBehaviour, votingIssueOptions } from './03-electoral.js';
|
|
11
11
|
export { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';
|
|
12
12
|
export { mbtiOptions, psychologicalAssessment } from './05-psychological.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,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,
|
|
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,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,GAC3B,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;AAE3B,+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 {\n genderOptions,\n languageOptions,\n minorityOptions,\n profile,\n religionOptions,\n reservationOptions,\n} from './01-profile.js';\nexport {\n civicEngagementOptions,\n electionResultOptions,\n officeElectionLevelOptions,\n partyAssociationRoleOptions,\n partyOptions,\n politicalAssociation,\n politicalSpectrumOptions,\n relativesInPoliticsOptions,\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"]}
|
|
@@ -32,10 +32,18 @@ export interface BaseField {
|
|
|
32
32
|
description?: string;
|
|
33
33
|
/** Mark as sensitive (shown with privacy notice) */
|
|
34
34
|
sensitive?: boolean;
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* If set, field visibility is conditional on another field's value.
|
|
37
|
+
* - `values`: positive match — only visible when referenced field's value is in the list.
|
|
38
|
+
* - `notIn`: negative match — only visible when referenced field's value is NOT in the list.
|
|
39
|
+
* An undefined referenced value counts as "not in the list" (field is shown).
|
|
40
|
+
*/
|
|
36
41
|
conditionalOn?: {
|
|
37
42
|
field: string;
|
|
38
43
|
values: string[];
|
|
44
|
+
} | {
|
|
45
|
+
field: string;
|
|
46
|
+
notIn: string[];
|
|
39
47
|
};
|
|
40
48
|
}
|
|
41
49
|
export interface SelectField extends BaseField {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/profile-fields/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,IAAI,EACA,MAAM,GACN,UAAU,GACV,QAAQ,GACR,MAAM,GACN,eAAe,GACf,cAAc,GACd,QAAQ,GACR,cAAc,GACd,SAAS,CAAC;IACd,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,YAAY,EAAE,OAAO,C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CACxB;AAED,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,gBAAgB,GAChB,SAAS,GACT,WAAW,GACX,CAAC,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAA;CAAE,CAAC,CAAC;AAE3E,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/profile-fields/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Type definitions for UDP profile field configuration.\n *\n * Mirrors the dating-schema profile-fields/types.ts pattern.\n * These types describe field metadata — NOT the user's actual profile data.\n */\n\nexport interface FieldOption {\n value: string;\n label: string;\n /** Short description — shown on chips/cards */\n description?: string;\n}\n\nexport interface BaseField {\n /** Display order within the step */\n order: number;\n /** Unique key — maps to DB field name */\n key: string;\n /** Human-readable label */\n label: string;\n /** Field type for form rendering */\n type:\n | 'text'\n | 'textarea'\n | 'number'\n | 'date'\n | 'single_select'\n | 'multi_select'\n | 'object'\n | 'object_array'\n | 'address';\n /** Step number (1-12) this field belongs to */\n step: number;\n /** Whether this field is collected during onboarding */\n isOnboarding: boolean;\n /**\n * All UDP fields are optional — users can skip any question.\n * This flag is kept for metadata/documentation but does not affect form flow.\n */\n optional?: boolean;\n /** Help text shown below the field */\n description?: string;\n /** Mark as sensitive (shown with privacy notice) */\n sensitive?: boolean;\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/profile-fields/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Type definitions for UDP profile field configuration.\n *\n * Mirrors the dating-schema profile-fields/types.ts pattern.\n * These types describe field metadata — NOT the user's actual profile data.\n */\n\nexport interface FieldOption {\n value: string;\n label: string;\n /** Short description — shown on chips/cards */\n description?: string;\n}\n\nexport interface BaseField {\n /** Display order within the step */\n order: number;\n /** Unique key — maps to DB field name */\n key: string;\n /** Human-readable label */\n label: string;\n /** Field type for form rendering */\n type:\n | 'text'\n | 'textarea'\n | 'number'\n | 'date'\n | 'single_select'\n | 'multi_select'\n | 'object'\n | 'object_array'\n | 'address';\n /** Step number (1-12) this field belongs to */\n step: number;\n /** Whether this field is collected during onboarding */\n isOnboarding: boolean;\n /**\n * All UDP fields are optional — users can skip any question.\n * This flag is kept for metadata/documentation but does not affect form flow.\n */\n optional?: boolean;\n /** Help text shown below the field */\n description?: string;\n /** Mark as sensitive (shown with privacy notice) */\n sensitive?: boolean;\n /**\n * If set, field visibility is conditional on another field's value.\n * - `values`: positive match — only visible when referenced field's value is in the list.\n * - `notIn`: negative match — only visible when referenced field's value is NOT in the list.\n * An undefined referenced value counts as \"not in the list\" (field is shown).\n */\n conditionalOn?:\n | { field: string; values: string[] }\n | { field: string; notIn: string[] };\n}\n\nexport interface SelectField extends BaseField {\n type: 'single_select';\n options: FieldOption[];\n}\n\nexport interface MultiSelectField extends BaseField {\n type: 'multi_select';\n options: FieldOption[];\n maxSelect?: number;\n}\n\nexport interface TextField extends BaseField {\n type: 'text' | 'textarea';\n maxLength?: number;\n}\n\nexport interface NumberField extends BaseField {\n type: 'number';\n min?: number;\n max?: number;\n}\n\nexport type ProfileField =\n | SelectField\n | MultiSelectField\n | TextField\n | NumberField\n | (BaseField & { type: 'date' | 'object' | 'object_array' | 'address' });\n\nexport interface FieldGroup {\n key: string;\n label: string;\n description?: string;\n step: number;\n fields: ProfileField[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-fields.d.ts","sourceRoot":"","sources":["../src/progress-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"progress-fields.d.ts","sourceRoot":"","sources":["../src/progress-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAsHxD,CAAC;AAEX,gCAAgC;AAChC,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAE3D,CAAC;AAEX;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAYlF;AAED,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAcrD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,GACnD;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAuBnC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,GACnE;IACD,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAeA"}
|
package/dist/progress-fields.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-fields.js","sourceRoot":"","sources":["../src/progress-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAsC;IACpE,CAAC,EAAE;QACD,6DAA6D;QAC7D,wEAAwE;QACxE,UAAU;QACV,QAAQ;QACR,aAAa;QACb,gBAAgB;QAChB,iBAAiB;QACjB,oBAAoB;QACpB,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB;QACnB,gBAAgB;KACjB;IACD,CAAC,EAAE;QACD,mBAAmB;QACnB,sBAAsB;QACtB,wBAAwB;QACxB,0BAA0B;QAC1B,2BAA2B;KAC5B;IACD,CAAC,EAAE;QACD,YAAY;QACZ,kBAAkB;QAClB,iBAAiB;QACjB,iBAAiB;QACjB,qBAAqB;KACtB;IACD,CAAC,EAAE;QACD,yBAAyB;QACzB,0BAA0B;QAC1B,oBAAoB;QACpB,mBAAmB;QACnB,uBAAuB;QACvB,sBAAsB;QACtB,gBAAgB;QAChB,uBAAuB;KACxB;IACD,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;IAC9B,CAAC,EAAE;QACD,sBAAsB;QACtB,qBAAqB;QACrB,0BAA0B;QAC1B,6BAA6B;QAC7B,+BAA+B;QAC/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,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1C,WAAW,IAAI,MAAM,CAAC;QACtB,WAAW,IAAI,KAAK,CAAC;IACvB,CAAC;IAED,MAAM,OAAO,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AACtD,CAAC","sourcesContent":["/**\n * UDP Progress Fields — Single source of truth for step progress counting.\n *\n * Used by both frontend (stepper UI) and backend (computeStepProgressCounts).\n * Each step lists the curated fields that determine filled/total progress.\n *\n * Dot-paths (e.g., \"currentAddress.state\") resolve nested subdocument fields.\n * Only these fields count toward progress — extra fields in the schema are ignored.\n */\n\nexport const UDP_PROGRESS_FIELDS: Record<number, readonly string[]> = {\n 1: [\n // 'fullName' is a synthetic key — counts as filled if ANY of\n // firstName / middleName / lastName is set. See UDP_PROGRESS_SYNTHETIC.\n 'fullName',\n 'gender',\n 'dateOfBirth',\n 'whatsappNumber',\n 'primaryLanguage',\n 'secondaryLanguages',\n 'familyReligion',\n 'personalReligion',\n 'reservationStatus',\n 'minorityStatus',\n ],\n 2: [\n 'politicalSpectrum',\n 'selfPartyAssociation',\n 'familyPartyAssociation',\n 'publicOfficeAndElections',\n 'networkAndCivicEngagement',\n ],\n 3: [\n 'epicNumber',\n 'willVoteThisTime',\n 'didVoteLastTime',\n 'votingFrequency',\n 'primaryVotingIssues',\n ],\n 4: [\n 'participateInRevolution',\n 'desiredPoliticalPosition',\n 'leadershipSkillset',\n 'politicalExposure',\n 'comfortWithVisibility',\n 'socialInfluenceLevel',\n 'pastExperience',\n 'changesYouWantToBring',\n ],\n 5: ['mbtiType', 'oceanScores'],\n 6: [\n 'highestQualification',\n 'education10th.board',\n 'education10th.schoolName',\n 'education10th.yearOfPassing',\n 'education12th.institutionName',\n 'education12th.yearOfPassing',\n 'diplomas',\n 'graduations',\n 'postGraduations',\n 'doctorates',\n 'postDoctorates',\n 'otherCertificates',\n 'educationNotes',\n ],\n 7: [\n 'employmentStatus',\n 'occupation',\n 'workShift',\n 'comfortableWithShift',\n 'desiredShift',\n 'incomeRange',\n 'dreamOccupation',\n ],\n 8: [\n 'neurodiverseIdentity',\n 'conditions',\n 'sensoryPreferences',\n 'learningStyle',\n 'communicationPreference',\n 'supportNeeds',\n ],\n 9: [\n 'disabilityStatus',\n 'generalHealth',\n 'healthInsurance',\n 'diet',\n 'physicalActivity',\n 'sleepQuality',\n 'substanceUse',\n 'stressLevel',\n ],\n 10: [\n 'viewOnAnimalCruelty',\n 'viewOnLgbtqStatements',\n 'viewOnLgbtqOpinion',\n 'viewOnTransgenderInclusion',\n 'viewOnTransgenderOpinion',\n 'facingCasteDiscrimination',\n 'casteDiscriminationPlaces',\n 'viewOnGenderEquality',\n ],\n 11: [\n 'currentAddress.state',\n 'currentAddress.district',\n 'currentAddress.village',\n 'permanentAddress.state',\n 'permanentAddress.district',\n 'permanentAddress.village',\n 'homeNativePlace.state',\n 'homeNativePlace.district',\n 'ancestralPlace.state',\n 'ancestralPlace.district',\n ],\n 12: [\n 'maritalStatus',\n 'familyMembers',\n 'numberOfDependents',\n 'housingType',\n 'householdIncome',\n 'bplCard',\n 'digitalAccess',\n 'migrationStatus',\n 'landOwnership',\n 'primaryIncomeSource',\n ],\n} as const;\n\n/** Total number of UDP steps */\nexport const UDP_TOTAL_STEPS = 12;\n\n/**\n * Synthetic progress keys — keys that aren't real fields but represent\n * a group of underlying fields. Counted as \"filled\" if ANY underlying\n * field is filled. Used for UI sub-steps that collect multiple fields\n * at once (e.g. the fullName sub-step that saves firstName, middleName,\n * and lastName).\n */\nexport const UDP_PROGRESS_SYNTHETIC: Record<string, readonly string[]> = {\n fullName: ['firstName', 'middleName', 'lastName'],\n} as const;\n\n/**\n * Resolve a dot-path (e.g., \"currentAddress.state\") against a data object.\n * Works with both plain objects and Mongoose subdocuments.\n */\nexport function getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== 'object') {\n return undefined;\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n return current;\n}\n\n/** Determine if a field value counts as \"filled\" for progress */\nexport function isFieldFilled(value: unknown): boolean {\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') {\n // Area entity ref - check for name\n if ('name' in value && typeof (value as Record<string, unknown>).name === 'string') {\n return (value as Record<string, unknown>).name !== '';\n }\n return Object.keys(value).length > 0;\n }\n return false;\n}\n\n/**\n * Calculate progress for a single step.\n * Shared between frontend (stepper UI) and backend (API response).\n */\nexport function calculateStepProgress(\n stepNumber: number,\n formData: Record<string, unknown> | undefined | null,\n): { filled: number; total: number } {\n const fields = UDP_PROGRESS_FIELDS[stepNumber];\n if (!fields) return { filled: 0, total: 0 };\n\n const total = fields.length;\n if (!formData || total === 0) return { filled: 0, total };\n\n let filled = 0;\n for (const fieldPath of fields) {\n // Synthetic keys (e.g., \"fullName\") — filled if ANY underlying field is filled.\n const syntheticPaths = UDP_PROGRESS_SYNTHETIC[fieldPath];\n if (syntheticPaths) {\n if (syntheticPaths.some((p) => isFieldFilled(getNestedValue(formData, p)))) {\n filled++;\n }\n continue;\n }\n if (isFieldFilled(getNestedValue(formData, fieldPath))) {\n filled++;\n }\n }\n\n return { filled, total };\n}\n\n/**\n * Calculate overall progress across all steps.\n * Returns per-step breakdown + overall percentage.\n *\n * Mirrors dating-schema's calculateDatingOverallProgress().\n *\n * @param stepData - Map of step number → form data (e.g., { 1: {...}, 2: {...} })\n */\nexport function calculateOverallProgress(\n stepData: Record<number, Record<string, unknown> | undefined | null>,\n): {\n steps: { stepNumber: number; filled: number; total: number }[];\n totalFilled: number;\n totalFields: number;\n percent: number;\n} {\n const steps: { stepNumber: number; filled: number; total: number }[] = [];\n let totalFilled = 0;\n let totalFields = 0;\n\n for (let stepNumber = 1; stepNumber <= UDP_TOTAL_STEPS; stepNumber++) {\n const { filled, total } = calculateStepProgress(stepNumber, stepData[stepNumber]);\n steps.push({ stepNumber, filled, total });\n totalFilled += filled;\n totalFields += total;\n }\n\n const percent = totalFields > 0 ? Math.round((totalFilled / totalFields) * 100) : 0;\n\n return { steps, totalFilled, totalFields, percent };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"progress-fields.js","sourceRoot":"","sources":["../src/progress-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAsC;IACpE,CAAC,EAAE;QACD,6DAA6D;QAC7D,wEAAwE;QACxE,UAAU;QACV,QAAQ;QACR,aAAa;QACb,gBAAgB;QAChB,iBAAiB;QACjB,oBAAoB;QACpB,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB;QACnB,gBAAgB;KACjB;IACD,CAAC,EAAE;QACD,mBAAmB;QACnB,sBAAsB;QACtB,sBAAsB;QACtB,wBAAwB;QACxB,qBAAqB;QACrB,0BAA0B;QAC1B,2BAA2B;KAC5B;IACD,CAAC,EAAE;QACD,YAAY;QACZ,kBAAkB;QAClB,iBAAiB;QACjB,iBAAiB;QACjB,qBAAqB;KACtB;IACD,CAAC,EAAE;QACD,yBAAyB;QACzB,0BAA0B;QAC1B,oBAAoB;QACpB,mBAAmB;QACnB,uBAAuB;QACvB,sBAAsB;QACtB,gBAAgB;QAChB,uBAAuB;KACxB;IACD,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;IAC9B,CAAC,EAAE;QACD,sBAAsB;QACtB,qBAAqB;QACrB,0BAA0B;QAC1B,6BAA6B;QAC7B,+BAA+B;QAC/B,6BAA6B;QAC7B,UAAU;QACV,aAAa;QACb,iBAAi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C1C,WAAW,IAAI,MAAM,CAAC;QACtB,WAAW,IAAI,KAAK,CAAC;IACvB,CAAC;IAED,MAAM,OAAO,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AACtD,CAAC","sourcesContent":["/**\n * UDP Progress Fields — Single source of truth for step progress counting.\n *\n * Used by both frontend (stepper UI) and backend (computeStepProgressCounts).\n * Each step lists the curated fields that determine filled/total progress.\n *\n * Dot-paths (e.g., \"currentAddress.state\") resolve nested subdocument fields.\n * Only these fields count toward progress — extra fields in the schema are ignored.\n */\n\nexport const UDP_PROGRESS_FIELDS: Record<number, readonly string[]> = {\n 1: [\n // 'fullName' is a synthetic key — counts as filled if ANY of\n // firstName / middleName / lastName is set. See UDP_PROGRESS_SYNTHETIC.\n 'fullName',\n 'gender',\n 'dateOfBirth',\n 'whatsappNumber',\n 'primaryLanguage',\n 'secondaryLanguages',\n 'familyReligion',\n 'personalReligion',\n 'reservationStatus',\n 'minorityStatus',\n ],\n 2: [\n 'politicalSpectrum',\n 'selfPartyAssociation',\n 'partyAssociationRole',\n 'familyPartyAssociation',\n 'relativesInPolitics',\n 'publicOfficeAndElections',\n 'networkAndCivicEngagement',\n ],\n 3: [\n 'epicNumber',\n 'willVoteThisTime',\n 'didVoteLastTime',\n 'votingFrequency',\n 'primaryVotingIssues',\n ],\n 4: [\n 'participateInRevolution',\n 'desiredPoliticalPosition',\n 'leadershipSkillset',\n 'politicalExposure',\n 'comfortWithVisibility',\n 'socialInfluenceLevel',\n 'pastExperience',\n 'changesYouWantToBring',\n ],\n 5: ['mbtiType', 'oceanScores'],\n 6: [\n 'highestQualification',\n 'education10th.board',\n 'education10th.schoolName',\n 'education10th.yearOfPassing',\n 'education12th.institutionName',\n 'education12th.yearOfPassing',\n 'diplomas',\n 'graduations',\n 'postGraduations',\n 'doctorates',\n 'postDoctorates',\n 'otherCertificates',\n 'educationNotes',\n ],\n 7: [\n 'employmentStatus',\n 'occupation',\n 'workShift',\n 'comfortableWithShift',\n 'desiredShift',\n 'incomeRange',\n 'dreamOccupation',\n ],\n 8: [\n 'neurodiverseIdentity',\n 'conditions',\n 'sensoryPreferences',\n 'learningStyle',\n 'communicationPreference',\n 'supportNeeds',\n ],\n 9: [\n 'disabilityStatus',\n 'generalHealth',\n 'healthInsurance',\n 'diet',\n 'physicalActivity',\n 'sleepQuality',\n 'substanceUse',\n 'stressLevel',\n ],\n 10: [\n 'viewOnAnimalCruelty',\n 'viewOnLgbtqStatements',\n 'viewOnLgbtqOpinion',\n 'viewOnTransgenderInclusion',\n 'viewOnTransgenderOpinion',\n 'facingCasteDiscrimination',\n 'casteDiscriminationPlaces',\n 'viewOnGenderEquality',\n ],\n 11: [\n 'currentAddress.state',\n 'currentAddress.district',\n 'currentAddress.village',\n 'permanentAddress.state',\n 'permanentAddress.district',\n 'permanentAddress.village',\n 'homeNativePlace.state',\n 'homeNativePlace.district',\n 'ancestralPlace.state',\n 'ancestralPlace.district',\n ],\n 12: [\n 'maritalStatus',\n 'familyMembers',\n 'numberOfDependents',\n 'housingType',\n 'householdIncome',\n 'bplCard',\n 'digitalAccess',\n 'migrationStatus',\n 'landOwnership',\n 'primaryIncomeSource',\n ],\n} as const;\n\n/** Total number of UDP steps */\nexport const UDP_TOTAL_STEPS = 12;\n\n/**\n * Synthetic progress keys — keys that aren't real fields but represent\n * a group of underlying fields. Counted as \"filled\" if ANY underlying\n * field is filled. Used for UI sub-steps that collect multiple fields\n * at once (e.g. the fullName sub-step that saves firstName, middleName,\n * and lastName).\n */\nexport const UDP_PROGRESS_SYNTHETIC: Record<string, readonly string[]> = {\n fullName: ['firstName', 'middleName', 'lastName'],\n} as const;\n\n/**\n * Resolve a dot-path (e.g., \"currentAddress.state\") against a data object.\n * Works with both plain objects and Mongoose subdocuments.\n */\nexport function getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== 'object') {\n return undefined;\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n return current;\n}\n\n/** Determine if a field value counts as \"filled\" for progress */\nexport function isFieldFilled(value: unknown): boolean {\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') {\n // Area entity ref - check for name\n if ('name' in value && typeof (value as Record<string, unknown>).name === 'string') {\n return (value as Record<string, unknown>).name !== '';\n }\n return Object.keys(value).length > 0;\n }\n return false;\n}\n\n/**\n * Calculate progress for a single step.\n * Shared between frontend (stepper UI) and backend (API response).\n */\nexport function calculateStepProgress(\n stepNumber: number,\n formData: Record<string, unknown> | undefined | null,\n): { filled: number; total: number } {\n const fields = UDP_PROGRESS_FIELDS[stepNumber];\n if (!fields) return { filled: 0, total: 0 };\n\n const total = fields.length;\n if (!formData || total === 0) return { filled: 0, total };\n\n let filled = 0;\n for (const fieldPath of fields) {\n // Synthetic keys (e.g., \"fullName\") — filled if ANY underlying field is filled.\n const syntheticPaths = UDP_PROGRESS_SYNTHETIC[fieldPath];\n if (syntheticPaths) {\n if (syntheticPaths.some((p) => isFieldFilled(getNestedValue(formData, p)))) {\n filled++;\n }\n continue;\n }\n if (isFieldFilled(getNestedValue(formData, fieldPath))) {\n filled++;\n }\n }\n\n return { filled, total };\n}\n\n/**\n * Calculate overall progress across all steps.\n * Returns per-step breakdown + overall percentage.\n *\n * Mirrors dating-schema's calculateDatingOverallProgress().\n *\n * @param stepData - Map of step number → form data (e.g., { 1: {...}, 2: {...} })\n */\nexport function calculateOverallProgress(\n stepData: Record<number, Record<string, unknown> | undefined | null>,\n): {\n steps: { stepNumber: number; filled: number; total: number }[];\n totalFilled: number;\n totalFields: number;\n percent: number;\n} {\n const steps: { stepNumber: number; filled: number; total: number }[] = [];\n let totalFilled = 0;\n let totalFields = 0;\n\n for (let stepNumber = 1; stepNumber <= UDP_TOTAL_STEPS; stepNumber++) {\n const { filled, total } = calculateStepProgress(stepNumber, stepData[stepNumber]);\n steps.push({ stepNumber, filled, total });\n totalFilled += filled;\n totalFields += total;\n }\n\n const percent = totalFields > 0 ? Math.round((totalFilled / totalFields) * 100) : 0;\n\n return { steps, totalFilled, totalFields, percent };\n}\n"]}
|
package/dist/step-01.schema.d.ts
CHANGED
|
@@ -86,17 +86,28 @@ export declare const step01ProfileSchema: z.ZodObject<{
|
|
|
86
86
|
reservationStatus: z.ZodOptional<z.ZodEnum<{
|
|
87
87
|
SC: "SC";
|
|
88
88
|
ST: "ST";
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
OBC_NCL: "OBC_NCL";
|
|
90
|
+
OBC_CL: "OBC_CL";
|
|
91
|
+
MBC: "MBC";
|
|
92
|
+
SEBC: "SEBC";
|
|
93
|
+
SBC: "SBC";
|
|
94
|
+
DNT_NT: "DNT_NT";
|
|
91
95
|
EWS: "EWS";
|
|
92
96
|
GENERAL: "GENERAL";
|
|
93
97
|
DONT_KNOW: "DONT_KNOW";
|
|
94
|
-
|
|
98
|
+
PREFER_NOT_TO_SAY: "PREFER_NOT_TO_SAY";
|
|
95
99
|
}>>;
|
|
96
100
|
minorityStatus: z.ZodOptional<z.ZodEnum<{
|
|
101
|
+
PREFER_NOT_TO_SAY: "PREFER_NOT_TO_SAY";
|
|
97
102
|
NO: "NO";
|
|
98
|
-
|
|
103
|
+
MUSLIM: "MUSLIM";
|
|
104
|
+
CHRISTIAN: "CHRISTIAN";
|
|
105
|
+
SIKH: "SIKH";
|
|
106
|
+
BUDDHIST: "BUDDHIST";
|
|
107
|
+
JAIN: "JAIN";
|
|
108
|
+
PARSI: "PARSI";
|
|
99
109
|
LINGUISTIC: "LINGUISTIC";
|
|
110
|
+
BOTH: "BOTH";
|
|
100
111
|
NOT_SURE: "NOT_SURE";
|
|
101
112
|
}>>;
|
|
102
113
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-01.schema.d.ts","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"step-01.schema.d.ts","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmI9B,CAAC;AAIH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/step-01.schema.js
CHANGED
|
@@ -99,11 +99,38 @@ export const step01ProfileSchema = z.object({
|
|
|
99
99
|
'prefer_not_to_say',
|
|
100
100
|
])
|
|
101
101
|
.optional(),
|
|
102
|
-
/** Reservation / caste category */
|
|
102
|
+
/** Reservation / caste category — exhaustive per central + state notifications. */
|
|
103
103
|
reservationStatus: z
|
|
104
|
-
.enum([
|
|
104
|
+
.enum([
|
|
105
|
+
'SC',
|
|
106
|
+
'ST',
|
|
107
|
+
'OBC_NCL',
|
|
108
|
+
'OBC_CL',
|
|
109
|
+
'MBC',
|
|
110
|
+
'SEBC',
|
|
111
|
+
'SBC',
|
|
112
|
+
'DNT_NT',
|
|
113
|
+
'EWS',
|
|
114
|
+
'GENERAL',
|
|
115
|
+
'DONT_KNOW',
|
|
116
|
+
'PREFER_NOT_TO_SAY',
|
|
117
|
+
])
|
|
118
|
+
.optional(),
|
|
119
|
+
/** Minority community status — per Ministry of Minority Affairs (6 religious + linguistic). */
|
|
120
|
+
minorityStatus: z
|
|
121
|
+
.enum([
|
|
122
|
+
'NO',
|
|
123
|
+
'MUSLIM',
|
|
124
|
+
'CHRISTIAN',
|
|
125
|
+
'SIKH',
|
|
126
|
+
'BUDDHIST',
|
|
127
|
+
'JAIN',
|
|
128
|
+
'PARSI',
|
|
129
|
+
'LINGUISTIC',
|
|
130
|
+
'BOTH',
|
|
131
|
+
'NOT_SURE',
|
|
132
|
+
'PREFER_NOT_TO_SAY',
|
|
133
|
+
])
|
|
105
134
|
.optional(),
|
|
106
|
-
/** Minority community status */
|
|
107
|
-
minorityStatus: z.enum(['NO', 'RELIGIOUS', 'LINGUISTIC', 'NOT_SURE']).optional(),
|
|
108
135
|
});
|
|
109
136
|
//# sourceMappingURL=step-01.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-01.schema.js","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,+EAA+E;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,UAAU,EAAE,qBAAqB;IACjC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAE9C,gFAAgF;IAChF,MAAM,EAAE,CAAC;SACN,IAAI,CAAC;QACJ,KAAK;QACL,OAAO;QACP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C,CAAC","sourcesContent":["/**\n * Step 01 — Profile\n *\n * Fields: firstName, middleName, lastName, gender, dateOfBirth,\n * whatsappNumber, primaryLanguage, secondaryLanguages,\n * familyReligion, personalReligion, reservationStatus, minorityStatus\n *\n * @module udp-schema/step-01\n */\n\nimport { z } from 'zod';\nimport {\n emptyStringToUndefined,\n optionalPhoneSchema,\n optionalTrimmedString,\n} from './zod-helpers.js';\n\n// ─── Main Step 01 Schema ────────────────────────────────────────────────────\n\nexport const step01ProfileSchema = z.object({\n firstName: z.string().trim().max(50).optional(),\n middleName: optionalTrimmedString,\n lastName: z.string().trim().max(50).optional(),\n\n /** Gender — matches dating-schema enum EXACTLY (same values, same spelling). */\n gender: z\n .enum([\n 'man',\n 'woman',\n 'non_binary',\n 'trans_man',\n 'trans_woman',\n 'genderfluid',\n 'genderqueer',\n 'agender',\n 'bigender',\n 'pangender',\n 'androgynous',\n 'intersex',\n 'gender_nonconforming',\n 'two_spirit',\n 'hijra',\n 'other',\n 'prefer_not_to_say',\n ])\n .optional(),\n\n dateOfBirth: z.preprocess(emptyStringToUndefined, z.coerce.date().optional()),\n\n whatsappNumber: optionalPhoneSchema,\n\n /** Single language code string (e.g., \"hindi\", \"english\") — matches dating motherTongue options */\n primaryLanguage: z.string().trim().optional(),\n\n /** Array of language code strings */\n secondaryLanguages: z.array(z.string().trim()).max(10).optional(),\n\n /**\n * Family religion — uses dating-schema religion option values.\n * e.g., \"hindu\", \"muslim_sunni\", \"christian_catholic\", etc.\n */\n familyReligion: z\n .enum([\n 'hindu',\n 'muslim_sunni',\n 'muslim_shia',\n 'muslim_sufi',\n 'muslim_other',\n 'christian_catholic',\n 'christian_protestant',\n 'christian_other',\n 'sikh',\n 'jain_digambar',\n 'jain_shwetambar',\n 'buddhist',\n 'parsi_zoroastrian',\n 'jewish',\n 'bahai',\n 'spiritual',\n 'atheist',\n 'agnostic',\n 'no_religion',\n 'inter_religion',\n 'other',\n 'prefer_not_to_say',\n ])\n .optional(),\n\n /** Personal religion — same options as familyReligion */\n personalReligion: z\n .enum([\n 'hindu',\n 'muslim_sunni',\n 'muslim_shia',\n 'muslim_sufi',\n 'muslim_other',\n 'christian_catholic',\n 'christian_protestant',\n 'christian_other',\n 'sikh',\n 'jain_digambar',\n 'jain_shwetambar',\n 'buddhist',\n 'parsi_zoroastrian',\n 'jewish',\n 'bahai',\n 'spiritual',\n 'atheist',\n 'agnostic',\n 'no_religion',\n 'inter_religion',\n 'other',\n 'prefer_not_to_say',\n ])\n .optional(),\n\n /** Reservation / caste category — exhaustive per central + state notifications. */\n reservationStatus: z\n .enum([\n 'SC',\n 'ST',\n 'OBC_NCL',\n 'OBC_CL',\n 'MBC',\n 'SEBC',\n 'SBC',\n 'DNT_NT',\n 'EWS',\n 'GENERAL',\n 'DONT_KNOW',\n 'PREFER_NOT_TO_SAY',\n ])\n .optional(),\n\n /** Minority community status — per Ministry of Minority Affairs (6 religious + linguistic). */\n minorityStatus: z\n .enum([\n 'NO',\n 'MUSLIM',\n 'CHRISTIAN',\n 'SIKH',\n 'BUDDHIST',\n 'JAIN',\n 'PARSI',\n 'LINGUISTIC',\n 'BOTH',\n 'NOT_SURE',\n 'PREFER_NOT_TO_SAY',\n ])\n .optional(),\n});\n\n// ─── Inferred types ─────────────────────────────────────────────────────────\n\nexport type Step01ProfileInput = z.infer<typeof step01ProfileSchema>;\n"]}
|