udp-schema 0.1.20 → 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
|
@@ -121,7 +121,7 @@ export declare const step03ResidenceSchema: z.ZodObject<{
|
|
|
121
121
|
ancestralNativePlace: z.ZodOptional<z.ZodString>;
|
|
122
122
|
yearsAtCurrentAddress: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
123
123
|
sameAsCurrentAddress: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
-
currentAddress: z.ZodObject<{
|
|
124
|
+
currentAddress: z.ZodOptional<z.ZodObject<{
|
|
125
125
|
country: z.ZodOptional<z.ZodString>;
|
|
126
126
|
state: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
127
127
|
_id: z.ZodString;
|
|
@@ -211,8 +211,8 @@ export declare const step03ResidenceSchema: z.ZodObject<{
|
|
|
211
211
|
directions: z.ZodOptional<z.ZodString>;
|
|
212
212
|
latitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
213
213
|
longitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
214
|
-
}, z.core.$strip
|
|
215
|
-
permanentAddress: z.ZodObject<{
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
permanentAddress: z.ZodOptional<z.ZodObject<{
|
|
216
216
|
country: z.ZodOptional<z.ZodString>;
|
|
217
217
|
state: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
218
218
|
_id: z.ZodString;
|
|
@@ -302,7 +302,7 @@ export declare const step03ResidenceSchema: z.ZodObject<{
|
|
|
302
302
|
directions: z.ZodOptional<z.ZodString>;
|
|
303
303
|
latitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
304
304
|
longitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
305
|
-
}, z.core.$strip
|
|
305
|
+
}, z.core.$strip>>;
|
|
306
306
|
addressNotes: z.ZodOptional<z.ZodString>;
|
|
307
307
|
}, z.core.$strip>;
|
|
308
308
|
export type Step03ResidenceInput = z.infer<typeof step03ResidenceSchema>;
|
package/dist/step-03.schema.js
CHANGED
|
@@ -61,8 +61,8 @@ export const step03ResidenceSchema = z.object({
|
|
|
61
61
|
ancestralNativePlace: z.string().trim().optional(),
|
|
62
62
|
yearsAtCurrentAddress: z.coerce.number().min(0).max(120).optional(),
|
|
63
63
|
sameAsCurrentAddress: z.boolean().optional(),
|
|
64
|
-
currentAddress: addressSchema,
|
|
65
|
-
permanentAddress: addressSchema,
|
|
64
|
+
currentAddress: addressSchema.optional(),
|
|
65
|
+
permanentAddress: addressSchema.optional(),
|
|
66
66
|
addressNotes: z.string().trim().optional(),
|
|
67
67
|
});
|
|
68
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,CAAC,CAAC,WAAW,EAAE;IAC3E,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE;IAC1D,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC;KACD,QAAQ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th 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"]}
|