@floristcloud/api-lib 1.0.17 → 1.0.19
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/commands/report/get-report-group-by-client.query.js +1 -1
- package/build/commands/report/get-report-group-by-position.query.js +3 -3
- package/build/schemas/discount-rules/discount-rules.schema.js +5 -5
- package/commands/report/get-report-group-by-client.query.ts +2 -1
- package/commands/report/get-report-group-by-position.query.ts +5 -3
- package/package.json +2 -2
- package/schemas/discount-rules/discount-rules.schema.ts +5 -5
|
@@ -21,7 +21,7 @@ const GetReportGroupByClientRequestSchema = zod_1.z
|
|
|
21
21
|
const GetReportGroupByClientResponseSchema = zod_1.z.object({
|
|
22
22
|
message: zod_1.z.string().optional(),
|
|
23
23
|
data: zod_1.z.object({
|
|
24
|
-
groupByClient: zod_1.z.record(zod_1.z.object({
|
|
24
|
+
groupByClient: zod_1.z.record(zod_1.z.string(), zod_1.z.object({
|
|
25
25
|
uuid: zod_1.z.string(),
|
|
26
26
|
clientName: zod_1.z.string(),
|
|
27
27
|
totalOrders: zod_1.z.number(),
|
|
@@ -6,7 +6,7 @@ const enum_1 = require("../../enum");
|
|
|
6
6
|
const date_helper_1 = require("../../helpers/date.helper");
|
|
7
7
|
const GetReportGroupByPositionRequestSchema = zod_1.z
|
|
8
8
|
.object({
|
|
9
|
-
type: zod_1.z.
|
|
9
|
+
type: zod_1.z.enum(enum_1.PositionReportTypeEnum).default(enum_1.PositionReportTypeEnum.PRODUCT),
|
|
10
10
|
categoryUUID: zod_1.z.string().optional(),
|
|
11
11
|
startDate: zod_1.z.coerce.date().transform(val => (val ? (0, date_helper_1.setStartDay)(val) : val)),
|
|
12
12
|
endDate: zod_1.z.coerce.date().transform(val => (val ? (0, date_helper_1.setEndDay)(val) : val)),
|
|
@@ -25,7 +25,7 @@ const GetReportGroupByPositionResponseSchema = zod_1.z.object({
|
|
|
25
25
|
message: zod_1.z.string().optional(),
|
|
26
26
|
data: zod_1.z.object({
|
|
27
27
|
categories: zod_1.z
|
|
28
|
-
.record(zod_1.z.object({
|
|
28
|
+
.record(zod_1.z.string(), zod_1.z.object({
|
|
29
29
|
categoryInfo: zod_1.z.object({
|
|
30
30
|
uuid: zod_1.z.string(),
|
|
31
31
|
name: zod_1.z.string(),
|
|
@@ -44,7 +44,7 @@ const GetReportGroupByPositionResponseSchema = zod_1.z.object({
|
|
|
44
44
|
}))
|
|
45
45
|
.optional(),
|
|
46
46
|
products: zod_1.z
|
|
47
|
-
.record(zod_1.z.object({
|
|
47
|
+
.record(zod_1.z.string(), zod_1.z.object({
|
|
48
48
|
productKey: zod_1.z.string(),
|
|
49
49
|
totalOrders: zod_1.z.number(),
|
|
50
50
|
soldUnits: zod_1.z.number(),
|
|
@@ -26,7 +26,7 @@ const DiscountRulesQuantityBasedDataSchema = zod_1.z
|
|
|
26
26
|
multipleQuantity: zod_1.z.number(),
|
|
27
27
|
})
|
|
28
28
|
.and(exports.discountRulesModeSchema);
|
|
29
|
-
const DiscountRulesItemDiscountDataSchema =
|
|
29
|
+
const DiscountRulesItemDiscountDataSchema = exports.discountRulesModeSchema;
|
|
30
30
|
const DiscountRulesDiscountProhibitedDataSchema = zod_1.z.object({}).default({});
|
|
31
31
|
exports.DiscountRulesTypeSchema = zod_1.z.discriminatedUnion('type', [
|
|
32
32
|
zod_1.z.object({
|
|
@@ -53,10 +53,10 @@ exports.DiscountRulesTypeSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
53
53
|
exports.DiscountRulesBaseSchema = zod_1.z.object({
|
|
54
54
|
uuid: zod_1.z.string(),
|
|
55
55
|
companyUUID: zod_1.z.string(),
|
|
56
|
-
type: zod_1.z.
|
|
57
|
-
defaultApplyProduct: zod_1.z.
|
|
58
|
-
defaultApplyClient: zod_1.z.
|
|
59
|
-
status: zod_1.z.
|
|
56
|
+
type: zod_1.z.enum(enum_1.DiscountRulesTypeEnum),
|
|
57
|
+
defaultApplyProduct: zod_1.z.enum(enum_1.DiscountRulesApplyTypeEnum),
|
|
58
|
+
defaultApplyClient: zod_1.z.enum(enum_1.DiscountRulesApplyTypeEnum),
|
|
59
|
+
status: zod_1.z.enum(enum_1.DiscountRulesStatusEnum),
|
|
60
60
|
createdAt: zod_1.z.coerce.date(),
|
|
61
61
|
updatedAt: zod_1.z.coerce.date(),
|
|
62
62
|
});
|
|
@@ -24,6 +24,7 @@ const GetReportGroupByClientResponseSchema = z.object({
|
|
|
24
24
|
message: z.string().optional(),
|
|
25
25
|
data: z.object({
|
|
26
26
|
groupByClient: z.record(
|
|
27
|
+
z.string(),
|
|
27
28
|
z.object({
|
|
28
29
|
uuid: z.string(),
|
|
29
30
|
clientName: z.string(),
|
|
@@ -39,7 +40,7 @@ const GetReportGroupByClientResponseSchema = z.object({
|
|
|
39
40
|
middlePrice: z.number(),
|
|
40
41
|
grossProfit: z.number(),
|
|
41
42
|
marginality: z.number(),
|
|
42
|
-
})
|
|
43
|
+
})
|
|
43
44
|
),
|
|
44
45
|
}),
|
|
45
46
|
});
|
|
@@ -4,7 +4,7 @@ import { dateRangeCheck, setEndDay, setStartDay } from '../../helpers/date.helpe
|
|
|
4
4
|
|
|
5
5
|
const GetReportGroupByPositionRequestSchema = z
|
|
6
6
|
.object({
|
|
7
|
-
type: z.
|
|
7
|
+
type: z.enum(PositionReportTypeEnum).default(PositionReportTypeEnum.PRODUCT),
|
|
8
8
|
categoryUUID: z.string().optional(),
|
|
9
9
|
startDate: z.coerce.date().transform(val => (val ? setStartDay(val) : val)),
|
|
10
10
|
endDate: z.coerce.date().transform(val => (val ? setEndDay(val) : val)),
|
|
@@ -28,6 +28,7 @@ const GetReportGroupByPositionResponseSchema = z.object({
|
|
|
28
28
|
data: z.object({
|
|
29
29
|
categories: z
|
|
30
30
|
.record(
|
|
31
|
+
z.string(),
|
|
31
32
|
z.object({
|
|
32
33
|
categoryInfo: z.object({
|
|
33
34
|
uuid: z.string(),
|
|
@@ -44,11 +45,12 @@ const GetReportGroupByPositionResponseSchema = z.object({
|
|
|
44
45
|
middlePrice: z.number(),
|
|
45
46
|
grossProfit: z.number(),
|
|
46
47
|
marginality: z.number(),
|
|
47
|
-
})
|
|
48
|
+
})
|
|
48
49
|
)
|
|
49
50
|
.optional(),
|
|
50
51
|
products: z
|
|
51
52
|
.record(
|
|
53
|
+
z.string(),
|
|
52
54
|
z.object({
|
|
53
55
|
productKey: z.string(),
|
|
54
56
|
totalOrders: z.number(),
|
|
@@ -62,7 +64,7 @@ const GetReportGroupByPositionResponseSchema = z.object({
|
|
|
62
64
|
middlePrice: z.number(),
|
|
63
65
|
grossProfit: z.number(),
|
|
64
66
|
marginality: z.number(),
|
|
65
|
-
})
|
|
67
|
+
})
|
|
66
68
|
)
|
|
67
69
|
.optional(),
|
|
68
70
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floristcloud/api-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"zod": "^
|
|
15
|
+
"zod": "^4.1.13"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -28,7 +28,7 @@ const DiscountRulesQuantityBasedDataSchema = z
|
|
|
28
28
|
})
|
|
29
29
|
.and(discountRulesModeSchema);
|
|
30
30
|
|
|
31
|
-
const DiscountRulesItemDiscountDataSchema =
|
|
31
|
+
const DiscountRulesItemDiscountDataSchema = discountRulesModeSchema;
|
|
32
32
|
|
|
33
33
|
const DiscountRulesDiscountProhibitedDataSchema = z.object({}).default({});
|
|
34
34
|
|
|
@@ -58,10 +58,10 @@ export const DiscountRulesTypeSchema = z.discriminatedUnion('type', [
|
|
|
58
58
|
export const DiscountRulesBaseSchema = z.object({
|
|
59
59
|
uuid: z.string(),
|
|
60
60
|
companyUUID: z.string(),
|
|
61
|
-
type: z.
|
|
62
|
-
defaultApplyProduct: z.
|
|
63
|
-
defaultApplyClient: z.
|
|
64
|
-
status: z.
|
|
61
|
+
type: z.enum(DiscountRulesTypeEnum),
|
|
62
|
+
defaultApplyProduct: z.enum(DiscountRulesApplyTypeEnum),
|
|
63
|
+
defaultApplyClient: z.enum(DiscountRulesApplyTypeEnum),
|
|
64
|
+
status: z.enum(DiscountRulesStatusEnum),
|
|
65
65
|
createdAt: z.coerce.date(),
|
|
66
66
|
updatedAt: z.coerce.date(),
|
|
67
67
|
});
|