udp-schema 0.1.19 → 0.1.21
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/step-03.schema.d.ts
CHANGED
|
@@ -97,6 +97,12 @@ export declare const addressSchema: z.ZodObject<{
|
|
|
97
97
|
}, z.core.$loose>, z.ZodObject<{
|
|
98
98
|
name: z.ZodString;
|
|
99
99
|
}, z.core.$loose>, z.ZodString]>>;
|
|
100
|
+
policeStation: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
101
|
+
_id: z.ZodString;
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
}, z.core.$loose>, z.ZodString]>>;
|
|
100
106
|
housePlotDetails: z.ZodOptional<z.ZodString>;
|
|
101
107
|
pincode: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
102
108
|
landmark: z.ZodOptional<z.ZodString>;
|
|
@@ -115,7 +121,7 @@ export declare const step03ResidenceSchema: z.ZodObject<{
|
|
|
115
121
|
ancestralNativePlace: z.ZodOptional<z.ZodString>;
|
|
116
122
|
yearsAtCurrentAddress: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
117
123
|
sameAsCurrentAddress: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
-
currentAddress: z.ZodObject<{
|
|
124
|
+
currentAddress: z.ZodOptional<z.ZodObject<{
|
|
119
125
|
country: z.ZodOptional<z.ZodString>;
|
|
120
126
|
state: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
121
127
|
_id: z.ZodString;
|
|
@@ -193,14 +199,20 @@ export declare const step03ResidenceSchema: z.ZodObject<{
|
|
|
193
199
|
}, z.core.$loose>, z.ZodObject<{
|
|
194
200
|
name: z.ZodString;
|
|
195
201
|
}, z.core.$loose>, z.ZodString]>>;
|
|
202
|
+
policeStation: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
203
|
+
_id: z.ZodString;
|
|
204
|
+
name: z.ZodString;
|
|
205
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
206
|
+
name: z.ZodString;
|
|
207
|
+
}, z.core.$loose>, z.ZodString]>>;
|
|
196
208
|
housePlotDetails: z.ZodOptional<z.ZodString>;
|
|
197
209
|
pincode: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
198
210
|
landmark: z.ZodOptional<z.ZodString>;
|
|
199
211
|
directions: z.ZodOptional<z.ZodString>;
|
|
200
212
|
latitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
201
213
|
longitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
202
|
-
}, z.core.$strip
|
|
203
|
-
permanentAddress: z.ZodObject<{
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
permanentAddress: z.ZodOptional<z.ZodObject<{
|
|
204
216
|
country: z.ZodOptional<z.ZodString>;
|
|
205
217
|
state: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
206
218
|
_id: z.ZodString;
|
|
@@ -278,13 +290,19 @@ export declare const step03ResidenceSchema: z.ZodObject<{
|
|
|
278
290
|
}, z.core.$loose>, z.ZodObject<{
|
|
279
291
|
name: z.ZodString;
|
|
280
292
|
}, z.core.$loose>, z.ZodString]>>;
|
|
293
|
+
policeStation: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
294
|
+
_id: z.ZodString;
|
|
295
|
+
name: z.ZodString;
|
|
296
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
297
|
+
name: z.ZodString;
|
|
298
|
+
}, z.core.$loose>, z.ZodString]>>;
|
|
281
299
|
housePlotDetails: z.ZodOptional<z.ZodString>;
|
|
282
300
|
pincode: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
283
301
|
landmark: z.ZodOptional<z.ZodString>;
|
|
284
302
|
directions: z.ZodOptional<z.ZodString>;
|
|
285
303
|
latitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
286
304
|
longitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
287
|
-
}, z.core.$strip
|
|
305
|
+
}, z.core.$strip>>;
|
|
288
306
|
addressNotes: z.ZodOptional<z.ZodString>;
|
|
289
307
|
}, z.core.$strip>;
|
|
290
308
|
export type Step03ResidenceInput = z.infer<typeof step03ResidenceSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-03.schema.d.ts","sourceRoot":"","sources":["../src/step-03.schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;;;iCAMb,CAAC;AAEd,iDAAiD;AACjD,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"step-03.schema.d.ts","sourceRoot":"","sources":["../src/step-03.schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;;;iCAMb,CAAC;AAEd,iDAAiD;AACjD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+BxB,CAAC;AAIH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUhC,CAAC;AAIH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACzE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/step-03.schema.js
CHANGED
|
@@ -38,6 +38,8 @@ export const addressSchema = z.object({
|
|
|
38
38
|
urbanBody: areaRefSchema,
|
|
39
39
|
urbanWard: areaRefSchema,
|
|
40
40
|
locality: areaRefSchema,
|
|
41
|
+
// Common
|
|
42
|
+
policeStation: areaRefSchema,
|
|
41
43
|
// Details
|
|
42
44
|
housePlotDetails: z.string().trim().optional(),
|
|
43
45
|
pincode: z
|
|
@@ -59,8 +61,8 @@ export const step03ResidenceSchema = z.object({
|
|
|
59
61
|
ancestralNativePlace: z.string().trim().optional(),
|
|
60
62
|
yearsAtCurrentAddress: z.coerce.number().min(0).max(120).optional(),
|
|
61
63
|
sameAsCurrentAddress: z.boolean().optional(),
|
|
62
|
-
currentAddress: addressSchema,
|
|
63
|
-
permanentAddress: addressSchema,
|
|
64
|
+
currentAddress: addressSchema.optional(),
|
|
65
|
+
permanentAddress: addressSchema.optional(),
|
|
64
66
|
addressNotes: z.string().trim().optional(),
|
|
65
67
|
});
|
|
66
68
|
//# sourceMappingURL=step-03.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-03.schema.js","sourceRoot":"","sources":["../src/step-03.schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,2DAA2D;AAE3D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,KAAK,CAAC;IACL,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,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AAE;IAC5C,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;IACxC,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC1C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC","sourcesContent":["/**\n * Step 03 — Residence / Address Schema\n *\n * Single source of truth used by both frontend and backend.\n *\n * @module udp-schema/step-03\n */\n\nimport { z } from 'zod';\n\n// ─── Sub-schemas ────────────────────────────────────────\n\n/**\n * Area entity reference — accepts:\n * • `{ _id, name }` — existing area entity selected in frontend\n * • `{ name }` — custom / manually entered\n * • raw string — legacy ObjectId stored in DB\n */\nexport const areaRefSchema = z\n .union([\n z.object({ _id: z.string(), name: z.string().trim().min(1) }).passthrough(),\n z.object({ name: z.string().trim().min(1) }).passthrough(),\n z.string().trim().min(1),\n ])\n .optional();\n\n/** Full address block (current or permanent). */\nexport const addressSchema = z.object({\n country: z.string().trim().optional(),\n state: areaRefSchema,\n areaType: z.enum(['RURAL', 'URBAN']).optional(),\n division: areaRefSchema,\n district: areaRefSchema,\n tehsil: areaRefSchema,\n // Rural\n block: areaRefSchema,\n gramPanchayat: areaRefSchema,\n village: areaRefSchema,\n hamlet: areaRefSchema,\n ruralWard: areaRefSchema,\n // Urban\n urbanBody: areaRefSchema,\n urbanWard: areaRefSchema,\n locality: areaRefSchema,\n // Common\n policeStation: areaRefSchema,\n // Details\n housePlotDetails: z.string().trim().optional(),\n pincode: z\n .string()\n .trim()\n .regex(/^\\d{6}$/, 'Pincode must be 6 digits')\n .optional()\n .or(z.literal('')),\n landmark: z.string().trim().optional(),\n directions: z.string().trim().optional(),\n latitude: z.coerce.number().min(-90).max(90).optional(),\n longitude: z.coerce.number().min(-180).max(180).optional(),\n});\n\n// ─── Main step-03 schema ────────────────────────────────\n\nexport const step03ResidenceSchema = z.object({\n domicileSource: z.enum(['BIRTH_PLACE', 'HOME_NATIVE_PLACE', 'ANCESTRAL_NATIVE_PLACE']).optional(),\n birthPlace: z.string().trim().optional(),\n homeNativePlace: z.string().trim().optional(),\n ancestralNativePlace: z.string().trim().optional(),\n yearsAtCurrentAddress: z.coerce.number().min(0).max(120).optional(),\n sameAsCurrentAddress: z.boolean().optional(),\n currentAddress: addressSchema.optional(),\n permanentAddress: addressSchema.optional(),\n addressNotes: z.string().trim().optional(),\n});\n\n// ─── Inferred types ─────────────────────────────────────\n\nexport type Step03ResidenceInput = z.infer<typeof step03ResidenceSchema>;\nexport type AddressInput = z.infer<typeof addressSchema>;\n"]}
|