@lyxa.ai/core 1.3.34 → 1.3.36
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/mongo/models/blocked-time.model.d.ts +2 -3
- package/dist/libraries/mongo/models/blocked-time.model.js +1 -6
- package/dist/libraries/mongo/models/blocked-time.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-cart.model.d.ts +2 -3
- package/dist/libraries/mongo/models/service-cart.model.js +1 -6
- package/dist/libraries/mongo/models/service-cart.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-order.model.d.ts +2 -3
- package/dist/libraries/mongo/models/service-order.model.js +1 -6
- package/dist/libraries/mongo/models/service-order.model.js.map +1 -1
- 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
|
@@ -3,9 +3,8 @@ import { Vendor } from "./vendor.model";
|
|
|
3
3
|
import { Professional } from "./professional.model";
|
|
4
4
|
export declare class BlockedTime {
|
|
5
5
|
vendor: Ref<Vendor>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
timeTo: string;
|
|
6
|
+
timeFrom: Date;
|
|
7
|
+
timeTo: Date;
|
|
9
8
|
professionals: Ref<Professional>[];
|
|
10
9
|
reason?: string;
|
|
11
10
|
createdBy?: Ref<Vendor>;
|
|
@@ -16,7 +16,6 @@ const professional_model_1 = require("./professional.model");
|
|
|
16
16
|
const mongoose_1 = require("mongoose");
|
|
17
17
|
let BlockedTime = class BlockedTime {
|
|
18
18
|
vendor;
|
|
19
|
-
date;
|
|
20
19
|
timeFrom;
|
|
21
20
|
timeTo;
|
|
22
21
|
professionals;
|
|
@@ -31,14 +30,10 @@ __decorate([
|
|
|
31
30
|
__decorate([
|
|
32
31
|
(0, typegoose_1.prop)({ required: true }),
|
|
33
32
|
__metadata("design:type", Date)
|
|
34
|
-
], BlockedTime.prototype, "date", void 0);
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
37
|
-
__metadata("design:type", String)
|
|
38
33
|
], BlockedTime.prototype, "timeFrom", void 0);
|
|
39
34
|
__decorate([
|
|
40
35
|
(0, typegoose_1.prop)({ required: true }),
|
|
41
|
-
__metadata("design:type",
|
|
36
|
+
__metadata("design:type", Date)
|
|
42
37
|
], BlockedTime.prototype, "timeTo", void 0);
|
|
43
38
|
__decorate([
|
|
44
39
|
(0, typegoose_1.prop)({ ref: () => professional_model_1.Professional, type: () => [mongoose_1.Types.ObjectId] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocked-time.model.js","sourceRoot":"/","sources":["libraries/mongo/models/blocked-time.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,iDAAwC;AACxC,6DAAoD;AACpD,uCAAiC;AAS1B,IAAM,WAAW,GAAjB,MAAM,WAAW;IAEb,MAAM,CAAe;IAGrB,
|
|
1
|
+
{"version":3,"file":"blocked-time.model.js","sourceRoot":"/","sources":["libraries/mongo/models/blocked-time.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,iDAAwC;AACxC,6DAAoD;AACpD,uCAAiC;AAS1B,IAAM,WAAW,GAAjB,MAAM,WAAW;IAEb,MAAM,CAAe;IAGrB,QAAQ,CAAQ;IAGhB,MAAM,CAAQ;IAGd,aAAa,CAAuB;IAGpC,MAAM,CAAU;IAGhB,SAAS,CAAe;CAClC,CAAA;AAlBY,kCAAW;AAEb;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACP,IAAI;6CAAC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACT,IAAI;2CAAC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iCAAY,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,gBAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;;kDACrB;AAGpC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACA;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;8CACG;sBAjBtB,WAAW;IAPvB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC7B,IAAA,wBAAY,EAAC;QACV,aAAa,EAAE;YACX,UAAU,EAAE,cAAc;YAC1B,UAAU,EAAE,IAAI;SACnB;KACJ,CAAC;GACW,WAAW,CAkBvB","sourcesContent":["import { index, modelOptions, prop, Ref } from \"@typegoose/typegoose\";\nimport { Vendor } from \"./vendor.model\";\nimport { Professional } from \"./professional.model\";\nimport { Types } from \"mongoose\";\n\n@index({ vendor: 1, date: 1 })\n@modelOptions({\n schemaOptions: {\n collection: 'blockedTimes',\n timestamps: true\n }\n})\nexport class BlockedTime {\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>;\n \n @prop({ required: true })\n public timeFrom!: Date; \n\n @prop({ required: true })\n public timeTo!: Date; \n \n @prop({ ref: () => Professional, type: () => [Types.ObjectId] })\n public professionals!: Ref<Professional>[];\n\n @prop({ type: String })\n public reason?: string;\n\n @prop({ ref: () => Vendor })\n public createdBy?: Ref<Vendor>;\n}"]}
|
|
@@ -11,9 +11,8 @@ export declare class ServiceCart extends TimeStamps {
|
|
|
11
11
|
vendor: Ref<Vendor>;
|
|
12
12
|
service: Ref<Service>;
|
|
13
13
|
serviceLocation?: UserAddress;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
timeTo: string;
|
|
14
|
+
timeFrom: Date;
|
|
15
|
+
timeTo: Date;
|
|
17
16
|
recurrencePattern?: ServiceOrderRecurrencePattern;
|
|
18
17
|
status: ServiceCartStatus;
|
|
19
18
|
serviceLineItems: Ref<ServiceLineItem>[];
|
|
@@ -23,7 +23,6 @@ let ServiceCart = class ServiceCart extends defaultClasses_1.TimeStamps {
|
|
|
23
23
|
vendor;
|
|
24
24
|
service;
|
|
25
25
|
serviceLocation;
|
|
26
|
-
date;
|
|
27
26
|
timeFrom;
|
|
28
27
|
timeTo;
|
|
29
28
|
recurrencePattern;
|
|
@@ -50,14 +49,10 @@ __decorate([
|
|
|
50
49
|
__decorate([
|
|
51
50
|
(0, typegoose_1.prop)({ required: true }),
|
|
52
51
|
__metadata("design:type", Date)
|
|
53
|
-
], ServiceCart.prototype, "date", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
56
|
-
__metadata("design:type", String)
|
|
57
52
|
], ServiceCart.prototype, "timeFrom", void 0);
|
|
58
53
|
__decorate([
|
|
59
54
|
(0, typegoose_1.prop)({ required: true }),
|
|
60
|
-
__metadata("design:type",
|
|
55
|
+
__metadata("design:type", Date)
|
|
61
56
|
], ServiceCart.prototype, "timeTo", void 0);
|
|
62
57
|
__decorate([
|
|
63
58
|
(0, typegoose_1.prop)({ enum: enum_1.ServiceOrderRecurrencePattern, default: enum_1.ServiceOrderRecurrencePattern.ONETIME }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,6CAAoC;AACpC,iDAAwC;AACxC,kDAA2F;AAC3F,uEAA4D;AAC5D,0DAAqD;AAErD,mDAA0C;
|
|
1
|
+
{"version":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tC;AAQjD;IANN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,wBAAiB;QACvB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,wBAAiB,CAAC,MAAM;QACjC,QAAQ,EAAE,IAAI;KACd,CAAC;;2CACgC;AAO3B;IALN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,yCAAe;QAC1B,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,KAAK;KACjB,CAAC;;qDAC8C;sBAnCpC,WAAW;IAvBvB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,cAAc;YAC1B,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5B;QACD,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAClB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpB,IAAA,iBAAK,EACL,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACtB;QACC,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE;YACxB,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,wBAAiB,CAAC,MAAM,EAAE,wBAAiB,CAAC,MAAM,CAAC,EAAE;YACrE,SAAS,EAAE,IAAI;SACf;KACD,CACD;GACY,WAAW,CAoCvB","sourcesContent":["import { Index, modelOptions, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport { ServiceOrderRecurrencePattern, ServiceCartStatus } from '../../../utilities/enum';\nimport { ServiceLineItem } from './service-line-item.model';\nimport { UserAddress } from './shared/address.model';\nimport { StartEndTime } from './shared/work-hour.model';\nimport { Service } from './service.model';\nimport { DateToString } from 'mongoose';\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'serviceCarts',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t},\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\n@Index({ user: 1 })\n@Index({ vendor: 1 })\n@Index({ status: 1 })\n@Index(\n\t{ user: 1, vendor: 1 },\n\t{\n\t\tunique: true,\n\t\tpartialFilterExpression: {\n\t\t\tstatus: { $in: [ServiceCartStatus.ACTIVE, ServiceCartStatus.LOCKED] },\n\t\t\tdeletedAt: null,\n\t\t},\n\t}\n)\nexport class ServiceCart extends TimeStamps {\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, ref: () => Service })\n\tpublic service!: Ref<Service>;\n\n\t@prop({ required: false, type: UserAddress })\n\tpublic serviceLocation?: UserAddress;\n\n\t@prop({ required: true })\n\tpublic timeFrom!: Date;\n\n\t@prop({ required: true })\n\tpublic timeTo!: Date;\n\n\t@prop({ enum: ServiceOrderRecurrencePattern, default: ServiceOrderRecurrencePattern.ONETIME })\n\tpublic recurrencePattern?: ServiceOrderRecurrencePattern\n\n\t@prop({\n\t\tenum: ServiceCartStatus,\n\t\ttype: String,\n\t\tdefault: ServiceCartStatus.ACTIVE,\n\t\trequired: true,\n\t})\n\tpublic status!: ServiceCartStatus;\n\n\t@prop({\n\t\tref: () => ServiceLineItem,\n\t\tforeignField: 'cart',\n\t\tlocalField: '_id',\n\t})\n\tpublic serviceLineItems: Ref<ServiceLineItem>[];\n}\n"]}
|
|
@@ -19,9 +19,8 @@ export declare class ServiceOrder {
|
|
|
19
19
|
cart: Ref<ServiceCart>;
|
|
20
20
|
status: ServiceOrderStatus;
|
|
21
21
|
priority: ServiceOrderPriority;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
timeTo: string;
|
|
22
|
+
timeFrom: Date;
|
|
23
|
+
timeTo: Date;
|
|
25
24
|
userNotes?: string;
|
|
26
25
|
vendorNotes?: string;
|
|
27
26
|
professionals: Ref<Professional>[];
|
|
@@ -32,7 +32,6 @@ let ServiceOrder = class ServiceOrder {
|
|
|
32
32
|
cart;
|
|
33
33
|
status;
|
|
34
34
|
priority;
|
|
35
|
-
date;
|
|
36
35
|
timeFrom;
|
|
37
36
|
timeTo;
|
|
38
37
|
userNotes;
|
|
@@ -88,14 +87,10 @@ __decorate([
|
|
|
88
87
|
__decorate([
|
|
89
88
|
(0, typegoose_1.prop)({ required: true }),
|
|
90
89
|
__metadata("design:type", Date)
|
|
91
|
-
], ServiceOrder.prototype, "date", void 0);
|
|
92
|
-
__decorate([
|
|
93
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
94
|
-
__metadata("design:type", String)
|
|
95
90
|
], ServiceOrder.prototype, "timeFrom", void 0);
|
|
96
91
|
__decorate([
|
|
97
92
|
(0, typegoose_1.prop)({ required: true }),
|
|
98
|
-
__metadata("design:type",
|
|
93
|
+
__metadata("design:type", Date)
|
|
99
94
|
], ServiceOrder.prototype, "timeTo", void 0);
|
|
100
95
|
__decorate([
|
|
101
96
|
(0, typegoose_1.prop)({ type: String }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,6CAAoC;AACpC,iDAAwC;AAExC,kDAAiI;AACjI,6DAAoD;AACpD,wEAA8D;AAC9D,kFAAuE;AACvE,6DAAmD;AACnD,oFAA0E;AAC1E,wFAA6E;AAC7E,oFAA0E;AAC1E,4EAA8E;AAC9E,mDAA0C;AAE1C,uCAAiC;AAO1B,IAAM,YAAY,GAAlB,MA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,GAAG,EAAE,CAAC,CAAC,kDAA0B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;oDACZ;AAG7C;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACS;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDACG;uBAtFjB,YAAY;IALxB,IAAA,wBAAY,EAAC;QACV,aAAa,EAAE;YACX,UAAU,EAAE,cAAc;SAC7B;KACJ,CAAC;GACW,YAAY,CAuFxB","sourcesContent":["import { modelOptions, prop, Ref } from \"@typegoose/typegoose\";\nimport { User } from \"./user.model\";\nimport { Vendor } from \"./vendor.model\";\nimport { ServicePackage } from \"./service-package.model\";\nimport { ServiceOrderRecurrencePattern, PaymentMethod, ServiceOrderPriority, ServiceOrderStatus } from \"../../../utilities/enum\";\nimport { Professional } from \"./professional.model\";\nimport { ServiceTimer } from \"./embedded/service-timer.model\";\nimport { ServiceOrderFlag } from \"./embedded/service-order-flag.model\";\nimport { ServiceCart } from \"./service-cart.model\";\nimport { PaymentInformation } from \"./embedded/payment-infromation.model\";\nimport { ServiceOrderFinance } from \"./embedded/service-order-finance.model\";\nimport { ServiceOrderCancel } from \"./embedded/service-order-cance.model\";\nimport { ServiceOrderStatusTimeline } from \"./embedded/status-timeline.model\";\nimport { Service } from \"./service.model\";\nimport { StartEndTime } from \"./shared/work-hour.model\";\nimport { Types } from \"mongoose\";\n\n@modelOptions({\n schemaOptions: {\n collection: \"serviceOrder\"\n }\n})\nexport class ServiceOrder {\n @prop({ type: String, required: true, unique: true })\n public orderId!: string\n\n @prop({ ref: () => Service, required: true })\n public service!: Ref<Service>\n\n @prop({ ref: () => User, required: true })\n public user!: Ref<User>\n\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>\n\n @prop({ ref: () => ServiceCart, required: true })\n public cart!: Ref<ServiceCart>\n\n @prop({ enum: ServiceOrderStatus, default: ServiceOrderStatus.PENDING })\n status!: ServiceOrderStatus\n\n @prop({ enum: ServiceOrderPriority, default: ServiceOrderPriority.NORMAL })\n public priority!: ServiceOrderPriority\n\n @prop({ required: true })\n public timeFrom!: Date;\n\n @prop({ required: true })\n public timeTo!: Date;\n\n @prop({ type: String })\n public userNotes?: string;\n\n @prop({ type: String })\n public vendorNotes?: string;\n\n @prop({ ref: () => Professional, type: () => [Types.ObjectId] })\n public professionals!: Ref<Professional>[];\n\n @prop({ type: () => ServiceTimer })\n public serviceTimer?: ServiceTimer\n\n @prop({ type: () => ServiceOrderFlag })\n public flag?: ServiceOrderFlag\n\n @prop()\n public confirmedAt?: Date;\n\n @prop()\n public autoConfirmedAt?: Date;\n\n @prop({ default: false })\n public isUrgent!: boolean;\n\n @prop()\n public urgentAt?: Date;\n\n @prop({ default: false })\n public isOverdue!: boolean;\n\n @prop()\n public overdueAt?: Date;\n\n @prop({ required: true, type: ServiceOrderFinance })\n public finance: ServiceOrderFinance\n\n @prop({ enum: ServiceOrderRecurrencePattern, default: ServiceOrderRecurrencePattern.ONETIME })\n public recurrencePattern?: ServiceOrderRecurrencePattern\n\n @prop({ default: false })\n public isPaid!: boolean;\n\n @prop({ enum: PaymentMethod, type: String })\n public paymentMethod?: PaymentMethod;\n\n @prop({ type: () => PaymentInformation })\n public paymentInformation?: PaymentInformation;\n\n @prop({ type: () => ServiceOrderCancel })\n public orderCancel?: ServiceOrderCancel;\n\n @prop({ type: () => [ServiceOrderStatusTimeline], default: [] })\n public statusTimeline: ServiceOrderStatusTimeline[];\n\n @prop({ type: Number })\n public serviceDuration!: number; // minutes\n\n @prop({ type: Number })\n public bufferTime: number; // minutes\n}"]}
|
|
@@ -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,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,CAAC;IACF,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC;IAC3D,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC;CAC1D,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,0BAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC;CACxC,CAAC,CAAC;AAKH,MAAa,uBAAwB,SAAQ,iCAG5C;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,+BAAuB;QAC9B,MAAM,EAAE,gCAAwB;QAChC,uBAAuB,EAAE,IAAI,iDAAuB,CAAC,EAAE,OAAO,EAAE,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,wCAA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aAAa,CAAC;YAChD,oBAAoB,EAAE,0BAAa,CAAC,MAAM,CAAC,sBAAsB,CAAC;YAClE,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,UAAU,CAAC;YAC3C,kBAAkB,EAAE,0BAAa,CAAC,MAAM,CAAC,oBAAoB,CAAC;SAC9D,CAAC;KACF,CAAC;IACF,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC;IAC3D,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC;CAC1D,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,0BAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC;CACxC,CAAC,CAAC;AAKH,MAAa,uBAAwB,SAAQ,iCAG5C;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,+BAAuB;QAC9B,MAAM,EAAE,gCAAwB;QAChC,uBAAuB,EAAE,IAAI,iDAAuB,CAAC,EAAE,OAAO,EAAE,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\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