udp-schema 1.0.0 → 2.0.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/field-helpers.d.ts +23 -8
- package/dist/field-helpers.d.ts.map +1 -1
- package/dist/field-helpers.js +43 -12
- package/dist/field-helpers.js.map +1 -1
- package/dist/field-meta.d.ts +14 -52
- package/dist/field-meta.d.ts.map +1 -1
- package/dist/field-meta.js +13 -307
- package/dist/field-meta.js.map +1 -1
- package/dist/index.d.ts +23 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -21
- package/dist/index.js.map +1 -1
- package/dist/profile-fields/01-profile.d.ts +264 -0
- package/dist/profile-fields/01-profile.d.ts.map +1 -0
- package/dist/profile-fields/01-profile.js +258 -0
- package/dist/profile-fields/01-profile.js.map +1 -0
- package/dist/profile-fields/02-political.d.ts +133 -0
- package/dist/profile-fields/02-political.d.ts.map +1 -0
- package/dist/profile-fields/02-political.js +133 -0
- package/dist/profile-fields/02-political.js.map +1 -0
- package/dist/profile-fields/03-electoral.d.ts +46 -0
- package/dist/profile-fields/03-electoral.d.ts.map +1 -0
- package/dist/profile-fields/03-electoral.js +91 -0
- package/dist/profile-fields/03-electoral.js.map +1 -0
- package/dist/profile-fields/04-leadership.d.ts +34 -0
- package/dist/profile-fields/04-leadership.d.ts.map +1 -0
- package/dist/profile-fields/04-leadership.js +139 -0
- package/dist/profile-fields/04-leadership.js.map +1 -0
- package/dist/profile-fields/05-psychological.d.ts +58 -0
- package/dist/profile-fields/05-psychological.d.ts.map +1 -0
- package/dist/profile-fields/05-psychological.js +49 -0
- package/dist/profile-fields/05-psychological.js.map +1 -0
- package/dist/profile-fields/06-education.d.ts +28 -0
- package/dist/profile-fields/06-education.d.ts.map +1 -0
- package/dist/profile-fields/06-education.js +136 -0
- package/dist/profile-fields/06-education.js.map +1 -0
- package/dist/profile-fields/07-employment.d.ts +75 -0
- package/dist/profile-fields/07-employment.d.ts.map +1 -0
- package/dist/profile-fields/07-employment.js +112 -0
- package/dist/profile-fields/07-employment.js.map +1 -0
- package/dist/profile-fields/08-neurodiversity.d.ts +100 -0
- package/dist/profile-fields/08-neurodiversity.d.ts.map +1 -0
- package/dist/profile-fields/08-neurodiversity.js +146 -0
- package/dist/profile-fields/08-neurodiversity.js.map +1 -0
- package/dist/profile-fields/09-health.d.ts +89 -0
- package/dist/profile-fields/09-health.d.ts.map +1 -0
- package/dist/profile-fields/09-health.js +160 -0
- package/dist/profile-fields/09-health.js.map +1 -0
- package/dist/profile-fields/10-worldview.d.ts +75 -0
- package/dist/profile-fields/10-worldview.d.ts.map +1 -0
- package/dist/profile-fields/10-worldview.js +140 -0
- package/dist/profile-fields/10-worldview.js.map +1 -0
- package/dist/profile-fields/11-residence.d.ts +3 -0
- package/dist/profile-fields/11-residence.d.ts.map +1 -0
- package/dist/profile-fields/11-residence.js +45 -0
- package/dist/profile-fields/11-residence.js.map +1 -0
- package/dist/profile-fields/12-household.d.ts +90 -0
- package/dist/profile-fields/12-household.d.ts.map +1 -0
- package/dist/profile-fields/12-household.js +187 -0
- package/dist/profile-fields/12-household.js.map +1 -0
- package/dist/profile-fields/index.d.ts +22 -0
- package/dist/profile-fields/index.d.ts.map +1 -0
- package/dist/profile-fields/index.js +47 -0
- package/dist/profile-fields/index.js.map +1 -0
- package/dist/profile-fields/types.d.ts +66 -0
- package/dist/profile-fields/types.d.ts.map +1 -0
- package/dist/profile-fields/types.js +8 -0
- package/dist/profile-fields/types.js.map +1 -0
- package/dist/progress-fields.d.ts +18 -0
- package/dist/progress-fields.d.ts.map +1 -1
- package/dist/progress-fields.js +21 -0
- package/dist/progress-fields.js.map +1 -1
- package/dist/step-01.schema.d.ts.map +1 -1
- package/dist/step-01.schema.js +1 -1
- package/dist/step-01.schema.js.map +1 -1
- package/dist/step-03.schema.d.ts +1 -1
- package/dist/step-03.schema.d.ts.map +1 -1
- package/dist/step-03.schema.js +1 -8
- package/dist/step-03.schema.js.map +1 -1
- package/dist/step-04.schema.d.ts +1 -1
- package/dist/step-04.schema.d.ts.map +1 -1
- package/dist/step-04.schema.js +2 -6
- package/dist/step-04.schema.js.map +1 -1
- package/dist/step-07.schema.d.ts.map +1 -1
- package/dist/step-07.schema.js +2 -16
- package/dist/step-07.schema.js.map +1 -1
- package/dist/step-08.schema.d.ts.map +1 -1
- package/dist/step-08.schema.js +1 -3
- package/dist/step-08.schema.js.map +1 -1
- package/dist/step-09.schema.d.ts +1 -1
- package/dist/step-09.schema.d.ts.map +1 -1
- package/dist/step-09.schema.js +5 -19
- package/dist/step-09.schema.js.map +1 -1
- package/dist/step-12.schema.d.ts +1 -1
- package/dist/step-12.schema.d.ts.map +1 -1
- package/dist/step-12.schema.js +3 -23
- package/dist/step-12.schema.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
export const familyMemberOptions = [
|
|
2
|
+
{ value: 'father', label: 'Father' },
|
|
3
|
+
{ value: 'mother', label: 'Mother' },
|
|
4
|
+
{ value: 'step_father', label: 'Step-father' },
|
|
5
|
+
{ value: 'step_mother', label: 'Step-mother' },
|
|
6
|
+
{ value: 'wife_husband', label: 'Wife / Husband' },
|
|
7
|
+
{ value: 'blood_brother', label: 'Blood Brother' },
|
|
8
|
+
{ value: 'blood_sister', label: 'Blood Sister' },
|
|
9
|
+
{ value: 'half_brother', label: 'Half Brother' },
|
|
10
|
+
{ value: 'half_sister', label: 'Half Sister' },
|
|
11
|
+
{ value: 'step_brother', label: 'Step Brother' },
|
|
12
|
+
{ value: 'step_sister', label: 'Step Sister' },
|
|
13
|
+
{ value: 'son', label: 'Son' },
|
|
14
|
+
{ value: 'daughter', label: 'Daughter' },
|
|
15
|
+
{ value: 'other', label: 'Other' },
|
|
16
|
+
];
|
|
17
|
+
export const digitalAccessOptions = [
|
|
18
|
+
{ value: 'smartphone', label: 'Smartphone' },
|
|
19
|
+
{ value: 'feature_phone', label: 'Feature phone' },
|
|
20
|
+
{ value: 'computer_laptop', label: 'Computer / Laptop' },
|
|
21
|
+
{ value: 'internet_at_home', label: 'Internet at home' },
|
|
22
|
+
{ value: 'no_internet', label: 'No internet access' },
|
|
23
|
+
{ value: 'no_phone', label: 'No phone' },
|
|
24
|
+
];
|
|
25
|
+
export const householdIncomeOptions = [
|
|
26
|
+
{ value: 'below_5k', label: 'Below ₹5,000' },
|
|
27
|
+
{ value: '5k_10k', label: '₹5,000 – ₹10,000' },
|
|
28
|
+
{ value: '10k_25k', label: '₹10,000 – ₹25,000' },
|
|
29
|
+
{ value: '25k_50k', label: '₹25,000 – ₹50,000' },
|
|
30
|
+
{ value: '50k_1L', label: '₹50,000 – ₹1 Lakh' },
|
|
31
|
+
{ value: '1L_2.5L', label: '₹1 Lakh – ₹2.5 Lakh' },
|
|
32
|
+
{ value: 'above_2.5L', label: 'Above ₹2.5 Lakh' },
|
|
33
|
+
{ value: 'prefer_not_to_say', label: 'Prefer not to say' },
|
|
34
|
+
];
|
|
35
|
+
export const household = {
|
|
36
|
+
key: 'household',
|
|
37
|
+
label: 'Household & Economic Profile',
|
|
38
|
+
step: 12,
|
|
39
|
+
description: 'Family, housing, income, and economic profile.',
|
|
40
|
+
fields: [
|
|
41
|
+
{
|
|
42
|
+
order: 1,
|
|
43
|
+
key: 'maritalStatus',
|
|
44
|
+
label: 'Marital Status',
|
|
45
|
+
type: 'single_select',
|
|
46
|
+
step: 12,
|
|
47
|
+
isOnboarding: true,
|
|
48
|
+
optional: true,
|
|
49
|
+
options: [
|
|
50
|
+
{ value: 'single', label: 'Single' },
|
|
51
|
+
{ value: 'married', label: 'Married' },
|
|
52
|
+
{ value: 'divorced', label: 'Divorced' },
|
|
53
|
+
{ value: 'widowed', label: 'Widowed' },
|
|
54
|
+
{ value: 'separated', label: 'Separated' },
|
|
55
|
+
{ value: 'prefer_not_to_say', label: 'Prefer not to say' },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
order: 2,
|
|
60
|
+
key: 'familyMembers',
|
|
61
|
+
label: 'Family Members',
|
|
62
|
+
type: 'multi_select',
|
|
63
|
+
step: 12,
|
|
64
|
+
isOnboarding: true,
|
|
65
|
+
optional: true,
|
|
66
|
+
options: [...familyMemberOptions],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
order: 3,
|
|
70
|
+
key: 'numberOfDependents',
|
|
71
|
+
label: 'Number of Dependents',
|
|
72
|
+
type: 'number',
|
|
73
|
+
step: 12,
|
|
74
|
+
isOnboarding: true,
|
|
75
|
+
optional: true,
|
|
76
|
+
min: 0,
|
|
77
|
+
max: 50,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
order: 4,
|
|
81
|
+
key: 'housingType',
|
|
82
|
+
label: 'Housing Type',
|
|
83
|
+
type: 'single_select',
|
|
84
|
+
step: 12,
|
|
85
|
+
isOnboarding: true,
|
|
86
|
+
optional: true,
|
|
87
|
+
options: [
|
|
88
|
+
{ value: 'own_house', label: 'Own house' },
|
|
89
|
+
{ value: 'rented', label: 'Rented' },
|
|
90
|
+
{ value: 'government_quarters', label: 'Government quarters' },
|
|
91
|
+
{ value: 'shared', label: 'Shared housing' },
|
|
92
|
+
{ value: 'homeless', label: 'Homeless' },
|
|
93
|
+
{ value: 'other', label: 'Other' },
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
order: 5,
|
|
98
|
+
key: 'householdIncome',
|
|
99
|
+
label: 'Household Income',
|
|
100
|
+
type: 'single_select',
|
|
101
|
+
step: 12,
|
|
102
|
+
isOnboarding: true,
|
|
103
|
+
optional: true,
|
|
104
|
+
options: [...householdIncomeOptions],
|
|
105
|
+
sensitive: true,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
order: 6,
|
|
109
|
+
key: 'bplCard',
|
|
110
|
+
label: 'BPL Card',
|
|
111
|
+
type: 'single_select',
|
|
112
|
+
step: 12,
|
|
113
|
+
isOnboarding: true,
|
|
114
|
+
optional: true,
|
|
115
|
+
options: [
|
|
116
|
+
{ value: 'yes', label: 'Yes' },
|
|
117
|
+
{ value: 'no', label: 'No' },
|
|
118
|
+
{ value: 'applied', label: 'Applied / Pending' },
|
|
119
|
+
{ value: 'dont_know', label: "Don't know" },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
order: 7,
|
|
124
|
+
key: 'digitalAccess',
|
|
125
|
+
label: 'Digital Access',
|
|
126
|
+
type: 'multi_select',
|
|
127
|
+
step: 12,
|
|
128
|
+
isOnboarding: true,
|
|
129
|
+
optional: true,
|
|
130
|
+
options: [...digitalAccessOptions],
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
order: 8,
|
|
134
|
+
key: 'migrationStatus',
|
|
135
|
+
label: 'Migration Status',
|
|
136
|
+
type: 'single_select',
|
|
137
|
+
step: 12,
|
|
138
|
+
isOnboarding: true,
|
|
139
|
+
optional: true,
|
|
140
|
+
options: [
|
|
141
|
+
{ value: 'native', label: 'Native (always lived here)' },
|
|
142
|
+
{ value: 'within_district', label: 'Migrated within district' },
|
|
143
|
+
{ value: 'within_state', label: 'Migrated within state' },
|
|
144
|
+
{ value: 'inter_state', label: 'Inter-state migrant' },
|
|
145
|
+
{ value: 'international', label: 'International migrant' },
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
order: 9,
|
|
150
|
+
key: 'landOwnership',
|
|
151
|
+
label: 'Land Ownership',
|
|
152
|
+
type: 'single_select',
|
|
153
|
+
step: 12,
|
|
154
|
+
isOnboarding: true,
|
|
155
|
+
optional: true,
|
|
156
|
+
options: [
|
|
157
|
+
{ value: 'own_agricultural', label: 'Own agricultural land' },
|
|
158
|
+
{ value: 'own_residential', label: 'Own residential land' },
|
|
159
|
+
{ value: 'government_allotted', label: 'Government allotted' },
|
|
160
|
+
{ value: 'no_land', label: 'No land' },
|
|
161
|
+
{ value: 'leased', label: 'Leased land' },
|
|
162
|
+
{ value: 'other', label: 'Other' },
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
order: 10,
|
|
167
|
+
key: 'primaryIncomeSource',
|
|
168
|
+
label: 'Primary Income Source',
|
|
169
|
+
type: 'single_select',
|
|
170
|
+
step: 12,
|
|
171
|
+
isOnboarding: true,
|
|
172
|
+
optional: true,
|
|
173
|
+
options: [
|
|
174
|
+
{ value: 'agriculture', label: 'Agriculture' },
|
|
175
|
+
{ value: 'government_job', label: 'Government job' },
|
|
176
|
+
{ value: 'private_job', label: 'Private job' },
|
|
177
|
+
{ value: 'business', label: 'Business' },
|
|
178
|
+
{ value: 'daily_wage', label: 'Daily wage' },
|
|
179
|
+
{ value: 'pension', label: 'Pension' },
|
|
180
|
+
{ value: 'remittance', label: 'Remittance' },
|
|
181
|
+
{ value: 'no_fixed_income', label: 'No fixed income' },
|
|
182
|
+
{ value: 'other', label: 'Other' },
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
};
|
|
187
|
+
//# sourceMappingURL=12-household.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"12-household.js","sourceRoot":"","sources":["../../src/profile-fields/12-household.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9C,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9C,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,EAAE;IAClD,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;IAClD,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAChD,EAAE,KAAK,E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AE;gBAC3D,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;gBAC9D,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;gBACtC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE;gBACzC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;aACnC;SACF;QACD;YACE,KAAK,EAAE,EAAE;YACT,GAAG,EAAE,qBAAqB;YAC1B,KAAK,EAAE,uBAAuB;YAC9B,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,EAAE;YACR,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;gBAC9C,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;gBACpD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;gBAC9C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;gBACxC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;gBAC5C,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;gBACtC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;gBAC5C,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBACtD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;aACnC;SACF;KACF;CACF,CAAC","sourcesContent":["import type { FieldGroup } from './types.js';\n\nexport const familyMemberOptions = [\n { value: 'father', label: 'Father' },\n { value: 'mother', label: 'Mother' },\n { value: 'step_father', label: 'Step-father' },\n { value: 'step_mother', label: 'Step-mother' },\n { value: 'wife_husband', label: 'Wife / Husband' },\n { value: 'blood_brother', label: 'Blood Brother' },\n { value: 'blood_sister', label: 'Blood Sister' },\n { value: 'half_brother', label: 'Half Brother' },\n { value: 'half_sister', label: 'Half Sister' },\n { value: 'step_brother', label: 'Step Brother' },\n { value: 'step_sister', label: 'Step Sister' },\n { value: 'son', label: 'Son' },\n { value: 'daughter', label: 'Daughter' },\n { value: 'other', label: 'Other' },\n] as const;\n\nexport const digitalAccessOptions = [\n { value: 'smartphone', label: 'Smartphone' },\n { value: 'feature_phone', label: 'Feature phone' },\n { value: 'computer_laptop', label: 'Computer / Laptop' },\n { value: 'internet_at_home', label: 'Internet at home' },\n { value: 'no_internet', label: 'No internet access' },\n { value: 'no_phone', label: 'No phone' },\n] as const;\n\nexport const householdIncomeOptions = [\n { value: 'below_5k', label: 'Below ₹5,000' },\n { value: '5k_10k', label: '₹5,000 – ₹10,000' },\n { value: '10k_25k', label: '₹10,000 – ₹25,000' },\n { value: '25k_50k', label: '₹25,000 – ₹50,000' },\n { value: '50k_1L', label: '₹50,000 – ₹1 Lakh' },\n { value: '1L_2.5L', label: '₹1 Lakh – ₹2.5 Lakh' },\n { value: 'above_2.5L', label: 'Above ₹2.5 Lakh' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n] as const;\n\nexport const household: FieldGroup = {\n key: 'household',\n label: 'Household & Economic Profile',\n step: 12,\n description: 'Family, housing, income, and economic profile.',\n fields: [\n {\n order: 1,\n key: 'maritalStatus',\n label: 'Marital Status',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'single', label: 'Single' },\n { value: 'married', label: 'Married' },\n { value: 'divorced', label: 'Divorced' },\n { value: 'widowed', label: 'Widowed' },\n { value: 'separated', label: 'Separated' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n ],\n },\n {\n order: 2,\n key: 'familyMembers',\n label: 'Family Members',\n type: 'multi_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [...familyMemberOptions],\n },\n {\n order: 3,\n key: 'numberOfDependents',\n label: 'Number of Dependents',\n type: 'number',\n step: 12,\n isOnboarding: true,\n optional: true,\n min: 0,\n max: 50,\n },\n {\n order: 4,\n key: 'housingType',\n label: 'Housing Type',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'own_house', label: 'Own house' },\n { value: 'rented', label: 'Rented' },\n { value: 'government_quarters', label: 'Government quarters' },\n { value: 'shared', label: 'Shared housing' },\n { value: 'homeless', label: 'Homeless' },\n { value: 'other', label: 'Other' },\n ],\n },\n {\n order: 5,\n key: 'householdIncome',\n label: 'Household Income',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [...householdIncomeOptions],\n sensitive: true,\n },\n {\n order: 6,\n key: 'bplCard',\n label: 'BPL Card',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'yes', label: 'Yes' },\n { value: 'no', label: 'No' },\n { value: 'applied', label: 'Applied / Pending' },\n { value: 'dont_know', label: \"Don't know\" },\n ],\n },\n {\n order: 7,\n key: 'digitalAccess',\n label: 'Digital Access',\n type: 'multi_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [...digitalAccessOptions],\n },\n {\n order: 8,\n key: 'migrationStatus',\n label: 'Migration Status',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'native', label: 'Native (always lived here)' },\n { value: 'within_district', label: 'Migrated within district' },\n { value: 'within_state', label: 'Migrated within state' },\n { value: 'inter_state', label: 'Inter-state migrant' },\n { value: 'international', label: 'International migrant' },\n ],\n },\n {\n order: 9,\n key: 'landOwnership',\n label: 'Land Ownership',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'own_agricultural', label: 'Own agricultural land' },\n { value: 'own_residential', label: 'Own residential land' },\n { value: 'government_allotted', label: 'Government allotted' },\n { value: 'no_land', label: 'No land' },\n { value: 'leased', label: 'Leased land' },\n { value: 'other', label: 'Other' },\n ],\n },\n {\n order: 10,\n key: 'primaryIncomeSource',\n label: 'Primary Income Source',\n type: 'single_select',\n step: 12,\n isOnboarding: true,\n optional: true,\n options: [\n { value: 'agriculture', label: 'Agriculture' },\n { value: 'government_job', label: 'Government job' },\n { value: 'private_job', label: 'Private job' },\n { value: 'business', label: 'Business' },\n { value: 'daily_wage', label: 'Daily wage' },\n { value: 'pension', label: 'Pension' },\n { value: 'remittance', label: 'Remittance' },\n { value: 'no_fixed_income', label: 'No fixed income' },\n { value: 'other', label: 'Other' },\n ],\n },\n ],\n};\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UDP Profile Fields — barrel export.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the dating-schema profile-fields pattern.
|
|
5
|
+
* Each file defines a FieldGroup with rich field metadata and options.
|
|
6
|
+
*/
|
|
7
|
+
export type { BaseField, FieldGroup, FieldOption, MultiSelectField, NumberField, ProfileField, SelectField, TextField, } from './types.js';
|
|
8
|
+
export { genderOptions, languageOptions, minorityOptions, profile, religionOptions, reservationOptions, } from './01-profile.js';
|
|
9
|
+
export { civicEngagementOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, } from './02-political.js';
|
|
10
|
+
export { electoralBehaviour, votingIssueOptions } from './03-electoral.js';
|
|
11
|
+
export { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';
|
|
12
|
+
export { mbtiOptions, psychologicalAssessment } from './05-psychological.js';
|
|
13
|
+
export { education, qualificationOptions } from './06-education.js';
|
|
14
|
+
export { employment, employmentStatusOptions, incomeRangeOptions, shiftOptions, } from './07-employment.js';
|
|
15
|
+
export { neurodiversity, neurodiversityConditionOptions, sensoryPreferenceOptions, supportNeedOptions, } from './08-neurodiversity.js';
|
|
16
|
+
export { dietOptions, disabilityOptions, healthLifestyle, substanceUseOptions, } from './09-health.js';
|
|
17
|
+
export { casteDiscriminationPlaceOptions, lgbtqStatementOptions, transgenderStatementOptions, worldView, } from './10-worldview.js';
|
|
18
|
+
export { residence } from './11-residence.js';
|
|
19
|
+
export { digitalAccessOptions, familyMemberOptions, household, householdIncomeOptions, } from './12-household.js';
|
|
20
|
+
import type { FieldGroup } from './types.js';
|
|
21
|
+
export declare const allFieldGroups: readonly FieldGroup[];
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UDP Profile Fields — barrel export.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the dating-schema profile-fields pattern.
|
|
5
|
+
* Each file defines a FieldGroup with rich field metadata and options.
|
|
6
|
+
*/
|
|
7
|
+
// ── Field groups ────────────────────────────────────────────────────────────
|
|
8
|
+
export { genderOptions, languageOptions, minorityOptions, profile, religionOptions, reservationOptions, } from './01-profile.js';
|
|
9
|
+
export { civicEngagementOptions, partyOptions, politicalAssociation, politicalSpectrumOptions, } from './02-political.js';
|
|
10
|
+
export { electoralBehaviour, votingIssueOptions } from './03-electoral.js';
|
|
11
|
+
export { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';
|
|
12
|
+
export { mbtiOptions, psychologicalAssessment } from './05-psychological.js';
|
|
13
|
+
export { education, qualificationOptions } from './06-education.js';
|
|
14
|
+
export { employment, employmentStatusOptions, incomeRangeOptions, shiftOptions, } from './07-employment.js';
|
|
15
|
+
export { neurodiversity, neurodiversityConditionOptions, sensoryPreferenceOptions, supportNeedOptions, } from './08-neurodiversity.js';
|
|
16
|
+
export { dietOptions, disabilityOptions, healthLifestyle, substanceUseOptions, } from './09-health.js';
|
|
17
|
+
export { casteDiscriminationPlaceOptions, lgbtqStatementOptions, transgenderStatementOptions, worldView, } from './10-worldview.js';
|
|
18
|
+
export { residence } from './11-residence.js';
|
|
19
|
+
export { digitalAccessOptions, familyMemberOptions, household, householdIncomeOptions, } from './12-household.js';
|
|
20
|
+
// ── All field groups (for building lookup maps) ─────────────────────────────
|
|
21
|
+
import { profile } from './01-profile.js';
|
|
22
|
+
import { politicalAssociation } from './02-political.js';
|
|
23
|
+
import { electoralBehaviour } from './03-electoral.js';
|
|
24
|
+
import { leadershipAmbitions } from './04-leadership.js';
|
|
25
|
+
import { psychologicalAssessment } from './05-psychological.js';
|
|
26
|
+
import { education } from './06-education.js';
|
|
27
|
+
import { employment } from './07-employment.js';
|
|
28
|
+
import { neurodiversity } from './08-neurodiversity.js';
|
|
29
|
+
import { healthLifestyle } from './09-health.js';
|
|
30
|
+
import { worldView } from './10-worldview.js';
|
|
31
|
+
import { residence } from './11-residence.js';
|
|
32
|
+
import { household } from './12-household.js';
|
|
33
|
+
export const allFieldGroups = [
|
|
34
|
+
profile,
|
|
35
|
+
politicalAssociation,
|
|
36
|
+
electoralBehaviour,
|
|
37
|
+
leadershipAmbitions,
|
|
38
|
+
psychologicalAssessment,
|
|
39
|
+
education,
|
|
40
|
+
employment,
|
|
41
|
+
neurodiversity,
|
|
42
|
+
healthLifestyle,
|
|
43
|
+
worldView,
|
|
44
|
+
residence,
|
|
45
|
+
household,
|
|
46
|
+
];
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile-fields/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,+EAA+E;AAE/E,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,OAAO,EACP,eAAe,EACf,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,yB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AAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,MAAM,CAAC,MAAM,cAAc,GAA0B;IACnD,OAAO;IACP,oBAAoB;IACpB,kBAAkB;IAClB,mBAAmB;IACnB,uBAAuB;IACvB,SAAS;IACT,UAAU;IACV,cAAc;IACd,eAAe;IACf,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC","sourcesContent":["/**\n * UDP Profile Fields — barrel export.\n *\n * Mirrors the dating-schema profile-fields pattern.\n * Each file defines a FieldGroup with rich field metadata and options.\n */\n\nexport type {\n BaseField,\n FieldGroup,\n FieldOption,\n MultiSelectField,\n NumberField,\n ProfileField,\n SelectField,\n TextField,\n} from './types.js';\n\n// ── Field groups ────────────────────────────────────────────────────────────\n\nexport {\n genderOptions,\n languageOptions,\n minorityOptions,\n profile,\n religionOptions,\n reservationOptions,\n} from './01-profile.js';\nexport {\n civicEngagementOptions,\n partyOptions,\n politicalAssociation,\n politicalSpectrumOptions,\n} from './02-political.js';\nexport { electoralBehaviour, votingIssueOptions } from './03-electoral.js';\nexport { leadershipAmbitions, leadershipSkillsetOptions } from './04-leadership.js';\nexport { mbtiOptions, psychologicalAssessment } from './05-psychological.js';\nexport { education, qualificationOptions } from './06-education.js';\nexport {\n employment,\n employmentStatusOptions,\n incomeRangeOptions,\n shiftOptions,\n} from './07-employment.js';\nexport {\n neurodiversity,\n neurodiversityConditionOptions,\n sensoryPreferenceOptions,\n supportNeedOptions,\n} from './08-neurodiversity.js';\nexport {\n dietOptions,\n disabilityOptions,\n healthLifestyle,\n substanceUseOptions,\n} from './09-health.js';\nexport {\n casteDiscriminationPlaceOptions,\n lgbtqStatementOptions,\n transgenderStatementOptions,\n worldView,\n} from './10-worldview.js';\nexport { residence } from './11-residence.js';\nexport {\n digitalAccessOptions,\n familyMemberOptions,\n household,\n householdIncomeOptions,\n} from './12-household.js';\n\n// ── All field groups (for building lookup maps) ─────────────────────────────\n\nimport { profile } from './01-profile.js';\nimport { politicalAssociation } from './02-political.js';\nimport { electoralBehaviour } from './03-electoral.js';\nimport { leadershipAmbitions } from './04-leadership.js';\nimport { psychologicalAssessment } from './05-psychological.js';\nimport { education } from './06-education.js';\nimport { employment } from './07-employment.js';\nimport { neurodiversity } from './08-neurodiversity.js';\nimport { healthLifestyle } from './09-health.js';\nimport { worldView } from './10-worldview.js';\nimport { residence } from './11-residence.js';\nimport { household } from './12-household.js';\nimport type { FieldGroup } from './types.js';\n\nexport const allFieldGroups: readonly FieldGroup[] = [\n profile,\n politicalAssociation,\n electoralBehaviour,\n leadershipAmbitions,\n psychologicalAssessment,\n education,\n employment,\n neurodiversity,\n healthLifestyle,\n worldView,\n residence,\n household,\n];\n"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for UDP profile field configuration.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the dating-schema profile-fields/types.ts pattern.
|
|
5
|
+
* These types describe field metadata — NOT the user's actual profile data.
|
|
6
|
+
*/
|
|
7
|
+
export interface FieldOption {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
/** Short description — shown on chips/cards */
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface BaseField {
|
|
14
|
+
/** Display order within the step */
|
|
15
|
+
order: number;
|
|
16
|
+
/** Unique key — maps to DB field name */
|
|
17
|
+
key: string;
|
|
18
|
+
/** Human-readable label */
|
|
19
|
+
label: string;
|
|
20
|
+
/** Field type for form rendering */
|
|
21
|
+
type: 'text' | 'textarea' | 'number' | 'date' | 'single_select' | 'multi_select' | 'object' | 'object_array' | 'address';
|
|
22
|
+
/** Step number (1-12) this field belongs to */
|
|
23
|
+
step: number;
|
|
24
|
+
/** Whether this field is collected during onboarding */
|
|
25
|
+
isOnboarding: boolean;
|
|
26
|
+
/** If true, can be skipped during onboarding */
|
|
27
|
+
optional?: boolean;
|
|
28
|
+
/** Help text shown below the field */
|
|
29
|
+
description?: string;
|
|
30
|
+
/** Mark as sensitive (shown with privacy notice) */
|
|
31
|
+
sensitive?: boolean;
|
|
32
|
+
/** If set, field only applicable when referenced field has one of the listed values */
|
|
33
|
+
conditionalOn?: {
|
|
34
|
+
field: string;
|
|
35
|
+
values: string[];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface SelectField extends BaseField {
|
|
39
|
+
type: 'single_select';
|
|
40
|
+
options: FieldOption[];
|
|
41
|
+
}
|
|
42
|
+
export interface MultiSelectField extends BaseField {
|
|
43
|
+
type: 'multi_select';
|
|
44
|
+
options: FieldOption[];
|
|
45
|
+
maxSelect?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface TextField extends BaseField {
|
|
48
|
+
type: 'text' | 'textarea';
|
|
49
|
+
maxLength?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface NumberField extends BaseField {
|
|
52
|
+
type: 'number';
|
|
53
|
+
min?: number;
|
|
54
|
+
max?: number;
|
|
55
|
+
}
|
|
56
|
+
export type ProfileField = SelectField | MultiSelectField | TextField | NumberField | (BaseField & {
|
|
57
|
+
type: 'date' | 'object' | 'object_array' | 'address';
|
|
58
|
+
});
|
|
59
|
+
export interface FieldGroup {
|
|
60
|
+
key: string;
|
|
61
|
+
label: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
step: number;
|
|
64
|
+
fields: ProfileField[];
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/profile-fields/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,oCAAoC;IACpC,KAAK,EAAE,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AM,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"}
|
|
@@ -0,0 +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 /** If true, can be skipped during onboarding */\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"]}
|
|
@@ -25,4 +25,22 @@ export declare function calculateStepProgress(stepNumber: number, formData: Reco
|
|
|
25
25
|
filled: number;
|
|
26
26
|
total: number;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Calculate overall progress across all steps.
|
|
30
|
+
* Returns per-step breakdown + overall percentage.
|
|
31
|
+
*
|
|
32
|
+
* Mirrors dating-schema's calculateDatingOverallProgress().
|
|
33
|
+
*
|
|
34
|
+
* @param stepData - Map of step number → form data (e.g., { 1: {...}, 2: {...} })
|
|
35
|
+
*/
|
|
36
|
+
export declare function calculateOverallProgress(stepData: Record<number, Record<string, unknown> | undefined | null>): {
|
|
37
|
+
steps: {
|
|
38
|
+
stepNumber: number;
|
|
39
|
+
filled: number;
|
|
40
|
+
total: number;
|
|
41
|
+
}[];
|
|
42
|
+
totalFilled: number;
|
|
43
|
+
totalFields: number;
|
|
44
|
+
percent: number;
|
|
45
|
+
};
|
|
28
46
|
//# sourceMappingURL=progress-fields.d.ts.map
|
|
@@ -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,CA+GxD,CAAC;AAEX,gCAAgC;AAChC,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;;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,wBA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AC;CACjB,CAeA"}
|
package/dist/progress-fields.js
CHANGED
|
@@ -176,4 +176,25 @@ export function calculateStepProgress(stepNumber, formData) {
|
|
|
176
176
|
}
|
|
177
177
|
return { filled, total };
|
|
178
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Calculate overall progress across all steps.
|
|
181
|
+
* Returns per-step breakdown + overall percentage.
|
|
182
|
+
*
|
|
183
|
+
* Mirrors dating-schema's calculateDatingOverallProgress().
|
|
184
|
+
*
|
|
185
|
+
* @param stepData - Map of step number → form data (e.g., { 1: {...}, 2: {...} })
|
|
186
|
+
*/
|
|
187
|
+
export function calculateOverallProgress(stepData) {
|
|
188
|
+
const steps = [];
|
|
189
|
+
let totalFilled = 0;
|
|
190
|
+
let totalFields = 0;
|
|
191
|
+
for (let stepNumber = 1; stepNumber <= UDP_TOTAL_STEPS; stepNumber++) {
|
|
192
|
+
const { filled, total } = calculateStepProgress(stepNumber, stepData[stepNumber]);
|
|
193
|
+
steps.push({ stepNumber, filled, total });
|
|
194
|
+
totalFilled += filled;
|
|
195
|
+
totalFields += total;
|
|
196
|
+
}
|
|
197
|
+
const percent = totalFields > 0 ? Math.round((totalFilled / totalFields) * 100) : 0;
|
|
198
|
+
return { steps, totalFilled, totalFields, percent };
|
|
199
|
+
}
|
|
179
200
|
//# sourceMappingURL=progress-fields.js.map
|
|
@@ -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,WAAW;QACX,UAAU;QACV,QAAQ;QACR,aAAa;QACb,gBAAgB;QAChB,iBAAiB;QACjB,oBAAoB;QACpB,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB;QACnB,gBAAgB;KACjB;IACD,CAAC,EAAE;QACD,mBAAmB;QACnB,sBAAsB;QACtB,wBAAwB;QACxB,0BAA0B;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C,CAAC,MAAM,GAAG,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,UAAkB,EAClB,QAAoD;IAEpD,MAAM,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAE5C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5B,IAAI,CAAC,QAAQ,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;IAE1D,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,SAAS,IAAI,MAAM,EAAE,CAAC;QAC/B,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","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 'firstName',\n 'lastName',\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 ],\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 'viewOnTransgenderInclusion',\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 * 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 if (isFieldFilled(getNestedValue(formData, fieldPath))) {\n filled++;\n }\n }\n\n return { filled, total };\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,WAAW;QACX,UAAU;QACV,QAAQ;QACR,aAAa;QACb,gBAAgB;QAChB,iBAAiB;QACjB,oBAAoB;QACpB,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB;QACnB,gBAAgB;KACjB;IACD,CAAC,EAAE;QACD,mBAAmB;QACnB,sBAAsB;QACtB,wBAAwB;QACxB,0B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W,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 'firstName',\n 'lastName',\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 ],\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 'viewOnTransgenderInclusion',\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 * 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 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-01.schema.d.ts","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"step-01.schema.d.ts","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2G9B,CAAC;AAIH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/step-01.schema.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module udp-schema/step-01
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
-
import { emptyStringToUndefined, optionalTrimmedString,
|
|
11
|
+
import { emptyStringToUndefined, optionalPhoneSchema, optionalTrimmedString, } from './zod-helpers.js';
|
|
12
12
|
// ─── Main Step 01 Schema ────────────────────────────────────────────────────
|
|
13
13
|
export const step01ProfileSchema = z.object({
|
|
14
14
|
firstName: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-01.schema.js","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"step-01.schema.js","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,+EAA+E;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC;SAChC,GAAG,CAAC,EAA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;QACd,aAAa;QACb,aAAa;QACb,cAAc;QACd,oBAAoB;QACpB,sBAAsB;QACtB,iBAAiB;QACjB,MAAM;QACN,eAAe;QACf,iBAAiB;QACjB,UAAU;QACV,mBAAmB;QACnB,QAAQ;QACR,OAAO;QACP,WAAW;QACX,SAAS;QACT,UAAU;QACV,aAAa;QACb,gBAAgB;QAChB,OAAO;QACP,mBAAmB;KACpB,CAAC;SACD,QAAQ,EAAE;IAEb,mCAAmC;IACnC,iBAAiB,EAAE,CAAC;SACjB,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;SACtF,QAAQ,EAAE;IAEb,gCAAgC;IAChC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE;CACjF,CAAC,CAAC","sourcesContent":["/**\n * Step 01 — Profile\n *\n * Fields: firstName, middleName, lastName, gender, dateOfBirth,\n * whatsappNumber, primaryLanguage, secondaryLanguages,\n * familyReligion, personalReligion, reservationStatus, minorityStatus\n *\n * @module udp-schema/step-01\n */\n\nimport { z } from 'zod';\nimport {\n emptyStringToUndefined,\n optionalPhoneSchema,\n optionalTrimmedString,\n} from './zod-helpers.js';\n\n// ─── Main Step 01 Schema ────────────────────────────────────────────────────\n\nexport const step01ProfileSchema = z.object({\n firstName: z\n .string()\n .trim()\n .min(1, 'First name is required')\n .max(50, 'First name must be at most 50 characters'),\n\n middleName: optionalTrimmedString,\n\n lastName: z\n .string()\n .trim()\n .min(1, 'Last name is required')\n .max(50, 'Last name must be at most 50 characters'),\n\n gender: z\n .enum([\n 'man',\n 'woman',\n 'non_binary',\n 'transgender_man',\n 'transgender_woman',\n 'genderqueer',\n 'genderfluid',\n 'agender',\n 'two_spirit',\n 'other',\n 'prefer_not_to_say',\n ])\n .optional(),\n\n dateOfBirth: z.preprocess(emptyStringToUndefined, z.coerce.date().optional()),\n\n whatsappNumber: optionalPhoneSchema,\n\n /** Single language code string (e.g., \"hindi\", \"english\") — matches dating motherTongue options */\n primaryLanguage: z.string().trim().optional(),\n\n /** Array of language code strings */\n secondaryLanguages: z.array(z.string().trim()).max(10).optional(),\n\n /**\n * Family religion — uses dating-schema religion option values.\n * e.g., \"hindu\", \"muslim_sunni\", \"christian_catholic\", etc.\n */\n familyReligion: z\n .enum([\n 'hindu',\n 'muslim_sunni',\n 'muslim_shia',\n 'muslim_sufi',\n 'muslim_other',\n 'christian_catholic',\n 'christian_protestant',\n 'christian_other',\n 'sikh',\n 'jain_digambar',\n 'jain_shwetambar',\n 'buddhist',\n 'parsi_zoroastrian',\n 'jewish',\n 'bahai',\n 'spiritual',\n 'atheist',\n 'agnostic',\n 'no_religion',\n 'inter_religion',\n 'other',\n 'prefer_not_to_say',\n ])\n .optional(),\n\n /** Personal religion — same options as familyReligion */\n personalReligion: z\n .enum([\n 'hindu',\n 'muslim_sunni',\n 'muslim_shia',\n 'muslim_sufi',\n 'muslim_other',\n 'christian_catholic',\n 'christian_protestant',\n 'christian_other',\n 'sikh',\n 'jain_digambar',\n 'jain_shwetambar',\n 'buddhist',\n 'parsi_zoroastrian',\n 'jewish',\n 'bahai',\n 'spiritual',\n 'atheist',\n 'agnostic',\n 'no_religion',\n 'inter_religion',\n 'other',\n 'prefer_not_to_say',\n ])\n .optional(),\n\n /** Reservation / caste category */\n reservationStatus: z\n .enum(['SC', 'ST', 'OBC_NC', 'OBC_C', 'EWS', 'GENERAL', 'DONT_KNOW', 'PREFER_NOT_SAY'])\n .optional(),\n\n /** Minority community status */\n minorityStatus: z.enum(['NO', 'RELIGIOUS', 'LINGUISTIC', 'NOT_SURE']).optional(),\n});\n\n// ─── Inferred types ─────────────────────────────────────────────────────────\n\nexport type Step01ProfileInput = z.infer<typeof step01ProfileSchema>;\n"]}
|
package/dist/step-03.schema.d.ts
CHANGED
|
@@ -21,11 +21,11 @@ export declare const step03ElectoralSchema: z.ZodObject<{
|
|
|
21
21
|
no: "no";
|
|
22
22
|
}>>;
|
|
23
23
|
votingFrequency: z.ZodOptional<z.ZodEnum<{
|
|
24
|
-
never: "never";
|
|
25
24
|
every_election: "every_election";
|
|
26
25
|
most_elections: "most_elections";
|
|
27
26
|
sometimes: "sometimes";
|
|
28
27
|
rarely: "rarely";
|
|
28
|
+
never: "never";
|
|
29
29
|
first_time_voter: "first_time_voter";
|
|
30
30
|
}>>;
|
|
31
31
|
primaryVotingIssues: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-03.schema.d.ts","sourceRoot":"","sources":["../src/step-03.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"step-03.schema.d.ts","sourceRoot":"","sources":["../src/step-03.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;iBAiBhC,CAAC;AAIH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/step-03.schema.js
CHANGED
|
@@ -17,14 +17,7 @@ export const step03ElectoralSchema = z.object({
|
|
|
17
17
|
didVoteLastTime: z.enum(['yes', 'no', 'prefer_not_to_say']).optional(),
|
|
18
18
|
/** Voting frequency */
|
|
19
19
|
votingFrequency: z
|
|
20
|
-
.enum([
|
|
21
|
-
'every_election',
|
|
22
|
-
'most_elections',
|
|
23
|
-
'sometimes',
|
|
24
|
-
'rarely',
|
|
25
|
-
'never',
|
|
26
|
-
'first_time_voter',
|
|
27
|
-
])
|
|
20
|
+
.enum(['every_election', 'most_elections', 'sometimes', 'rarely', 'never', 'first_time_voter'])
|
|
28
21
|
.optional(),
|
|
29
22
|
/** Primary voting issues (multi-select string array) */
|
|
30
23
|
primaryVotingIssues: z.array(z.string().trim()).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-03.schema.js","sourceRoot":"","sources":["../src/step-03.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,6BAA6B;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAExC,+BAA+B;IAC/B,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,EAAE;IAEhF,8BAA8B;IAC9B,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,EAAE;IAEtE,uBAAuB;IACvB,eAAe,EAAE,CAAC;SACf,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"step-03.schema.js","sourceRoot":"","sources":["../src/step-03.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,6BAA6B;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAExC,+BAA+B;IAC/B,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,EAAE;IAEhF,8BAA8B;IAC9B,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,EAAE;IAEtE,uBAAuB;IACvB,eAAe,EAAE,CAAC;SACf,IAAI,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;SAC9F,QAAQ,EAAE;IAEb,wDAAwD;IACxD,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC3D,CAAC,CAAC","sourcesContent":["/**\n * Step 03 — Electoral Behaviour\n *\n * Fields: epicNumber, willVoteThisTime, didVoteLastTime,\n * votingFrequency, primaryVotingIssues\n *\n * @module udp-schema/step-03\n */\n\nimport { z } from 'zod';\n\n// ─── Main Step 03 Schema ────────────────────────────────────────────────────\n\nexport const step03ElectoralSchema = z.object({\n /** Voter ID / EPIC number */\n epicNumber: z.string().trim().optional(),\n\n /** Will you vote this time? */\n willVoteThisTime: z.enum(['yes', 'no', 'maybe', 'prefer_not_to_say']).optional(),\n\n /** Did you vote last time? */\n didVoteLastTime: z.enum(['yes', 'no', 'prefer_not_to_say']).optional(),\n\n /** Voting frequency */\n votingFrequency: z\n .enum(['every_election', 'most_elections', 'sometimes', 'rarely', 'never', 'first_time_voter'])\n .optional(),\n\n /** Primary voting issues (multi-select string array) */\n primaryVotingIssues: z.array(z.string().trim()).optional(),\n});\n\n// ─── Inferred types ─────────────────────────────────────────────────────────\n\nexport type Step03ElectoralInput = z.infer<typeof step03ElectoralSchema>;\n"]}
|
package/dist/step-04.schema.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const step04LeadershipSchema: z.ZodObject<{
|
|
|
17
17
|
}>>;
|
|
18
18
|
desiredPoliticalPosition: z.ZodOptional<z.ZodEnum<{
|
|
19
19
|
other: "other";
|
|
20
|
+
none: "none";
|
|
20
21
|
sarpanch: "sarpanch";
|
|
21
22
|
block_pramukh: "block_pramukh";
|
|
22
23
|
zila_panchayat: "zila_panchayat";
|
|
@@ -24,7 +25,6 @@ export declare const step04LeadershipSchema: z.ZodObject<{
|
|
|
24
25
|
mp: "mp";
|
|
25
26
|
municipal_councillor: "municipal_councillor";
|
|
26
27
|
mayor: "mayor";
|
|
27
|
-
none: "none";
|
|
28
28
|
}>>;
|
|
29
29
|
leadershipSkillset: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
30
|
politicalExposure: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-04.schema.d.ts","sourceRoot":"","sources":["../src/step-04.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"step-04.schema.d.ts","sourceRoot":"","sources":["../src/step-04.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0CjC,CAAC;AAIH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|