@lyxa.ai/core 1.4.166 → 1.4.168
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/cart.model.d.ts +4 -3
- package/dist/libraries/mongo/models/cart.model.js +11 -17
- package/dist/libraries/mongo/models/cart.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-cart-v1.model.d.ts +16 -0
- package/dist/libraries/mongo/models/service-cart-v1.model.js +65 -0
- package/dist/libraries/mongo/models/service-cart-v1.model.js.map +1 -0
- package/dist/libraries/mongo/models/service-cart.model.d.ts +7 -9
- package/dist/libraries/mongo/models/service-cart.model.js +11 -25
- package/dist/libraries/mongo/models/service-cart.model.js.map +1 -1
- package/dist/libraries/socket/events/order-actions.socket.event.d.ts +36 -36
- package/dist/libraries/trpc/middlewares/phone-verified.js +1 -1
- package/dist/libraries/trpc/middlewares/phone-verified.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/enum.d.ts +4 -0
- package/dist/types/utilities/enum.js +6 -1
- package/dist/types/utilities/enum.js.map +1 -1
- package/dist/utilities/enum.d.ts +4 -0
- package/dist/utilities/enum.js +6 -1
- package/dist/utilities/enum.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { Ref } from '@typegoose/typegoose';
|
|
|
2
2
|
import { Shop } from './shop.model';
|
|
3
3
|
import { Parent } from './parent.model';
|
|
4
4
|
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
5
|
-
import { CartStatus, ChargeType, ItemType, PaymentPreference } from '../../../utilities/enum';
|
|
5
|
+
import { CartStatus, CartType, ChargeType, ItemType, PaymentPreference } from '../../../utilities/enum';
|
|
6
6
|
import { Address } from './shared/address.model';
|
|
7
7
|
import { User } from './user.model';
|
|
8
8
|
import { LineItem } from './line-item.model';
|
|
@@ -19,12 +19,13 @@ export declare class ShopSnap {
|
|
|
19
19
|
}
|
|
20
20
|
export declare class Cart extends TimeStamps {
|
|
21
21
|
cartId?: string;
|
|
22
|
+
cartType?: CartType;
|
|
22
23
|
title?: string;
|
|
23
24
|
exchangeRate?: number;
|
|
24
25
|
cashbackRate?: number;
|
|
25
26
|
user: Ref<User>;
|
|
26
|
-
parent
|
|
27
|
-
shop
|
|
27
|
+
parent?: Ref<Parent>;
|
|
28
|
+
shop?: Ref<Shop>;
|
|
28
29
|
shopSnap?: ShopSnap;
|
|
29
30
|
isGroupOrder?: boolean;
|
|
30
31
|
paymentPreference?: PaymentPreference;
|
|
@@ -66,6 +66,7 @@ __decorate([
|
|
|
66
66
|
], ShopSnap.prototype, "defaultPreparationTime", void 0);
|
|
67
67
|
let Cart = class Cart extends defaultClasses_1.TimeStamps {
|
|
68
68
|
cartId;
|
|
69
|
+
cartType;
|
|
69
70
|
title;
|
|
70
71
|
exchangeRate;
|
|
71
72
|
cashbackRate;
|
|
@@ -88,6 +89,10 @@ __decorate([
|
|
|
88
89
|
(0, typegoose_1.prop)({ type: String, unique: true, index: true }),
|
|
89
90
|
__metadata("design:type", String)
|
|
90
91
|
], Cart.prototype, "cartId", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.CartType, default: enum_1.CartType.REGULAR }),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], Cart.prototype, "cartType", void 0);
|
|
91
96
|
__decorate([
|
|
92
97
|
(0, typegoose_1.prop)({ trim: true, maxlength: 100 }),
|
|
93
98
|
__metadata("design:type", String)
|
|
@@ -105,11 +110,11 @@ __decorate([
|
|
|
105
110
|
__metadata("design:type", Object)
|
|
106
111
|
], Cart.prototype, "user", void 0);
|
|
107
112
|
__decorate([
|
|
108
|
-
(0, typegoose_1.prop)({
|
|
113
|
+
(0, typegoose_1.prop)({ ref: () => parent_model_1.Parent }),
|
|
109
114
|
__metadata("design:type", Object)
|
|
110
115
|
], Cart.prototype, "parent", void 0);
|
|
111
116
|
__decorate([
|
|
112
|
-
(0, typegoose_1.prop)({
|
|
117
|
+
(0, typegoose_1.prop)({ ref: () => shop_model_1.Shop }),
|
|
113
118
|
__metadata("design:type", Object)
|
|
114
119
|
], Cart.prototype, "shop", void 0);
|
|
115
120
|
__decorate([
|
|
@@ -141,12 +146,7 @@ __decorate([
|
|
|
141
146
|
__metadata("design:type", Boolean)
|
|
142
147
|
], Cart.prototype, "priceChanged", void 0);
|
|
143
148
|
__decorate([
|
|
144
|
-
(0, typegoose_1.prop)({
|
|
145
|
-
enum: enum_1.CartStatus,
|
|
146
|
-
type: String,
|
|
147
|
-
default: enum_1.CartStatus.ACTIVE,
|
|
148
|
-
required: true,
|
|
149
|
-
}),
|
|
149
|
+
(0, typegoose_1.prop)({ enum: enum_1.CartStatus, type: String, default: enum_1.CartStatus.ACTIVE, required: true }),
|
|
150
150
|
__metadata("design:type", String)
|
|
151
151
|
], Cart.prototype, "status", void 0);
|
|
152
152
|
__decorate([
|
|
@@ -163,19 +163,13 @@ __decorate([
|
|
|
163
163
|
], Cart.prototype, "lineItems", void 0);
|
|
164
164
|
exports.Cart = Cart = __decorate([
|
|
165
165
|
(0, typegoose_1.modelOptions)({
|
|
166
|
-
schemaOptions: {
|
|
167
|
-
|
|
168
|
-
toJSON: { virtuals: true },
|
|
169
|
-
toObject: { virtuals: true },
|
|
170
|
-
},
|
|
171
|
-
options: {
|
|
172
|
-
allowMixed: typegoose_1.Severity.ALLOW,
|
|
173
|
-
},
|
|
166
|
+
schemaOptions: { collection: 'carts', toJSON: { virtuals: true }, toObject: { virtuals: true } },
|
|
167
|
+
options: { allowMixed: typegoose_1.Severity.ALLOW },
|
|
174
168
|
}),
|
|
175
169
|
(0, typegoose_1.index)({ user: 1 }),
|
|
176
170
|
(0, typegoose_1.index)({ shop: 1 }),
|
|
177
171
|
(0, typegoose_1.index)({ status: 1 }),
|
|
178
|
-
(0, typegoose_1.index)({ user: 1, shop: 1 }, {
|
|
172
|
+
(0, typegoose_1.index)({ user: 1, shop: 1, vendor: 1 }, {
|
|
179
173
|
unique: true,
|
|
180
174
|
partialFilterExpression: {
|
|
181
175
|
status: { $in: [enum_1.CartStatus.ACTIVE, enum_1.CartStatus.LOCKED] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,6CAAoC;AACpC,iDAAwC;AACxC,4EAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,6CAAoC;AACpC,iDAAwC;AACxC,4EAAqE;AACrE,kDAAwG;AACxG,0DAAiD;AACjD,6CAAoC;AACpC,uDAA6C;AAC7C,kEAAwE;AACxE,wBAA8B;AAC9B,0DAAiD;AAEjD,MAAa,QAAQ;IAEb,IAAI,CAAU;IAGd,UAAU,CAAc;IAGxB,MAAM,CAAU;IAGhB,QAAQ,CAAY;IAGpB,OAAO,CAAW;IAGlB,IAAI,CAAU;IAGd,cAAc,CAAW;IAGzB,sBAAsB,CAAU;CACvC;AAxBD,4BAwBC;AAtBO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAU,EAAE,OAAO,EAAE,iBAAU,CAAC,MAAM,EAAE,CAAC;;4CACtD;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,qBAAM,EAAE,CAAC;8BACvB,qBAAM;wCAAC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EA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;QAE/D,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,IAAI,CA8DhB","sourcesContent":["import { prop, Ref, index, modelOptions, Severity, pre } from '@typegoose/typegoose';\nimport { Shop } from './shop.model';\nimport { Parent } from './parent.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CartStatus, CartType, ChargeType, ItemType, PaymentPreference } from '../../../utilities/enum';\nimport { Address } from './shared/address.model';\nimport { User } from './user.model';\nimport { LineItem } from './line-item.model';\nimport { handlePreSaveForUniqueId } from '../utilities/unique-id.hooks';\nimport { CartModel } from '.';\nimport { Charge } from './embedded/charge.model';\n\nexport class ShopSnap {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, enum: ChargeType, default: ChargeType.CUSTOM })\n\tpublic chargeType!: ChargeType;\n\n\t@prop({ required: true, type: Charge })\n\tpublic charge!: Charge;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n}\n\n@modelOptions({\n\tschemaOptions: { collection: 'carts', toJSON: { virtuals: true }, toObject: { virtuals: true } },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ user: 1 })\n@index({ shop: 1 })\n@index({ status: 1 })\n@index(\n\t{ user: 1, shop: 1, vendor: 1 },\n\t{\n\t\tunique: true,\n\t\tpartialFilterExpression: {\n\t\t\tstatus: { $in: [CartStatus.ACTIVE, CartStatus.LOCKED] },\n\t\t\tdeletedAt: null,\n\t\t},\n\t}\n)\n@pre<Cart>('save', async function (next) {\n\t// Generate unique id if not exists\n\tawait handlePreSaveForUniqueId.call(this, CartModel, 'cartId');\n\n\tnext();\n})\nexport class Cart extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic cartId?: string;\n\n\t// this should be inside abstract cart\n\t@prop({ type: String, enum: CartType, default: CartType.REGULAR })\n\tpublic cartType?: CartType;\n\n\t@prop({ trim: true, maxlength: 100 })\n\tpublic title?: string;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic exchangeRate?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic cashbackRate?: number;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t// parent is required for regular cart but optional for service cart\n\t@prop({ ref: () => Parent })\n\tpublic parent?: Ref<Parent>;\n\n\t// shop is required for regular cart but optional for service cart\n\t@prop({ ref: () => Shop })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ type: ShopSnap })\n\tpublic shopSnap?: ShopSnap;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isGroupOrder?: boolean;\n\n\t@prop({ type: String, enum: PaymentPreference })\n\tpublic paymentPreference?: PaymentPreference;\n\n\t@prop({ type: Number, default: Infinity })\n\tpublic spendingLimitForGuest?: number;\n\n\t@prop({ type: Number, default: Infinity })\n\tpublic secondarySpendingLimitForGuest?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic stockChanged?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic priceChanged?: boolean;\n\n\t@prop({ enum: CartStatus, type: String, default: CartStatus.ACTIVE, required: true })\n\tpublic status!: CartStatus;\n\n\t@prop({ type: String, trim: true })\n\tpublic couponCode?: string;\n\n\t//todo: we need to keep embedded line items and remove line item model\n\t@prop({\n\t\tref: () => LineItem,\n\t\tforeignField: 'cart',\n\t\tlocalField: '_id',\n\t})\n\tpublic lineItems?: Ref<LineItem>[];\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Ref } from '@typegoose/typegoose';
|
|
2
|
+
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
3
|
+
import { User } from './user.model';
|
|
4
|
+
import { Vendor } from './vendor.model';
|
|
5
|
+
import { ServiceCartStatus, ServiceType, SubServiceType } from '../../../utilities/enum';
|
|
6
|
+
import { ServiceLineItem } from './embedded/service-line-item.model';
|
|
7
|
+
import { OrderSlotRange } from './shared/duration.model';
|
|
8
|
+
export declare class ServiceCartV1 extends TimeStamps {
|
|
9
|
+
user: Ref<User>;
|
|
10
|
+
vendor: Ref<Vendor>;
|
|
11
|
+
serviceType: ServiceType;
|
|
12
|
+
subServiceType?: SubServiceType;
|
|
13
|
+
status?: ServiceCartStatus;
|
|
14
|
+
lineItems: ServiceLineItem[];
|
|
15
|
+
slotRange?: OrderSlotRange;
|
|
16
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ServiceCartV1 = void 0;
|
|
13
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
+
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
|
+
const user_model_1 = require("./user.model");
|
|
16
|
+
const vendor_model_1 = require("./vendor.model");
|
|
17
|
+
const enum_1 = require("../../../utilities/enum");
|
|
18
|
+
const service_line_item_model_1 = require("./embedded/service-line-item.model");
|
|
19
|
+
const duration_model_1 = require("./shared/duration.model");
|
|
20
|
+
let ServiceCartV1 = class ServiceCartV1 extends defaultClasses_1.TimeStamps {
|
|
21
|
+
user;
|
|
22
|
+
vendor;
|
|
23
|
+
serviceType;
|
|
24
|
+
subServiceType;
|
|
25
|
+
status;
|
|
26
|
+
lineItems;
|
|
27
|
+
slotRange;
|
|
28
|
+
};
|
|
29
|
+
exports.ServiceCartV1 = ServiceCartV1;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typegoose_1.prop)({ required: true, ref: () => user_model_1.User }),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], ServiceCartV1.prototype, "user", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typegoose_1.prop)({ required: true, ref: () => vendor_model_1.Vendor }),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], ServiceCartV1.prototype, "vendor", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceType }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], ServiceCartV1.prototype, "serviceType", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.SubServiceType }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], ServiceCartV1.prototype, "subServiceType", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.ServiceCartStatus, default: enum_1.ServiceCartStatus.ACTIVE }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], ServiceCartV1.prototype, "status", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typegoose_1.prop)({ required: true, type: [service_line_item_model_1.ServiceLineItem] }),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], ServiceCartV1.prototype, "lineItems", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typegoose_1.prop)({ type: duration_model_1.OrderSlotRange, _id: false }),
|
|
56
|
+
__metadata("design:type", duration_model_1.OrderSlotRange)
|
|
57
|
+
], ServiceCartV1.prototype, "slotRange", void 0);
|
|
58
|
+
exports.ServiceCartV1 = ServiceCartV1 = __decorate([
|
|
59
|
+
(0, typegoose_1.modelOptions)({
|
|
60
|
+
schemaOptions: { collection: 'serviceCarts', toJSON: { virtuals: true }, toObject: { virtuals: true } },
|
|
61
|
+
options: { allowMixed: typegoose_1.Severity.ALLOW },
|
|
62
|
+
}),
|
|
63
|
+
(0, typegoose_1.Index)({ user: 1, vendor: 1 }, { unique: true, partialFilterExpression: { status: enum_1.ServiceCartStatus.ACTIVE, deletedAt: null } })
|
|
64
|
+
], ServiceCartV1);
|
|
65
|
+
//# sourceMappingURL=service-cart-v1.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-cart-v1.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-cart-v1.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,6CAAoC;AACpC,iDAAwC;AACxC,kDAAyF;AACzF,gFAAqE;AACrE,4DAAyD;AAUlD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,2BAAU;IAErC,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGrB,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,MAAM,CAAqB;IAG3B,SAAS,CAAqB;IAG9B,SAAS,CAAkB;CAClC,CAAA;AArBY,sCAAa;AAElB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;2CAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;6CAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;kDACzB;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAc,EAAE,CAAC;;qDACN;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAiB,EAAE,OAAO,EAAE,wBAAiB,CAAC,MAAM,EAAE,CAAC;;6CACjD;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,yCAAe,CAAC,EAAE,CAAC;;gDACb;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,+BAAc,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BACxB,+BAAc;gDAAC;wBApBtB,aAAa;IARzB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QACvG,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE;KACvC,CAAC;IACD,IAAA,iBAAK,EACL,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACtB,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,MAAM,EAAE,wBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAChG;GACY,aAAa,CAqBzB","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 { ServiceCartStatus, ServiceType, SubServiceType } from '../../../utilities/enum';\nimport { ServiceLineItem } from './embedded/service-line-item.model';\nimport { OrderSlotRange } from './shared/duration.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'serviceCarts', toJSON: { virtuals: true }, toObject: { virtuals: true } },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@Index(\n\t{ user: 1, vendor: 1 },\n\t{ unique: true, partialFilterExpression: { status: ServiceCartStatus.ACTIVE, deletedAt: null } }\n)\nexport class ServiceCartV1 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, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ type: String, enum: ServiceCartStatus, default: ServiceCartStatus.ACTIVE })\n\tpublic status?: ServiceCartStatus;\n\n\t@prop({ required: true, type: [ServiceLineItem] })\n\tpublic lineItems!: ServiceLineItem[];\n\n\t@prop({ type: OrderSlotRange, _id: false })\n\tpublic slotRange?: OrderSlotRange;\n}\n"]}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { Ref } from '@typegoose/typegoose';
|
|
2
|
-
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
3
|
-
import { User } from './user.model';
|
|
4
2
|
import { Vendor } from './vendor.model';
|
|
5
|
-
import {
|
|
3
|
+
import { CartType, ServiceType, SubServiceType } from '../../../utilities/enum';
|
|
6
4
|
import { ServiceLineItem } from './embedded/service-line-item.model';
|
|
7
5
|
import { OrderSlotRange } from './shared/duration.model';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { Cart } from './cart.model';
|
|
7
|
+
export declare class ServiceCart extends Cart {
|
|
8
|
+
cartType?: CartType;
|
|
9
|
+
vendor?: Ref<Vendor>;
|
|
10
|
+
serviceType?: ServiceType;
|
|
12
11
|
subServiceType?: SubServiceType;
|
|
13
|
-
|
|
14
|
-
lineItems: ServiceLineItem[];
|
|
12
|
+
serviceLineItems?: ServiceLineItem[];
|
|
15
13
|
slotRange?: OrderSlotRange;
|
|
16
14
|
}
|
|
@@ -11,32 +11,29 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ServiceCart = void 0;
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
-
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
|
-
const user_model_1 = require("./user.model");
|
|
16
14
|
const vendor_model_1 = require("./vendor.model");
|
|
17
15
|
const enum_1 = require("../../../utilities/enum");
|
|
18
16
|
const service_line_item_model_1 = require("./embedded/service-line-item.model");
|
|
19
17
|
const duration_model_1 = require("./shared/duration.model");
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const cart_model_1 = require("./cart.model");
|
|
19
|
+
class ServiceCart extends cart_model_1.Cart {
|
|
22
20
|
vendor;
|
|
23
21
|
serviceType;
|
|
24
22
|
subServiceType;
|
|
25
|
-
|
|
26
|
-
lineItems;
|
|
23
|
+
serviceLineItems;
|
|
27
24
|
slotRange;
|
|
28
|
-
}
|
|
25
|
+
}
|
|
29
26
|
exports.ServiceCart = ServiceCart;
|
|
30
27
|
__decorate([
|
|
31
|
-
(0, typegoose_1.prop)({
|
|
32
|
-
__metadata("design:type",
|
|
33
|
-
], ServiceCart.prototype, "
|
|
28
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.CartType, default: enum_1.CartType.SERVICE }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ServiceCart.prototype, "cartType", void 0);
|
|
34
31
|
__decorate([
|
|
35
|
-
(0, typegoose_1.prop)({
|
|
32
|
+
(0, typegoose_1.prop)({ ref: () => vendor_model_1.Vendor }),
|
|
36
33
|
__metadata("design:type", Object)
|
|
37
34
|
], ServiceCart.prototype, "vendor", void 0);
|
|
38
35
|
__decorate([
|
|
39
|
-
(0, typegoose_1.prop)({
|
|
36
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.ServiceType }),
|
|
40
37
|
__metadata("design:type", String)
|
|
41
38
|
], ServiceCart.prototype, "serviceType", void 0);
|
|
42
39
|
__decorate([
|
|
@@ -44,22 +41,11 @@ __decorate([
|
|
|
44
41
|
__metadata("design:type", String)
|
|
45
42
|
], ServiceCart.prototype, "subServiceType", void 0);
|
|
46
43
|
__decorate([
|
|
47
|
-
(0, typegoose_1.prop)({ type:
|
|
48
|
-
__metadata("design:type", String)
|
|
49
|
-
], ServiceCart.prototype, "status", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typegoose_1.prop)({ required: true, type: [service_line_item_model_1.ServiceLineItem] }),
|
|
44
|
+
(0, typegoose_1.prop)({ type: [service_line_item_model_1.ServiceLineItem] }),
|
|
52
45
|
__metadata("design:type", Array)
|
|
53
|
-
], ServiceCart.prototype, "
|
|
46
|
+
], ServiceCart.prototype, "serviceLineItems", void 0);
|
|
54
47
|
__decorate([
|
|
55
48
|
(0, typegoose_1.prop)({ type: duration_model_1.OrderSlotRange, _id: false }),
|
|
56
49
|
__metadata("design:type", duration_model_1.OrderSlotRange)
|
|
57
50
|
], ServiceCart.prototype, "slotRange", void 0);
|
|
58
|
-
exports.ServiceCart = ServiceCart = __decorate([
|
|
59
|
-
(0, typegoose_1.modelOptions)({
|
|
60
|
-
schemaOptions: { collection: 'serviceCarts', toJSON: { virtuals: true }, toObject: { virtuals: true } },
|
|
61
|
-
options: { allowMixed: typegoose_1.Severity.ALLOW },
|
|
62
|
-
}),
|
|
63
|
-
(0, typegoose_1.Index)({ user: 1, vendor: 1 }, { unique: true, partialFilterExpression: { status: enum_1.ServiceCartStatus.ACTIVE, deletedAt: null } })
|
|
64
|
-
], ServiceCart);
|
|
65
51
|
//# sourceMappingURL=service-cart.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"service-cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,iDAAwC;AACxC,kDAAgF;AAChF,gFAAqE;AACrE,4DAAyD;AACzD,6CAAoC;AAEpC,MAAa,WAAY,SAAQ,iBAAI;IAM7B,MAAM,CAAe;IAIrB,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAIhC,gBAAgB,CAAqB;IAGrC,SAAS,CAAkB;CAClC;AArBD,kCAqBC;AAnBe;IADd,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,OAAO,EAAE,eAAQ,CAAC,OAAO,EAAE,CAAC;;6CAC/B;AAI5B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;2CACA;AAIrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;gDACT;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAc,EAAE,CAAC;;mDACN;AAIhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,yCAAe,CAAC,EAAE,CAAC;;qDACU;AAGrC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,+BAAc,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BACxB,+BAAc;8CAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { CartType, ServiceType, SubServiceType } from '../../../utilities/enum';\nimport { ServiceLineItem } from './embedded/service-line-item.model';\nimport { OrderSlotRange } from './shared/duration.model';\nimport { Cart } from './cart.model';\n\nexport class ServiceCart extends Cart {\n\t@prop({ type: String, enum: CartType, default: CartType.SERVICE })\n\tdeclare public cartType?: CartType;\n\n\t// vendor is required for service cart but optional for regular cart\n\t@prop({ ref: () => Vendor })\n\tpublic vendor?: Ref<Vendor>;\n\n\t// serviceType is required for service cart but optional for regular cart\n\t@prop({ type: String, enum: ServiceType })\n\tpublic serviceType?: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t// serviceLineItems is required for service cart but optional for regular cart\n\t@prop({ type: [ServiceLineItem] })\n\tpublic serviceLineItems?: ServiceLineItem[];\n\n\t@prop({ type: OrderSlotRange, _id: false })\n\tpublic slotRange?: OrderSlotRange;\n}\n"]}
|
|
@@ -41,33 +41,33 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
42
|
total: number;
|
|
43
43
|
deliveryFee: number;
|
|
44
|
+
secondaryDeliveryFee: number;
|
|
45
|
+
riderTips: number;
|
|
46
|
+
secondaryRiderTips: number;
|
|
44
47
|
secondaryTotal: number;
|
|
45
48
|
paidAmount: number;
|
|
46
49
|
secondaryPaidAmount: number;
|
|
47
|
-
riderTips: number;
|
|
48
|
-
secondaryDeliveryFee: number;
|
|
49
|
-
secondaryRiderTips: number;
|
|
50
50
|
}, {
|
|
51
51
|
total: number;
|
|
52
52
|
deliveryFee: number;
|
|
53
|
+
secondaryDeliveryFee: number;
|
|
54
|
+
riderTips: number;
|
|
55
|
+
secondaryRiderTips: number;
|
|
53
56
|
secondaryTotal: number;
|
|
54
57
|
paidAmount: number;
|
|
55
58
|
secondaryPaidAmount: number;
|
|
56
|
-
riderTips: number;
|
|
57
|
-
secondaryDeliveryFee: number;
|
|
58
|
-
secondaryRiderTips: number;
|
|
59
59
|
}>;
|
|
60
60
|
}, "strip", z.ZodTypeAny, {
|
|
61
61
|
paymentMethod: PaymentMethod;
|
|
62
62
|
pricing: {
|
|
63
63
|
total: number;
|
|
64
64
|
deliveryFee: number;
|
|
65
|
+
secondaryDeliveryFee: number;
|
|
66
|
+
riderTips: number;
|
|
67
|
+
secondaryRiderTips: number;
|
|
65
68
|
secondaryTotal: number;
|
|
66
69
|
paidAmount: number;
|
|
67
70
|
secondaryPaidAmount: number;
|
|
68
|
-
riderTips: number;
|
|
69
|
-
secondaryDeliveryFee: number;
|
|
70
|
-
secondaryRiderTips: number;
|
|
71
71
|
};
|
|
72
72
|
shopProfit: number;
|
|
73
73
|
}, {
|
|
@@ -75,12 +75,12 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
|
75
75
|
pricing: {
|
|
76
76
|
total: number;
|
|
77
77
|
deliveryFee: number;
|
|
78
|
+
secondaryDeliveryFee: number;
|
|
79
|
+
riderTips: number;
|
|
80
|
+
secondaryRiderTips: number;
|
|
78
81
|
secondaryTotal: number;
|
|
79
82
|
paidAmount: number;
|
|
80
83
|
secondaryPaidAmount: number;
|
|
81
|
-
riderTips: number;
|
|
82
|
-
secondaryDeliveryFee: number;
|
|
83
|
-
secondaryRiderTips: number;
|
|
84
84
|
};
|
|
85
85
|
shopProfit: number;
|
|
86
86
|
}>;
|
|
@@ -103,12 +103,12 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
|
103
103
|
pricing: {
|
|
104
104
|
total: number;
|
|
105
105
|
deliveryFee: number;
|
|
106
|
+
secondaryDeliveryFee: number;
|
|
107
|
+
riderTips: number;
|
|
108
|
+
secondaryRiderTips: number;
|
|
106
109
|
secondaryTotal: number;
|
|
107
110
|
paidAmount: number;
|
|
108
111
|
secondaryPaidAmount: number;
|
|
109
|
-
riderTips: number;
|
|
110
|
-
secondaryDeliveryFee: number;
|
|
111
|
-
secondaryRiderTips: number;
|
|
112
112
|
};
|
|
113
113
|
shopProfit: number;
|
|
114
114
|
};
|
|
@@ -132,12 +132,12 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
|
132
132
|
pricing: {
|
|
133
133
|
total: number;
|
|
134
134
|
deliveryFee: number;
|
|
135
|
+
secondaryDeliveryFee: number;
|
|
136
|
+
riderTips: number;
|
|
137
|
+
secondaryRiderTips: number;
|
|
135
138
|
secondaryTotal: number;
|
|
136
139
|
paidAmount: number;
|
|
137
140
|
secondaryPaidAmount: number;
|
|
138
|
-
riderTips: number;
|
|
139
|
-
secondaryDeliveryFee: number;
|
|
140
|
-
secondaryRiderTips: number;
|
|
141
141
|
};
|
|
142
142
|
shopProfit: number;
|
|
143
143
|
};
|
|
@@ -185,33 +185,33 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
|
|
|
185
185
|
}, "strip", z.ZodTypeAny, {
|
|
186
186
|
total: number;
|
|
187
187
|
deliveryFee: number;
|
|
188
|
+
secondaryDeliveryFee: number;
|
|
189
|
+
riderTips: number;
|
|
190
|
+
secondaryRiderTips: number;
|
|
188
191
|
secondaryTotal: number;
|
|
189
192
|
paidAmount: number;
|
|
190
193
|
secondaryPaidAmount: number;
|
|
191
|
-
riderTips: number;
|
|
192
|
-
secondaryDeliveryFee: number;
|
|
193
|
-
secondaryRiderTips: number;
|
|
194
194
|
}, {
|
|
195
195
|
total: number;
|
|
196
196
|
deliveryFee: number;
|
|
197
|
+
secondaryDeliveryFee: number;
|
|
198
|
+
riderTips: number;
|
|
199
|
+
secondaryRiderTips: number;
|
|
197
200
|
secondaryTotal: number;
|
|
198
201
|
paidAmount: number;
|
|
199
202
|
secondaryPaidAmount: number;
|
|
200
|
-
riderTips: number;
|
|
201
|
-
secondaryDeliveryFee: number;
|
|
202
|
-
secondaryRiderTips: number;
|
|
203
203
|
}>;
|
|
204
204
|
}, "strip", z.ZodTypeAny, {
|
|
205
205
|
paymentMethod: PaymentMethod;
|
|
206
206
|
pricing: {
|
|
207
207
|
total: number;
|
|
208
208
|
deliveryFee: number;
|
|
209
|
+
secondaryDeliveryFee: number;
|
|
210
|
+
riderTips: number;
|
|
211
|
+
secondaryRiderTips: number;
|
|
209
212
|
secondaryTotal: number;
|
|
210
213
|
paidAmount: number;
|
|
211
214
|
secondaryPaidAmount: number;
|
|
212
|
-
riderTips: number;
|
|
213
|
-
secondaryDeliveryFee: number;
|
|
214
|
-
secondaryRiderTips: number;
|
|
215
215
|
};
|
|
216
216
|
shopProfit: number;
|
|
217
217
|
}, {
|
|
@@ -219,12 +219,12 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
|
|
|
219
219
|
pricing: {
|
|
220
220
|
total: number;
|
|
221
221
|
deliveryFee: number;
|
|
222
|
+
secondaryDeliveryFee: number;
|
|
223
|
+
riderTips: number;
|
|
224
|
+
secondaryRiderTips: number;
|
|
222
225
|
secondaryTotal: number;
|
|
223
226
|
paidAmount: number;
|
|
224
227
|
secondaryPaidAmount: number;
|
|
225
|
-
riderTips: number;
|
|
226
|
-
secondaryDeliveryFee: number;
|
|
227
|
-
secondaryRiderTips: number;
|
|
228
228
|
};
|
|
229
229
|
shopProfit: number;
|
|
230
230
|
}>;
|
|
@@ -247,12 +247,12 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
|
|
|
247
247
|
pricing: {
|
|
248
248
|
total: number;
|
|
249
249
|
deliveryFee: number;
|
|
250
|
+
secondaryDeliveryFee: number;
|
|
251
|
+
riderTips: number;
|
|
252
|
+
secondaryRiderTips: number;
|
|
250
253
|
secondaryTotal: number;
|
|
251
254
|
paidAmount: number;
|
|
252
255
|
secondaryPaidAmount: number;
|
|
253
|
-
riderTips: number;
|
|
254
|
-
secondaryDeliveryFee: number;
|
|
255
|
-
secondaryRiderTips: number;
|
|
256
256
|
};
|
|
257
257
|
shopProfit: number;
|
|
258
258
|
};
|
|
@@ -276,12 +276,12 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
|
|
|
276
276
|
pricing: {
|
|
277
277
|
total: number;
|
|
278
278
|
deliveryFee: number;
|
|
279
|
+
secondaryDeliveryFee: number;
|
|
280
|
+
riderTips: number;
|
|
281
|
+
secondaryRiderTips: number;
|
|
279
282
|
secondaryTotal: number;
|
|
280
283
|
paidAmount: number;
|
|
281
284
|
secondaryPaidAmount: number;
|
|
282
|
-
riderTips: number;
|
|
283
|
-
secondaryDeliveryFee: number;
|
|
284
|
-
secondaryRiderTips: number;
|
|
285
285
|
};
|
|
286
286
|
shopProfit: number;
|
|
287
287
|
};
|
|
@@ -19,7 +19,7 @@ function createPhoneVerifiedProcedure(options) {
|
|
|
19
19
|
if (!user.isPhoneVerified)
|
|
20
20
|
throw new server_1.TRPCError({
|
|
21
21
|
code: 'FORBIDDEN',
|
|
22
|
-
message: '
|
|
22
|
+
message: 'You should verify your phone number to proceed. Go to profile, click on change phone number, enter your phone number and verify it!',
|
|
23
23
|
});
|
|
24
24
|
return next({ ctx });
|
|
25
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-verified.js","sourceRoot":"/","sources":["libraries/trpc/middlewares/phone-verified.ts"],"names":[],"mappings":";;AAaA,oEAoBC;AAjCD,yCAAyC;AACzC,iCAAsD;AACtD,qCAA4C;AAC5C,+CAA+C;AAU/C,SAAgB,4BAA4B,CAAC,OAA6B;IACzE,OAAO,IAAA,mCAA4B,EAAC,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE;QACxE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,kBAAS,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC,CAAC;QAClF,CAAC;QAED,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,qBAAc,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QAEhE,MAAM,IAAI,GAAG,MAAM,kBAAS,CAAC,OAAO,CAAC,EAAE,GAAG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AM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,qIAAqI;aAC9I,CAAC,CAAC;QAEJ,OAAO,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { TRPCError } from '@trpc/server';\nimport { createAuthenticatedProcedure } from './auth'; // Adjust import path!\nimport { AuthEntityType } from '../../auth';\nimport { UserModel } from '../../mongo/models';\n\ninterface PhoneVerifiedOptions {\n\tentityTypes: AuthEntityType[];\n}\n\n/**\n * A factory that creates a procedure requiring a verified phone number,\n * ensuring the user is authenticated and their phone is verified.\n */\nexport function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions) {\n\treturn createAuthenticatedProcedure(options).use(async ({ ctx, next }) => {\n\t\tif (!ctx.entity) {\n\t\t\tthrow new TRPCError({ code: 'UNAUTHORIZED', message: 'User not authenticated' });\n\t\t}\n\n\t\tif (ctx.entity.type == AuthEntityType.CRM) return next({ ctx });\n\n\t\tconst user = await UserModel.findOne({ _id: ctx.entity.id });\n\t\tif (!user) {\n\t\t\tthrow new TRPCError({ code: 'UNAUTHORIZED', message: 'User not found' });\n\t\t}\n\t\tif (!user.isPhoneVerified)\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'FORBIDDEN',\n\t\t\t\tmessage: 'You should verify your phone number to proceed. Go to profile, click on change phone number, enter your phone number and verify it!',\n\t\t\t});\n\n\t\treturn next({ ctx });\n\t});\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -1283,6 +1283,10 @@ export declare enum TournamentParticipantStatus {
|
|
|
1283
1283
|
SEEN = "seen",
|
|
1284
1284
|
NOT_SEEN = "not_seen"
|
|
1285
1285
|
}
|
|
1286
|
+
export declare enum CartType {
|
|
1287
|
+
REGULAR = "regular",
|
|
1288
|
+
SERVICE = "service"
|
|
1289
|
+
}
|
|
1286
1290
|
export declare enum CancellationReschedulingFeeType {
|
|
1287
1291
|
CANCELLATION = "cancellation",
|
|
1288
1292
|
RESCHEDULING = "rescheduling"
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BobType = exports.BobChannelType = exports.BobModel = exports.BobSettlementStatus = exports.BobSettlementType = exports.BobAccountType = exports.ZoneStatus = exports.FaqAccountType = exports.CounterType = exports.BannerUserType = exports.BannerLinkType = exports.BannerClickType = exports.VendorRole = exports.ShopRole = exports.OnlineStatus = exports.ShopOnlineStatus = exports.ChargeType = exports.ClickType = exports.NotificationAccountType = exports.DishCategory = exports.ProductDietaryType = exports.ShopDietaryType = exports.PriceOption = exports.ProductType = exports.CoreAuthIdentityType = exports.UserAppSectionItemType = exports.UserAppSectionType = exports.AdminLogsUpdatedFieldsType = exports.UpdatedField = exports.GeoLocationType = exports.RatingAccountType = exports.SubscriptionStatus = exports.SubscriptionPackage = exports.PaidCurrency = exports.PaymentStatus = exports.ChangeReturnMethod = exports.PaymentMethod = exports.ValueType = exports.HolidayWorkStatus = exports.WorkStatus = exports.WeekDay = exports.GlobalItemType = exports.AdjustmentStatus = exports.ServiceItemType = exports.ItemType = exports.Status = exports.AppPlatform = exports.AccountType = exports.AgentLiveStatus = exports.AuthEntityType = void 0;
|
|
4
4
|
exports.PayoutType = exports.AddRemoveCreditAccountType = exports.SettingsReasonStatus = exports.CancellationReasonTypeEnum = exports.SupportReasonTypeEnum = exports.PlusSettingsPackageType = exports.AddRemoveCreditSettlementType = exports.SettlementType = exports.MediaType = exports.WorkingHourSettingsType = exports.ZoneGeometryType = exports.RiderAssignmentStatus = exports.CourierServiceType = exports.TripLegStatus = exports.DeliveryStatus = exports.CourierOrderPaymentFrom = exports.UserActionReason = exports.UserActionType = exports.ShopCourierOrderStatus = exports.ServiceBookingStatus = exports.CourierOrderStatus = exports.RegularOrderStatus = exports.AdjustmentType = exports.ServiceBookingStatusTimelineType = exports.StatusTimelineType = exports.OrderType = exports.Language = exports.OrderSize = exports.RiderBagSize = exports.RiderType = exports.ShiftType = exports.CreatedBy = exports.RiderAvailability = exports.LiveStatus = exports.PaymentIntentStatus = exports.CardStatus = exports.CardUserType = exports.PaymentProvider = exports.CardType = exports.PaymentPreference = exports.CartStatus = exports.LimitedTimeOfferCampaignStatus = exports.AdminRole = exports.PunchMarketingStatus = exports.MarketingStatus = exports.ServiceMarketingType = exports.MarketingType = exports.FavouriteType = exports.CouponExpirationReason = exports.CouponType = void 0;
|
|
5
5
|
exports.DateFormatType = exports.AppAppearanceType = exports.GraphType = exports.CalendarEventType = exports.CalendarViewType = exports.LyxaTimeZoneEnum = exports.UserOrderCompletionScope = exports.GroupCartNotificationStatus = exports.Currency = exports.RequestFrom = exports.UploadState = exports.SubServiceType = exports.ServiceType = exports.ActionType = exports.DeviceType = exports.PushNotificationEventType = exports.SocketEventType = exports.SocketServiceQueue = exports.OtpMethodType = exports.ReviewType = exports.FoodNutritionType = exports.AdjustmentReason = exports.UrgentOrderReasons = exports.ServiceFlagReasonType = exports.ServiceFlagType = exports.FlagReasonType = exports.FlagType = exports.PromotionType = exports.ServiceBookingCanceledBy = exports.TRPCErrorEnum = exports.ShopFilterSortByEnum = exports.BookingStatus = exports.ProfessionalScheduleType = exports.ServiceBookingRecurrencePattern = exports.ProfessionalRecurrencePattern = exports.ServiceBookingPriority = exports.ProfessionalStatus = exports.Service = exports.ServiceLineItemType = exports.ServiceCartStatus = exports.ChatroomType = exports.UserRef = exports.TicketStatus = exports.TicketType = exports.RewardedToTypeEnum = exports.ReplacementType = exports.ReplacementReason = exports.OrderCanceledBy = exports.LogUser = exports.PayoutStatus = void 0;
|
|
6
|
-
exports.CancellationReschedulingFeeType = exports.TournamentParticipantStatus = exports.TournamentMatchStatus = exports.TournamentScheduledNotificationTarget = exports.TournamentNotificationTag = exports.TournamentProvider = exports.TournamentRewardType = exports.OnlinePaymentStatus = exports.BarcodeTypes = exports.RiderScoreEventTag = exports.AreebaPaymentType = exports.HttpStatus = exports.LogTag = exports.LogLevel = exports.SyncCacheEnumType = void 0;
|
|
6
|
+
exports.CancellationReschedulingFeeType = exports.CartType = exports.TournamentParticipantStatus = exports.TournamentMatchStatus = exports.TournamentScheduledNotificationTarget = exports.TournamentNotificationTag = exports.TournamentProvider = exports.TournamentRewardType = exports.OnlinePaymentStatus = exports.BarcodeTypes = exports.RiderScoreEventTag = exports.AreebaPaymentType = exports.HttpStatus = exports.LogTag = exports.LogLevel = exports.SyncCacheEnumType = void 0;
|
|
7
7
|
var AuthEntityType;
|
|
8
8
|
(function (AuthEntityType) {
|
|
9
9
|
AuthEntityType["USER"] = "USER";
|
|
@@ -1453,6 +1453,11 @@ var TournamentParticipantStatus;
|
|
|
1453
1453
|
TournamentParticipantStatus["SEEN"] = "seen";
|
|
1454
1454
|
TournamentParticipantStatus["NOT_SEEN"] = "not_seen";
|
|
1455
1455
|
})(TournamentParticipantStatus || (exports.TournamentParticipantStatus = TournamentParticipantStatus = {}));
|
|
1456
|
+
var CartType;
|
|
1457
|
+
(function (CartType) {
|
|
1458
|
+
CartType["REGULAR"] = "regular";
|
|
1459
|
+
CartType["SERVICE"] = "service";
|
|
1460
|
+
})(CartType || (exports.CartType = CartType = {}));
|
|
1456
1461
|
var CancellationReschedulingFeeType;
|
|
1457
1462
|
(function (CancellationReschedulingFeeType) {
|
|
1458
1463
|
CancellationReschedulingFeeType["CANCELLATION"] = "cancellation";
|