@floristcloud/api-lib 1.2.40 → 1.2.42
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/notification/get-notifications-status.query.js +29 -0
- package/build/commands/notification/index.js +1 -0
- package/build/commands/order/group/send-group-order-invoice.command.js +16 -3
- package/build/commands/order/index.js +0 -1
- package/commands/notification/get-notifications-status.query.ts +35 -0
- package/commands/notification/index.ts +1 -0
- package/commands/order/group/send-group-order-invoice.command.ts +23 -6
- package/commands/order/index.ts +0 -1
- package/package.json +1 -1
- package/build/commands/order/send-order-invoice.command.js +0 -26
- package/commands/order/send-order-invoice.command.ts +0 -28
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetNotificationsStatusContractQuery = exports.GET_NOTIFICATIONS_STATUS_LIMIT = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
exports.GET_NOTIFICATIONS_STATUS_LIMIT = 100;
|
|
7
|
+
// uuids are passed as CSV in the query string: `?uuids=uuid1,uuid2,...` — for UI polling.
|
|
8
|
+
const GetNotificationsStatusRequestSchema = zod_1.z.object({
|
|
9
|
+
uuids: zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.transform(value => value.split(',').map(item => item.trim()).filter(Boolean))
|
|
12
|
+
.pipe(zod_1.z.array(zod_1.z.string().uuid()).min(1).max(exports.GET_NOTIFICATIONS_STATUS_LIMIT)),
|
|
13
|
+
});
|
|
14
|
+
const NotificationStatusItemSchema = zod_1.z.object({
|
|
15
|
+
uuid: zod_1.z.string().uuid(),
|
|
16
|
+
status: zod_1.z.nativeEnum(enum_1.NotificationStatusEnum),
|
|
17
|
+
channel: zod_1.z.nativeEnum(enum_1.NotificationChannelEnum).nullable(),
|
|
18
|
+
errorMessage: zod_1.z.string().nullable(),
|
|
19
|
+
attempts: zod_1.z.number().int().nonnegative(),
|
|
20
|
+
});
|
|
21
|
+
const GetNotificationsStatusResponseSchema = zod_1.z.object({
|
|
22
|
+
data: zod_1.z.array(NotificationStatusItemSchema),
|
|
23
|
+
});
|
|
24
|
+
var GetNotificationsStatusContractQuery;
|
|
25
|
+
(function (GetNotificationsStatusContractQuery) {
|
|
26
|
+
GetNotificationsStatusContractQuery.RequestSchema = GetNotificationsStatusRequestSchema;
|
|
27
|
+
GetNotificationsStatusContractQuery.ResponseSchema = GetNotificationsStatusResponseSchema;
|
|
28
|
+
GetNotificationsStatusContractQuery.ItemSchema = NotificationStatusItemSchema;
|
|
29
|
+
})(GetNotificationsStatusContractQuery || (exports.GetNotificationsStatusContractQuery = GetNotificationsStatusContractQuery = {}));
|
|
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./send-staff-notification-s2s.command"), exports);
|
|
18
|
+
__exportStar(require("./get-notifications-status.query"), exports);
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SendGroupOrderInvoiceContractCommand = void 0;
|
|
3
|
+
exports.SendGroupOrderInvoiceContractCommand = exports.SEND_GROUP_ORDER_INVOICE_LIMIT = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enum_1 = require("../../../enum");
|
|
6
|
+
exports.SEND_GROUP_ORDER_INVOICE_LIMIT = 100;
|
|
6
7
|
const SendGroupOrderInvoiceRequestSchema = zod_1.z.object({
|
|
7
|
-
orders: zod_1.z
|
|
8
|
+
orders: zod_1.z
|
|
9
|
+
.array(zod_1.z.object({
|
|
8
10
|
uuid: zod_1.z.string().uuid(),
|
|
9
11
|
channel: zod_1.z.nativeEnum(enum_1.NotificationChannelEnum).optional(),
|
|
10
|
-
}))
|
|
12
|
+
}))
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(exports.SEND_GROUP_ORDER_INVOICE_LIMIT),
|
|
15
|
+
});
|
|
16
|
+
const SendGroupOrderInvoiceResultItemSchema = zod_1.z.object({
|
|
17
|
+
orderUUID: zod_1.z.string().uuid(),
|
|
18
|
+
isSuccess: zod_1.z.boolean(),
|
|
19
|
+
notificationUUID: zod_1.z.string().uuid().optional(),
|
|
20
|
+
errorCode: zod_1.z.string().optional(),
|
|
21
|
+
errorMessage: zod_1.z.string().optional(),
|
|
11
22
|
});
|
|
12
23
|
const SendGroupOrderInvoiceResponseSchema = zod_1.z.object({
|
|
13
24
|
processed: zod_1.z.number(),
|
|
14
25
|
success: zod_1.z.number(),
|
|
15
26
|
failed: zod_1.z.number(),
|
|
27
|
+
results: zod_1.z.array(SendGroupOrderInvoiceResultItemSchema),
|
|
16
28
|
});
|
|
17
29
|
var SendGroupOrderInvoiceContractCommand;
|
|
18
30
|
(function (SendGroupOrderInvoiceContractCommand) {
|
|
19
31
|
SendGroupOrderInvoiceContractCommand.RequestSchema = SendGroupOrderInvoiceRequestSchema;
|
|
20
32
|
SendGroupOrderInvoiceContractCommand.ResponseSchema = SendGroupOrderInvoiceResponseSchema;
|
|
33
|
+
SendGroupOrderInvoiceContractCommand.ResultItemSchema = SendGroupOrderInvoiceResultItemSchema;
|
|
21
34
|
})(SendGroupOrderInvoiceContractCommand || (exports.SendGroupOrderInvoiceContractCommand = SendGroupOrderInvoiceContractCommand = {}));
|
|
@@ -21,7 +21,6 @@ __exportStar(require("./get-order.query"), exports);
|
|
|
21
21
|
__exportStar(require("./get-order-list.query"), exports);
|
|
22
22
|
__exportStar(require("./copy-order.command"), exports);
|
|
23
23
|
__exportStar(require("./export-order-invoice.command"), exports);
|
|
24
|
-
__exportStar(require("./send-order-invoice.command"), exports);
|
|
25
24
|
__exportStar(require("./apply-order-discount.command"), exports);
|
|
26
25
|
__exportStar(require("./zeroing-receipt-delivery-order.command"), exports);
|
|
27
26
|
// group
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { NotificationChannelEnum, NotificationStatusEnum } from '../../enum';
|
|
3
|
+
|
|
4
|
+
export const GET_NOTIFICATIONS_STATUS_LIMIT = 100;
|
|
5
|
+
|
|
6
|
+
// uuids are passed as CSV in the query string: `?uuids=uuid1,uuid2,...` — for UI polling.
|
|
7
|
+
const GetNotificationsStatusRequestSchema = z.object({
|
|
8
|
+
uuids: z
|
|
9
|
+
.string()
|
|
10
|
+
.transform(value => value.split(',').map(item => item.trim()).filter(Boolean))
|
|
11
|
+
.pipe(z.array(z.string().uuid()).min(1).max(GET_NOTIFICATIONS_STATUS_LIMIT)),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const NotificationStatusItemSchema = z.object({
|
|
15
|
+
uuid: z.string().uuid(),
|
|
16
|
+
status: z.nativeEnum(NotificationStatusEnum),
|
|
17
|
+
channel: z.nativeEnum(NotificationChannelEnum).nullable(),
|
|
18
|
+
errorMessage: z.string().nullable(),
|
|
19
|
+
attempts: z.number().int().nonnegative(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const GetNotificationsStatusResponseSchema = z.object({
|
|
23
|
+
data: z.array(NotificationStatusItemSchema),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export namespace GetNotificationsStatusContractQuery {
|
|
27
|
+
export const RequestSchema = GetNotificationsStatusRequestSchema;
|
|
28
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
29
|
+
|
|
30
|
+
export const ResponseSchema = GetNotificationsStatusResponseSchema;
|
|
31
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
32
|
+
|
|
33
|
+
export const ItemSchema = NotificationStatusItemSchema;
|
|
34
|
+
export type Item = z.infer<typeof ItemSchema>;
|
|
35
|
+
}
|
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { NotificationChannelEnum } from '../../../enum';
|
|
3
3
|
|
|
4
|
+
export const SEND_GROUP_ORDER_INVOICE_LIMIT = 100;
|
|
5
|
+
|
|
4
6
|
const SendGroupOrderInvoiceRequestSchema = z.object({
|
|
5
|
-
orders: z
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
orders: z
|
|
8
|
+
.array(
|
|
9
|
+
z.object({
|
|
10
|
+
uuid: z.string().uuid(),
|
|
11
|
+
channel: z.nativeEnum(NotificationChannelEnum).optional(),
|
|
12
|
+
}),
|
|
13
|
+
)
|
|
14
|
+
.min(1)
|
|
15
|
+
.max(SEND_GROUP_ORDER_INVOICE_LIMIT),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const SendGroupOrderInvoiceResultItemSchema = z.object({
|
|
19
|
+
orderUUID: z.string().uuid(),
|
|
20
|
+
isSuccess: z.boolean(),
|
|
21
|
+
notificationUUID: z.string().uuid().optional(),
|
|
22
|
+
errorCode: z.string().optional(),
|
|
23
|
+
errorMessage: z.string().optional(),
|
|
11
24
|
});
|
|
12
25
|
|
|
13
26
|
const SendGroupOrderInvoiceResponseSchema = z.object({
|
|
14
27
|
processed: z.number(),
|
|
15
28
|
success: z.number(),
|
|
16
29
|
failed: z.number(),
|
|
30
|
+
results: z.array(SendGroupOrderInvoiceResultItemSchema),
|
|
17
31
|
});
|
|
18
32
|
|
|
19
33
|
export namespace SendGroupOrderInvoiceContractCommand {
|
|
@@ -22,4 +36,7 @@ export namespace SendGroupOrderInvoiceContractCommand {
|
|
|
22
36
|
|
|
23
37
|
export const ResponseSchema = SendGroupOrderInvoiceResponseSchema;
|
|
24
38
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
39
|
+
|
|
40
|
+
export const ResultItemSchema = SendGroupOrderInvoiceResultItemSchema;
|
|
41
|
+
export type ResultItem = z.infer<typeof ResultItemSchema>;
|
|
25
42
|
}
|
package/commands/order/index.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './get-order.query';
|
|
|
5
5
|
export * from './get-order-list.query';
|
|
6
6
|
export * from './copy-order.command';
|
|
7
7
|
export * from './export-order-invoice.command';
|
|
8
|
-
export * from './send-order-invoice.command';
|
|
9
8
|
export * from './apply-order-discount.command';
|
|
10
9
|
export * from './zeroing-receipt-delivery-order.command';
|
|
11
10
|
// group
|
package/package.json
CHANGED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SendOrderInvoiceContractCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const notification_channel_enum_1 = require("../../enum/notification-channel.enum");
|
|
6
|
-
const SendOrderInvoiceRequestSchema = zod_1.z.object({
|
|
7
|
-
channel: zod_1.z
|
|
8
|
-
.enum([
|
|
9
|
-
notification_channel_enum_1.NotificationChannelEnum.WHATSAPP,
|
|
10
|
-
notification_channel_enum_1.NotificationChannelEnum.EMAIL,
|
|
11
|
-
notification_channel_enum_1.NotificationChannelEnum.MAX,
|
|
12
|
-
notification_channel_enum_1.NotificationChannelEnum.TELEGRAM_BOT,
|
|
13
|
-
])
|
|
14
|
-
.optional(),
|
|
15
|
-
});
|
|
16
|
-
const SendOrderInvoiceResponseSchema = zod_1.z.object({
|
|
17
|
-
message: zod_1.z.string().optional(),
|
|
18
|
-
data: zod_1.z.object({
|
|
19
|
-
isSuccess: zod_1.z.boolean(),
|
|
20
|
-
}),
|
|
21
|
-
});
|
|
22
|
-
var SendOrderInvoiceContractCommand;
|
|
23
|
-
(function (SendOrderInvoiceContractCommand) {
|
|
24
|
-
SendOrderInvoiceContractCommand.RequestSchema = SendOrderInvoiceRequestSchema;
|
|
25
|
-
SendOrderInvoiceContractCommand.ResponseSchema = SendOrderInvoiceResponseSchema;
|
|
26
|
-
})(SendOrderInvoiceContractCommand || (exports.SendOrderInvoiceContractCommand = SendOrderInvoiceContractCommand = {}));
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { NotificationChannelEnum } from '../../enum/notification-channel.enum';
|
|
3
|
-
|
|
4
|
-
const SendOrderInvoiceRequestSchema = z.object({
|
|
5
|
-
channel: z
|
|
6
|
-
.enum([
|
|
7
|
-
NotificationChannelEnum.WHATSAPP,
|
|
8
|
-
NotificationChannelEnum.EMAIL,
|
|
9
|
-
NotificationChannelEnum.MAX,
|
|
10
|
-
NotificationChannelEnum.TELEGRAM_BOT,
|
|
11
|
-
] as const)
|
|
12
|
-
.optional(),
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const SendOrderInvoiceResponseSchema = z.object({
|
|
16
|
-
message: z.string().optional(),
|
|
17
|
-
data: z.object({
|
|
18
|
-
isSuccess: z.boolean(),
|
|
19
|
-
}),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export namespace SendOrderInvoiceContractCommand {
|
|
23
|
-
export const RequestSchema = SendOrderInvoiceRequestSchema;
|
|
24
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
25
|
-
|
|
26
|
-
export const ResponseSchema = SendOrderInvoiceResponseSchema;
|
|
27
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
-
}
|