@floristcloud/api-lib 1.0.50 → 1.0.52
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/product-configuration/create-product-configuration.command.js +3 -3
- package/build/commands/product-configuration/find-product-configuration-by-attributes.query.js +1 -1
- package/build/commands/product-configuration/get-product-configuration.query.js +2 -2
- package/build/commands/product-configuration/update-product-configuration.command.js +3 -3
- package/build/commands/user/get-user-list-s2s.query.js +13 -0
- package/build/commands/user/index.js +1 -0
- package/build/commands/write-off/update-write-off-status.command.js +12 -2
- package/build/enum/notification-type.enum.js +1 -0
- package/build/schemas/write-off/write-off.schema.js +1 -0
- package/commands/product-configuration/create-product-configuration.command.ts +1 -1
- package/commands/product-configuration/find-product-configuration-by-attributes.query.ts +1 -1
- package/commands/product-configuration/get-product-configuration.query.ts +1 -1
- package/commands/product-configuration/update-product-configuration.command.ts +1 -1
- package/commands/user/get-user-list-s2s.query.ts +14 -0
- package/commands/user/index.ts +1 -0
- package/commands/write-off/update-write-off-status.command.ts +17 -4
- package/enum/notification-type.enum.ts +1 -0
- package/package.json +1 -1
- package/schemas/write-off/write-off.schema.ts +1 -0
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateProductConfigurationContractCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
6
|
const CreateProductConfigurationResponseSchema = zod_1.z.object({
|
|
7
7
|
message: zod_1.z.string().optional(),
|
|
8
|
-
data:
|
|
8
|
+
data: schemas_1.ProductConfigurationSchema,
|
|
9
9
|
});
|
|
10
10
|
var CreateProductConfigurationContractCommand;
|
|
11
11
|
(function (CreateProductConfigurationContractCommand) {
|
|
12
|
-
CreateProductConfigurationContractCommand.RequestSchema =
|
|
12
|
+
CreateProductConfigurationContractCommand.RequestSchema = schemas_1.CreateProductConfigurationRequestSchema;
|
|
13
13
|
CreateProductConfigurationContractCommand.ResponseSchema = CreateProductConfigurationResponseSchema;
|
|
14
14
|
})(CreateProductConfigurationContractCommand || (exports.CreateProductConfigurationContractCommand = CreateProductConfigurationContractCommand = {}));
|
package/build/commands/product-configuration/find-product-configuration-by-attributes.query.js
CHANGED
|
@@ -10,7 +10,7 @@ const FindProductConfigurationByAttributesRequestSchema = zod_1.z.object({
|
|
|
10
10
|
size: zod_1.z.coerce.number().optional().nullable(),
|
|
11
11
|
});
|
|
12
12
|
const FindProductConfigurationByAttributesDataSchema = zod_1.z.object({
|
|
13
|
-
|
|
13
|
+
mainConfigurations: schemas_1.ProductConfigurationSchema.array(),
|
|
14
14
|
optionalConfigurations: schemas_1.ProductConfigurationSchema.array(),
|
|
15
15
|
});
|
|
16
16
|
const FindProductConfigurationByAttributesResponseSchema = zod_1.z.object({
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetProductConfigurationContractQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
6
|
const GetProductConfigurationRequestSchema = zod_1.z.object({});
|
|
7
7
|
const GetProductConfigurationResponseSchema = zod_1.z.object({
|
|
8
8
|
message: zod_1.z.string().optional(),
|
|
9
|
-
data:
|
|
9
|
+
data: schemas_1.ProductConfigurationSchema,
|
|
10
10
|
});
|
|
11
11
|
var GetProductConfigurationContractQuery;
|
|
12
12
|
(function (GetProductConfigurationContractQuery) {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateProductConfigurationContractCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
6
|
const UpdateProductConfigurationResponseSchema = zod_1.z.object({
|
|
7
7
|
message: zod_1.z.string().optional(),
|
|
8
|
-
data:
|
|
8
|
+
data: schemas_1.ProductConfigurationSchema,
|
|
9
9
|
});
|
|
10
10
|
var UpdateProductConfigurationContractCommand;
|
|
11
11
|
(function (UpdateProductConfigurationContractCommand) {
|
|
12
|
-
UpdateProductConfigurationContractCommand.RequestSchema =
|
|
12
|
+
UpdateProductConfigurationContractCommand.RequestSchema = schemas_1.UpdateProductConfigurationRequestSchema;
|
|
13
13
|
UpdateProductConfigurationContractCommand.ResponseSchema = UpdateProductConfigurationResponseSchema;
|
|
14
14
|
})(UpdateProductConfigurationContractCommand || (exports.UpdateProductConfigurationContractCommand = UpdateProductConfigurationContractCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetUserListS2SContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const get_user_list_query_1 = require("./get-user-list.query");
|
|
6
|
+
const GetUserListS2SRequestSchema = get_user_list_query_1.GetUserListContractQuery.RequestSchema.extend({
|
|
7
|
+
companyUUID: zod_1.z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
var GetUserListS2SContractQuery;
|
|
10
|
+
(function (GetUserListS2SContractQuery) {
|
|
11
|
+
GetUserListS2SContractQuery.RequestSchema = GetUserListS2SRequestSchema;
|
|
12
|
+
GetUserListS2SContractQuery.ResponseSchema = get_user_list_query_1.GetUserListContractQuery.ResponseSchema;
|
|
13
|
+
})(GetUserListS2SContractQuery || (exports.GetUserListS2SContractQuery = GetUserListS2SContractQuery = {}));
|
|
@@ -21,6 +21,7 @@ __exportStar(require("./updateRole.command"), exports);
|
|
|
21
21
|
__exportStar(require("./getUser.command"), exports);
|
|
22
22
|
__exportStar(require("./createUserForCompany.command"), exports);
|
|
23
23
|
__exportStar(require("./get-user-list.query"), exports);
|
|
24
|
+
__exportStar(require("./get-user-list-s2s.query"), exports);
|
|
24
25
|
__exportStar(require("./update-password-by-user.command"), exports);
|
|
25
26
|
__exportStar(require("./update-user.command"), exports);
|
|
26
27
|
__exportStar(require("./generate-and-send-password-by-admin.command"), exports);
|
|
@@ -4,9 +4,19 @@ exports.UpdateWriteOffStatusContractCommand = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
6
|
const enum_1 = require("../../enum");
|
|
7
|
-
const UpdateWriteOffStatusRequestSchema = zod_1.z
|
|
7
|
+
const UpdateWriteOffStatusRequestSchema = zod_1.z
|
|
8
|
+
.object({
|
|
8
9
|
status: zod_1.z.union([zod_1.z.literal(enum_1.WriteOffStatusEnum.APPROVED), zod_1.z.literal(enum_1.WriteOffStatusEnum.REJECTED)]),
|
|
9
|
-
|
|
10
|
+
rejectionReason: zod_1.z.string().optional(),
|
|
11
|
+
})
|
|
12
|
+
.refine(data => {
|
|
13
|
+
if (data.status === enum_1.WriteOffStatusEnum.REJECTED) {
|
|
14
|
+
return data.rejectionReason && data.rejectionReason.trim().length > 0;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}, {
|
|
18
|
+
message: 'rejectionReason is required when status is REJECTED',
|
|
19
|
+
path: ['rejectionReason'],
|
|
10
20
|
});
|
|
11
21
|
const UpdateWriteOffStatusResponseSchema = zod_1.z.object({
|
|
12
22
|
message: zod_1.z.string().optional(),
|
|
@@ -7,4 +7,5 @@ var NotificationTypeEnum;
|
|
|
7
7
|
NotificationTypeEnum["ORDER_STATUS"] = "ORDER_STATUS";
|
|
8
8
|
NotificationTypeEnum["ORDER_INVOICE"] = "ORDER_INVOICE";
|
|
9
9
|
NotificationTypeEnum["CART_EXPIRATION"] = "CART_EXPIRATION";
|
|
10
|
+
NotificationTypeEnum["WRITE_OFF_REJECTED"] = "WRITE_OFF_REJECTED";
|
|
10
11
|
})(NotificationTypeEnum || (exports.NotificationTypeEnum = NotificationTypeEnum = {}));
|
|
@@ -13,6 +13,7 @@ exports.WriteOffSchema = zod_1.z.object({
|
|
|
13
13
|
quantity: zod_1.z.number(),
|
|
14
14
|
reason: zod_1.z.string(),
|
|
15
15
|
comment: zod_1.z.string().nullable(),
|
|
16
|
+
rejectionReason: zod_1.z.string().nullable(),
|
|
16
17
|
productUUID: zod_1.z.string(),
|
|
17
18
|
categoryUUID: zod_1.z.string().nullable(),
|
|
18
19
|
consignmentUUID: zod_1.z.string(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CreateProductConfigurationRequestSchema, ProductConfigurationSchema } from '
|
|
2
|
+
import { CreateProductConfigurationRequestSchema, ProductConfigurationSchema } from '../../schemas';
|
|
3
3
|
|
|
4
4
|
const CreateProductConfigurationResponseSchema = z.object({
|
|
5
5
|
message: z.string().optional(),
|
|
@@ -9,7 +9,7 @@ const FindProductConfigurationByAttributesRequestSchema = z.object({
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
const FindProductConfigurationByAttributesDataSchema = z.object({
|
|
12
|
-
|
|
12
|
+
mainConfigurations: ProductConfigurationSchema.array(),
|
|
13
13
|
optionalConfigurations: ProductConfigurationSchema.array(),
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ProductConfigurationSchema, UpdateProductConfigurationRequestSchema } from '
|
|
2
|
+
import { ProductConfigurationSchema, UpdateProductConfigurationRequestSchema } from '../../schemas';
|
|
3
3
|
|
|
4
4
|
const UpdateProductConfigurationResponseSchema = z.object({
|
|
5
5
|
message: z.string().optional(),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GetUserListContractQuery } from './get-user-list.query';
|
|
3
|
+
|
|
4
|
+
const GetUserListS2SRequestSchema = GetUserListContractQuery.RequestSchema.extend({
|
|
5
|
+
companyUUID: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export namespace GetUserListS2SContractQuery {
|
|
9
|
+
export const RequestSchema = GetUserListS2SRequestSchema;
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = GetUserListContractQuery.ResponseSchema;
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
package/commands/user/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './updateRole.command';
|
|
|
5
5
|
export * from './getUser.command';
|
|
6
6
|
export * from './createUserForCompany.command';
|
|
7
7
|
export * from './get-user-list.query';
|
|
8
|
+
export * from './get-user-list-s2s.query';
|
|
8
9
|
export * from './update-password-by-user.command';
|
|
9
10
|
export * from './update-user.command';
|
|
10
11
|
export * from './generate-and-send-password-by-admin.command';
|
|
@@ -2,10 +2,23 @@ import { z } from 'zod';
|
|
|
2
2
|
import { WriteOffSchema } from '../../schemas';
|
|
3
3
|
import { WriteOffStatusEnum } from '../../enum';
|
|
4
4
|
|
|
5
|
-
const UpdateWriteOffStatusRequestSchema = z
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const UpdateWriteOffStatusRequestSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
status: z.union([z.literal(WriteOffStatusEnum.APPROVED), z.literal(WriteOffStatusEnum.REJECTED)]),
|
|
8
|
+
rejectionReason: z.string().optional(),
|
|
9
|
+
})
|
|
10
|
+
.refine(
|
|
11
|
+
data => {
|
|
12
|
+
if (data.status === WriteOffStatusEnum.REJECTED) {
|
|
13
|
+
return data.rejectionReason && data.rejectionReason.trim().length > 0;
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
message: 'rejectionReason is required when status is REJECTED',
|
|
19
|
+
path: ['rejectionReason'],
|
|
20
|
+
},
|
|
21
|
+
);
|
|
9
22
|
|
|
10
23
|
const UpdateWriteOffStatusResponseSchema = z.object({
|
|
11
24
|
message: z.string().optional(),
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ export const WriteOffSchema = z.object({
|
|
|
11
11
|
quantity: z.number(),
|
|
12
12
|
reason: z.string(),
|
|
13
13
|
comment: z.string().nullable(),
|
|
14
|
+
rejectionReason: z.string().nullable(),
|
|
14
15
|
productUUID: z.string(),
|
|
15
16
|
categoryUUID: z.string().nullable(),
|
|
16
17
|
consignmentUUID: z.string(),
|