@floristcloud/api-lib 1.0.49 → 1.0.50
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/build/helpers/index.js +0 -1
- package/build/schemas/product-configuration/product-configuration.schema.js +8 -9
- package/helpers/index.ts +0 -1
- package/package.json +1 -1
- package/schemas/product-configuration/product-configuration.schema.ts +8 -9
- package/build/helpers/zod.helper.js +0 -8
- package/helpers/zod.helper.ts +0 -6
package/build/helpers/index.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UpdateProductConfigurationRequestSchema = exports.CreateProductConfigurationRequestSchema = exports.ProductConfigurationSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enum_1 = require("../../enum");
|
|
6
|
-
const helpers_1 = require("../../helpers");
|
|
7
6
|
exports.ProductConfigurationSchema = zod_1.z.object({
|
|
8
7
|
uuid: zod_1.z.uuid(),
|
|
9
8
|
categoryUUID: zod_1.z.uuid(),
|
|
@@ -16,20 +15,20 @@ exports.ProductConfigurationSchema = zod_1.z.object({
|
|
|
16
15
|
});
|
|
17
16
|
exports.CreateProductConfigurationRequestSchema = zod_1.z.object({
|
|
18
17
|
categoryUUID: zod_1.z.uuid(),
|
|
19
|
-
country:
|
|
20
|
-
grower:
|
|
21
|
-
size: zod_1.z.coerce.number().nullable(),
|
|
22
|
-
isOptional: zod_1.z.coerce.boolean(),
|
|
18
|
+
country: zod_1.z.string().nullable().optional(),
|
|
19
|
+
grower: zod_1.z.string().nullable().optional(),
|
|
20
|
+
size: zod_1.z.coerce.number().nullable().optional(),
|
|
21
|
+
isOptional: zod_1.z.coerce.boolean().optional().default(false),
|
|
23
22
|
multiplicity: zod_1.z.coerce.number(),
|
|
24
|
-
multiplicityDescription:
|
|
23
|
+
multiplicityDescription: zod_1.z.string().nullable().optional(),
|
|
25
24
|
});
|
|
26
25
|
exports.UpdateProductConfigurationRequestSchema = zod_1.z
|
|
27
26
|
.object({
|
|
28
|
-
country:
|
|
29
|
-
grower:
|
|
27
|
+
country: zod_1.z.string().nullable(),
|
|
28
|
+
grower: zod_1.z.string().nullable(),
|
|
30
29
|
size: zod_1.z.coerce.number().nullable(),
|
|
31
30
|
isOptional: zod_1.z.coerce.boolean(),
|
|
32
31
|
multiplicity: zod_1.z.coerce.number(),
|
|
33
|
-
multiplicityDescription:
|
|
32
|
+
multiplicityDescription: zod_1.z.string().nullable(),
|
|
34
33
|
})
|
|
35
34
|
.partial();
|
package/helpers/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { CountryCodeEnum } from '../../enum';
|
|
3
|
-
import { emptyStringToNull } from '../../helpers';
|
|
4
3
|
|
|
5
4
|
export const ProductConfigurationSchema = z.object({
|
|
6
5
|
uuid: z.uuid(),
|
|
@@ -15,21 +14,21 @@ export const ProductConfigurationSchema = z.object({
|
|
|
15
14
|
|
|
16
15
|
export const CreateProductConfigurationRequestSchema = z.object({
|
|
17
16
|
categoryUUID: z.uuid(),
|
|
18
|
-
country:
|
|
19
|
-
grower:
|
|
20
|
-
size: z.coerce.number().nullable(),
|
|
21
|
-
isOptional: z.coerce.boolean(),
|
|
17
|
+
country: z.string().nullable().optional(),
|
|
18
|
+
grower: z.string().nullable().optional(),
|
|
19
|
+
size: z.coerce.number().nullable().optional(),
|
|
20
|
+
isOptional: z.coerce.boolean().optional().default(false),
|
|
22
21
|
multiplicity: z.coerce.number(),
|
|
23
|
-
multiplicityDescription:
|
|
22
|
+
multiplicityDescription: z.string().nullable().optional(),
|
|
24
23
|
});
|
|
25
24
|
|
|
26
25
|
export const UpdateProductConfigurationRequestSchema = z
|
|
27
26
|
.object({
|
|
28
|
-
country:
|
|
29
|
-
grower:
|
|
27
|
+
country: z.string().nullable(),
|
|
28
|
+
grower: z.string().nullable(),
|
|
30
29
|
size: z.coerce.number().nullable(),
|
|
31
30
|
isOptional: z.coerce.boolean(),
|
|
32
31
|
multiplicity: z.coerce.number(),
|
|
33
|
-
multiplicityDescription:
|
|
32
|
+
multiplicityDescription: z.string().nullable(),
|
|
34
33
|
})
|
|
35
34
|
.partial();
|