@lyxa.ai/core 1.3.34 → 1.3.35
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/libraries/socket/events/order-actions.socket.event.d.ts +172 -0
- package/dist/libraries/socket/events/order-actions.socket.event.js +14 -0
- package/dist/libraries/socket/events/order-actions.socket.event.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -25,6 +25,64 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
|
25
25
|
orderAction: z.ZodNativeEnum<typeof OrderAction>;
|
|
26
26
|
paymentMethod: z.ZodNativeEnum<typeof PaymentMethod>;
|
|
27
27
|
preparationTimeMinutes: z.ZodNumber;
|
|
28
|
+
adjustedFinance: z.ZodObject<{
|
|
29
|
+
paymentMethod: z.ZodNativeEnum<typeof PaymentMethod>;
|
|
30
|
+
shopProfit: z.ZodNumber;
|
|
31
|
+
pricing: z.ZodObject<{
|
|
32
|
+
total: z.ZodNumber;
|
|
33
|
+
secondaryTotal: z.ZodNumber;
|
|
34
|
+
paidAmount: z.ZodNumber;
|
|
35
|
+
secondaryPaidAmount: z.ZodNumber;
|
|
36
|
+
deliveryFee: z.ZodNumber;
|
|
37
|
+
secondaryDeliveryFee: z.ZodNumber;
|
|
38
|
+
riderTips: z.ZodNumber;
|
|
39
|
+
secondaryRiderTips: z.ZodNumber;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
total: number;
|
|
42
|
+
deliveryFee: number;
|
|
43
|
+
riderTips: number;
|
|
44
|
+
secondaryDeliveryFee: number;
|
|
45
|
+
secondaryRiderTips: number;
|
|
46
|
+
secondaryTotal: number;
|
|
47
|
+
paidAmount: number;
|
|
48
|
+
secondaryPaidAmount: number;
|
|
49
|
+
}, {
|
|
50
|
+
total: number;
|
|
51
|
+
deliveryFee: number;
|
|
52
|
+
riderTips: number;
|
|
53
|
+
secondaryDeliveryFee: number;
|
|
54
|
+
secondaryRiderTips: number;
|
|
55
|
+
secondaryTotal: number;
|
|
56
|
+
paidAmount: number;
|
|
57
|
+
secondaryPaidAmount: number;
|
|
58
|
+
}>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
paymentMethod: PaymentMethod;
|
|
61
|
+
pricing: {
|
|
62
|
+
total: number;
|
|
63
|
+
deliveryFee: number;
|
|
64
|
+
riderTips: number;
|
|
65
|
+
secondaryDeliveryFee: number;
|
|
66
|
+
secondaryRiderTips: number;
|
|
67
|
+
secondaryTotal: number;
|
|
68
|
+
paidAmount: number;
|
|
69
|
+
secondaryPaidAmount: number;
|
|
70
|
+
};
|
|
71
|
+
shopProfit: number;
|
|
72
|
+
}, {
|
|
73
|
+
paymentMethod: PaymentMethod;
|
|
74
|
+
pricing: {
|
|
75
|
+
total: number;
|
|
76
|
+
deliveryFee: number;
|
|
77
|
+
riderTips: number;
|
|
78
|
+
secondaryDeliveryFee: number;
|
|
79
|
+
secondaryRiderTips: number;
|
|
80
|
+
secondaryTotal: number;
|
|
81
|
+
paidAmount: number;
|
|
82
|
+
secondaryPaidAmount: number;
|
|
83
|
+
};
|
|
84
|
+
shopProfit: number;
|
|
85
|
+
}>;
|
|
28
86
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
29
87
|
triggerAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
30
88
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -37,6 +95,20 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
|
37
95
|
orderId: string;
|
|
38
96
|
paymentMethod: PaymentMethod;
|
|
39
97
|
triggerAt: Date;
|
|
98
|
+
adjustedFinance: {
|
|
99
|
+
paymentMethod: PaymentMethod;
|
|
100
|
+
pricing: {
|
|
101
|
+
total: number;
|
|
102
|
+
deliveryFee: number;
|
|
103
|
+
riderTips: number;
|
|
104
|
+
secondaryDeliveryFee: number;
|
|
105
|
+
secondaryRiderTips: number;
|
|
106
|
+
secondaryTotal: number;
|
|
107
|
+
paidAmount: number;
|
|
108
|
+
secondaryPaidAmount: number;
|
|
109
|
+
};
|
|
110
|
+
shopProfit: number;
|
|
111
|
+
};
|
|
40
112
|
orderStatus: RegularOrderStatus;
|
|
41
113
|
orderAction: OrderAction;
|
|
42
114
|
preparationTimeMinutes: number;
|
|
@@ -50,6 +122,20 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
|
50
122
|
orderId: string;
|
|
51
123
|
paymentMethod: PaymentMethod;
|
|
52
124
|
triggerAt: Date;
|
|
125
|
+
adjustedFinance: {
|
|
126
|
+
paymentMethod: PaymentMethod;
|
|
127
|
+
pricing: {
|
|
128
|
+
total: number;
|
|
129
|
+
deliveryFee: number;
|
|
130
|
+
riderTips: number;
|
|
131
|
+
secondaryDeliveryFee: number;
|
|
132
|
+
secondaryRiderTips: number;
|
|
133
|
+
secondaryTotal: number;
|
|
134
|
+
paidAmount: number;
|
|
135
|
+
secondaryPaidAmount: number;
|
|
136
|
+
};
|
|
137
|
+
shopProfit: number;
|
|
138
|
+
};
|
|
53
139
|
orderStatus: RegularOrderStatus;
|
|
54
140
|
orderAction: OrderAction;
|
|
55
141
|
preparationTimeMinutes: number;
|
|
@@ -89,6 +175,64 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
|
|
|
89
175
|
orderAction: z.ZodNativeEnum<typeof OrderAction>;
|
|
90
176
|
paymentMethod: z.ZodNativeEnum<typeof PaymentMethod>;
|
|
91
177
|
preparationTimeMinutes: z.ZodNumber;
|
|
178
|
+
adjustedFinance: z.ZodObject<{
|
|
179
|
+
paymentMethod: z.ZodNativeEnum<typeof PaymentMethod>;
|
|
180
|
+
shopProfit: z.ZodNumber;
|
|
181
|
+
pricing: z.ZodObject<{
|
|
182
|
+
total: z.ZodNumber;
|
|
183
|
+
secondaryTotal: z.ZodNumber;
|
|
184
|
+
paidAmount: z.ZodNumber;
|
|
185
|
+
secondaryPaidAmount: z.ZodNumber;
|
|
186
|
+
deliveryFee: z.ZodNumber;
|
|
187
|
+
secondaryDeliveryFee: z.ZodNumber;
|
|
188
|
+
riderTips: z.ZodNumber;
|
|
189
|
+
secondaryRiderTips: z.ZodNumber;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
total: number;
|
|
192
|
+
deliveryFee: number;
|
|
193
|
+
riderTips: number;
|
|
194
|
+
secondaryDeliveryFee: number;
|
|
195
|
+
secondaryRiderTips: number;
|
|
196
|
+
secondaryTotal: number;
|
|
197
|
+
paidAmount: number;
|
|
198
|
+
secondaryPaidAmount: number;
|
|
199
|
+
}, {
|
|
200
|
+
total: number;
|
|
201
|
+
deliveryFee: number;
|
|
202
|
+
riderTips: number;
|
|
203
|
+
secondaryDeliveryFee: number;
|
|
204
|
+
secondaryRiderTips: number;
|
|
205
|
+
secondaryTotal: number;
|
|
206
|
+
paidAmount: number;
|
|
207
|
+
secondaryPaidAmount: number;
|
|
208
|
+
}>;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
paymentMethod: PaymentMethod;
|
|
211
|
+
pricing: {
|
|
212
|
+
total: number;
|
|
213
|
+
deliveryFee: number;
|
|
214
|
+
riderTips: number;
|
|
215
|
+
secondaryDeliveryFee: number;
|
|
216
|
+
secondaryRiderTips: number;
|
|
217
|
+
secondaryTotal: number;
|
|
218
|
+
paidAmount: number;
|
|
219
|
+
secondaryPaidAmount: number;
|
|
220
|
+
};
|
|
221
|
+
shopProfit: number;
|
|
222
|
+
}, {
|
|
223
|
+
paymentMethod: PaymentMethod;
|
|
224
|
+
pricing: {
|
|
225
|
+
total: number;
|
|
226
|
+
deliveryFee: number;
|
|
227
|
+
riderTips: number;
|
|
228
|
+
secondaryDeliveryFee: number;
|
|
229
|
+
secondaryRiderTips: number;
|
|
230
|
+
secondaryTotal: number;
|
|
231
|
+
paidAmount: number;
|
|
232
|
+
secondaryPaidAmount: number;
|
|
233
|
+
};
|
|
234
|
+
shopProfit: number;
|
|
235
|
+
}>;
|
|
92
236
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
93
237
|
triggerAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
94
238
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -101,6 +245,20 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
|
|
|
101
245
|
orderId: string;
|
|
102
246
|
paymentMethod: PaymentMethod;
|
|
103
247
|
triggerAt: Date;
|
|
248
|
+
adjustedFinance: {
|
|
249
|
+
paymentMethod: PaymentMethod;
|
|
250
|
+
pricing: {
|
|
251
|
+
total: number;
|
|
252
|
+
deliveryFee: number;
|
|
253
|
+
riderTips: number;
|
|
254
|
+
secondaryDeliveryFee: number;
|
|
255
|
+
secondaryRiderTips: number;
|
|
256
|
+
secondaryTotal: number;
|
|
257
|
+
paidAmount: number;
|
|
258
|
+
secondaryPaidAmount: number;
|
|
259
|
+
};
|
|
260
|
+
shopProfit: number;
|
|
261
|
+
};
|
|
104
262
|
orderStatus: RegularOrderStatus;
|
|
105
263
|
orderAction: OrderAction;
|
|
106
264
|
preparationTimeMinutes: number;
|
|
@@ -114,6 +272,20 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
|
|
|
114
272
|
orderId: string;
|
|
115
273
|
paymentMethod: PaymentMethod;
|
|
116
274
|
triggerAt: Date;
|
|
275
|
+
adjustedFinance: {
|
|
276
|
+
paymentMethod: PaymentMethod;
|
|
277
|
+
pricing: {
|
|
278
|
+
total: number;
|
|
279
|
+
deliveryFee: number;
|
|
280
|
+
riderTips: number;
|
|
281
|
+
secondaryDeliveryFee: number;
|
|
282
|
+
secondaryRiderTips: number;
|
|
283
|
+
secondaryTotal: number;
|
|
284
|
+
paidAmount: number;
|
|
285
|
+
secondaryPaidAmount: number;
|
|
286
|
+
};
|
|
287
|
+
shopProfit: number;
|
|
288
|
+
};
|
|
117
289
|
orderStatus: RegularOrderStatus;
|
|
118
290
|
orderAction: OrderAction;
|
|
119
291
|
preparationTimeMinutes: number;
|
|
@@ -26,6 +26,20 @@ exports.OrderActionsOutputSchema = zod_1.z.object({
|
|
|
26
26
|
preparationTimeMinutes: validation_1.ZodValidation.number('Preparation Time (minutes)', {
|
|
27
27
|
isNonnegative: true,
|
|
28
28
|
}),
|
|
29
|
+
adjustedFinance: zod_1.z.object({
|
|
30
|
+
paymentMethod: validation_1.ZodValidation.enumType(enum_1.PaymentMethod, 'paymentMethod'),
|
|
31
|
+
shopProfit: validation_1.ZodValidation.number('shopProfit'),
|
|
32
|
+
pricing: zod_1.z.object({
|
|
33
|
+
total: validation_1.ZodValidation.number('total'),
|
|
34
|
+
secondaryTotal: validation_1.ZodValidation.number('secondaryTotal'),
|
|
35
|
+
paidAmount: validation_1.ZodValidation.number('paidAmount'),
|
|
36
|
+
secondaryPaidAmount: validation_1.ZodValidation.number('secondaryPaidAmount'),
|
|
37
|
+
deliveryFee: validation_1.ZodValidation.number('deliveryFee'),
|
|
38
|
+
secondaryDeliveryFee: validation_1.ZodValidation.number('secondaryDeliveryFee'),
|
|
39
|
+
riderTips: validation_1.ZodValidation.number('riderTip'),
|
|
40
|
+
secondaryRiderTips: validation_1.ZodValidation.number('secondaryRiderTips'),
|
|
41
|
+
}),
|
|
42
|
+
}),
|
|
29
43
|
createdAt: validation_1.ZodValidation.coerce.date('Order Creation Date'),
|
|
30
44
|
triggerAt: validation_1.ZodValidation.coerce.date('Order Trigger Date'),
|
|
31
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAoE;AACpE,kDAA6F;AAC7F,wDAAqD;AACrD,uEAAoE;AAEpE,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,gCAAi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,YAAY,EAAE,CAAC;KAC/E,CAAC;IAEF,YAAY,OAAmC;QAC9C,KAAK,CAAC,sBAAe,CAAC,aAAa,EAAE,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AAhBF,0DAiBC","sourcesContent":["import { z } from 'zod';\nimport { DTO, ZodValidation } from '../../../utilities/validation/';\nimport { PaymentMethod, RegularOrderStatus, SocketEventType } from '../../../utilities/enum';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { SocketNotificationEvent } from './socketNotificationEvent';\n\nexport enum OrderAction {\n\tPLACED = 'placed',\n\tADJUSTMENT = 'adjustment',\n\tREPLACEMENT = 'replacement',\n}\n\nconst OrderUserSchema = z.object({\n\t_id: ZodValidation.objectId('User ID'),\n\tname: ZodValidation.string('User Name'),\n});\n\nexport const OrderActionsOutputSchema = z.object({\n\t_id: ZodValidation.objectId('Order ID'),\n\torderId: ZodValidation.string('Readable Order ID'),\n\tuser: OrderUserSchema,\n\torderStatus: ZodValidation.enumType(RegularOrderStatus, 'status'),\n\torderAction: ZodValidation.enumType(OrderAction, 'orderAction'),\n\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\tpreparationTimeMinutes: ZodValidation.number('Preparation Time (minutes)', {\n\t\tisNonnegative: true,\n\t}),\n\tcreatedAt: ZodValidation.coerce.date('Order Creation Date'),\n\ttriggerAt: ZodValidation.coerce.date('Order Trigger Date'),\n});\n\nexport const OrderActionsInputSchema = z.object({\n\tshopId: ZodValidation.objectId('shopId'),\n});\n\nexport type OrderActionSocketInputDTO = DTO<typeof OrderActionsInputSchema>;\nexport type OrderActionSocketOutputDTO = DTO<typeof OrderActionsOutputSchema>;\n\nexport class OrderActionsSocketEvent extends BaseSocketEvent<\n\ttypeof OrderActionsInputSchema,\n\ttypeof OrderActionsOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: OrderActionsInputSchema,\n\t\toutput: OrderActionsOutputSchema,\n\t\tsocketNotificationEvent: new SocketNotificationEvent({ message: 'New Order!' }),\n\t};\n\n\tconstructor(payload: OrderActionSocketOutputDTO) {\n\t\tsuper(SocketEventType.ORDER_ACTIONS, OrderActionsSocketEvent.schemas, payload);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAoE;AACpE,kDAA6F;AAC7F,wDAAqD;AACrD,uEAAoE;AAEpE,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;AAC5B,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,GAAG,EAAE,0BAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,IAAI,EAAE,0BAAa,CAAC,MAAM,CAAC,WAAW,CAAC;CACvC,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,GAAG,EAAE,0BAAa,CAAC,QAAQ,CAAC,UAAU,CAAC;IACvC,OAAO,EAAE,0BAAa,CAAC,MAAM,CAAC,mBAAmB,CAAC;IAClD,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,0BAAa,CAAC,QAAQ,CAAC,yBAAkB,EAAE,QAAQ,CAAC;IACjE,WAAW,EAAE,0BAAa,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;IAC/D,aAAa,EAAE,0BAAa,CAAC,QAAQ,CAAC,oBAAa,EAAE,eAAe,CAAC;IACrE,sBAAsB,EAAE,0BAAa,CAAC,MAAM,CAAC,4BAA4B,EAAE;QAC1E,aAAa,EAAE,IAAI;KACnB,CAA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sBAAe,CAAC,aAAa,EAAE,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AAhBF,0DAiBC","sourcesContent":["import { z } from 'zod';\nimport { DTO, ZodValidation } from '../../../utilities/validation/';\nimport { PaymentMethod, RegularOrderStatus, SocketEventType } from '../../../utilities/enum';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { SocketNotificationEvent } from './socketNotificationEvent';\n\nexport enum OrderAction {\n\tPLACED = 'placed',\n\tADJUSTMENT = 'adjustment',\n\tREPLACEMENT = 'replacement',\n}\n\nconst OrderUserSchema = z.object({\n\t_id: ZodValidation.objectId('User ID'),\n\tname: ZodValidation.string('User Name'),\n});\n\nexport const OrderActionsOutputSchema = z.object({\n\t_id: ZodValidation.objectId('Order ID'),\n\torderId: ZodValidation.string('Readable Order ID'),\n\tuser: OrderUserSchema,\n\torderStatus: ZodValidation.enumType(RegularOrderStatus, 'status'),\n\torderAction: ZodValidation.enumType(OrderAction, 'orderAction'),\n\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\tpreparationTimeMinutes: ZodValidation.number('Preparation Time (minutes)', {\n\t\tisNonnegative: true,\n\t}),\n\tadjustedFinance: z.object({\n\t\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\t\tshopProfit: ZodValidation.number('shopProfit'),\n\t\tpricing: z.object({\n\t\t\ttotal: ZodValidation.number('total'),\n\t\t\tsecondaryTotal: ZodValidation.number('secondaryTotal'),\n\t\t\tpaidAmount: ZodValidation.number('paidAmount'),\n\t\t\tsecondaryPaidAmount: ZodValidation.number('secondaryPaidAmount'),\n\t\t\tdeliveryFee: ZodValidation.number('deliveryFee'),\n\t\t\tsecondaryDeliveryFee: ZodValidation.number('secondaryDeliveryFee'),\n\t\t\triderTips: ZodValidation.number('riderTip'),\n\t\t\tsecondaryRiderTips: ZodValidation.number('secondaryRiderTips'),\n\t\t}),\n\t}),\n\tcreatedAt: ZodValidation.coerce.date('Order Creation Date'),\n\ttriggerAt: ZodValidation.coerce.date('Order Trigger Date'),\n});\n\nexport const OrderActionsInputSchema = z.object({\n\tshopId: ZodValidation.objectId('shopId'),\n});\n\nexport type OrderActionSocketInputDTO = DTO<typeof OrderActionsInputSchema>;\nexport type OrderActionSocketOutputDTO = DTO<typeof OrderActionsOutputSchema>;\n\nexport class OrderActionsSocketEvent extends BaseSocketEvent<\n\ttypeof OrderActionsInputSchema,\n\ttypeof OrderActionsOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: OrderActionsInputSchema,\n\t\toutput: OrderActionsOutputSchema,\n\t\tsocketNotificationEvent: new SocketNotificationEvent({ message: 'New Order!' }),\n\t};\n\n\tconstructor(payload: OrderActionSocketOutputDTO) {\n\t\tsuper(SocketEventType.ORDER_ACTIONS, OrderActionsSocketEvent.schemas, payload);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED