@lyxa.ai/core 1.0.290 → 1.0.292
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 +1 -2
- package/dist/libraries/mongo/models/cart.model.js +4 -5
- package/dist/libraries/mongo/models/cart.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-package.model.d.ts +2 -0
- package/dist/libraries/mongo/models/service-package.model.js +6 -0
- package/dist/libraries/mongo/models/service-package.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.d.ts +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,6 @@ import { Shop } from './shop.model';
|
|
|
3
3
|
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
4
4
|
import { CartStatus, PaymentPreference } from '../../../utilities/enum';
|
|
5
5
|
import { RegularOrderAddress } from './shared/address.model';
|
|
6
|
-
import { Coupon } from './coupon.model';
|
|
7
6
|
import { User } from './user.model';
|
|
8
7
|
import { LineItem } from './line-item.model';
|
|
9
8
|
export declare class Cart extends TimeStamps {
|
|
@@ -17,6 +16,6 @@ export declare class Cart extends TimeStamps {
|
|
|
17
16
|
spendingLimitForGuest?: number;
|
|
18
17
|
secondarySpendingLimitForGuest?: number;
|
|
19
18
|
status: CartStatus;
|
|
20
|
-
|
|
19
|
+
couponCode?: string;
|
|
21
20
|
lineItems: Ref<LineItem>[];
|
|
22
21
|
}
|
|
@@ -15,7 +15,6 @@ const shop_model_1 = require("./shop.model");
|
|
|
15
15
|
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
16
16
|
const enum_1 = require("../../../utilities/enum");
|
|
17
17
|
const address_model_1 = require("./shared/address.model");
|
|
18
|
-
const coupon_model_1 = require("./coupon.model");
|
|
19
18
|
const user_model_1 = require("./user.model");
|
|
20
19
|
const line_item_model_1 = require("./line-item.model");
|
|
21
20
|
const uniqueIdHooks_1 = require("../utilities/uniqueIdHooks");
|
|
@@ -31,7 +30,7 @@ let Cart = class Cart extends defaultClasses_1.TimeStamps {
|
|
|
31
30
|
spendingLimitForGuest;
|
|
32
31
|
secondarySpendingLimitForGuest;
|
|
33
32
|
status;
|
|
34
|
-
|
|
33
|
+
couponCode;
|
|
35
34
|
lineItems;
|
|
36
35
|
};
|
|
37
36
|
exports.Cart = Cart;
|
|
@@ -81,9 +80,9 @@ __decorate([
|
|
|
81
80
|
__metadata("design:type", String)
|
|
82
81
|
], Cart.prototype, "status", void 0);
|
|
83
82
|
__decorate([
|
|
84
|
-
(0, typegoose_1.prop)({
|
|
85
|
-
__metadata("design:type",
|
|
86
|
-
], Cart.prototype, "
|
|
83
|
+
(0, typegoose_1.prop)({ type: String, trim: true }),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], Cart.prototype, "couponCode", void 0);
|
|
87
86
|
__decorate([
|
|
88
87
|
(0, typegoose_1.prop)({
|
|
89
88
|
ref: () => line_item_model_1.LineItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,6CAAoC;AACpC,4EAAqE;AACrE,kDAAwE;AACxE,0DAA6D;
|
|
1
|
+
{"version":3,"file":"cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,6CAAoC;AACpC,4EAAqE;AACrE,kDAAwE;AACxE,0DAA6D;AAE7D,6CAAoC;AACpC,uDAA6C;AAC7C,8DAAsE;AACtE,wBAA8B;AAgCvB,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,MAAM,CAAS;IAGf,KAAK,CAAU;IAGf,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,eAAe,CAAuB;IAGtC,YAAY,CAAW;I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EAAE,YAAS,EAAE,QAAQ,CAAC,CAAC;QAE/D,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,IAAI,CA6ChB","sourcesContent":["import { prop, Ref, index, modelOptions, Severity, pre } from '@typegoose/typegoose';\nimport { Shop } from './shop.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CartStatus, PaymentPreference } from '../../../utilities/enum';\nimport { 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/uniqueIdHooks';\nimport { CartModel } from '.';\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({ slug: 1 }, { unique: true, sparse: true })\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({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ required: false, type: RegularOrderAddress })\n\tpublic deliveryAddress?: RegularOrderAddress;\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({\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"]}
|
|
@@ -3,9 +3,11 @@ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
|
3
3
|
import { Status } from '../../../utilities/enum';
|
|
4
4
|
import { Vendor } from './vendor.model';
|
|
5
5
|
import { ServiceCategory } from './service-category.model';
|
|
6
|
+
import { Service } from "./service.model";
|
|
6
7
|
export declare class ServicePackage extends TimeStamps {
|
|
7
8
|
name: string;
|
|
8
9
|
vendor: Ref<Vendor>;
|
|
10
|
+
service: Ref<Service>;
|
|
9
11
|
category: Ref<ServiceCategory>;
|
|
10
12
|
price: number;
|
|
11
13
|
secondaryPrice: number;
|
|
@@ -15,9 +15,11 @@ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
|
15
15
|
const enum_1 = require("../../../utilities/enum");
|
|
16
16
|
const vendor_model_1 = require("./vendor.model");
|
|
17
17
|
const service_category_model_1 = require("./service-category.model");
|
|
18
|
+
const service_model_1 = require("./service.model");
|
|
18
19
|
let ServicePackage = class ServicePackage extends defaultClasses_1.TimeStamps {
|
|
19
20
|
name;
|
|
20
21
|
vendor;
|
|
22
|
+
service;
|
|
21
23
|
category;
|
|
22
24
|
price;
|
|
23
25
|
secondaryPrice;
|
|
@@ -40,6 +42,10 @@ __decorate([
|
|
|
40
42
|
(0, typegoose_1.prop)({ required: true, ref: () => vendor_model_1.Vendor }),
|
|
41
43
|
__metadata("design:type", Object)
|
|
42
44
|
], ServicePackage.prototype, "vendor", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typegoose_1.prop)({ required: true, ref: () => service_model_1.Service }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], ServicePackage.prototype, "service", void 0);
|
|
43
49
|
__decorate([
|
|
44
50
|
(0, typegoose_1.prop)({ required: true, ref: () => service_category_model_1.ServiceCategory }),
|
|
45
51
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,kDAAiD;AACjD,iDAAwC;AACxC,qEAA2D;
|
|
1
|
+
{"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,kDAAiD;AACjD,iDAAwC;AACxC,qEAA2D;AAC3D,mDAA0C;AAOnC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEnC,IAAI,CAAU;IAGd,MAAM,CAAe;IAGrB,OAAO,CAAc;IAGrB,QAAQ,CAAwB;IAGhC,KAAK,CAAU;IAGf,cAAc,CAAU;IAGxB,QAAQ,CAAU;IAGlB,qBAAqB,CAAU;IAG/B,WAAW,CAAU;IAGrB,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,MAAM,CAAyB;IAG/B,MAAM,CAAU;IAGhB,gBAAgB,CAAW;IAG3B,aAAa,CAAU;CACjC,CAAA;AA7CY,wCAAc;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;4CAC7C;AAGd;IADN,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CAAC,MAAM,CAAC,EAAE,CAAC;;8CAC3B;AAG/B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;8CACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;wDACN;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;qDACb;yBA5CrB,cAAc;IAL1B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;IACpF,IAAA,iBAAK,EACF,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACtB,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CACjE;GACY,cAAc,CA6C1B","sourcesContent":["import { Index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { ServiceCategory } from './service-category.model';\nimport { Service } from \"./service.model\";\n\n@modelOptions({ schemaOptions: { collection: 'servicePackages', timestamps: true } })\n@Index(\n { name: 1, vendor: 1 },\n { unique: true, partialFilterExpression: { deletedAt: null } }\n)\nexport class ServicePackage extends TimeStamps {\n @prop({ required: true, type: String, trim: true, maxlength: 20 })\n public name!: string;\n\n @prop({ required: true, ref: () => Vendor })\n public vendor!: Ref<Vendor>;\n\n @prop({ required: true, ref: () => Service })\n public service: Ref<Service>\n\n @prop({ required: true, ref: () => ServiceCategory })\n public category!: Ref<ServiceCategory>;\n\n @prop({ required: true, type: Number, min: 1 })\n public price!: number;\n\n @prop({ required: true, type: Number, min: 1 })\n public secondaryPrice!: number;\n\n @prop({ required: true, type: Number, min: 0 })\n public duration!: number; // in hours\n\n @prop({ required: true, type: Number, min: 1 })\n public numberOfProfessionals!: number;\n\n @prop({ type: String, trim: true })\n public description?: string;\n\n @prop({ type: String })\n public image!: string;\n\n @prop({ type: String, maxlength: 250})\n public vendorNotes?: string;\n\n @prop({ ref: () => ServicePackage, default: [], type: [String] })\n public addons?: Ref<ServicePackage>[];\n\n @prop({ type: String, enum: Status, default: Status.ACTIVE })\n public status?: Status;\n\n @prop({ type: Boolean, default: false })\n public includeMaterials!: boolean;\n\n @prop({ type: Number, default: 0, min: 0 })\n public materialsCost?: number;\n}\n\n"]}
|
|
@@ -31,7 +31,7 @@ export declare class User extends TimeStamps {
|
|
|
31
31
|
isPhoneVerified?: boolean;
|
|
32
32
|
onlineStatus?: OnlineStatus;
|
|
33
33
|
fcmTokens?: string[];
|
|
34
|
-
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject> & Omit<User & {
|
|
34
|
+
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject, {}> & Omit<User & {
|
|
35
35
|
_id: import("mongoose").Types.ObjectId;
|
|
36
36
|
} & {
|
|
37
37
|
__v: number;
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED