udp-schema 2.8.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/helpers.d.ts.map +1 -1
  2. package/dist/helpers.js +10 -3
  3. package/dist/helpers.js.map +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -2
  7. package/dist/index.js.map +1 -1
  8. package/dist/onboarding-config.d.ts.map +1 -1
  9. package/dist/onboarding-config.js +14 -0
  10. package/dist/onboarding-config.js.map +1 -1
  11. package/dist/onboarding-form.d.ts +48 -1
  12. package/dist/onboarding-form.d.ts.map +1 -1
  13. package/dist/profile-fields/01-profile.d.ts.map +1 -1
  14. package/dist/profile-fields/01-profile.js +10 -2
  15. package/dist/profile-fields/01-profile.js.map +1 -1
  16. package/dist/profile-fields/02-political.d.ts +188 -2
  17. package/dist/profile-fields/02-political.d.ts.map +1 -1
  18. package/dist/profile-fields/02-political.js +146 -4
  19. package/dist/profile-fields/02-political.js.map +1 -1
  20. package/dist/profile-fields/03-electoral.d.ts +114 -15
  21. package/dist/profile-fields/03-electoral.d.ts.map +1 -1
  22. package/dist/profile-fields/03-electoral.js +54 -9
  23. package/dist/profile-fields/03-electoral.js.map +1 -1
  24. package/dist/profile-fields/index.d.ts +1 -1
  25. package/dist/profile-fields/index.d.ts.map +1 -1
  26. package/dist/profile-fields/index.js +1 -1
  27. package/dist/profile-fields/index.js.map +1 -1
  28. package/dist/profile-fields/types.d.ts +9 -1
  29. package/dist/profile-fields/types.d.ts.map +1 -1
  30. package/dist/profile-fields/types.js.map +1 -1
  31. package/dist/progress-fields.d.ts.map +1 -1
  32. package/dist/progress-fields.js +2 -0
  33. package/dist/progress-fields.js.map +1 -1
  34. package/dist/step-02.schema.d.ts +47 -0
  35. package/dist/step-02.schema.d.ts.map +1 -1
  36. package/dist/step-02.schema.js +49 -4
  37. package/dist/step-02.schema.js.map +1 -1
  38. package/dist/step-12.schema.d.ts +1 -1
  39. package/package.json +1 -1
@@ -1,7 +1,34 @@
1
1
  import type { FieldGroup } from './types.js';
2
+ /**
3
+ * Primary voting issues — exhaustive list of issues that shape voting
4
+ * decisions in Indian elections. Grouped below by theme (economic,
5
+ * social, governance, identity, environment, development) but kept flat
6
+ * in the exported array so they can be multi-selected freely.
7
+ */
2
8
  export declare const votingIssueOptions: readonly [{
3
9
  readonly value: "economy";
4
10
  readonly label: "Economy & Jobs";
11
+ }, {
12
+ readonly value: "unemployment";
13
+ readonly label: "Unemployment";
14
+ }, {
15
+ readonly value: "inflation";
16
+ readonly label: "Inflation / Cost of Living";
17
+ }, {
18
+ readonly value: "farmer_issues";
19
+ readonly label: "Farmer Issues / MSP";
20
+ }, {
21
+ readonly value: "labour_wages";
22
+ readonly label: "Labour Rights & Wages";
23
+ }, {
24
+ readonly value: "poverty";
25
+ readonly label: "Poverty Alleviation";
26
+ }, {
27
+ readonly value: "business_msme";
28
+ readonly label: "Business / MSME Development";
29
+ }, {
30
+ readonly value: "tax_policy";
31
+ readonly label: "Tax Policy";
5
32
  }, {
6
33
  readonly value: "healthcare";
7
34
  readonly label: "Healthcare";
@@ -9,35 +36,107 @@ export declare const votingIssueOptions: readonly [{
9
36
  readonly value: "education";
10
37
  readonly label: "Education";
11
38
  }, {
12
- readonly value: "unemployment";
13
- readonly label: "Unemployment";
39
+ readonly value: "housing";
40
+ readonly label: "Housing & Shelter";
14
41
  }, {
15
- readonly value: "corruption";
16
- readonly label: "Corruption";
42
+ readonly value: "welfare_schemes";
43
+ readonly label: "Welfare Schemes (PDS, MGNREGA, PMAY)";
44
+ }, {
45
+ readonly value: "pension_social_security";
46
+ readonly label: "Pension & Social Security";
47
+ }, {
48
+ readonly value: "infrastructure";
49
+ readonly label: "Roads, Bridges & Infrastructure";
50
+ }, {
51
+ readonly value: "water_sanitation";
52
+ readonly label: "Water & Sanitation";
53
+ }, {
54
+ readonly value: "electricity";
55
+ readonly label: "Electricity / Power Supply";
56
+ }, {
57
+ readonly value: "public_transport";
58
+ readonly label: "Public Transport";
59
+ }, {
60
+ readonly value: "digital_infrastructure";
61
+ readonly label: "Digital & Internet Access";
17
62
  }, {
18
63
  readonly value: "womens_safety";
19
64
  readonly label: "Women's Safety";
20
65
  }, {
21
- readonly value: "environment";
22
- readonly label: "Environment";
66
+ readonly value: "womens_rights";
67
+ readonly label: "Women's Rights & Empowerment";
23
68
  }, {
24
69
  readonly value: "caste_issues";
25
- readonly label: "Caste Issues";
70
+ readonly label: "Caste & Reservation";
26
71
  }, {
27
72
  readonly value: "religious_issues";
28
- readonly label: "Religious Issues";
73
+ readonly label: "Religion & Secularism";
29
74
  }, {
30
- readonly value: "infrastructure";
31
- readonly label: "Infrastructure";
75
+ readonly value: "minority_rights";
76
+ readonly label: "Minority Rights";
77
+ }, {
78
+ readonly value: "lgbtq_rights";
79
+ readonly label: "LGBTQ+ Rights";
80
+ }, {
81
+ readonly value: "tribal_rights";
82
+ readonly label: "Tribal / Adivasi Rights";
83
+ }, {
84
+ readonly value: "corruption";
85
+ readonly label: "Corruption";
86
+ }, {
87
+ readonly value: "law_order";
88
+ readonly label: "Law & Order";
89
+ }, {
90
+ readonly value: "judicial_reform";
91
+ readonly label: "Judicial Reform";
92
+ }, {
93
+ readonly value: "bureaucratic_reform";
94
+ readonly label: "Bureaucratic Reform / Red Tape";
95
+ }, {
96
+ readonly value: "electoral_reform";
97
+ readonly label: "Electoral Reform";
32
98
  }, {
33
99
  readonly value: "national_security";
34
- readonly label: "National Security";
100
+ readonly label: "National Security / Defence";
35
101
  }, {
36
- readonly value: "farmer_issues";
37
- readonly label: "Farmer Issues";
102
+ readonly value: "foreign_policy";
103
+ readonly label: "Foreign Policy";
38
104
  }, {
39
- readonly value: "water_sanitation";
40
- readonly label: "Water & Sanitation";
105
+ readonly value: "nationalism";
106
+ readonly label: "Nationalism / Cultural Identity";
107
+ }, {
108
+ readonly value: "citizenship_caa_nrc";
109
+ readonly label: "Citizenship (CAA / NRC)";
110
+ }, {
111
+ readonly value: "border_security";
112
+ readonly label: "Border Security / Terrorism";
113
+ }, {
114
+ readonly value: "uniform_civil_code";
115
+ readonly label: "Uniform Civil Code";
116
+ }, {
117
+ readonly value: "environment";
118
+ readonly label: "Environment & Climate";
119
+ }, {
120
+ readonly value: "pollution";
121
+ readonly label: "Air & Water Pollution";
122
+ }, {
123
+ readonly value: "renewable_energy";
124
+ readonly label: "Renewable Energy";
125
+ }, {
126
+ readonly value: "urban_development";
127
+ readonly label: "Urban Development / Smart Cities";
128
+ }, {
129
+ readonly value: "rural_development";
130
+ readonly label: "Rural Development";
131
+ }, {
132
+ readonly value: "youth_issues";
133
+ readonly label: "Youth Issues & Aspirations";
134
+ }, {
135
+ readonly value: "drug_abuse";
136
+ readonly label: "Drug Abuse & Trafficking";
137
+ }, {
138
+ readonly value: "local_issues";
139
+ readonly label: "Local / Constituency Issues";
41
140
  }, {
42
141
  readonly value: "other";
43
142
  readonly label: "Other";
@@ -1 +1 @@
1
- {"version":3,"file":"03-electoral.d.ts","sourceRoot":"","sources":["../../src/profile-fields/03-electoral.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAerB,CAAC;AAEX,eAAO,MAAM,kBAAkB,EAAE,UAyEhC,CAAC"}
1
+ {"version":3,"file":"03-electoral.d.ts","sourceRoot":"","sources":["../../src/profile-fields/03-electoral.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8DrB,CAAC;AAEX,eAAO,MAAM,kBAAkB,EAAE,UAyEhC,CAAC"}
@@ -1,17 +1,62 @@
1
+ /**
2
+ * Primary voting issues — exhaustive list of issues that shape voting
3
+ * decisions in Indian elections. Grouped below by theme (economic,
4
+ * social, governance, identity, environment, development) but kept flat
5
+ * in the exported array so they can be multi-selected freely.
6
+ */
1
7
  export const votingIssueOptions = [
8
+ // ── Economic ──
2
9
  { value: 'economy', label: 'Economy & Jobs' },
10
+ { value: 'unemployment', label: 'Unemployment' },
11
+ { value: 'inflation', label: 'Inflation / Cost of Living' },
12
+ { value: 'farmer_issues', label: 'Farmer Issues / MSP' },
13
+ { value: 'labour_wages', label: 'Labour Rights & Wages' },
14
+ { value: 'poverty', label: 'Poverty Alleviation' },
15
+ { value: 'business_msme', label: 'Business / MSME Development' },
16
+ { value: 'tax_policy', label: 'Tax Policy' },
17
+ // ── Social services & welfare ──
3
18
  { value: 'healthcare', label: 'Healthcare' },
4
19
  { value: 'education', label: 'Education' },
5
- { value: 'unemployment', label: 'Unemployment' },
6
- { value: 'corruption', label: 'Corruption' },
7
- { value: 'womens_safety', label: "Women's Safety" },
8
- { value: 'environment', label: 'Environment' },
9
- { value: 'caste_issues', label: 'Caste Issues' },
10
- { value: 'religious_issues', label: 'Religious Issues' },
11
- { value: 'infrastructure', label: 'Infrastructure' },
12
- { value: 'national_security', label: 'National Security' },
13
- { value: 'farmer_issues', label: 'Farmer Issues' },
20
+ { value: 'housing', label: 'Housing & Shelter' },
21
+ { value: 'welfare_schemes', label: 'Welfare Schemes (PDS, MGNREGA, PMAY)' },
22
+ { value: 'pension_social_security', label: 'Pension & Social Security' },
23
+ // ── Infrastructure ──
24
+ { value: 'infrastructure', label: 'Roads, Bridges & Infrastructure' },
14
25
  { value: 'water_sanitation', label: 'Water & Sanitation' },
26
+ { value: 'electricity', label: 'Electricity / Power Supply' },
27
+ { value: 'public_transport', label: 'Public Transport' },
28
+ { value: 'digital_infrastructure', label: 'Digital & Internet Access' },
29
+ // ── Social issues ──
30
+ { value: 'womens_safety', label: "Women's Safety" },
31
+ { value: 'womens_rights', label: "Women's Rights & Empowerment" },
32
+ { value: 'caste_issues', label: 'Caste & Reservation' },
33
+ { value: 'religious_issues', label: 'Religion & Secularism' },
34
+ { value: 'minority_rights', label: 'Minority Rights' },
35
+ { value: 'lgbtq_rights', label: 'LGBTQ+ Rights' },
36
+ { value: 'tribal_rights', label: 'Tribal / Adivasi Rights' },
37
+ // ── Governance ──
38
+ { value: 'corruption', label: 'Corruption' },
39
+ { value: 'law_order', label: 'Law & Order' },
40
+ { value: 'judicial_reform', label: 'Judicial Reform' },
41
+ { value: 'bureaucratic_reform', label: 'Bureaucratic Reform / Red Tape' },
42
+ { value: 'electoral_reform', label: 'Electoral Reform' },
43
+ // ── National / identity ──
44
+ { value: 'national_security', label: 'National Security / Defence' },
45
+ { value: 'foreign_policy', label: 'Foreign Policy' },
46
+ { value: 'nationalism', label: 'Nationalism / Cultural Identity' },
47
+ { value: 'citizenship_caa_nrc', label: 'Citizenship (CAA / NRC)' },
48
+ { value: 'border_security', label: 'Border Security / Terrorism' },
49
+ { value: 'uniform_civil_code', label: 'Uniform Civil Code' },
50
+ // ── Environment ──
51
+ { value: 'environment', label: 'Environment & Climate' },
52
+ { value: 'pollution', label: 'Air & Water Pollution' },
53
+ { value: 'renewable_energy', label: 'Renewable Energy' },
54
+ // ── Development ──
55
+ { value: 'urban_development', label: 'Urban Development / Smart Cities' },
56
+ { value: 'rural_development', label: 'Rural Development' },
57
+ { value: 'youth_issues', label: 'Youth Issues & Aspirations' },
58
+ { value: 'drug_abuse', label: 'Drug Abuse & Trafficking' },
59
+ { value: 'local_issues', label: 'Local / Constituency Issues' },
15
60
  { value: 'other', label: 'Other' },
16
61
  ];
17
62
  export const electoralBehaviour = {
@@ -1 +1 @@
1
- {"version":3,"file":"03-electoral.js","sourceRoot":"","sources":["../../src/profile-fields/03-electoral.ts"],"names":[],"mappings":"AAEA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pD,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;gBAC1C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;gBACpC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;gBAClC,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE;aACzD;SACF;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,qBAAqB;YAC1B,KAAK,EAAE,uBAAuB;YAC9B,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;SACjC;KACF;CACF,CAAC","sourcesContent":["import type { FieldGroup } from './types.js';\n\nexport const votingIssueOptions = [\n { value: 'economy', label: 'Economy & Jobs' },\n { value: 'healthcare', label: 'Healthcare' },\n { value: 'education', label: 'Education' },\n { value: 'unemployment', label: 'Unemployment' },\n { value: 'corruption', label: 'Corruption' },\n { value: 'womens_safety', label: \"Women's Safety\" },\n { value: 'environment', label: 'Environment' },\n { value: 'caste_issues', label: 'Caste Issues' },\n { value: 'religious_issues', label: 'Religious Issues' },\n { value: 'infrastructure', label: 'Infrastructure' },\n { value: 'national_security', label: 'National Security' },\n { value: 'farmer_issues', label: 'Farmer Issues' },\n { value: 'water_sanitation', label: 'Water & Sanitation' },\n { value: 'other', label: 'Other' },\n] as const;\n\nexport const electoralBehaviour: FieldGroup = {\n key: 'electoral_behaviour',\n label: 'Electoral Behaviour',\n step: 3,\n description: 'Your voter ID, voting history, and the issues that matter to you.',\n fields: [\n {\n order: 1,\n key: 'epicNumber',\n label: 'Voter ID (EPIC)',\n type: 'text',\n step: 3,\n isOnboarding: true,\n optional: true,\n maxLength: 20,\n },\n {\n order: 2,\n key: 'willVoteThisTime',\n label: 'Will Vote This Time',\n type: 'single_select',\n step: 3,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'yes', label: 'Yes' },\n { value: 'no', label: 'No' },\n { value: 'maybe', label: 'Maybe' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n ],\n },\n {\n order: 3,\n key: 'didVoteLastTime',\n label: 'Voted Last Time',\n type: 'single_select',\n step: 3,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'yes', label: 'Yes' },\n { value: 'no', label: 'No' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n ],\n },\n {\n order: 4,\n key: 'votingFrequency',\n label: 'Voting Frequency',\n type: 'single_select',\n step: 3,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'every_election', label: 'Every election' },\n { value: 'most_elections', label: 'Most elections' },\n { value: 'sometimes', label: 'Sometimes' },\n { value: 'rarely', label: 'Rarely' },\n { value: 'never', label: 'Never' },\n { value: 'first_time_voter', label: 'First-time voter' },\n ],\n },\n {\n order: 5,\n key: 'primaryVotingIssues',\n label: 'Primary Voting Issues',\n type: 'multi_select',\n step: 3,\n isOnboarding: true,\n optional: true,\n options: [...votingIssueOptions],\n },\n ],\n};\n"]}
1
+ {"version":3,"file":"03-electoral.js","sourceRoot":"","sources":["../../src/profile-fields/03-electoral.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,iBAAiB;IACjB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE;IAC7C,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAChD,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,4BAA4B,EAAE;IAC3D,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,qBAAqB,EAAE;IACxD,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,uBAAuB,EAAE;IACzD,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,qBAAqB,EAAE;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,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;gBAC5B,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,EAAE;aAC3D;SACF;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,iBAAiB;YACtB,KAAK,EAAE,kBAAkB;YACzB,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;gBACpD,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;gBACpD,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;gBAC1C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;gBACpC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;gBAClC,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE;aACzD;SACF;QACD;YACE,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,qBAAqB;YAC1B,KAAK,EAAE,uBAAuB;YAC9B,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;SACjC;KACF;CACF,CAAC","sourcesContent":["import type { FieldGroup } from './types.js';\n\n/**\n * Primary voting issues — exhaustive list of issues that shape voting\n * decisions in Indian elections. Grouped below by theme (economic,\n * social, governance, identity, environment, development) but kept flat\n * in the exported array so they can be multi-selected freely.\n */\nexport const votingIssueOptions = [\n // ── Economic ──\n { value: 'economy', label: 'Economy & Jobs' },\n { value: 'unemployment', label: 'Unemployment' },\n { value: 'inflation', label: 'Inflation / Cost of Living' },\n { value: 'farmer_issues', label: 'Farmer Issues / MSP' },\n { value: 'labour_wages', label: 'Labour Rights & Wages' },\n { value: 'poverty', label: 'Poverty Alleviation' },\n { value: 'business_msme', label: 'Business / MSME Development' },\n { value: 'tax_policy', label: 'Tax Policy' },\n\n // ── Social services & welfare ──\n { value: 'healthcare', label: 'Healthcare' },\n { value: 'education', label: 'Education' },\n { value: 'housing', label: 'Housing & Shelter' },\n { value: 'welfare_schemes', label: 'Welfare Schemes (PDS, MGNREGA, PMAY)' },\n { value: 'pension_social_security', label: 'Pension & Social Security' },\n\n // ── Infrastructure ──\n { value: 'infrastructure', label: 'Roads, Bridges & Infrastructure' },\n { value: 'water_sanitation', label: 'Water & Sanitation' },\n { value: 'electricity', label: 'Electricity / Power Supply' },\n { value: 'public_transport', label: 'Public Transport' },\n { value: 'digital_infrastructure', label: 'Digital & Internet Access' },\n\n // ── Social issues ──\n { value: 'womens_safety', label: \"Women's Safety\" },\n { value: 'womens_rights', label: \"Women's Rights & Empowerment\" },\n { value: 'caste_issues', label: 'Caste & Reservation' },\n { value: 'religious_issues', label: 'Religion & Secularism' },\n { value: 'minority_rights', label: 'Minority Rights' },\n { value: 'lgbtq_rights', label: 'LGBTQ+ Rights' },\n { value: 'tribal_rights', label: 'Tribal / Adivasi Rights' },\n\n // ── Governance ──\n { value: 'corruption', label: 'Corruption' },\n { value: 'law_order', label: 'Law & Order' },\n { value: 'judicial_reform', label: 'Judicial Reform' },\n { value: 'bureaucratic_reform', label: 'Bureaucratic Reform / Red Tape' },\n { value: 'electoral_reform', label: 'Electoral Reform' },\n\n // ── National / identity ──\n { value: 'national_security', label: 'National Security / Defence' },\n { value: 'foreign_policy', label: 'Foreign Policy' },\n { value: 'nationalism', label: 'Nationalism / Cultural Identity' },\n { value: 'citizenship_caa_nrc', label: 'Citizenship (CAA / NRC)' },\n { value: 'border_security', label: 'Border Security / Terrorism' },\n { value: 'uniform_civil_code', label: 'Uniform Civil Code' },\n\n // ── Environment ──\n { value: 'environment', label: 'Environment & Climate' },\n { value: 'pollution', label: 'Air & Water Pollution' },\n { value: 'renewable_energy', label: 'Renewable Energy' },\n\n // ── Development ──\n { value: 'urban_development', label: 'Urban Development / Smart Cities' },\n { value: 'rural_development', label: 'Rural Development' },\n { value: 'youth_issues', label: 'Youth Issues & Aspirations' },\n { value: 'drug_abuse', label: 'Drug Abuse & Trafficking' },\n { value: 'local_issues', label: 'Local / Constituency Issues' },\n\n { value: 'other', label: 'Other' },\n] as const;\n\nexport const electoralBehaviour: FieldGroup = {\n key: 'electoral_behaviour',\n label: 'Electoral Behaviour',\n step: 3,\n description: 'Your voter ID, voting history, and the issues that matter to you.',\n fields: [\n {\n order: 1,\n key: 'epicNumber',\n label: 'Voter ID (EPIC)',\n type: 'text',\n step: 3,\n isOnboarding: true,\n optional: true,\n maxLength: 20,\n },\n {\n order: 2,\n key: 'willVoteThisTime',\n label: 'Will Vote This Time',\n type: 'single_select',\n step: 3,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'yes', label: 'Yes' },\n { value: 'no', label: 'No' },\n { value: 'maybe', label: 'Maybe' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n ],\n },\n {\n order: 3,\n key: 'didVoteLastTime',\n label: 'Voted Last Time',\n type: 'single_select',\n step: 3,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'yes', label: 'Yes' },\n { value: 'no', label: 'No' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n ],\n },\n {\n order: 4,\n key: 'votingFrequency',\n label: 'Voting Frequency',\n type: 'single_select',\n step: 3,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'every_election', label: 'Every election' },\n { value: 'most_elections', label: 'Most elections' },\n { value: 'sometimes', label: 'Sometimes' },\n { value: 'rarely', label: 'Rarely' },\n { value: 'never', label: 'Never' },\n { value: 'first_time_voter', label: 'First-time voter' },\n ],\n },\n {\n order: 5,\n key: 'primaryVotingIssues',\n label: 'Primary Voting Issues',\n type: 'multi_select',\n step: 3,\n isOnboarding: true,\n optional: true,\n options: [...votingIssueOptions],\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,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EACL,UAAU,EACV,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,8BAA8B,EAC9B,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,EACrB,2BAA2B,EAC3B,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAgB3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,cAAc,EAAE,SAAS,UAAU,EAa/C,CAAC"}
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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AAC;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 partyOptions,\n politicalAssociation,\n politicalSpectrumOptions,\n} from './02-political.js';\nexport { electoralBehaviour, votingIssueOptions } from './03-electoral.js';\nexport { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';\nexport { mbtiOptions, psychologicalAssessment } from './05-psychological.js';\nexport { education, qualificationOptions } from './06-education.js';\nexport {\n employment,\n employmentStatusOptions,\n incomeRangeOptions,\n shiftOptions,\n} from './07-employment.js';\nexport {\n neurodiversity,\n neurodiversityConditionOptions,\n sensoryPreferenceOptions,\n supportNeedOptions,\n} from './08-neurodiversity.js';\nexport {\n dietOptions,\n disabilityOptions,\n healthLifestyle,\n substanceUseOptions,\n} from './09-health.js';\nexport {\n casteDiscriminationPlaceOptions,\n lgbtqStatementOptions,\n transgenderStatementOptions,\n worldView,\n} from './10-worldview.js';\nexport { residence } from './11-residence.js';\nexport {\n digitalAccessOptions,\n familyMemberOptions,\n household,\n householdIncomeOptions,\n} from './12-household.js';\n\n// ── All field groups (for building lookup maps) ─────────────────────────────\n\nimport { profile } from './01-profile.js';\nimport { politicalAssociation } from './02-political.js';\nimport { electoralBehaviour } from './03-electoral.js';\nimport { leadershipAmbitions } from './04-leadership.js';\nimport { psychologicalAssessment } from './05-psychological.js';\nimport { education } from './06-education.js';\nimport { employment } from './07-employment.js';\nimport { neurodiversity } from './08-neurodiversity.js';\nimport { healthLifestyle } from './09-health.js';\nimport { worldView } from './10-worldview.js';\nimport { residence } from './11-residence.js';\nimport { household } from './12-household.js';\nimport type { FieldGroup } from './types.js';\n\nexport const allFieldGroups: readonly FieldGroup[] = [\n profile,\n politicalAssociation,\n electoralBehaviour,\n leadershipAmbitions,\n psychologicalAssessment,\n education,\n employment,\n neurodiversity,\n healthLifestyle,\n worldView,\n residence,\n household,\n];\n"]}
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,E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BAAgB,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
- /** If set, field only applicable when referenced field has one of the listed values */
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,W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AK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC1F;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;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 /** If set, field only applicable when referenced field has one of the listed values */\n conditionalOn?: { field: string; values: 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
+ {"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?: { field: string; values: string[] } | { 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,CAoHxD,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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,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"}
@@ -25,7 +25,9 @@ export const UDP_PROGRESS_FIELDS = {
25
25
  2: [
26
26
  'politicalSpectrum',
27
27
  'selfPartyAssociation',
28
+ 'partyAssociationRole',
28
29
  'familyPartyAssociation',
30
+ 'relativesInPolitics',
29
31
  'publicOfficeAndElections',
30
32
  'networkAndCivicEngagement',
31
33
  ],
@@ -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,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AAC;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 '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,sB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E,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 '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"]}
@@ -21,18 +21,65 @@ export declare const step02PoliticalSchema: z.ZodObject<{
21
21
  apolitical: "apolitical";
22
22
  }>>;
23
23
  selfPartyAssociation: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
24
+ partyAssociationRole: z.ZodOptional<z.ZodEnum<{
25
+ prefer_not_to_say: "prefer_not_to_say";
26
+ none: "none";
27
+ member: "member";
28
+ active_worker: "active_worker";
29
+ office_bearer: "office_bearer";
30
+ candidate: "candidate";
31
+ spokesperson: "spokesperson";
32
+ volunteer: "volunteer";
33
+ sympathizer: "sympathizer";
34
+ }>>;
24
35
  familyPartyAssociation: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
36
+ relativesInPolitics: z.ZodOptional<z.ZodEnum<{
37
+ prefer_not_to_say: "prefer_not_to_say";
38
+ none: "none";
39
+ immediate_family: "immediate_family";
40
+ extended_family: "extended_family";
41
+ both: "both";
42
+ dont_know: "dont_know";
43
+ }>>;
25
44
  publicOfficeAndElections: z.ZodOptional<z.ZodObject<{
26
45
  hasHeldOffice: z.ZodOptional<z.ZodEnum<{
27
46
  prefer_not_to_say: "prefer_not_to_say";
28
47
  yes: "yes";
29
48
  no: "no";
30
49
  }>>;
50
+ officeLevel: z.ZodOptional<z.ZodEnum<{
51
+ other: "other";
52
+ panchayat: "panchayat";
53
+ ward: "ward";
54
+ municipality: "municipality";
55
+ block: "block";
56
+ district: "district";
57
+ assembly: "assembly";
58
+ parliament: "parliament";
59
+ }>>;
60
+ officeYears: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
31
61
  officeDetails: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
32
62
  electionContested: z.ZodOptional<z.ZodEnum<{
33
63
  yes: "yes";
34
64
  no: "no";
35
65
  }>>;
66
+ electionLevel: z.ZodOptional<z.ZodEnum<{
67
+ other: "other";
68
+ panchayat: "panchayat";
69
+ ward: "ward";
70
+ municipality: "municipality";
71
+ block: "block";
72
+ district: "district";
73
+ assembly: "assembly";
74
+ parliament: "parliament";
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
+ }>>;
36
83
  electionDetails: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
37
84
  }, z.core.$strip>>;
38
85
  networkAndCivicEngagement: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1 +1 @@
1
- {"version":3,"file":"step-02.schema.d.ts","sourceRoot":"","sources":["../src/step-02.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmChC,CAAC;AAIH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"step-02.schema.d.ts","sourceRoot":"","sources":["../src/step-02.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkFhC,CAAC;AAIH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -25,16 +25,61 @@ export const step02PoliticalSchema = z.object({
25
25
  'prefer_not_to_say',
26
26
  ])
27
27
  .optional(),
28
- /** Self party association */
28
+ /** Self party association — party key (e.g. "bjp", "inc", "none") */
29
29
  selfPartyAssociation: optionalTrimmedString,
30
- /** Family party association */
30
+ /** Nature of association with the party — only meaningful when selfPartyAssociation is a real party. */
31
+ partyAssociationRole: z
32
+ .enum([
33
+ 'member',
34
+ 'active_worker',
35
+ 'office_bearer',
36
+ 'candidate',
37
+ 'spokesperson',
38
+ 'volunteer',
39
+ 'sympathizer',
40
+ 'none',
41
+ 'prefer_not_to_say',
42
+ ])
43
+ .optional(),
44
+ /** Family party association — same party-key enum via free string. */
31
45
  familyPartyAssociation: optionalTrimmedString,
32
- /** Public office and elections history */
46
+ /** Relatives in politics (immediate / extended / both / none / prefer-not). */
47
+ relativesInPolitics: z
48
+ .enum(['none', 'immediate_family', 'extended_family', 'both', 'dont_know', 'prefer_not_to_say'])
49
+ .optional(),
50
+ /** Public office and elections history. */
33
51
  publicOfficeAndElections: z
34
52
  .object({
35
53
  hasHeldOffice: z.enum(['yes', 'no', 'prefer_not_to_say']).optional(),
36
- officeDetails: optionalTrimmedString,
54
+ officeLevel: z
55
+ .enum([
56
+ 'panchayat',
57
+ 'ward',
58
+ 'municipality',
59
+ 'block',
60
+ 'district',
61
+ 'assembly',
62
+ 'parliament',
63
+ 'other',
64
+ ])
65
+ .optional(),
66
+ officeYears: optionalTrimmedString, // e.g. "2018-2023"
67
+ officeDetails: optionalTrimmedString, // free text — position name / notes
37
68
  electionContested: z.enum(['yes', 'no']).optional(),
69
+ electionLevel: z
70
+ .enum([
71
+ 'panchayat',
72
+ 'ward',
73
+ 'municipality',
74
+ 'block',
75
+ 'district',
76
+ 'assembly',
77
+ 'parliament',
78
+ 'other',
79
+ ])
80
+ .optional(),
81
+ electionYear: optionalTrimmedString, // e.g. "2023"
82
+ electionResult: z.enum(['won', 'lost', 'withdrew', 'ongoing']).optional(),
38
83
  electionDetails: optionalTrimmedString,
39
84
  })
40
85
  .optional(),