dating-schema 0.49.0 → 0.50.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/profile.js CHANGED
@@ -6,31 +6,18 @@
6
6
  *
7
7
  * @module dating-schema/profile
8
8
  */
9
+ import { GENDER_VALUES, OCCUPATION_VALUES, RELIGION_VALUES } from 'udp-schema';
9
10
  import { z } from 'zod';
10
11
  import { photoSchema } from './common.js';
11
12
  // ─── Helper: extract option values from field config ─────────────────────────
12
13
  /** Build a z.enum() from a field config's options array values. */
13
14
  const opts = (values) => z.enum(values);
14
15
  // ─── 01. Hero & Identity ─────────────────────────────────────────────────────
15
- const genderOpts = opts([
16
- 'man',
17
- 'woman',
18
- 'non_binary',
19
- 'trans_man',
20
- 'trans_woman',
21
- 'genderfluid',
22
- 'genderqueer',
23
- 'agender',
24
- 'bigender',
25
- 'pangender',
26
- 'androgynous',
27
- 'intersex',
28
- 'gender_nonconforming',
29
- 'two_spirit',
30
- 'hijra',
31
- 'other',
32
- 'prefer_not_to_say',
33
- ]);
16
+ /** Gender imported from udp-schema/shared-enums to keep the
17
+ * 17-value enum in lockstep with UDP step-01 + future service
18
+ * profiles. NEVER duplicate the values here — `udp-schema`'s
19
+ * `GENDER_VALUES` is the canonical source. */
20
+ const genderOpts = z.enum(GENDER_VALUES);
34
21
  const pronounsOpts = opts([
35
22
  'he_him',
36
23
  'she_her',
@@ -162,30 +149,9 @@ const complexionOpts = opts([
162
149
  'very_dark',
163
150
  'prefer_not_to_say',
164
151
  ]);
165
- const religionOpts = opts([
166
- 'hindu',
167
- 'muslim_sunni',
168
- 'muslim_shia',
169
- 'muslim_sufi',
170
- 'muslim_other',
171
- 'christian_catholic',
172
- 'christian_protestant',
173
- 'christian_other',
174
- 'sikh',
175
- 'jain_digambar',
176
- 'jain_shwetambar',
177
- 'buddhist',
178
- 'parsi_zoroastrian',
179
- 'jewish',
180
- 'bahai',
181
- 'spiritual',
182
- 'atheist',
183
- 'agnostic',
184
- 'no_religion',
185
- 'inter_religion',
186
- 'other',
187
- 'prefer_not_to_say',
188
- ]);
152
+ /** Religion imported from udp-schema/shared-enums. 22 denominated
153
+ * values shared with UDP step-01's familyReligion + personalReligion. */
154
+ const religionOpts = z.enum(RELIGION_VALUES);
189
155
  const religionPracticeLevelOpts = opts([
190
156
  'devout',
191
157
  'weekly',
@@ -306,48 +272,10 @@ const institutionTierOpts = opts([
306
272
  'open_distance',
307
273
  'prefer_not_to_say',
308
274
  ]);
309
- const professionOpts = opts([
310
- 'it_software',
311
- 'engineering',
312
- 'healthcare_doctor',
313
- 'healthcare_nursing',
314
- 'healthcare_pharma',
315
- 'psychology_therapy',
316
- 'education_teaching',
317
- 'science_research',
318
- 'finance_banking',
319
- 'chartered_accountant',
320
- 'business_management',
321
- 'arts_entertainment',
322
- 'media_communication',
323
- 'design_creative',
324
- 'civil_services',
325
- 'government_public',
326
- 'defence_military',
327
- 'police_law_enforcement',
328
- 'legal',
329
- 'skilled_trades',
330
- 'transport_logistics',
331
- 'hospitality_travel',
332
- 'beauty_wellness',
333
- 'agriculture_farming',
334
- 'real_estate',
335
- 'retail_ecommerce',
336
- 'manufacturing',
337
- 'merchant_navy',
338
- 'ngo_social_work',
339
- 'religious_spiritual',
340
- 'freelancer_gig',
341
- 'content_creator',
342
- 'self_employed',
343
- 'student',
344
- 'homemaker',
345
- 'retired',
346
- 'not_working',
347
- 'differently_abled_pension',
348
- 'other',
349
- 'prefer_not_to_say',
350
- ]);
275
+ /** Profession / occupation — imported from udp-schema/shared-enums.
276
+ * 39-value taxonomy shared with UDP step-07's `occupation` +
277
+ * `dreamOccupation`. */
278
+ const professionOpts = z.enum(OCCUPATION_VALUES);
351
279
  const relationshipStatusOpts = opts([
352
280
  'never_married',
353
281
  'dating',
@@ -465,7 +393,7 @@ const rashiOpts = opts([
465
393
  'dont_know',
466
394
  'prefer_not_to_say',
467
395
  ]);
468
- // hometownState uses z.string() — no enum needed (values come from area-entity API)
396
+ // hometownState uses z.string() — no enum needed (values come from area search API)
469
397
  // ─── 04. What I'm Looking For ────────────────────────────────────────────────
470
398
  const relationshipRoleOpts = opts([
471
399
  'mentor',
@@ -1886,7 +1814,7 @@ const areaRefSchema = z.object({
1886
1814
  const currentLocationSchema = z.object({
1887
1815
  displayName: z.string().optional(),
1888
1816
  country: areaRefSchema.optional(),
1889
- // Full area hierarchy — each { _id, name, type } traces back to AreaEntity in survey-db
1817
+ // Full area hierarchy — each { _id, name, type } traces back to Area in location-db
1890
1818
  state: areaRefSchema.optional(),
1891
1819
  district: areaRefSchema.optional(),
1892
1820
  areaType: z.enum(['RURAL', 'URBAN']).optional(),
@@ -2039,7 +1967,9 @@ export const fullProfileSchema = z.object({
2039
1967
  // ── 04. What I'm Looking For ───────────────────────────────────────────────
2040
1968
  whatImLookingFor: z.string().trim().max(300).optional(),
2041
1969
  relationshipRole: z.array(relationshipRoleOpts).max(3).optional(),
2042
- preferredAgeRange: z.object({ min: z.number().min(18).max(70), max: z.number().min(18).max(70) }).optional(),
1970
+ preferredAgeRange: z
1971
+ .object({ min: z.number().min(18).max(70), max: z.number().min(18).max(70) })
1972
+ .optional(),
2043
1973
  dealbreakers: z.array(dealbreakersOpts).max(10).optional(),
2044
1974
  // ── 05. Personality & Temperament ──────────────────────────────────────────
2045
1975
  bigFiveOpenness: z.number().int().min(1).max(10).optional(),
@@ -2306,7 +2236,9 @@ export const createProfileSchema = z.object({
2306
2236
  .array(z.object({ prompt: z.string(), answer: z.string().max(250) }))
2307
2237
  .max(3)
2308
2238
  .optional(),
2309
- preferredAgeRange: z.object({ min: z.number().min(18).max(70), max: z.number().min(18).max(70) }).optional(),
2239
+ preferredAgeRange: z
2240
+ .object({ min: z.number().min(18).max(70), max: z.number().min(18).max(70) })
2241
+ .optional(),
2310
2242
  // Privacy — per-field visibility overrides
2311
2243
  fieldVisibility: z
2312
2244
  .record(z.string(), z.enum(['public', 'on_match', 'trust_gate', 'private']))