@lyxa.ai/core 1.3.67 → 1.3.68
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.
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const validation_1 = require("../../../utilities/validation/");
|
|
6
6
|
const enum_1 = require("../../../utilities/enum");
|
|
7
7
|
const BaseSocketEvent_1 = require("../BaseSocketEvent");
|
|
8
|
-
const
|
|
8
|
+
const socketNotificationEvent_1 = require("./socketNotificationEvent");
|
|
9
9
|
var OrderAction;
|
|
10
10
|
(function (OrderAction) {
|
|
11
11
|
OrderAction["PLACED"] = "placed";
|
|
@@ -53,7 +53,7 @@ class OrderActionsSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
|
|
|
53
53
|
output: exports.OrderActionsOutputSchema,
|
|
54
54
|
};
|
|
55
55
|
constructor(payload) {
|
|
56
|
-
const socketNotificationEvent =
|
|
56
|
+
const socketNotificationEvent = new socketNotificationEvent_1.SocketNotificationEvent({
|
|
57
57
|
message: 'New Order!',
|
|
58
58
|
notificationType: enum_1.SocketEventType.ORDER_ACTIONS,
|
|
59
59
|
_id: payload._id,
|
|
@@ -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;AAErD,
|
|
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;AAErD,uEAAoE;AAEpE,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;AAC5B,CAAC,EAJW,WAAW,2BAAX,WAAW,QA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;AAhCF,0DAiCC","sourcesContent":["import { z } from 'zod';\nimport { DTO, ZodValidation } from '../../../utilities/validation/';\nimport { PaymentMethod, RegularOrderStatus, SocketEventType } from '../../../utilities/enum';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { EventFactory } from '../core';\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\tshopId: ZodValidation.objectId('shopId'),\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};\n\n\tconstructor(payload: OrderActionSocketOutputDTO) {\n\t\tconst socketNotificationEvent = new SocketNotificationEvent({\n\t\t\tmessage: 'New Order!',\n\t\t\tnotificationType: SocketEventType.ORDER_ACTIONS,\n\t\t\t_id: payload._id,\n\t\t});\n\n\t\tsuper(\n\t\t\tSocketEventType.ORDER_ACTIONS,\n\t\t\tOrderActionsSocketEvent.schemas,\n\t\t\tpayload,\n\t\t\tundefined,\n\t\t\tsocketNotificationEvent\n\t\t);\n\t}\n\n\tstatic identifier(input: z.infer<typeof OrderActionsInputSchema>): string {\n\t\treturn input.shopId.toString();\n\t}\n\n\tprotected getIdentifier(): string {\n\t\tconsole.log('this.data.shopId.toString(): ', this.data.shopId.toString());\n\t\treturn this.data.shopId.toString();\n\t}\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED