@lyxa.ai/core 1.4.161-alpha.2 → 1.4.162

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.
Files changed (27) hide show
  1. package/dist/libraries/mongo/models/cart.model.d.ts +3 -4
  2. package/dist/libraries/mongo/models/cart.model.js +17 -11
  3. package/dist/libraries/mongo/models/cart.model.js.map +1 -1
  4. package/dist/libraries/mongo/models/embedded/delivery-charge-setting.model.d.ts +3 -0
  5. package/dist/libraries/mongo/models/embedded/delivery-charge-setting.model.js +6 -0
  6. package/dist/libraries/mongo/models/embedded/delivery-charge-setting.model.js.map +1 -1
  7. package/dist/libraries/mongo/models/service-cart.model.d.ts +9 -7
  8. package/dist/libraries/mongo/models/service-cart.model.js +25 -11
  9. package/dist/libraries/mongo/models/service-cart.model.js.map +1 -1
  10. package/dist/libraries/socket/events/order-actions.socket.event.d.ts +36 -36
  11. package/dist/libraries/trpc/middlewares/auth.d.ts +1 -1
  12. package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +1 -1
  13. package/dist/libraries/trpc/middlewares/phone-verified.d.ts +1 -1
  14. package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +1 -1
  15. package/dist/types/README.md +1 -1
  16. package/dist/types/package.json +1 -1
  17. package/dist/types/utilities/enum.d.ts +0 -4
  18. package/dist/types/utilities/enum.js +1 -6
  19. package/dist/types/utilities/enum.js.map +1 -1
  20. package/dist/types/utilities/validation/common-validation.d.ts +12 -12
  21. package/dist/utilities/enum.d.ts +0 -4
  22. package/dist/utilities/enum.js +1 -6
  23. package/dist/utilities/enum.js.map +1 -1
  24. package/package.json +1 -1
  25. package/dist/libraries/mongo/models/service-cart-v1.model.d.ts +0 -16
  26. package/dist/libraries/mongo/models/service-cart-v1.model.js +0 -65
  27. package/dist/libraries/mongo/models/service-cart-v1.model.js.map +0 -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, CartType, ChargeType, ItemType, PaymentPreference } from '../../../utilities/enum';
