@verisure-italy/zipcode-types 1.4.0 → 1.5.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/index.cjs CHANGED
@@ -20,17 +20,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- overbookingAllocationTypeSchema: () => overbookingAllocationTypeSchema,
24
- overbookingAllocationTypes: () => overbookingAllocationTypes
23
+ areaSchema: () => areaSchema,
24
+ enabledSchema: () => enabledSchema
25
25
  });
26
26
  module.exports = __toCommonJS(index_exports);
27
27
 
28
- // src/types.ts
28
+ // src/models.ts
29
+ var import_shared_types = require("@verisure-italy/shared-types");
29
30
  var import_zod = require("zod");
30
- var overbookingAllocationTypes = ["front", "ko", "telesales", "ecommerce"];
31
- var overbookingAllocationTypeSchema = import_zod.z.enum(overbookingAllocationTypes);
31
+ var enabledSchema = import_zod.z.object({
32
+ zipCode: import_shared_types.zipCodeSchema
33
+ });
34
+ var areaSchema = import_zod.z.object({
35
+ id: import_zod.z.uuid(),
36
+ city: import_zod.z.string().min(2, "city.required"),
37
+ province: import_zod.z.string().min(2, "province.required").max(3, "province.bad_format"),
38
+ region: import_zod.z.string().min(2, "region.required"),
39
+ town: import_zod.z.string().min(2, "town.required"),
40
+ zipCode: import_shared_types.zipCodeSchema
41
+ });
32
42
  // Annotate the CommonJS export names for ESM import in node:
33
43
  0 && (module.exports = {
34
- overbookingAllocationTypeSchema,
35
- overbookingAllocationTypes
44
+ areaSchema,
45
+ enabledSchema
36
46
  });
package/dist/index.d.cts CHANGED
@@ -1,12 +1,17 @@
1
1
  import { z } from 'zod';
2
2
 
3
- declare const overbookingAllocationTypes: readonly ["front", "ko", "telesales", "ecommerce"];
4
- declare const overbookingAllocationTypeSchema: z.ZodEnum<{
5
- front: "front";
6
- ko: "ko";
7
- telesales: "telesales";
8
- ecommerce: "ecommerce";
9
- }>;
10
- type OverbookingAllocationType = z.infer<typeof overbookingAllocationTypeSchema>;
3
+ declare const enabledSchema: z.ZodObject<{
4
+ zipCode: z.ZodString;
5
+ }, z.core.$strip>;
6
+ type Enabled = z.infer<typeof enabledSchema>;
7
+ declare const areaSchema: z.ZodObject<{
8
+ id: z.ZodUUID;
9
+ city: z.ZodString;
10
+ province: z.ZodString;
11
+ region: z.ZodString;
12
+ town: z.ZodString;
13
+ zipCode: z.ZodString;
14
+ }, z.core.$strip>;
15
+ type Area = z.infer<typeof areaSchema>;
11
16
 
12
- export { type OverbookingAllocationType, overbookingAllocationTypeSchema, overbookingAllocationTypes };
17
+ export { type Area, type Enabled, areaSchema, enabledSchema };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,17 @@
1
1
  import { z } from 'zod';
2
2
 
3
- declare const overbookingAllocationTypes: readonly ["front", "ko", "telesales", "ecommerce"];
4
- declare const overbookingAllocationTypeSchema: z.ZodEnum<{
5
- front: "front";
6
- ko: "ko";
7
- telesales: "telesales";
8
- ecommerce: "ecommerce";
9
- }>;
10
- type OverbookingAllocationType = z.infer<typeof overbookingAllocationTypeSchema>;
3
+ declare const enabledSchema: z.ZodObject<{
4
+ zipCode: z.ZodString;
5
+ }, z.core.$strip>;
6
+ type Enabled = z.infer<typeof enabledSchema>;
7
+ declare const areaSchema: z.ZodObject<{
8
+ id: z.ZodUUID;
9
+ city: z.ZodString;
10
+ province: z.ZodString;
11
+ region: z.ZodString;
12
+ town: z.ZodString;
13
+ zipCode: z.ZodString;
14
+ }, z.core.$strip>;
15
+ type Area = z.infer<typeof areaSchema>;
11
16
 
12
- export { type OverbookingAllocationType, overbookingAllocationTypeSchema, overbookingAllocationTypes };
17
+ export { type Area, type Enabled, areaSchema, enabledSchema };
package/dist/index.js CHANGED
@@ -1,8 +1,18 @@
1
- // src/types.ts
1
+ // src/models.ts
2
+ import { zipCodeSchema } from "@verisure-italy/shared-types";
2
3
  import { z } from "zod";
3
- var overbookingAllocationTypes = ["front", "ko", "telesales", "ecommerce"];
4
- var overbookingAllocationTypeSchema = z.enum(overbookingAllocationTypes);
4
+ var enabledSchema = z.object({
5
+ zipCode: zipCodeSchema
6
+ });
7
+ var areaSchema = z.object({
8
+ id: z.uuid(),
9
+ city: z.string().min(2, "city.required"),
10
+ province: z.string().min(2, "province.required").max(3, "province.bad_format"),
11
+ region: z.string().min(2, "region.required"),
12
+ town: z.string().min(2, "town.required"),
13
+ zipCode: zipCodeSchema
14
+ });
5
15
  export {
6
- overbookingAllocationTypeSchema,
7
- overbookingAllocationTypes
16
+ areaSchema,
17
+ enabledSchema
8
18
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@verisure-italy/zipcode-types",
3
3
  "description": "Types for ZipCode service",
4
- "version": "1.4.0",
4
+ "version": "1.5.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "zod": "4.1.12",
22
- "@verisure-italy/shared-types": "1.4.0"
22
+ "@verisure-italy/shared-types": "1.5.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "24.6.0",