udp-schema 2.19.0 → 2.21.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/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 +44 -5
- package/dist/onboarding-config.js.map +1 -1
- package/dist/onboarding-form.d.ts +33 -42
- package/dist/onboarding-form.d.ts.map +1 -1
- package/dist/profile-fields/02-political.d.ts +16 -22
- package/dist/profile-fields/02-political.d.ts.map +1 -1
- package/dist/profile-fields/02-political.js +92 -15
- 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/progress-fields.d.ts.map +1 -1
- package/dist/progress-fields.js +6 -1
- package/dist/progress-fields.js.map +1 -1
- package/dist/step-02.schema.d.ts +36 -43
- package/dist/step-02.schema.d.ts.map +1 -1
- package/dist/step-02.schema.js +50 -37
- package/dist/step-02.schema.js.map +1 -1
- package/dist/step-12.schema.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { yesNoPreferOptions } from './03-electoral.js';
|
|
1
2
|
export const politicalSpectrumOptions = [
|
|
2
3
|
{
|
|
3
4
|
value: 'far_left',
|
|
@@ -48,10 +49,20 @@ export const politicalSpectrumOptions = [
|
|
|
48
49
|
];
|
|
49
50
|
/**
|
|
50
51
|
* Indian political parties — exhaustive list of nationally- or state-recognized
|
|
51
|
-
* parties active as of 2026.
|
|
52
|
-
*
|
|
52
|
+
* parties active as of 2026. Ordering rationale:
|
|
53
|
+
* 1. `none` + `independent` are pinned to the top — they're the most-
|
|
54
|
+
* common selections for users who don't identify with any party,
|
|
55
|
+
* and surfacing them first reduces scroll for the majority case.
|
|
56
|
+
* 2. National parties next (BJP, INC, AAP, BSP, SP, TMC), then state /
|
|
57
|
+
* regional parties.
|
|
58
|
+
* 3. `other` and `prefer_not_to_say` stay at the bottom (standard
|
|
59
|
+
* "escape hatch" position).
|
|
60
|
+
*
|
|
61
|
+
* Includes post-2023 splits (NCP-SP, Shiv Sena UBT).
|
|
53
62
|
*/
|
|
54
63
|
export const partyOptions = [
|
|
64
|
+
{ value: 'none', label: 'No party affiliation' },
|
|
65
|
+
{ value: 'independent', label: 'Independent candidate' },
|
|
55
66
|
{ value: 'bjp', label: 'BJP' },
|
|
56
67
|
{ value: 'inc', label: 'Indian National Congress (INC)' },
|
|
57
68
|
{ value: 'aap', label: 'Aam Aadmi Party (AAP)' },
|
|
@@ -83,8 +94,6 @@ export const partyOptions = [
|
|
|
83
94
|
{ value: 'iuml', label: 'Indian Union Muslim League (IUML)' },
|
|
84
95
|
{ value: 'mns', label: 'Maharashtra Navnirman Sena (MNS)' },
|
|
85
96
|
{ value: 'agp', label: 'Asom Gana Parishad (AGP)' },
|
|
86
|
-
{ value: 'independent', label: 'Independent candidate' },
|
|
87
|
-
{ value: 'none', label: 'No party affiliation' },
|
|
88
97
|
{ value: 'other', label: 'Other' },
|
|
89
98
|
{ value: 'prefer_not_to_say', label: 'Prefer not to say' },
|
|
90
99
|
];
|
|
@@ -192,13 +201,9 @@ export const officeElectionLevelOptions = [
|
|
|
192
201
|
{ value: 'parliament', label: 'Parliament (MP)' },
|
|
193
202
|
{ value: 'other', label: 'Other' },
|
|
194
203
|
];
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
{ value: 'lost', label: 'Lost' },
|
|
199
|
-
{ value: 'withdrew', label: 'Withdrew before voting' },
|
|
200
|
-
{ value: 'ongoing', label: 'Currently contesting' },
|
|
201
|
-
];
|
|
204
|
+
// `yesNoPreferOptions` (used by hasContestedElection +
|
|
205
|
+
// hasHeldPublicOffice) lives in 03-electoral.ts where it was first
|
|
206
|
+
// introduced for `didVoteLastTime`. Imported above; not re-defined.
|
|
202
207
|
export const politicalAssociation = {
|
|
203
208
|
key: 'political_association',
|
|
204
209
|
label: 'Political Association & History',
|
|
@@ -260,18 +265,90 @@ export const politicalAssociation = {
|
|
|
260
265
|
optional: true,
|
|
261
266
|
options: [...relativesInPoliticsOptions],
|
|
262
267
|
},
|
|
268
|
+
// Replaces the legacy single composite `publicOfficeAndElections`
|
|
269
|
+
// sub-step (a 9-field nested object) with six simpler sub-steps.
|
|
270
|
+
// Each yes/no question gets its own screen; the level + year
|
|
271
|
+
// follow-ups are gated on `yes` so users who answer `no` /
|
|
272
|
+
// `prefer_not_to_say` skip straight past them. Position-name /
|
|
273
|
+
// notes / result fields from the legacy shape are dropped — they
|
|
274
|
+
// were free-text fields with low completion in the dense composite
|
|
275
|
+
// UI, and the simpler shape matches the rest of UDP onboarding.
|
|
263
276
|
{
|
|
264
277
|
order: 6,
|
|
265
|
-
key: '
|
|
266
|
-
label: '
|
|
267
|
-
type: '
|
|
278
|
+
key: 'hasContestedElection',
|
|
279
|
+
label: 'Have you ever contested an election?',
|
|
280
|
+
type: 'single_select',
|
|
268
281
|
step: 2,
|
|
269
282
|
isOnboarding: true,
|
|
270
283
|
optional: true,
|
|
271
|
-
|
|
284
|
+
options: [...yesNoPreferOptions],
|
|
272
285
|
},
|
|
273
286
|
{
|
|
274
287
|
order: 7,
|
|
288
|
+
key: 'electionLevel',
|
|
289
|
+
label: 'At which level did you contest?',
|
|
290
|
+
type: 'single_select',
|
|
291
|
+
step: 2,
|
|
292
|
+
isOnboarding: true,
|
|
293
|
+
optional: true,
|
|
294
|
+
options: [...officeElectionLevelOptions],
|
|
295
|
+
conditionalOn: {
|
|
296
|
+
field: 'hasContestedElection',
|
|
297
|
+
values: ['yes'],
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
order: 8,
|
|
302
|
+
key: 'electionYear',
|
|
303
|
+
label: 'In which year did you contest?',
|
|
304
|
+
type: 'number',
|
|
305
|
+
step: 2,
|
|
306
|
+
isOnboarding: true,
|
|
307
|
+
optional: true,
|
|
308
|
+
conditionalOn: {
|
|
309
|
+
field: 'hasContestedElection',
|
|
310
|
+
values: ['yes'],
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
order: 9,
|
|
315
|
+
key: 'hasHeldPublicOffice',
|
|
316
|
+
label: 'Have you ever held a public office?',
|
|
317
|
+
type: 'single_select',
|
|
318
|
+
step: 2,
|
|
319
|
+
isOnboarding: true,
|
|
320
|
+
optional: true,
|
|
321
|
+
options: [...yesNoPreferOptions],
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
order: 10,
|
|
325
|
+
key: 'officeLevel',
|
|
326
|
+
label: 'At which level did you hold office?',
|
|
327
|
+
type: 'single_select',
|
|
328
|
+
step: 2,
|
|
329
|
+
isOnboarding: true,
|
|
330
|
+
optional: true,
|
|
331
|
+
options: [...officeElectionLevelOptions],
|
|
332
|
+
conditionalOn: {
|
|
333
|
+
field: 'hasHeldPublicOffice',
|
|
334
|
+
values: ['yes'],
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
order: 11,
|
|
339
|
+
key: 'officeYear',
|
|
340
|
+
label: 'In which year did you hold office?',
|
|
341
|
+
type: 'number',
|
|
342
|
+
step: 2,
|
|
343
|
+
isOnboarding: true,
|
|
344
|
+
optional: true,
|
|
345
|
+
conditionalOn: {
|
|
346
|
+
field: 'hasHeldPublicOffice',
|
|
347
|
+
values: ['yes'],
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
order: 12,
|
|
275
352
|
key: 'networkAndCivicEngagement',
|
|
276
353
|
label: 'Civic Engagement',
|
|
277
354
|
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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AAE,CAAC,GAAG,2BAA2B,CAAC;YACzC,aAAa,EAAE;gBACb,KAAK,EAAE,sBAAsB;gBAC7B,KAAK,EAAE,CAAC,MAAM,EAAE,mBAAmB,CAAC;aACrC;SACF;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,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"]}
|
|
1
|
+
{"version":3,"file":"02-political.js","sourceRoot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ferOptions } from './03-electoral.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. Ordering rationale:\n * 1. `none` + `independent` are pinned to the top — they're the most-\n * common selections for users who don't identify with any party,\n * and surfacing them first reduces scroll for the majority case.\n * 2. National parties next (BJP, INC, AAP, BSP, SP, TMC), then state /\n * regional parties.\n * 3. `other` and `prefer_not_to_say` stay at the bottom (standard\n * \"escape hatch\" position).\n *\n * Includes post-2023 splits (NCP-SP, Shiv Sena UBT).\n */\nexport const partyOptions = [\n { value: 'none', label: 'No party affiliation' },\n { value: 'independent', label: 'Independent candidate' },\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: '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// `yesNoPreferOptions` (used by hasContestedElection +\n// hasHeldPublicOffice) lives in 03-electoral.ts where it was first\n// introduced for `didVoteLastTime`. Imported above; not re-defined.\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 // Replaces the legacy single composite `publicOfficeAndElections`\n // sub-step (a 9-field nested object) with six simpler sub-steps.\n // Each yes/no question gets its own screen; the level + year\n // follow-ups are gated on `yes` so users who answer `no` /\n // `prefer_not_to_say` skip straight past them. Position-name /\n // notes / result fields from the legacy shape are dropped — they\n // were free-text fields with low completion in the dense composite\n // UI, and the simpler shape matches the rest of UDP onboarding.\n {\n order: 6,\n key: 'hasContestedElection',\n label: 'Have you ever contested an election?',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...yesNoPreferOptions],\n },\n {\n order: 7,\n key: 'electionLevel',\n label: 'At which level did you contest?',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...officeElectionLevelOptions],\n conditionalOn: {\n field: 'hasContestedElection',\n values: ['yes'],\n },\n },\n {\n order: 8,\n key: 'electionYear',\n label: 'In which year did you contest?',\n type: 'number',\n step: 2,\n isOnboarding: true,\n optional: true,\n conditionalOn: {\n field: 'hasContestedElection',\n values: ['yes'],\n },\n },\n {\n order: 9,\n key: 'hasHeldPublicOffice',\n label: 'Have you ever held a public office?',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...yesNoPreferOptions],\n },\n {\n order: 10,\n key: 'officeLevel',\n label: 'At which level did you hold office?',\n type: 'single_select',\n step: 2,\n isOnboarding: true,\n optional: true,\n options: [...officeElectionLevelOptions],\n conditionalOn: {\n field: 'hasHeldPublicOffice',\n values: ['yes'],\n },\n },\n {\n order: 11,\n key: 'officeYear',\n label: 'In which year did you hold office?',\n type: 'number',\n step: 2,\n isOnboarding: true,\n optional: true,\n conditionalOn: {\n field: 'hasHeldPublicOffice',\n values: ['yes'],\n },\n },\n {\n order: 12,\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,
|
|
9
|
+
export { civicEngagementOptions, officeElectionLevelOptions, partyAssociationRoleOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, relativesInPoliticsOptions, } from './02-political.js';
|
|
10
10
|
export { electoralBehaviour, votingFrequencyOptions, votingIssueOptions, willVoteOptions, yesNoPreferOptions, } from './03-electoral.js';
|
|
11
11
|
export { comfortWithVisibilityOptions, desiredPoliticalPositionOptions, leadershipAmbitions, leadershipSkillsetOptions, participateOptions, pastExperienceOptions, politicalExposureOptions, socialInfluenceOptions, } 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,
|
|
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,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BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,GAC3B,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,
|
|
9
|
+
export { civicEngagementOptions, officeElectionLevelOptions, partyAssociationRoleOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, relativesInPoliticsOptions, } from './02-political.js';
|
|
10
10
|
export { electoralBehaviour, votingFrequencyOptions, votingIssueOptions, willVoteOptions, yesNoPreferOptions, } from './03-electoral.js';
|
|
11
11
|
export { comfortWithVisibilityOptions, desiredPoliticalPositionOptions, leadershipAmbitions, leadershipSkillsetOptions, participateOptions, pastExperienceOptions, politicalExposureOptions, socialInfluenceOptions, } 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,
|
|
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,0BAA0B,EAC1B,2BAA2B,EAC3B,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,aAAa,EACb,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,2BAA2B,EAC3B,UAAU,EACV,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,iCAAiC,EACjC,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,kCAAkC,EAClC,2BAA2B,EAC3B,cAAc,EACd,mCAAmC,EACnC,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAA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AmB;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 officeElectionLevelOptions,\n partyAssociationRoleOptions,\n partyOptions,\n politicalAssociation,\n politicalSpectrumOptions,\n relativesInPoliticsOptions,\n} from './02-political.js';\nexport {\n electoralBehaviour,\n votingFrequencyOptions,\n votingIssueOptions,\n willVoteOptions,\n yesNoPreferOptions,\n} from './03-electoral.js';\nexport {\n comfortWithVisibilityOptions,\n desiredPoliticalPositionOptions,\n leadershipAmbitions,\n leadershipSkillsetOptions,\n participateOptions,\n pastExperienceOptions,\n politicalExposureOptions,\n socialInfluenceOptions,\n} from './04-leadership.js';\nexport { mbtiOptions, psychologicalAssessment } from './05-psychological.js';\nexport {\n boardOptions,\n DEGREE_VALUES_BY_LEVEL,\n degreeNameOptions,\n education,\n qualificationOptions,\n streamOptions,\n subjectOptions,\n} from './06-education.js';\nexport {\n comfortableWithShiftOptions,\n employment,\n employmentStatusOptions,\n incomeRangeOptions,\n shiftOptions,\n} from './07-employment.js';\nexport {\n ageOfRealizationOptions,\n cognitiveStrengthOptions,\n communicationPreferenceOptions,\n executiveFunctionChallengeOptions,\n impactOnLifeOptions,\n learningStyleOptions,\n maskingBurnoutOptions,\n mentalHealthConditionOptions,\n neurodevelopmentalConditionOptions,\n neurodiverseIdentityOptions,\n neurodiversity,\n neurologicalChronicConditionOptions,\n personalityPatternOptions,\n sensoryProfileOptions,\n supportAccommodationOptions,\n} from './08-neurodiversity.js';\nexport {\n dietOptions,\n disabilityOptions,\n generalHealthOptions,\n healthInsuranceOptions,\n healthLifestyle,\n physicalActivityOptions,\n sleepQualityOptions,\n stressLevelOptions,\n substanceUseOptions,\n} from './09-health.js';\nexport {\n animalCrueltyOptions,\n casteDiscriminationOptions,\n casteDiscriminationPlaceOptions,\n genderEqualityOptions,\n lgbtqStatementOptions,\n transgenderStatementOptions,\n worldView,\n} from './10-worldview.js';\nexport { residence } from './11-residence.js';\nexport {\n bplCardOptions,\n digitalAccessOptions,\n familyMemberOptions,\n household,\n householdIncomeOptions,\n housingTypeOptions,\n landOwnershipOptions,\n maritalStatusOptions,\n migrationStatusOptions,\n primaryIncomeSourceOptions,\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"]}
|
|
@@ -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,CA4IxD,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
|
@@ -28,7 +28,12 @@ export const UDP_PROGRESS_FIELDS = {
|
|
|
28
28
|
'partyAssociationRole',
|
|
29
29
|
'familyPartyAssociation',
|
|
30
30
|
'relativesInPolitics',
|
|
31
|
-
'
|
|
31
|
+
'hasContestedElection',
|
|
32
|
+
'electionLevel',
|
|
33
|
+
'electionYear',
|
|
34
|
+
'hasHeldPublicOffice',
|
|
35
|
+
'officeLevel',
|
|
36
|
+
'officeYear',
|
|
32
37
|
'networkAndCivicEngagement',
|
|
33
38
|
],
|
|
34
39
|
3: [
|
|
@@ -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,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,WAAW;QACX,qBAAqB;QACrB,0BAA0B;QAC1B,6BAA6B;QAC7B,wBAAwB;QACxB,6BAA6B;QAC7B,WAAW;QACX,+BAA+B;QAC/B,iCAAiC;QACjC,6BAA6B;QAC7B,8BAA8B;QAC9B,wBAAwB;QACxB,4BAA4B;Q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AE,KAAK,EAAE,GAAG,qBAAqB,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAClF,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,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 '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 // Class 10\n 'education10th.board',\n 'education10th.schoolName',\n 'education10th.yearOfPassing',\n 'education10th.subjects',\n 'education10th.marksObtained',\n // Class 12\n 'education12th.institutionName',\n 'education12th.boardOrUniversity',\n 'education12th.yearOfPassing',\n 'education12th.courseOrStream',\n 'education12th.subjects',\n 'education12th.marksOrGrade',\n // Degree repeaters + certificates + notes\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 'neurodevelopmentalConditions',\n 'mentalHealthConditions',\n 'personalityPatterns',\n 'neurologicalChronicConditions',\n 'ageOfRealization',\n 'sensoryProfile',\n 'cognitiveStrengths',\n 'executiveFunctionChallenges',\n 'learningStyle',\n 'communicationPreference',\n 'supportAndAccommodations',\n 'maskingAndBurnout',\n 'impactOnLife',\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,sBAAsB;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QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3E,MAAM,EAAE,CAAC;YACX,CAAC;YACD,SAAS;QACX,CAAC;QACD,IAAI,aAAa,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;YACvD,MAAM,EAAE,CAAC;QACX,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CACtC,QAAoE;IAOpE,MAAM,KAAK,GAA4D,EAAE,CAAC;IAC1E,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,WAAW,GAAG,CAAC,CAAC;IAEpB,KAAK,IAAI,UAAU,GAAG,CAAC,EAAE,UAAU,IAAI,eAAe,EAAE,UAAU,EAAE,EAAE,CAAC;QACrE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,qBAAqB,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAClF,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,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 'partyAssociationRole',\n 'familyPartyAssociation',\n 'relativesInPolitics',\n 'hasContestedElection',\n 'electionLevel',\n 'electionYear',\n 'hasHeldPublicOffice',\n 'officeLevel',\n 'officeYear',\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 // Class 10\n 'education10th.board',\n 'education10th.schoolName',\n 'education10th.yearOfPassing',\n 'education10th.subjects',\n 'education10th.marksObtained',\n // Class 12\n 'education12th.institutionName',\n 'education12th.boardOrUniversity',\n 'education12th.yearOfPassing',\n 'education12th.courseOrStream',\n 'education12th.subjects',\n 'education12th.marksOrGrade',\n // Degree repeaters + certificates + notes\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 'neurodevelopmentalConditions',\n 'mentalHealthConditions',\n 'personalityPatterns',\n 'neurologicalChronicConditions',\n 'ageOfRealization',\n 'sensoryProfile',\n 'cognitiveStrengths',\n 'executiveFunctionChallenges',\n 'learningStyle',\n 'communicationPreference',\n 'supportAndAccommodations',\n 'maskingAndBurnout',\n 'impactOnLife',\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-02.schema.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Step 02 — Political Association & History
|
|
3
3
|
*
|
|
4
|
-
* Fields: politicalSpectrum, selfPartyAssociation,
|
|
5
|
-
*
|
|
4
|
+
* Fields: politicalSpectrum, selfPartyAssociation, partyAssociationRole,
|
|
5
|
+
* familyPartyAssociation, relativesInPolitics, hasContestedElection,
|
|
6
|
+
* electionLevel, hasHeldPublicOffice, officeLevel,
|
|
7
|
+
* networkAndCivicEngagement
|
|
6
8
|
*
|
|
7
9
|
* @module udp-schema/step-02
|
|
8
10
|
*/
|
|
@@ -41,47 +43,38 @@ export declare const step02PoliticalSchema: z.ZodObject<{
|
|
|
41
43
|
both: "both";
|
|
42
44
|
dont_know: "dont_know";
|
|
43
45
|
}>>;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
electionYear: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
77
|
-
electionResult: z.ZodOptional<z.ZodEnum<{
|
|
78
|
-
won: "won";
|
|
79
|
-
lost: "lost";
|
|
80
|
-
withdrew: "withdrew";
|
|
81
|
-
ongoing: "ongoing";
|
|
82
|
-
}>>;
|
|
83
|
-
electionDetails: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
84
|
-
}, z.core.$strip>>;
|
|
46
|
+
hasContestedElection: z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
prefer_not_to_say: "prefer_not_to_say";
|
|
48
|
+
yes: "yes";
|
|
49
|
+
no: "no";
|
|
50
|
+
}>>;
|
|
51
|
+
electionLevel: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
other: "other";
|
|
53
|
+
panchayat: "panchayat";
|
|
54
|
+
ward: "ward";
|
|
55
|
+
municipality: "municipality";
|
|
56
|
+
block: "block";
|
|
57
|
+
district: "district";
|
|
58
|
+
assembly: "assembly";
|
|
59
|
+
parliament: "parliament";
|
|
60
|
+
}>>;
|
|
61
|
+
electionYear: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
hasHeldPublicOffice: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
prefer_not_to_say: "prefer_not_to_say";
|
|
64
|
+
yes: "yes";
|
|
65
|
+
no: "no";
|
|
66
|
+
}>>;
|
|
67
|
+
officeLevel: z.ZodOptional<z.ZodEnum<{
|
|
68
|
+
other: "other";
|
|
69
|
+
panchayat: "panchayat";
|
|
70
|
+
ward: "ward";
|
|
71
|
+
municipality: "municipality";
|
|
72
|
+
block: "block";
|
|
73
|
+
district: "district";
|
|
74
|
+
assembly: "assembly";
|
|
75
|
+
parliament: "parliament";
|
|
76
|
+
}>>;
|
|
77
|
+
officeYear: z.ZodOptional<z.ZodNumber>;
|
|
85
78
|
networkAndCivicEngagement: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
79
|
}, z.core.$strip>;
|
|
87
80
|
export type Step02PoliticalInput = z.infer<typeof step02PoliticalSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-02.schema.d.ts","sourceRoot":"","sources":["../src/step-02.schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"step-02.schema.d.ts","sourceRoot":"","sources":["../src/step-02.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6FhC,CAAC;AAIH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/step-02.schema.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Step 02 — Political Association & History
|
|
3
3
|
*
|
|
4
|
-
* Fields: politicalSpectrum, selfPartyAssociation,
|
|
5
|
-
*
|
|
4
|
+
* Fields: politicalSpectrum, selfPartyAssociation, partyAssociationRole,
|
|
5
|
+
* familyPartyAssociation, relativesInPolitics, hasContestedElection,
|
|
6
|
+
* electionLevel, hasHeldPublicOffice, officeLevel,
|
|
7
|
+
* networkAndCivicEngagement
|
|
6
8
|
*
|
|
7
9
|
* @module udp-schema/step-02
|
|
8
10
|
*/
|
|
@@ -47,42 +49,53 @@ export const step02PoliticalSchema = z.object({
|
|
|
47
49
|
relativesInPolitics: z
|
|
48
50
|
.enum(['none', 'immediate_family', 'extended_family', 'both', 'dont_know', 'prefer_not_to_say'])
|
|
49
51
|
.optional(),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
52
|
+
// Public office + elections — split into 6 flat sub-steps replacing
|
|
53
|
+
// the legacy single composite field. Each yes/no answer gets its
|
|
54
|
+
// own screen; the level + year follow-ups are conditional on `yes`.
|
|
55
|
+
// The 9-field nested-object shape (officeYears as range string,
|
|
56
|
+
// electionResult, free-text details) is gone — those low-completion
|
|
57
|
+
// fields cluttered the dense composite UI; the simpler shape matches
|
|
58
|
+
// the rest of UDP onboarding.
|
|
59
|
+
/** Has the respondent ever contested an election. */
|
|
60
|
+
hasContestedElection: z.enum(['yes', 'no', 'prefer_not_to_say']).optional(),
|
|
61
|
+
/** Level of the contested election. Only meaningful when
|
|
62
|
+
* `hasContestedElection === 'yes'`. */
|
|
63
|
+
electionLevel: z
|
|
64
|
+
.enum([
|
|
65
|
+
'panchayat',
|
|
66
|
+
'ward',
|
|
67
|
+
'municipality',
|
|
68
|
+
'block',
|
|
69
|
+
'district',
|
|
70
|
+
'assembly',
|
|
71
|
+
'parliament',
|
|
72
|
+
'other',
|
|
73
|
+
])
|
|
74
|
+
.optional(),
|
|
75
|
+
/** Year the respondent contested. Bounded 1900..2100 to keep the
|
|
76
|
+
* dataset sane against typos. Only meaningful when
|
|
77
|
+
* `hasContestedElection === 'yes'`. */
|
|
78
|
+
electionYear: z.number().int().min(1900).max(2100).optional(),
|
|
79
|
+
/** Has the respondent ever held a public office. */
|
|
80
|
+
hasHeldPublicOffice: z.enum(['yes', 'no', 'prefer_not_to_say']).optional(),
|
|
81
|
+
/** Level of the office held. Only meaningful when
|
|
82
|
+
* `hasHeldPublicOffice === 'yes'`. */
|
|
83
|
+
officeLevel: z
|
|
84
|
+
.enum([
|
|
85
|
+
'panchayat',
|
|
86
|
+
'ward',
|
|
87
|
+
'municipality',
|
|
88
|
+
'block',
|
|
89
|
+
'district',
|
|
90
|
+
'assembly',
|
|
91
|
+
'parliament',
|
|
92
|
+
'other',
|
|
93
|
+
])
|
|
85
94
|
.optional(),
|
|
95
|
+
/** Year the respondent held office. Same bounds rationale as
|
|
96
|
+
* `electionYear`. Only meaningful when `hasHeldPublicOffice ===
|
|
97
|
+
* 'yes'`. */
|
|
98
|
+
officeYear: z.number().int().min(1900).max(2100).optional(),
|
|
86
99
|
/** Network and civic engagement (multi-select) */
|
|
87
100
|
networkAndCivicEngagement: z.array(z.string().trim()).optional(),
|
|
88
101
|
});
|