5
+ import { CartStatus, 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,13 +19,12 @@ export declare class ShopSnap {
19
19
  }
20
20
  export declare class Cart extends TimeStamps {
21
21
  cartId?: string;
22
- cartType?: CartType;
23
22
  title?: string;
24
23
  exchangeRate?: number;
25
24
  cashbackRate?: number;
26
25
  user: Ref<User>;
27
- parent?: Ref<Parent>;
28
- shop?: Ref<Shop>;
26
+ parent: Ref<Parent>;
27
+ shop: Ref<Shop>;
29
28
  shopSnap?: ShopSnap;
30
29
  isGroupOrder?: boolean;
31
30
  paymentPreference?: PaymentPreference;
@@ -66,7 +66,6 @@ __decorate([
66
66
  ], ShopSnap.prototype, "defaultPreparationTime", void 0);
67
67
  let Cart = class Cart extends defaultClasses_1.TimeStamps {
68
68
  cartId;
69
- cartType;
70
69
  title;
71
70
  exchangeRate;
72
71
  cashbackRate;
@@ -89,10 +88,6 @@ __decorate([
89
88
  (0, typegoose_1.prop)({ type: String, unique: true, index: true }),
90
89
  __metadata("design:type", String)
91
90
  ], 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);
96
91
  __decorate([
97
92
  (0, typegoose_1.prop)({ trim: true, maxlength: 100 }),
98
93
  __metadata("design:type", String)
@@ -110,11 +105,11 @@ __decorate([
110
105
  __metadata("design:type", Object)
111
106
  ], Cart.prototype, "user", void 0);
112
107
  __decorate([
113
- (0, typegoose_1.prop)({ ref: () => parent_model_1.Parent }),
108
+ (0, typegoose_1.prop)({ required: true, ref: () => parent_model_1.Parent }),
114
109
  __metadata("design:type", Object)
115
110
  ], Cart.prototype, "parent", void 0);
116
111
  __decorate([
117
- (0, typegoose_1.prop)({ ref: () => shop_model_1.Shop }),
112
+ (0, typegoose_1.prop)({ required: true, ref: () => shop_model_1.Shop }),
118
113
  __metadata("design:type", Object)
119
114
  ], Cart.prototype, "shop", void 0);
120
115
  __decorate([
@@ -146,7 +141,12 @@ __decorate([
146
141
  __metadata("design:type", Boolean)
147
142
  ], Cart.prototype, "priceChanged", void 0);
148
143
  __decorate([
149
- (0, typegoose_1.prop)({ enum: enum_1.CartStatus, type: String, default: enum_1.CartStatus.ACTIVE, required: true }),
144
+ (0, typegoose_1.prop)({
145
+ enum: enum_1.CartStatus,
146
+ type: String,
147
+ default: enum_1.CartStatus.ACTIVE,
148
+ required: true,
149
+ }),
150
150
  __metadata("design:type", String)
151
151
  ], Cart.prototype, "status", void 0);
152
152
  __decorate([
@@ -163,13 +163,19 @@ __decorate([
163
163
  ], Cart.prototype, "lineItems", void 0);
164
164
  exports.Cart = Cart = __decorate([
165
165
  (0, typegoose_1.modelOptions)({
166
- schemaOptions: { collection: 'carts', toJSON: { virtuals: true }, toObject: { virtuals: true } },
167
- options: { allowMixed: typegoose_1.Severity.ALLOW },
166
+ schemaOptions: {
167
+ collection: 'carts',
168
+ toJSON: { virtuals: true },
169
+ toObject: { virtuals: true },
170
+ },
171
+ options: {
172
+ allowMixed: typegoose_1.Severity.ALLOW,
173
+ },
168
174
  }),
169
175
  (0, typegoose_1.index)({ user: 1 }),
170
176
  (0, typegoose_1.index)({ shop: 1 }),
171
177
  (0, typegoose_1.index)({ status: 1 }),
172
- (0, typegoose_1.index)({ user: 1, shop: 1, vendor: 1 }, {
178
+ (0, typegoose_1.index)({ user: 1, shop: 1 }, {
173
179
  unique: true,
174
180
  partialFilterExpression: {
175
181
  status: { $in: [enum_1.CartStatus.ACTIVE, enum_1.CartStatus.LOCKED] },
@@ -1 +1 @@
1
- {"version":3,"file":"cart.model.js","sourceRo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;uCACiC;eA7DvB,IAAI;IAvBhB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QAChG,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE;KACvC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAClB,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAClB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpB,IAAA,iBAAK,EACL,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAC/B;QACC,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE;YACxB,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,iBAAU,CAAC,MAAM,EAAE,iBAAU,CAAC,MAAM,CAAC,EAAE;YACvD,SAAS,EAAE,IAAI;SACf;KACD,CACD;IACA,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QAEtC,MAAM,0CAAwB,CAAC,IAAI,CAAC,IAAI,EAAE,YAAS,EAAE,QAAQ,CAAC,CAAC;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"]}
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,kDAA8F;AAC9F,0DAAsE;AAEtE,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,IAA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,EAAE,EAAE,GAAG,EAAE,CAAC,iBAAU,CAAC,MAAM,EAAE,iBAAU,CAAC,MAAM,CAAC,EAAE;YACvD,SAAS,EAAE,IAAI;SACf;KACD,CACD;IACA,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QAEtC,MAAM,0CAAwB,CAAC,IAAI,CAAC,IAAI,EAAE,YAAS,EAAE,QAAQ,CAAC,CAAC;QAE/D,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,IAAI,CA4DhB","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, ChargeType, ItemType, PaymentPreference } from '../../../utilities/enum';\nimport { Address, RegularOrderAddress } from './shared/address.model';\nimport { Coupon } from './coupon.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: {\n\t\tcollection: 'carts',\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({ shop: 1 })\n@index({ status: 1 })\n@index(\n\t{ user: 1, shop: 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@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@prop({ required: true, ref: () => Parent })\n\tpublic parent!: Ref<Parent>;\n\n\t@prop({ required: true, 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({\n\t\tenum: CartStatus,\n\t\ttype: String,\n\t\tdefault: CartStatus.ACTIVE,\n\t\trequired: true,\n\t})\n\tpublic status!: CartStatus;\n\n\t@prop({ type: String, trim: true })\n\tpublic couponCode?: string;\n\n\t@prop({\n\t\tref: () => LineItem,\n\t\tforeignField: 'cart',\n\t\tlocalField: '_id',\n\t})\n\tpublic lineItems?: Ref<LineItem>[];\n}\n"]}
@@ -1,3 +1,5 @@
1
+ import { Ref } from '@typegoose/typegoose';
2
+ import { Zone } from '../zone.model';
1
3
  export declare class Charge {
2
4
  from: number;
3
5
  to: number;
@@ -7,4 +9,5 @@ export declare class Charge {
7
9
  export declare class DeliveryCharge {
8
10
  type: string;
9
11
  charges: Charge[];
12
+ zone?: Ref<Zone>;
10
13
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DeliveryCharge = exports.Charge = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
14
  const enum_1 = require("../../../../utilities/enum");
15
+ const zone_model_1 = require("../zone.model");
15
16
  class Charge {
16
17
  from;
17
18
  to;
@@ -38,6 +39,7 @@ __decorate([
38
39
  class DeliveryCharge {
39
40
  type;
40
41
  charges;
42
+ zone;
41
43
  }
42
44
  exports.DeliveryCharge = DeliveryCharge;
43
45
  __decorate([
@@ -48,4 +50,8 @@ __decorate([
48
50
  (0, typegoose_1.prop)({ type: () => [Charge], default: [] }),
49
51
  __metadata("design:type", Array)
50
52
  ], DeliveryCharge.prototype, "charges", void 0);
53
+ __decorate([
54
+ (0, typegoose_1.prop)({ ref: () => zone_model_1.Zone }),
55
+ __metadata("design:type", Object)
56
+ ], DeliveryCharge.prototype, "zone", void 0);
51
57
  //# sourceMappingURL=delivery-charge-setting.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"delivery-charge-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/delivery-charge-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAAuD;AAEvD,MAAa,MAAM;IAEX,IAAI,CAAU;IAGd,EAAE,CAAU;IAGZ,MAAM,CAAU;IAGhB,QAAQ,CAAU;CACzB;AAZD,wBAYC;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;oCAC1B;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;kCAC5B;AAGZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;sCACxB;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;wCACtB;AAG1B,MAAa,cAAc;IAE1B,IAAI,CAAS;IAGb,OAAO,CAAU;CACjB;AAND,wCAMC;AAJA;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,OAAO,EAAE,gBAAS,CAAC,OAAO,EAAE,CAAC;;4CACvD;AAGb;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;+CAC3B","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { OrderType } from '../../../../utilities/enum';\n\nexport class Charge {\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic from!: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic to!: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic charge!: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic riderCut!: number;\n}\n\nexport class DeliveryCharge {\n\t@prop({ type: String, enum: OrderType, default: OrderType.REGULAR })\n\ttype: string;\n\n\t@prop({ type: () => [Charge], default: [] })\n\tcharges: Charge[]\n}\n"]}
1
+ {"version":3,"file":"delivery-charge-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/delivery-charge-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAuD;AACvD,8CAAqC;AAErC,MAAa,MAAM;IAEX,IAAI,CAAU;IAGd,EAAE,CAAU;IAGZ,MAAM,CAAU;IAGhB,QAAQ,CAAU;CACzB;AAZD,wBAYC;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;oCAC1B;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;kCAC5B;AAGZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;sCACxB;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;wCACtB;AAG1B,MAAa,cAAc;IAEnB,IAAI,CAAS;IAGb,OAAO,CAAW;IAGlB,IAAI,CAAa;CACxB;AATD,wCASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,OAAO,EAAE,gBAAS,CAAC,OAAO,EAAE,CAAC;;4CAChD;AAGb;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;+CACnB;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;4CACF","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { OrderType } from '../../../../utilities/enum';\nimport { Zone } from '../zone.model';\n\nexport class Charge {\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic from!: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic to!: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic charge!: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic riderCut!: number;\n}\n\nexport class DeliveryCharge {\n\t@prop({ type: String, enum: OrderType, default: OrderType.REGULAR })\n\tpublic type: string;\n\n\t@prop({ type: () => [Charge], default: [] })\n\tpublic charges: Charge[];\n\n\t@prop({ ref: () => Zone })\n\tpublic zone?: Ref<Zone>;\n}\n"]}
@@ -1,14 +1,16 @@
1
1
  import { Ref } from '@typegoose/typegoose';
2
+ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
+ import { User } from './user.model';
2
4
  import { Vendor } from './vendor.model';
3
- import { CartType, ServiceType, SubServiceType } from '../../../utilities/enum';
5
+ import { ServiceCartStatus, ServiceType, SubServiceType } from '../../../utilities/enum';
4
6
  import { ServiceLineItem } from './embedded/service-line-item.model';
5
7
  import { OrderSlotRange } from './shared/duration.model';
6
- import { Cart } from './cart.model';
7
- export declare class ServiceCart extends Cart {
8
- cartType?: CartType;
9
- vendor?: Ref<Vendor>;
10
- serviceType?: ServiceType;
8
+ export declare class ServiceCart extends TimeStamps {
9
+ user: Ref<User>;
10
+ vendor: Ref<Vendor>;
11
+ serviceType: ServiceType;
11
12
  subServiceType?: SubServiceType;
12
- serviceLineItems?: ServiceLineItem[];
13
+ status?: ServiceCartStatus;
14
+ lineItems: ServiceLineItem[];
13
15
  slotRange?: OrderSlotRange;
14
16
  }
@@ -11,29 +11,32 @@ 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");
14
16
  const vendor_model_1 = require("./vendor.model");
15
17
  const enum_1 = require("../../../utilities/enum");
16
18
  const service_line_item_model_1 = require("./embedded/service-line-item.model");
17
19
  const duration_model_1 = require("./shared/duration.model");
18
- const cart_model_1 = require("./cart.model");
19
- class ServiceCart extends cart_model_1.Cart {
20
+ let ServiceCart = class ServiceCart extends defaultClasses_1.TimeStamps {
21
+ user;
20
22
  vendor;
21
23
  serviceType;
22
24
  subServiceType;
23
- serviceLineItems;
25
+ status;
26
+ lineItems;
24
27
  slotRange;
25
- }
28
+ };
26
29
  exports.ServiceCart = ServiceCart;
27
30
  __decorate([
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);
31
+ (0, typegoose_1.prop)({ required: true, ref: () => user_model_1.User }),
32
+ __metadata("design:type", Object)
33
+ ], ServiceCart.prototype, "user", void 0);
31
34
  __decorate([
32
- (0, typegoose_1.prop)({ ref: () => vendor_model_1.Vendor }),
35
+ (0, typegoose_1.prop)({ required: true, ref: () => vendor_model_1.Vendor }),
33
36
  __metadata("design:type", Object)
34
37
  ], ServiceCart.prototype, "vendor", void 0);
35
38
  __decorate([
36
- (0, typegoose_1.prop)({ type: String, enum: enum_1.ServiceType }),
39
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceType }),
37
40
  __metadata("design:type", String)
38
41
  ], ServiceCart.prototype, "serviceType", void 0);
39
42
  __decorate([
@@ -41,11 +44,22 @@ __decorate([
41
44
  __metadata("design:type", String)
42
45
  ], ServiceCart.prototype, "subServiceType", void 0);
43
46
  __decorate([
44
- (0, typegoose_1.prop)({ type: [service_line_item_model_1.ServiceLineItem] }),
47
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.ServiceCartStatus, default: enum_1.ServiceCartStatus.ACTIVE }),
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] }),
45
52
  __metadata("design:type", Array)
46
- ], ServiceCart.prototype, "serviceLineItems", void 0);
53
+ ], ServiceCart.prototype, "lineItems", void 0);
47
54
  __decorate([
48
55
  (0, typegoose_1.prop)({ type: duration_model_1.OrderSlotRange, _id: false }),
49
56
  __metadata("design:type", duration_model_1.OrderSlotRange)
50
57
  ], 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);
51
65
  //# 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,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"]}
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,kDAAyF;AACzF,gFAAqE;AACrE,4DAAyD;AAUlD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,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AK,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,WAAW,CAqBvB","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 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, 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"]}
@@ -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;
47
44
  secondaryTotal: number;
48
45
  paidAmount: number;
49
46
  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;
56
53
  secondaryTotal: number;
57
54
  paidAmount: number;
58
55
  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;
68
65
  secondaryTotal: number;
69
66
  paidAmount: number;
70
67
  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;
81
78
  secondaryTotal: number;
82
79
  paidAmount: number;
83
80
  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;
109
106
  secondaryTotal: number;
110
107
  paidAmount: number;
111
108
  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;
138
135
  secondaryTotal: number;
139
136
  paidAmount: number;
140
137
  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;
191
188
  secondaryTotal: number;
192
189
  paidAmount: number;
193
190
  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;
200
197
  secondaryTotal: number;
201
198
  paidAmount: number;
202
199
  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;
212
209
  secondaryTotal: number;
213
210
  paidAmount: number;
214
211
  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;
225
222
  secondaryTotal: number;
226
223
  paidAmount: number;
227
224
  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;
253
250
  secondaryTotal: number;
254
251
  paidAmount: number;
255
252
  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;
282
279
  secondaryTotal: number;
283
280
  paidAmount: number;
284
281
  secondaryPaidAmount: number;
282
+ riderTips: number;
283
+ secondaryDeliveryFee: number;
284
+ secondaryRiderTips: number;
285
285
  };
286
286
  shopProfit: number;
287
287
  };
@@ -5,9 +5,9 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
+ req: import("http").IncomingMessage;
8
9
  res: import("http").ServerResponse<import("http").IncomingMessage>;
9
10
  tokenType: TokenType | undefined;
10
- req: import("http").IncomingMessage;
11
11
  requestId: string | undefined;
12
12
  entity: import("../context").EntityContext | undefined;
13
13
  usedRefreshToken: boolean | undefined;
@@ -4,9 +4,9 @@ interface RoleProtectedOptions {
4
4
  allowedRoles: string[];
5
5
  }
6
6
  export declare function createRoleProtectedProcedure(options: RoleProtectedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
7
+ req: import("http").IncomingMessage;
7
8
  res: import("http").ServerResponse<import("http").IncomingMessage>;
8
9
  tokenType: import("../../auth").TokenType | undefined;
9
- req: import("http").IncomingMessage;
10
10
  requestId: string | undefined;
11
11
  entity: import("../context").EntityContext | undefined;
12
12
  usedRefreshToken: boolean | undefined;
@@ -3,9 +3,9 @@ interface PhoneVerifiedOptions {
3
3
  entityTypes: AuthEntityType[];
4
4
  }
5
5
  export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
6
+ req: import("http").IncomingMessage;
6
7
  res: import("http").ServerResponse<import("http").IncomingMessage>;
7
8
  tokenType: import("../../auth").TokenType | undefined;
8
- req: import("http").IncomingMessage;
9
9
  requestId: string | undefined;
10
10
  entity: import("../context").EntityContext | undefined;
11
11
  usedRefreshToken: boolean | undefined;
@@ -5,9 +5,9 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
+ req: import("http").IncomingMessage;
8
9
  res: import("http").ServerResponse<import("http").IncomingMessage>;
9
10
  tokenType: TokenType | undefined;
10
- req: import("http").IncomingMessage;
11
11
  requestId: string | undefined;
12
12
  entity: import("../context").EntityContext | undefined;
13
13
  usedRefreshToken: boolean | undefined;
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.161-alpha.2
25
+ Version: 1.4.162
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.4.161-alpha.2",
3
+ "version": "1.4.162",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -1282,7 +1282,3 @@ export declare enum TournamentParticipantStatus {
1282
1282
  SEEN = "seen",
1283
1283
  NOT_SEEN = "not_seen"
1284
1284
  }
1285
- export declare enum CartType {
1286
- REGULAR = "regular",
1287
- SERVICE = "service"
1288
- }
@@ -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.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;
6
+ 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";
@@ -1452,9 +1452,4 @@ var TournamentParticipantStatus;
1452
1452
  TournamentParticipantStatus["SEEN"] = "seen";
1453
1453
  TournamentParticipantStatus["NOT_SEEN"] = "not_seen";
1454
1454
  })(TournamentParticipantStatus || (exports.TournamentParticipantStatus = TournamentParticipantStatus = {}));
1455
- var CartType;
1456
- (function (CartType) {
1457
- CartType["REGULAR"] = "regular";
1458
- CartType["SERVICE"] = "service";
1459
- })(CartType || (exports.CartType = CartType = {}));
1460
1455
  //# sourceMappingURL=enum.js.map