udp-schema 2.28.0 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/shared-enums.d.ts +78 -0
- package/dist/shared-enums.d.ts.map +1 -0
- package/dist/shared-enums.js +184 -0
- package/dist/shared-enums.js.map +1 -0
- package/dist/step-01.schema.d.ts.map +1 -1
- package/dist/step-01.schema.js +8 -79
- package/dist/step-01.schema.js.map +1 -1
- package/dist/step-06.schema.d.ts.map +1 -1
- package/dist/step-06.schema.js +4 -13
- package/dist/step-06.schema.js.map +1 -1
- package/dist/step-07.schema.d.ts.map +1 -1
- package/dist/step-07.schema.js +8 -114
- package/dist/step-07.schema.js.map +1 -1
- package/package.json +1 -1
- package/dist/field-meta.d.ts +0 -20
- package/dist/field-meta.d.ts.map +0 -1
- package/dist/field-meta.js +0 -19
- package/dist/field-meta.js.map +0 -1
- package/dist/step-13.schema.d.ts +0 -186
- package/dist/step-13.schema.d.ts.map +0 -1
- package/dist/step-13.schema.js +0 -215
- package/dist/step-13.schema.js.map +0 -1
- package/dist/step-14.schema.d.ts +0 -88
- package/dist/step-14.schema.d.ts.map +0 -1
- package/dist/step-14.schema.js +0 -135
- package/dist/step-14.schema.js.map +0 -1
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAS5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAS5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CA4BvF;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAK7E;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAOjF"}
|
package/dist/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGnE;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,GAAqC;IAC3D,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,CAAC,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACxD,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,KAAK,GAAG,I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,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE;QAC9B,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAc,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;QAC5D,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * UDP Shared Helpers — single source of truth for utility functions.\n *\n * Used by both frontend and backend.\n *\n * @module udp-schema/helpers\n */\n\nimport { getFieldMeta, getFieldOptions } from './field-helpers.js';\nimport type { FieldOption } from './profile-fields/types.js';\n\n/**\n * Calculate age from an ISO date string (YYYY-MM-DD or Date-parseable).\n *\n * @returns Age in years, or null if invalid.\n */\nexport function calcAge(dob: string | Date | undefined | null): number | null {\n if (!dob) return null;\n const d = typeof dob === 'string' ? new Date(dob) : dob;\n if (Number.isNaN(d.getTime())) return null;\n const today = new Date();\n let age = today.getFullYear() - d.getFullYear();\n const m = today.getMonth() - d.getMonth();\n if (m < 0 || (m === 0 && today.getDate() < d.getDate())) age--;\n return age;\n}\n\n/**\n * Check if a field should be visible based on its `conditionalOn` rule.\n *\n * Looks up the field's metadata from profile-fields. If it has a `conditionalOn`\n * property, checks if the controlling field's current value is in the allowed list.\n *\n * @param fieldKey - The field to check visibility for\n * @param form - Current form data (flat key-value object)\n * @returns true if the field should be shown (no condition, or condition met)\n */\nexport function isFieldVisible(fieldKey: string, form: Record<string, unknown>): boolean {\n const meta = getFieldMeta(fieldKey);\n if (!meta?.conditionalOn) return true;\n\n const cond = meta.conditionalOn;\n const currentValue = form[cond.field];\n\n // Negative match (notIn): shown unless the value is in the excluded list.\n if ('notIn' in cond) {\n if (typeof currentValue !== 'string') return true; // unset → shown\n return !cond.notIn.includes(currentValue);\n }\n\n // Array-intersection match (includesAny): for multi_select controlling\n // fields. Shown when the referenced array has at least one value in\n // common with the trigger list. Used by step-12 link sub-steps which\n // gate on `familyMembers` (a multi-select) containing the matching\n // relation type. An empty / non-array referenced value → not shown.\n if ('includesAny' in cond) {\n if (!Array.isArray(currentValue)) return false;\n return currentValue.some(\n (v): v is string => typeof v === 'string' && cond.includesAny.includes(v),\n );\n }\n\n // Positive match (values): shown only when single value is in the list.\n if (typeof currentValue !== 'string') return false;\n return cond.values.includes(currentValue);\n}\n\n/**\n * Resolve a single-select field's current value to its display label.\n *\n * Uses getFieldOptions() from profile-fields for O(1) option lookup.\n * Falls back to the raw value if no option found.\n *\n * @param fieldKey - The field key (e.g., \"gender\", \"familyReligion\")\n * @param value - The current value (e.g., \"man\", \"hindu\")\n * @returns Display label string, or undefined if no value\n */\nexport function labelFor(fieldKey: string, value: unknown): string | undefined {\n if (!value || typeof value !== 'string') return undefined;\n const options = getFieldOptions(fieldKey);\n const opt = options.find((o: FieldOption) => o.value === value);\n return opt ? opt.label : value;\n}\n\n/**\n * Resolve a multi-select field's current values to display labels.\n *\n * @param fieldKey - The field key\n * @param values - Array of selected values\n * @returns Array of display labels, or undefined if empty\n */\nexport function labelsFor(fieldKey: string, values: unknown): string[] | undefined {\n if (!Array.isArray(values) || values.length === 0) return undefined;\n const options = getFieldOptions(fieldKey);\n return values.map((v: string) => {\n const opt = options.find((o: FieldOption) => o.value === v);\n return opt ? opt.label : v;\n });\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* @module udp-schema
|
|
18
18
|
*/
|
|
19
|
+
export { GENDER_VALUES, type Gender, HIGHEST_QUALIFICATION_VALUES, type HighestQualification, OCCUPATION_VALUES, type Occupation, RELIGION_VALUES, type Religion, } from './shared-enums.js';
|
|
19
20
|
export { type OnboardingFormData, udpOnboardingFormSchema, } from './onboarding-form.js';
|
|
20
21
|
export { canProceed } from './validation.js';
|
|
21
22
|
export { calcAge, isFieldVisible, labelFor, labelsFor } from './helpers.js';
|
|
@@ -34,6 +35,6 @@ export { type Step08NeurodiversityInput, step08NeurodiversitySchema } from './st
|
|
|
34
35
|
export { type Step09HealthInput, step09HealthSchema } from './step-09.schema.js';
|
|
35
36
|
export { type Step10WorldViewInput, step10WorldViewSchema } from './step-10.schema.js';
|
|
36
37
|
export { type SimplifiedAddressInput, type Step11ResidenceInput, simplifiedAddressSchema, step11ResidenceSchema, } from './step-11.schema.js';
|
|
37
|
-
export { type FamilyLink, type Step12HouseholdInput, step12HouseholdSchema } from './step-12.schema.js';
|
|
38
|
+
export { type FamilyLink, type Step12HouseholdInput, step12HouseholdSchema, } from './step-12.schema.js';
|
|
38
39
|
export { emptyStringToUndefined, optionalPhoneSchema, optionalTrimmedString, optionalYearSchema, } from './zod-helpers.js';
|
|
39
40
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAUH,OAAO,EACL,aAAa,EACb,KAAK,MAAM,EACX,4BAA4B,EAC5B,KAAK,oBAAoB,EACzB,iBAAiB,EACjB,KAAK,UAAU,EACf,eAAe,EACf,KAAK,QAAQ,GACd,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EACL,KAAK,kBAAkB,EACvB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI5E,OAAO,EACL,uBAAuB,EAEvB,cAAc,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/dist/index.js
CHANGED
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
*
|
|
17
17
|
* @module udp-schema
|
|
18
18
|
*/
|
|
19
|
+
// ─── Shared Enums (canonical, cross-package) ────────────────────────────────
|
|
20
|
+
//
|
|
21
|
+
// Source-of-truth value arrays for enums that span more than one
|
|
22
|
+
// service profile. dating-schema (and any future jobs / marketplace /
|
|
23
|
+
// homestay schema) imports from here so their Zod enums produce
|
|
24
|
+
// identical types. To add a new shared enum: declare it in
|
|
25
|
+
// `./shared-enums.ts`, then re-export it from this block.
|
|
26
|
+
export { GENDER_VALUES, HIGHEST_QUALIFICATION_VALUES, OCCUPATION_VALUES, RELIGION_VALUES, } from './shared-enums.js';
|
|
19
27
|
// ─── Unified Form Schema (like dating's onboardingFormSchema) ───────────────
|
|
20
28
|
export { udpOnboardingFormSchema, } from './onboarding-form.js';
|
|
21
29
|
// ─── Validation (single source of truth — used by frontend + backend) ───────
|
|
@@ -46,7 +54,7 @@ export { step08NeurodiversitySchema } from './step-08.schema.js';
|
|
|
46
54
|
export { step09HealthSchema } from './step-09.schema.js';
|
|
47
55
|
export { step10WorldViewSchema } from './step-10.schema.js';
|
|
48
56
|
export { simplifiedAddressSchema, step11ResidenceSchema, } from './step-11.schema.js';
|
|
49
|
-
export { step12HouseholdSchema } from './step-12.schema.js';
|
|
57
|
+
export { step12HouseholdSchema, } from './step-12.schema.js';
|
|
50
58
|
// ─── Zod Helpers ────────────────────────────────────────────────────────────
|
|
51
59
|
export { emptyStringToUndefined, optionalPhoneSchema, optionalTrimmedString, optionalYearSchema, } from './zod-helpers.js';
|
|
52
60
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,+EAA+E;AAE/E,OAAO,EAEL,uBAAuB,GACxB,MAAM,sBAAsB,C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E5B,+EAA+E;AAE/E,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,GAGpB,MAAM,wBAAwB,CAAC;AAEhC,+EAA+E;AAE/E,OAAO,EACL,wBAAwB,IAAI,2BAA2B,EACvD,qBAAqB,IAAI,wBAAwB,EACjD,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAE9B,+EAA+E;AAE/E,OAAO,EAA2B,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAA6B,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAA6B,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAA8B,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAiC,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAEL,sBAAsB,EAEtB,iBAAiB,EAEjB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA8B,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAkC,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAA0B,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAA6B,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAGL,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,+EAA+E;AAE/E,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC","sourcesContent":["/**\n * udp-schema — Shared schemas for User Detailed Profile (v2)\n *\n * Single source of truth consumed by both reform frontends and reform-backend.\n * 12-step \"1 question per screen\" architecture.\n *\n * Follows the same pattern as dating-schema:\n * - profile-fields/ with rich FieldGroup definitions\n * - getFieldOptions() / getFieldMeta() for runtime introspection\n * - Unified onboarding form schema (udpOnboardingFormSchema)\n * - Validation (canProceed) exported for frontend + backend\n * - Helpers (calcAge, labelFor, labelsFor) shared across codebases\n * - Onboarding-config for step grouping\n * - Zod step schemas for per-step validation\n * - Progress tracking (per-step + overall)\n *\n * @module udp-schema\n */\n\n// ─── Shared Enums (canonical, cross-package) ────────────────────────────────\n//\n// Source-of-truth value arrays for enums that span more than one\n// service profile. dating-schema (and any future jobs / marketplace /\n// homestay schema) imports from here so their Zod enums produce\n// identical types. To add a new shared enum: declare it in\n// `./shared-enums.ts`, then re-export it from this block.\n\nexport {\n GENDER_VALUES,\n type Gender,\n HIGHEST_QUALIFICATION_VALUES,\n type HighestQualification,\n OCCUPATION_VALUES,\n type Occupation,\n RELIGION_VALUES,\n type Religion,\n} from './shared-enums.js';\n\n// ─── Unified Form Schema (like dating's onboardingFormSchema) ───────────────\n\nexport {\n type OnboardingFormData,\n udpOnboardingFormSchema,\n} from './onboarding-form.js';\n\n// ─── Validation (single source of truth — used by frontend + backend) ───────\n\nexport { canProceed } from './validation.js';\n\n// ─── Shared Helpers ─────────────────────────────────────────────────────────\n\nexport { calcAge, isFieldVisible, labelFor, labelsFor } from './helpers.js';\n\n// ─── Profile Fields (rich metadata — like dating-schema) ────────────────────\n\nexport {\n ageOfRealizationOptions,\n // Field groups\n allFieldGroups,\n // Types\n type BaseField,\n boardOptions,\n casteDiscriminationPlaceOptions,\n civicEngagementOptions,\n cognitiveStrengthOptions,\n communicationPreferenceOptions,\n DEGREE_VALUES_BY_LEVEL,\n degreeNameOptions,\n desiredPoliticalPositionOptions,\n dietOptions,\n digitalAccessOptions,\n disabilityOptions,\n education,\n electoralBehaviour,\n employment,\n employmentStatusOptions,\n executiveFunctionChallengeOptions,\n type FieldGroup,\n type FieldOption,\n familyMemberOptions,\n // Option arrays (with labels + descriptions)\n genderOptions,\n healthLifestyle,\n household,\n householdIncomeOptions,\n impactOnLifeOptions,\n incomeRangeOptions,\n languageOptions,\n leadershipAmbitions,\n leadershipSkillsetOptions,\n learningStyleOptions,\n lgbtqStatementOptions,\n type MultiSelectField,\n maskingBurnoutOptions,\n mbtiOptions,\n mentalHealthConditionOptions,\n minorityOptions,\n type NumberField,\n neurodevelopmentalConditionOptions,\n neurodiverseIdentityOptions,\n neurodiversity,\n neurologicalChronicConditionOptions,\n occupationOptions,\n officeElectionLevelOptions,\n type ProfileField,\n partyAssociationRoleOptions,\n partyOptions,\n personalityPatternOptions,\n politicalAssociation,\n politicalSpectrumOptions,\n profile,\n psychologicalAssessment,\n qualificationOptions,\n relativesInPoliticsOptions,\n religionOptions,\n reservationOptions,\n residence,\n type SelectField,\n sensoryProfileOptions,\n shiftOptions,\n streamOptions,\n subjectOptions,\n substanceUseOptions,\n supportAccommodationOptions,\n type TextField,\n transgenderStatementOptions,\n votingIssueOptions,\n worldView,\n} from './profile-fields/index.js';\n\n// ─── Field Helpers (like dating-schema) ─────────────────────────────────────\n\nexport {\n getFieldMeta,\n getFieldOptions,\n getImmutableFields,\n getStepSchema,\n} from './field-helpers.js';\n\n// ─── Onboarding Configuration ───────────────────────────────────────────────\n\nexport {\n getUdpOnboardingFieldConfig,\n UDP_ONBOARDING_FIELDS,\n UDP_ONBOARDING_STEP_GROUPS,\n UDP_TOTAL_MAIN_STEPS,\n UDP_TOTAL_SUB_STEPS,\n type UdpOnboardingFieldConfig,\n type UdpOnboardingStepGroup,\n} from './onboarding-config.js';\n\n// ─── Progress Fields ────────────────────────────────────────────────────────\n\nexport {\n calculateOverallProgress as calculateUdpOverallProgress,\n calculateStepProgress as calculateUdpStepProgress,\n getNestedValue,\n isFieldFilled,\n UDP_PROGRESS_FIELDS,\n UDP_TOTAL_STEPS,\n} from './progress-fields.js';\n\n// ─── Step Schemas (Zod validation) ──────────────────────────────────────────\n\nexport { type Step01ProfileInput, step01ProfileSchema } from './step-01.schema.js';\nexport { type Step02PoliticalInput, step02PoliticalSchema } from './step-02.schema.js';\nexport { type Step03ElectoralInput, step03ElectoralSchema } from './step-03.schema.js';\nexport { type Step04LeadershipInput, step04LeadershipSchema } from './step-04.schema.js';\nexport { type Step05PsychologicalInput, step05PsychologicalSchema } from './step-05.schema.js';\nexport {\n type CertificateEntryInput,\n certificateEntrySchema,\n type DegreeEntryInput,\n degreeEntrySchema,\n type Step06EducationInput,\n step06EducationSchema,\n} from './step-06.schema.js';\nexport { type Step07EmploymentInput, step07EmploymentSchema } from './step-07.schema.js';\nexport { type Step08NeurodiversityInput, step08NeurodiversitySchema } from './step-08.schema.js';\nexport { type Step09HealthInput, step09HealthSchema } from './step-09.schema.js';\nexport { type Step10WorldViewInput, step10WorldViewSchema } from './step-10.schema.js';\nexport {\n type SimplifiedAddressInput,\n type Step11ResidenceInput,\n simplifiedAddressSchema,\n step11ResidenceSchema,\n} from './step-11.schema.js';\nexport {\n type FamilyLink,\n type Step12HouseholdInput,\n step12HouseholdSchema,\n} from './step-12.schema.js';\n\n// ─── Zod Helpers ────────────────────────────────────────────────────────────\n\nexport {\n emptyStringToUndefined,\n optionalPhoneSchema,\n optionalTrimmedString,\n optionalYearSchema,\n} from './zod-helpers.js';\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Enum Catalogues
|
|
3
|
+
* =======================
|
|
4
|
+
* Canonical `as const` value arrays for enums that span more than one
|
|
5
|
+
* service profile (UDP, dating, future jobs / marketplace / homestay).
|
|
6
|
+
* udp-schema is the source of truth; dating-schema imports from here so
|
|
7
|
+
* both packages produce IDENTICAL Zod enum types for the same concept.
|
|
8
|
+
*
|
|
9
|
+
* Why centralise in udp-schema (not a separate `community-enums`
|
|
10
|
+
* package)?
|
|
11
|
+
* - UDP is the canonical identity surface — gender / religion /
|
|
12
|
+
* occupation are identity facts before they are matchmaking facets.
|
|
13
|
+
* - One npm dep edge (dating-schema → udp-schema) is cheaper than a
|
|
14
|
+
* third coordination package today. When a 3rd consumer (jobs,
|
|
15
|
+
* marketplace, homestay) needs these, extract to a standalone
|
|
16
|
+
* `community-enums` package — the shape is the same, just lifted.
|
|
17
|
+
*
|
|
18
|
+
* Scope of this file:
|
|
19
|
+
* - ONLY the enums where a shared concept exists across services.
|
|
20
|
+
* - Service-specific enums (dating's `loveLanguage`, UDP's
|
|
21
|
+
* `reservationStatus`) stay in their owning package.
|
|
22
|
+
*
|
|
23
|
+
* @module udp-schema/shared-enums
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Self-identified gender. 17 values covering the full identity spectrum
|
|
27
|
+
* including trans and South Asian-specific identities (hijra).
|
|
28
|
+
*
|
|
29
|
+
* Use everywhere gender is recorded: UDP step-01, dating-profile,
|
|
30
|
+
* future service profiles. NEVER write `male` / `female` — the older
|
|
31
|
+
* binary vocabulary is intentionally retired in favour of `man` /
|
|
32
|
+
* `woman` (per current inclusive-identity conventions).
|
|
33
|
+
*/
|
|
34
|
+
export declare const GENDER_VALUES: readonly ["man", "woman", "non_binary", "trans_man", "trans_woman", "genderfluid", "genderqueer", "agender", "bigender", "pangender", "androgynous", "intersex", "gender_nonconforming", "two_spirit", "hijra", "other", "prefer_not_to_say"];
|
|
35
|
+
export type Gender = (typeof GENDER_VALUES)[number];
|
|
36
|
+
/**
|
|
37
|
+
* Family or personal religion, denominated to the sect / branch level.
|
|
38
|
+
* 22 values covering the major Indian religious communities plus
|
|
39
|
+
* non-religious / prefer-not-to-say options.
|
|
40
|
+
*
|
|
41
|
+
* The denomination granularity (e.g., `muslim_sunni` vs `muslim_shia`,
|
|
42
|
+
* `jain_digambar` vs `jain_shwetambar`) matters for both:
|
|
43
|
+
* - Population stats: denomination-level rollups for the superadmin
|
|
44
|
+
* dashboard.
|
|
45
|
+
* - Matchmaking: marriage rules within communities are often
|
|
46
|
+
* denomination-specific.
|
|
47
|
+
*/
|
|
48
|
+
export declare const RELIGION_VALUES: readonly ["hindu", "muslim_sunni", "muslim_shia", "muslim_sufi", "muslim_other", "christian_catholic", "christian_protestant", "christian_other", "sikh", "jain_digambar", "jain_shwetambar", "buddhist", "parsi_zoroastrian", "jewish", "bahai", "spiritual", "atheist", "agnostic", "no_religion", "inter_religion", "other", "prefer_not_to_say"];
|
|
49
|
+
export type Religion = (typeof RELIGION_VALUES)[number];
|
|
50
|
+
/**
|
|
51
|
+
* Industry / occupation taxonomy. 39 values covering the main Indian
|
|
52
|
+
* economic sectors plus non-working statuses (student / homemaker /
|
|
53
|
+
* retired / not_working / differently_abled_pension).
|
|
54
|
+
*
|
|
55
|
+
* Used by UDP step-07 (`occupation` + `dreamOccupation`) and
|
|
56
|
+
* dating-profile (`profession`). The two were already aligned in
|
|
57
|
+
* practice — this declaration formalises the canonical list so they
|
|
58
|
+
* can't drift.
|
|
59
|
+
*
|
|
60
|
+
* `prefer_not_to_say` is intentionally placed at the end so UI
|
|
61
|
+
* dropdowns surface it as the final option.
|
|
62
|
+
*/
|
|
63
|
+
export declare const OCCUPATION_VALUES: readonly ["it_software", "engineering", "healthcare_doctor", "healthcare_nursing", "healthcare_pharma", "psychology_therapy", "education_teaching", "science_research", "finance_banking", "chartered_accountant", "business_management", "arts_entertainment", "media_communication", "design_creative", "civil_services", "government_public", "defence_military", "police_law_enforcement", "legal", "skilled_trades", "transport_logistics", "hospitality_travel", "beauty_wellness", "agriculture_farming", "real_estate", "retail_ecommerce", "manufacturing", "merchant_navy", "ngo_social_work", "religious_spiritual", "freelancer_gig", "content_creator", "self_employed", "student", "homemaker", "retired", "not_working", "differently_abled_pension", "other", "prefer_not_to_say"];
|
|
64
|
+
export type Occupation = (typeof OCCUPATION_VALUES)[number];
|
|
65
|
+
/**
|
|
66
|
+
* Highest education attained, on the Indian system. 8 values matching
|
|
67
|
+
* the buckets the dashboard's education-distribution widget rolls up
|
|
68
|
+
* into. The granular education timeline (board, year, degree,
|
|
69
|
+
* currently-studying-or-not) lives in UDP step-06's `education10th`
|
|
70
|
+
* / `education12th` / `graduations[]` / etc.; `highestQualification`
|
|
71
|
+
* is the single-bucket summary.
|
|
72
|
+
*
|
|
73
|
+
* Use for the matchmaking education filter, the dashboard rollup,
|
|
74
|
+
* and any future jobs / counseling profile.
|
|
75
|
+
*/
|
|
76
|
+
export declare const HIGHEST_QUALIFICATION_VALUES: readonly ["CLASS_10", "CLASS_12", "DIPLOMA", "GRADUATION", "POST_GRAD", "PHD", "POST_DOCTORATE", "OTHER"];
|
|
77
|
+
export type HighestQualification = (typeof HIGHEST_QUALIFICATION_VALUES)[number];
|
|
78
|
+
//# sourceMappingURL=shared-enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-enums.d.ts","sourceRoot":"","sources":["../src/shared-enums.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,+OAkBhB,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAIpD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,sVAuBlB,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAIxD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,owBAwDpB,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAI5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,2GAS/B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Enum Catalogues
|
|
3
|
+
* =======================
|
|
4
|
+
* Canonical `as const` value arrays for enums that span more than one
|
|
5
|
+
* service profile (UDP, dating, future jobs / marketplace / homestay).
|
|
6
|
+
* udp-schema is the source of truth; dating-schema imports from here so
|
|
7
|
+
* both packages produce IDENTICAL Zod enum types for the same concept.
|
|
8
|
+
*
|
|
9
|
+
* Why centralise in udp-schema (not a separate `community-enums`
|
|
10
|
+
* package)?
|
|
11
|
+
* - UDP is the canonical identity surface — gender / religion /
|
|
12
|
+
* occupation are identity facts before they are matchmaking facets.
|
|
13
|
+
* - One npm dep edge (dating-schema → udp-schema) is cheaper than a
|
|
14
|
+
* third coordination package today. When a 3rd consumer (jobs,
|
|
15
|
+
* marketplace, homestay) needs these, extract to a standalone
|
|
16
|
+
* `community-enums` package — the shape is the same, just lifted.
|
|
17
|
+
*
|
|
18
|
+
* Scope of this file:
|
|
19
|
+
* - ONLY the enums where a shared concept exists across services.
|
|
20
|
+
* - Service-specific enums (dating's `loveLanguage`, UDP's
|
|
21
|
+
* `reservationStatus`) stay in their owning package.
|
|
22
|
+
*
|
|
23
|
+
* @module udp-schema/shared-enums
|
|
24
|
+
*/
|
|
25
|
+
// ─── Gender ──────────────────────────────────────────────────────────────────
|
|
26
|
+
/**
|
|
27
|
+
* Self-identified gender. 17 values covering the full identity spectrum
|
|
28
|
+
* including trans and South Asian-specific identities (hijra).
|
|
29
|
+
*
|
|
30
|
+
* Use everywhere gender is recorded: UDP step-01, dating-profile,
|
|
31
|
+
* future service profiles. NEVER write `male` / `female` — the older
|
|
32
|
+
* binary vocabulary is intentionally retired in favour of `man` /
|
|
33
|
+
* `woman` (per current inclusive-identity conventions).
|
|
34
|
+
*/
|
|
35
|
+
export const GENDER_VALUES = [
|
|
36
|
+
'man',
|
|
37
|
+
'woman',
|
|
38
|
+
'non_binary',
|
|
39
|
+
'trans_man',
|
|
40
|
+
'trans_woman',
|
|
41
|
+
'genderfluid',
|
|
42
|
+
'genderqueer',
|
|
43
|
+
'agender',
|
|
44
|
+
'bigender',
|
|
45
|
+
'pangender',
|
|
46
|
+
'androgynous',
|
|
47
|
+
'intersex',
|
|
48
|
+
'gender_nonconforming',
|
|
49
|
+
'two_spirit',
|
|
50
|
+
'hijra',
|
|
51
|
+
'other',
|
|
52
|
+
'prefer_not_to_say',
|
|
53
|
+
];
|
|
54
|
+
// ─── Religion ────────────────────────────────────────────────────────────────
|
|
55
|
+
/**
|
|
56
|
+
* Family or personal religion, denominated to the sect / branch level.
|
|
57
|
+
* 22 values covering the major Indian religious communities plus
|
|
58
|
+
* non-religious / prefer-not-to-say options.
|
|
59
|
+
*
|
|
60
|
+
* The denomination granularity (e.g., `muslim_sunni` vs `muslim_shia`,
|
|
61
|
+
* `jain_digambar` vs `jain_shwetambar`) matters for both:
|
|
62
|
+
* - Population stats: denomination-level rollups for the superadmin
|
|
63
|
+
* dashboard.
|
|
64
|
+
* - Matchmaking: marriage rules within communities are often
|
|
65
|
+
* denomination-specific.
|
|
66
|
+
*/
|
|
67
|
+
export const RELIGION_VALUES = [
|
|
68
|
+
'hindu',
|
|
69
|
+
'muslim_sunni',
|
|
70
|
+
'muslim_shia',
|
|
71
|
+
'muslim_sufi',
|
|
72
|
+
'muslim_other',
|
|
73
|
+
'christian_catholic',
|
|
74
|
+
'christian_protestant',
|
|
75
|
+
'christian_other',
|
|
76
|
+
'sikh',
|
|
77
|
+
'jain_digambar',
|
|
78
|
+
'jain_shwetambar',
|
|
79
|
+
'buddhist',
|
|
80
|
+
'parsi_zoroastrian',
|
|
81
|
+
'jewish',
|
|
82
|
+
'bahai',
|
|
83
|
+
'spiritual',
|
|
84
|
+
'atheist',
|
|
85
|
+
'agnostic',
|
|
86
|
+
'no_religion',
|
|
87
|
+
'inter_religion',
|
|
88
|
+
'other',
|
|
89
|
+
'prefer_not_to_say',
|
|
90
|
+
];
|
|
91
|
+
// ─── Occupation ──────────────────────────────────────────────────────────────
|
|
92
|
+
/**
|
|
93
|
+
* Industry / occupation taxonomy. 39 values covering the main Indian
|
|
94
|
+
* economic sectors plus non-working statuses (student / homemaker /
|
|
95
|
+
* retired / not_working / differently_abled_pension).
|
|
96
|
+
*
|
|
97
|
+
* Used by UDP step-07 (`occupation` + `dreamOccupation`) and
|
|
98
|
+
* dating-profile (`profession`). The two were already aligned in
|
|
99
|
+
* practice — this declaration formalises the canonical list so they
|
|
100
|
+
* can't drift.
|
|
101
|
+
*
|
|
102
|
+
* `prefer_not_to_say` is intentionally placed at the end so UI
|
|
103
|
+
* dropdowns surface it as the final option.
|
|
104
|
+
*/
|
|
105
|
+
export const OCCUPATION_VALUES = [
|
|
106
|
+
// Technology
|
|
107
|
+
'it_software',
|
|
108
|
+
'engineering',
|
|
109
|
+
// Healthcare & Medicine
|
|
110
|
+
'healthcare_doctor',
|
|
111
|
+
'healthcare_nursing',
|
|
112
|
+
'healthcare_pharma',
|
|
113
|
+
'psychology_therapy',
|
|
114
|
+
// Education & Research
|
|
115
|
+
'education_teaching',
|
|
116
|
+
'science_research',
|
|
117
|
+
// Finance & Business
|
|
118
|
+
'finance_banking',
|
|
119
|
+
'chartered_accountant',
|
|
120
|
+
'business_management',
|
|
121
|
+
// Creative & Media
|
|
122
|
+
'arts_entertainment',
|
|
123
|
+
'media_communication',
|
|
124
|
+
'design_creative',
|
|
125
|
+
// Government & Public Service
|
|
126
|
+
'civil_services',
|
|
127
|
+
'government_public',
|
|
128
|
+
'defence_military',
|
|
129
|
+
'police_law_enforcement',
|
|
130
|
+
// Legal
|
|
131
|
+
'legal',
|
|
132
|
+
// Trades & Services
|
|
133
|
+
'skilled_trades',
|
|
134
|
+
'transport_logistics',
|
|
135
|
+
'hospitality_travel',
|
|
136
|
+
'beauty_wellness',
|
|
137
|
+
// Agriculture & Rural
|
|
138
|
+
'agriculture_farming',
|
|
139
|
+
// Real Estate & Construction
|
|
140
|
+
'real_estate',
|
|
141
|
+
// Retail & Commerce
|
|
142
|
+
'retail_ecommerce',
|
|
143
|
+
'manufacturing',
|
|
144
|
+
// Maritime
|
|
145
|
+
'merchant_navy',
|
|
146
|
+
// Social & NGO
|
|
147
|
+
'ngo_social_work',
|
|
148
|
+
'religious_spiritual',
|
|
149
|
+
// Independent
|
|
150
|
+
'freelancer_gig',
|
|
151
|
+
'content_creator',
|
|
152
|
+
'self_employed',
|
|
153
|
+
// Non-working
|
|
154
|
+
'student',
|
|
155
|
+
'homemaker',
|
|
156
|
+
'retired',
|
|
157
|
+
'not_working',
|
|
158
|
+
'differently_abled_pension',
|
|
159
|
+
'other',
|
|
160
|
+
'prefer_not_to_say',
|
|
161
|
+
];
|
|
162
|
+
// ─── Highest Qualification ───────────────────────────────────────────────────
|
|
163
|
+
/**
|
|
164
|
+
* Highest education attained, on the Indian system. 8 values matching
|
|
165
|
+
* the buckets the dashboard's education-distribution widget rolls up
|
|
166
|
+
* into. The granular education timeline (board, year, degree,
|
|
167
|
+
* currently-studying-or-not) lives in UDP step-06's `education10th`
|
|
168
|
+
* / `education12th` / `graduations[]` / etc.; `highestQualification`
|
|
169
|
+
* is the single-bucket summary.
|
|
170
|
+
*
|
|
171
|
+
* Use for the matchmaking education filter, the dashboard rollup,
|
|
172
|
+
* and any future jobs / counseling profile.
|
|
173
|
+
*/
|
|
174
|
+
export const HIGHEST_QUALIFICATION_VALUES = [
|
|
175
|
+
'CLASS_10',
|
|
176
|
+
'CLASS_12',
|
|
177
|
+
'DIPLOMA',
|
|
178
|
+
'GRADUATION',
|
|
179
|
+
'POST_GRAD',
|
|
180
|
+
'PHD',
|
|
181
|
+
'POST_DOCTORATE',
|
|
182
|
+
'OTHER',
|
|
183
|
+
];
|
|
184
|
+
//# sourceMappingURL=shared-enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-enums.js","sourceRoot":"","sources":["../src/shared-enums.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,gFAAgF;AAEhF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK;IACL,OAAO;IACP,YAAY;IACZ,WAAW;IACX,aAAa;IACb,aAAa;IACb,aAA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IACX,SAAS;IACT,aAAa;IACb,2BAA2B;IAC3B,OAAO;IACP,mBAAmB;CACX,CAAC;AAIX,gFAAgF;AAEhF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,UAAU;IACV,UAAU;IACV,SAAS;IACT,YAAY;IACZ,WAAW;IACX,KAAK;IACL,gBAAgB;IAChB,OAAO;CACC,CAAC","sourcesContent":["/**\n * Shared Enum Catalogues\n * =======================\n * Canonical `as const` value arrays for enums that span more than one\n * service profile (UDP, dating, future jobs / marketplace / homestay).\n * udp-schema is the source of truth; dating-schema imports from here so\n * both packages produce IDENTICAL Zod enum types for the same concept.\n *\n * Why centralise in udp-schema (not a separate `community-enums`\n * package)?\n * - UDP is the canonical identity surface — gender / religion /\n * occupation are identity facts before they are matchmaking facets.\n * - One npm dep edge (dating-schema → udp-schema) is cheaper than a\n * third coordination package today. When a 3rd consumer (jobs,\n * marketplace, homestay) needs these, extract to a standalone\n * `community-enums` package — the shape is the same, just lifted.\n *\n * Scope of this file:\n * - ONLY the enums where a shared concept exists across services.\n * - Service-specific enums (dating's `loveLanguage`, UDP's\n * `reservationStatus`) stay in their owning package.\n *\n * @module udp-schema/shared-enums\n */\n\n// ─── Gender ──────────────────────────────────────────────────────────────────\n\n/**\n * Self-identified gender. 17 values covering the full identity spectrum\n * including trans and South Asian-specific identities (hijra).\n *\n * Use everywhere gender is recorded: UDP step-01, dating-profile,\n * future service profiles. NEVER write `male` / `female` — the older\n * binary vocabulary is intentionally retired in favour of `man` /\n * `woman` (per current inclusive-identity conventions).\n */\nexport const GENDER_VALUES = [\n 'man',\n 'woman',\n 'non_binary',\n 'trans_man',\n 'trans_woman',\n 'genderfluid',\n 'genderqueer',\n 'agender',\n 'bigender',\n 'pangender',\n 'androgynous',\n 'intersex',\n 'gender_nonconforming',\n 'two_spirit',\n 'hijra',\n 'other',\n 'prefer_not_to_say',\n] as const;\n\nexport type Gender = (typeof GENDER_VALUES)[number];\n\n// ─── Religion ────────────────────────────────────────────────────────────────\n\n/**\n * Family or personal religion, denominated to the sect / branch level.\n * 22 values covering the major Indian religious communities plus\n * non-religious / prefer-not-to-say options.\n *\n * The denomination granularity (e.g., `muslim_sunni` vs `muslim_shia`,\n * `jain_digambar` vs `jain_shwetambar`) matters for both:\n * - Population stats: denomination-level rollups for the superadmin\n * dashboard.\n * - Matchmaking: marriage rules within communities are often\n * denomination-specific.\n */\nexport const RELIGION_VALUES = [\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] as const;\n\nexport type Religion = (typeof RELIGION_VALUES)[number];\n\n// ─── Occupation ──────────────────────────────────────────────────────────────\n\n/**\n * Industry / occupation taxonomy. 39 values covering the main Indian\n * economic sectors plus non-working statuses (student / homemaker /\n * retired / not_working / differently_abled_pension).\n *\n * Used by UDP step-07 (`occupation` + `dreamOccupation`) and\n * dating-profile (`profession`). The two were already aligned in\n * practice — this declaration formalises the canonical list so they\n * can't drift.\n *\n * `prefer_not_to_say` is intentionally placed at the end so UI\n * dropdowns surface it as the final option.\n */\nexport const OCCUPATION_VALUES = [\n // Technology\n 'it_software',\n 'engineering',\n // Healthcare & Medicine\n 'healthcare_doctor',\n 'healthcare_nursing',\n 'healthcare_pharma',\n 'psychology_therapy',\n // Education & Research\n 'education_teaching',\n 'science_research',\n // Finance & Business\n 'finance_banking',\n 'chartered_accountant',\n 'business_management',\n // Creative & Media\n 'arts_entertainment',\n 'media_communication',\n 'design_creative',\n // Government & Public Service\n 'civil_services',\n 'government_public',\n 'defence_military',\n 'police_law_enforcement',\n // Legal\n 'legal',\n // Trades & Services\n 'skilled_trades',\n 'transport_logistics',\n 'hospitality_travel',\n 'beauty_wellness',\n // Agriculture & Rural\n 'agriculture_farming',\n // Real Estate & Construction\n 'real_estate',\n // Retail & Commerce\n 'retail_ecommerce',\n 'manufacturing',\n // Maritime\n 'merchant_navy',\n // Social & NGO\n 'ngo_social_work',\n 'religious_spiritual',\n // Independent\n 'freelancer_gig',\n 'content_creator',\n 'self_employed',\n // Non-working\n 'student',\n 'homemaker',\n 'retired',\n 'not_working',\n 'differently_abled_pension',\n 'other',\n 'prefer_not_to_say',\n] as const;\n\nexport type Occupation = (typeof OCCUPATION_VALUES)[number];\n\n// ─── Highest Qualification ───────────────────────────────────────────────────\n\n/**\n * Highest education attained, on the Indian system. 8 values matching\n * the buckets the dashboard's education-distribution widget rolls up\n * into. The granular education timeline (board, year, degree,\n * currently-studying-or-not) lives in UDP step-06's `education10th`\n * / `education12th` / `graduations[]` / etc.; `highestQualification`\n * is the single-bucket summary.\n *\n * Use for the matchmaking education filter, the dashboard rollup,\n * and any future jobs / counseling profile.\n */\nexport const HIGHEST_QUALIFICATION_VALUES = [\n 'CLASS_10',\n 'CLASS_12',\n 'DIPLOMA',\n 'GRADUATION',\n 'POST_GRAD',\n 'PHD',\n 'POST_DOCTORATE',\n 'OTHER',\n] as const;\n\nexport type HighestQualification = (typeof HIGHEST_QUALIFICATION_VALUES)[number];\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;AAUxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2D9B,CAAC;AAIH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/step-01.schema.js
CHANGED
|
@@ -8,97 +8,26 @@
|
|
|
8
8
|
* @module udp-schema/step-01
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
+
import { GENDER_VALUES, RELIGION_VALUES } from './shared-enums.js';
|
|
11
12
|
import { emptyStringToUndefined, optionalPhoneSchema, optionalTrimmedString, } from './zod-helpers.js';
|
|
12
13
|
// ─── Main Step 01 Schema ────────────────────────────────────────────────────
|
|
13
14
|
export const step01ProfileSchema = z.object({
|
|
14
15
|
firstName: z.string().trim().max(50).optional(),
|
|
15
16
|
middleName: optionalTrimmedString,
|
|
16
17
|
lastName: z.string().trim().max(50).optional(),
|
|
17
|
-
/** Gender —
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'man',
|
|
21
|
-
'woman',
|
|
22
|
-
'non_binary',
|
|
23
|
-
'trans_man',
|
|
24
|
-
'trans_woman',
|
|
25
|
-
'genderfluid',
|
|
26
|
-
'genderqueer',
|
|
27
|
-
'agender',
|
|
28
|
-
'bigender',
|
|
29
|
-
'pangender',
|
|
30
|
-
'androgynous',
|
|
31
|
-
'intersex',
|
|
32
|
-
'gender_nonconforming',
|
|
33
|
-
'two_spirit',
|
|
34
|
-
'hijra',
|
|
35
|
-
'other',
|
|
36
|
-
'prefer_not_to_say',
|
|
37
|
-
])
|
|
38
|
-
.optional(),
|
|
18
|
+
/** Gender — canonical 17-value enum from `shared-enums`. Shared with
|
|
19
|
+
* dating-schema and any future service profile. */
|
|
20
|
+
gender: z.enum(GENDER_VALUES).optional(),
|
|
39
21
|
dateOfBirth: z.preprocess(emptyStringToUndefined, z.coerce.date().optional()),
|
|
40
22
|
whatsappNumber: optionalPhoneSchema,
|
|
41
23
|
/** Single language code string (e.g., "hindi", "english") — matches dating motherTongue options */
|
|
42
24
|
primaryLanguage: z.string().trim().optional(),
|
|
43
25
|
/** Array of language code strings */
|
|
44
26
|
secondaryLanguages: z.array(z.string().trim()).max(10).optional(),
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
familyReligion: z
|
|
50
|
-
.enum([
|
|
51
|
-
'hindu',
|
|
52
|
-
'muslim_sunni',
|
|
53
|
-
'muslim_shia',
|
|
54
|
-
'muslim_sufi',
|
|
55
|
-
'muslim_other',
|
|
56
|
-
'christian_catholic',
|
|
57
|
-
'christian_protestant',
|
|
58
|
-
'christian_other',
|
|
59
|
-
'sikh',
|
|
60
|
-
'jain_digambar',
|
|
61
|
-
'jain_shwetambar',
|
|
62
|
-
'buddhist',
|
|
63
|
-
'parsi_zoroastrian',
|
|
64
|
-
'jewish',
|
|
65
|
-
'bahai',
|
|
66
|
-
'spiritual',
|
|
67
|
-
'atheist',
|
|
68
|
-
'agnostic',
|
|
69
|
-
'no_religion',
|
|
70
|
-
'inter_religion',
|
|
71
|
-
'other',
|
|
72
|
-
'prefer_not_to_say',
|
|
73
|
-
])
|
|
74
|
-
.optional(),
|
|
75
|
-
/** Personal religion — same options as familyReligion */
|
|
76
|
-
personalReligion: z
|
|
77
|
-
.enum([
|
|
78
|
-
'hindu',
|
|
79
|
-
'muslim_sunni',
|
|
80
|
-
'muslim_shia',
|
|
81
|
-
'muslim_sufi',
|
|
82
|
-
'muslim_other',
|
|
83
|
-
'christian_catholic',
|
|
84
|
-
'christian_protestant',
|
|
85
|
-
'christian_other',
|
|
86
|
-
'sikh',
|
|
87
|
-
'jain_digambar',
|
|
88
|
-
'jain_shwetambar',
|
|
89
|
-
'buddhist',
|
|
90
|
-
'parsi_zoroastrian',
|
|
91
|
-
'jewish',
|
|
92
|
-
'bahai',
|
|
93
|
-
'spiritual',
|
|
94
|
-
'atheist',
|
|
95
|
-
'agnostic',
|
|
96
|
-
'no_religion',
|
|
97
|
-
'inter_religion',
|
|
98
|
-
'other',
|
|
99
|
-
'prefer_not_to_say',
|
|
100
|
-
])
|
|
101
|
-
.optional(),
|
|
27
|
+
/** Family religion — canonical 22-value enum from `shared-enums`. */
|
|
28
|
+
familyReligion: z.enum(RELIGION_VALUES).optional(),
|
|
29
|
+
/** Personal religion — same canonical list as `familyReligion`. */
|
|
30
|
+
personalReligion: z.enum(RELIGION_VALUES).optional(),
|
|
102
31
|
/** Reservation / caste category — exhaustive per central + state notifications. */
|
|
103
32
|
reservationStatus: z
|
|
104
33
|
.enum([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-01.schema.js","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,+EAA+E;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,UAAU,EAAE,qBAAqB;IACjC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAE9C
|
|
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,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,q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CAAC;SACD,QAAQ,EAAE;IAEb,+FAA+F;IAC/F,cAAc,EAAE,CAAC;SACd,IAAI,CAAC;QACJ,IAAI;QACJ,QAAQ;QACR,WAAW;QACX,MAAM;QACN,UAAU;QACV,MAAM;QACN,OAAO;QACP,YAAY;QACZ,MAAM;QACN,UAAU;QACV,mBAAmB;KACpB,CAAC;SACD,QAAQ,EAAE;CACd,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 { GENDER_VALUES, RELIGION_VALUES } from './shared-enums.js';\nimport {\n emptyStringToUndefined,\n optionalPhoneSchema,\n optionalTrimmedString,\n} from './zod-helpers.js';\n\n// ─── Main Step 01 Schema ────────────────────────────────────────────────────\n\nexport const step01ProfileSchema = z.object({\n firstName: z.string().trim().max(50).optional(),\n middleName: optionalTrimmedString,\n lastName: z.string().trim().max(50).optional(),\n\n /** Gender — canonical 17-value enum from `shared-enums`. Shared with\n * dating-schema and any future service profile. */\n gender: z.enum(GENDER_VALUES).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 /** Family religion — canonical 22-value enum from `shared-enums`. */\n familyReligion: z.enum(RELIGION_VALUES).optional(),\n\n /** Personal religion — same canonical list as `familyReligion`. */\n personalReligion: z.enum(RELIGION_VALUES).optional(),\n\n /** Reservation / caste category — exhaustive per central + state notifications. */\n reservationStatus: z\n .enum([\n 'SC',\n 'ST',\n 'OBC_NCL',\n 'OBC_CL',\n 'MBC',\n 'SEBC',\n 'SBC',\n 'DNT_NT',\n 'EWS',\n 'GENERAL',\n 'DONT_KNOW',\n 'PREFER_NOT_TO_SAY',\n ])\n .optional(),\n\n /** Minority community status — per Ministry of Minority Affairs (6 religious + linguistic). */\n minorityStatus: z\n .enum([\n 'NO',\n 'MUSLIM',\n 'CHRISTIAN',\n 'SIKH',\n 'BUDDHIST',\n 'JAIN',\n 'PARSI',\n 'LINGUISTIC',\n 'BOTH',\n 'NOT_SURE',\n 'PREFER_NOT_TO_SAY',\n ])\n .optional(),\n});\n\n// ─── Inferred types ─────────────────────────────────────────────────────────\n\nexport type Step01ProfileInput = z.infer<typeof step01ProfileSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-06.schema.d.ts","sourceRoot":"","sources":["../src/step-06.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"step-06.schema.d.ts","sourceRoot":"","sources":["../src/step-06.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,iBAAiB;;;;;;;;iBAQ5B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AAIH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsDhC,CAAC;AAIH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC3E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/step-06.schema.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @module udp-schema/step-06
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
+
import { HIGHEST_QUALIFICATION_VALUES } from './shared-enums.js';
|
|
10
11
|
import { optionalYearSchema } from './zod-helpers.js';
|
|
11
12
|
// ─── Reusable sub-schemas ────────────────────────────────────────────────────
|
|
12
13
|
export const degreeEntrySchema = z.object({
|
|
@@ -26,19 +27,9 @@ export const certificateEntrySchema = z.object({
|
|
|
26
27
|
});
|
|
27
28
|
// ─── Main Step 06 Schema ────────────────────────────────────────────────────
|
|
28
29
|
export const step06EducationSchema = z.object({
|
|
29
|
-
/** Highest level of formal education completed or in progress
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'CLASS_10',
|
|
33
|
-
'CLASS_12',
|
|
34
|
-
'DIPLOMA',
|
|
35
|
-
'GRADUATION',
|
|
36
|
-
'POST_GRAD',
|
|
37
|
-
'PHD',
|
|
38
|
-
'POST_DOCTORATE',
|
|
39
|
-
'OTHER',
|
|
40
|
-
])
|
|
41
|
-
.optional(),
|
|
30
|
+
/** Highest level of formal education completed or in progress —
|
|
31
|
+
* canonical 8-bucket enum from `shared-enums`. */
|
|
32
|
+
highestQualification: z.enum(HIGHEST_QUALIFICATION_VALUES).optional(),
|
|
42
33
|
/**
|
|
43
34
|
* Class 10 / Secondary school details.
|
|
44
35
|
* `board` is a string value from boardOptions (cbse / icse / state_board / ...).
|