@lyxa.ai/core 1.3.91 → 1.3.93
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/addon.model.d.ts +1 -0
- package/dist/libraries/mongo/models/addon.model.js +5 -0
- package/dist/libraries/mongo/models/addon.model.js.map +1 -1
- package/dist/libraries/mongo/models/core-user.model.d.ts +1 -0
- package/dist/libraries/mongo/models/core-user.model.js +12 -0
- package/dist/libraries/mongo/models/core-user.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.d.ts +0 -1
- package/dist/libraries/mongo/models/user.model.js +0 -12
- package/dist/libraries/mongo/models/user.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ let AddOn = class AddOn {
|
|
|
27
27
|
minutes;
|
|
28
28
|
description;
|
|
29
29
|
status;
|
|
30
|
+
isVisible;
|
|
30
31
|
};
|
|
31
32
|
exports.AddOn = AddOn;
|
|
32
33
|
__decorate([
|
|
@@ -93,6 +94,10 @@ __decorate([
|
|
|
93
94
|
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
94
95
|
__metadata("design:type", String)
|
|
95
96
|
], AddOn.prototype, "status", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typegoose_1.prop)({ type: Boolean, deafult: true }),
|
|
99
|
+
__metadata("design:type", Boolean)
|
|
100
|
+
], AddOn.prototype, "isVisible", void 0);
|
|
96
101
|
exports.AddOn = AddOn = __decorate([
|
|
97
102
|
(0, typegoose_1.modelOptions)({
|
|
98
103
|
schemaOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/addon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAK8B;AAC9B,wDAAgC;AAChC,mCAA0C;AAC1C,kDAA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AAOf;IALN,IAAA,gBAAI,EAAC;QACF,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,CAAC;KACT,CAAC;;oCACoB;AAOf;IALN,IAAA,gBAAI,EAAC;QACF,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,CAAC;KACT,CAAC;;oCACoB;AAQf;IANN,IAAA,gBAAI,EAAC;QACF,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;KACV,CAAC;;sCACsB;AAMjB;IAJN,IAAA,gBAAI,EAAC;QACF,SAAS,EAAE,GAAG;QACd,IAAI,EAAE,IAAI;KACb,CAAC;;0CAC0B;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;qCACvC;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;wCACd;gBAzDhB,KAAK;IAPjB,IAAA,wBAAY,EAAC;QACV,aAAa,EAAE;YACX,UAAU,EAAE,QAAQ;YACpB,UAAU,EAAE,IAAI;SACnB;KACJ,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;GACrC,KAAK,CA2DjB","sourcesContent":["import {\n prop,\n modelOptions,\n Ref,\n index,\n} from \"@typegoose/typegoose\";\nimport mongoose from \"mongoose\";\nimport { Service, Vendor } from \"./index\";\nimport { Status } from \"../../../utilities/enum\";\n\n\n@modelOptions({\n schemaOptions: {\n collection: \"addons\",\n timestamps: true,\n },\n})\n@index({ name: 1, service: 1 }, { unique: false })\nexport class AddOn {\n @prop({ required: true, trim: true })\n public name!: string;\n\n @prop({\n required: true,\n type: () => [mongoose.Types.ObjectId],\n ref: () => Service,\n })\n public service!: Ref<Service>[];\n\n @prop({\n required: true,\n type: () => mongoose.Types.ObjectId,\n ref: () => Vendor,\n })\n public vendor!: Ref<Vendor>;\n\n @prop({\n required: true,\n type: String,\n trim: true,\n })\n public image!: string; // store URL or path\n\n @prop({\n required: true,\n type: Number,\n min: 0,\n })\n public price!: number;\n\n @prop({\n required: true,\n type: Number,\n min: 0,\n })\n public hours!: number;\n\n @prop({\n required: true,\n type: Number,\n min: 0,\n max: 59,\n })\n public minutes!: number;\n\n @prop({\n maxlength: 250,\n trim: true,\n })\n public description?: string;\n\n @prop({ type: String, enum: Status, default: Status.ACTIVE })\n public status: Status;\n\n @prop({ type: Boolean, deafult: true })\n public isVisible: boolean\n\n}\n"]}
|
|
@@ -2,6 +2,7 @@ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
|
2
2
|
import { Status } from '../../../utilities/enum';
|
|
3
3
|
import { ResetPasswordFields } from './embedded/rest-password.model';
|
|
4
4
|
export declare class CoreUser extends TimeStamps {
|
|
5
|
+
userId: string;
|
|
5
6
|
name: string;
|
|
6
7
|
email: string;
|
|
7
8
|
gender?: string;
|
|
@@ -14,7 +14,10 @@ const typegoose_1 = require("@typegoose/typegoose");
|
|
|
14
14
|
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
15
|
const enum_1 = require("../../../utilities/enum");
|
|
16
16
|
const rest_password_model_1 = require("./embedded/rest-password.model");
|
|
17
|
+
const id_generator_1 = require("../../../utilities/id-generator");
|
|
18
|
+
const _1 = require(".");
|
|
17
19
|
let CoreUser = class CoreUser extends defaultClasses_1.TimeStamps {
|
|
20
|
+
userId;
|
|
18
21
|
name;
|
|
19
22
|
email;
|
|
20
23
|
gender;
|
|
@@ -27,6 +30,10 @@ let CoreUser = class CoreUser extends defaultClasses_1.TimeStamps {
|
|
|
27
30
|
resetPassword;
|
|
28
31
|
};
|
|
29
32
|
exports.CoreUser = CoreUser;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typegoose_1.prop)({ type: String, unique: true }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CoreUser.prototype, "userId", void 0);
|
|
30
37
|
__decorate([
|
|
31
38
|
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
32
39
|
__metadata("design:type", String)
|
|
@@ -68,6 +75,11 @@ __decorate([
|
|
|
68
75
|
__metadata("design:type", rest_password_model_1.ResetPasswordFields)
|
|
69
76
|
], CoreUser.prototype, "resetPassword", void 0);
|
|
70
77
|
exports.CoreUser = CoreUser = __decorate([
|
|
78
|
+
(0, typegoose_1.pre)('save', async function () {
|
|
79
|
+
if (this.isNew) {
|
|
80
|
+
this.userId = await (0, id_generator_1.generateId)(_1.CounterModel, enum_1.CounterType.USER);
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
71
83
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'coreUsers' } })
|
|
72
84
|
], CoreUser);
|
|
73
85
|
//# sourceMappingURL=core-user.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/core-user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"core-user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/core-user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAA8D;AAC9D,wEAAqE;AACrE,kEAA6D;AAC7D,wBAAiC;AAQ1B,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,MAAM,CAAS;IAGf,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,GAAG,CAAQ;IAGX,WAAW,CAAU;IAGrB,YAAY,CAAU;IAGtB,MAAM,CAAU;IAGhB,gBAAgB,CAAU;I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AC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,IAAI,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC;IACD,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,CAAC;GAChD,QAAQ,CAiCpB","sourcesContent":["import { modelOptions, pre, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CounterType, Status } from '../../../utilities/enum';\nimport { ResetPasswordFields } from './embedded/rest-password.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\n\n@pre<CoreUser>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.userId = await generateId(CounterModel, CounterType.USER);\n\t}\n})\n@modelOptions({ schemaOptions: { collection: 'coreUsers' } })\nexport class CoreUser extends TimeStamps {\n\t@prop({ type: String, unique: true })\n\tpublic userId: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: false, type: String })\n\tpublic gender?: string;\n\n\t@prop({ required: false, type: Date })\n\tpublic dob?: Date;\n\n\t@prop({ required: true, type: String })\n\tpublic countryISO2!: string;\n\n\t@prop({ type: String })\n\tpublic profilePhoto?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String })\n\tpublic stripeCustomerId?: string;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic rewardPoints?: number;\n\n\t@prop({ type: ResetPasswordFields })\n\tpublic resetPassword?: ResetPasswordFields;\n}\n"]}
|
|
@@ -12,7 +12,6 @@ import { GeoLocation } from './shared/geo-location.model';
|
|
|
12
12
|
import { Wallet } from './embedded/wallet.model';
|
|
13
13
|
export declare class User extends TimeStamps {
|
|
14
14
|
coreUser: Ref<CoreUser>;
|
|
15
|
-
userId: string;
|
|
16
15
|
deviceId?: string;
|
|
17
16
|
favoriteProducts?: Ref<Product>[];
|
|
18
17
|
favoriteShops?: Ref<Shop>[];
|
|
@@ -22,12 +22,9 @@ const subscription_model_1 = require("./subscription.model");
|
|
|
22
22
|
const enum_1 = require("../../../utilities/enum");
|
|
23
23
|
const otp_fields_model_1 = require("./embedded/otp-fields.model");
|
|
24
24
|
const geo_location_model_1 = require("./shared/geo-location.model");
|
|
25
|
-
const id_generator_1 = require("../../../utilities/id-generator");
|
|
26
|
-
const _1 = require(".");
|
|
27
25
|
const wallet_model_1 = require("./embedded/wallet.model");
|
|
28
26
|
let User = User_1 = class User extends defaultClasses_1.TimeStamps {
|
|
29
27
|
coreUser;
|
|
30
|
-
userId;
|
|
31
28
|
deviceId;
|
|
32
29
|
favoriteProducts;
|
|
33
30
|
favoriteShops;
|
|
@@ -58,10 +55,6 @@ __decorate([
|
|
|
58
55
|
(0, typegoose_1.prop)({ required: true, ref: () => core_user_model_1.CoreUser }),
|
|
59
56
|
__metadata("design:type", Object)
|
|
60
57
|
], User.prototype, "coreUser", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, typegoose_1.prop)({ type: String, unique: true }),
|
|
63
|
-
__metadata("design:type", String)
|
|
64
|
-
], User.prototype, "userId", void 0);
|
|
65
58
|
__decorate([
|
|
66
59
|
(0, typegoose_1.prop)({ type: () => String }),
|
|
67
60
|
__metadata("design:type", String)
|
|
@@ -151,11 +144,6 @@ __decorate([
|
|
|
151
144
|
__metadata("design:type", wallet_model_1.Wallet)
|
|
152
145
|
], User.prototype, "wallet", void 0);
|
|
153
146
|
exports.User = User = User_1 = __decorate([
|
|
154
|
-
(0, typegoose_1.pre)('save', async function () {
|
|
155
|
-
if (this.isNew) {
|
|
156
|
-
this.userId = await (0, id_generator_1.generateId)(_1.CounterModel, enum_1.CounterType.USER);
|
|
157
|
-
}
|
|
158
|
-
}),
|
|
159
147
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'users' } }),
|
|
160
148
|
(0, typegoose_1.index)({ location: '2dsphere' }),
|
|
161
149
|
(0, typegoose_1.index)({ createdAt: 1, addresses: 1 })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oDAA4F;AAC5F,4EAAqE;AACrE,uDAA6C;AAC7C,mDAA0C;AAC1C,6CAAoC;AACpC,0DAAqD;AACrD,iDAAwC;AACxC,6DAAoD;AACpD,kDAAoE;AACpE,kEAAwD;AACxD,oEAA0D;
|
|
1
|
+
{"version":3,"file":"user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oDAA4F;AAC5F,4EAAqE;AACrE,uDAA6C;AAC7C,mDAA0C;AAC1C,6CAAoC;AACpC,0DAAqD;AACrD,iDAAwC;AACxC,6DAAoD;AACpD,kDAAoE;AACpE,kEAAwD;AACxD,oEAA0D;AAG1D,0DAAiD;AAM1C,IAAM,IAAI,YAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,QAAQ,CAAiB;IAGzB,QAAQ,CAAU;IAGlB,gBAAgB,CAAkB;IAGlC,aAAa,CAAe;IAG5B,SAAS,CAAiB;IAG1B,QAAQ,CAAe;IAGvB,cAAc,CAAU;IAGxB,eAAe,CAAQ;IAGvB,OAAO,CAAiB;IAGxB,yBAAyB,CAAU;IAGnC,kBAAkB,CAAU;IAG5B,iCAAiC,CAAU;IAG3C,qBAAqB,CAAW;IAGhC,YAAY,CAAe;IAG3B,YAAY,CAAqB;IAGjC,YAAY,CAAW;IAGvB,WAAW,CAAU;IAGrB,YAAY,CAAa;IAGzB,eAAe,CAAW;IAO1B,YAAY,CAAgB;IAG5B,SAAS,CAAY;IAGrB,MAAM,CAAU;IAEhB,MAAM,CAAC,KAAK,CAAC,YAAY,CAE/B,MAAc,EACd,IAAI,GA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CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;uCAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,qBAAM,EAAE,CAAC;8BACP,qBAAM;oCAAC;eArEX,IAAI;IAHhB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;IACxD,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC/B,IAAA,iBAAK,EAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;GACzB,IAAI,CAmFhB","sourcesContent":["import { index, modelOptions, pre, prop, Ref, ReturnModelType } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CoreUser } from './core-user.model';\nimport { Product } from './product.model';\nimport { Shop } from './shop.model';\nimport { UserAddress } from './shared/address.model';\nimport { Coupon } from './coupon.model';\nimport { Subscription } from './subscription.model';\nimport { CounterType, OnlineStatus } from '../../../utilities/enum';\nimport { OTPFields } from './embedded/otp-fields.model';\nimport { GeoLocation } from './shared/geo-location.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\nimport { Wallet } from './embedded/wallet.model';\n\n\n@modelOptions({ schemaOptions: { collection: 'users' } })\n@index({ location: '2dsphere' })\n@index({ createdAt: 1, addresses: 1 })\nexport class User extends TimeStamps {\n\t@prop({ required: true, ref: () => CoreUser })\n\tpublic coreUser!: Ref<CoreUser>;\n\n\t@prop({ type: () => String })\n\tpublic deviceId?: string;\n\n\t@prop({ type: () => [String], ref: () => Product })\n\tpublic favoriteProducts?: Ref<Product>[];\n\n\t@prop({ type: () => [String], ref: () => Shop })\n\tpublic favoriteShops?: Ref<Shop>[];\n\n\t@prop({ type: () => [UserAddress], default: [] })\n\tpublic addresses?: UserAddress[];\n\n\t@prop({ type: GeoLocation }) // Last order location for finding user zone\n\tpublic location?: GeoLocation;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic orderCompleted?: number;\n\n\t@prop({ type: Date })\n\tpublic repeatedOrderAt?: Date;\n\n\t@prop({ ref: () => Coupon })\n\tpublic coupons?: Ref<Coupon>[];\n\n\t@prop({ type: String })\n\tpublic newUserCouponDiscountType?: string;\n\n\t@prop({ type: Number })\n\tpublic newUserCouponValue?: number;\n\n\t@prop({ type: Number })\n\tpublic newUserCouponMaximumDiscountLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isNewUserCouponShowed?: boolean;\n\n\t@prop({ ref: () => Coupon })\n\tpublic referralCode?: Ref<Coupon>;\n\n\t@prop({ type: String, ref: () => Subscription })\n\tpublic subscription?: Ref<Subscription>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSubscribed?: boolean;\n\n\t@prop({ type: String, unique: true, sparse: true })\n\tpublic phoneNumber?: string;\n\n\t@prop({ type: () => OTPFields })\n\tpublic phoneOtpInfo?: OTPFields;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isPhoneVerified?: boolean;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: OnlineStatus,\n\t\tdefault: OnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: OnlineStatus;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: Wallet })\n\tpublic wallet?: Wallet;\n\n\tpublic static async updateWallet(\n\t\tthis: ReturnModelType<typeof User>,\n\t\tuserId: string,\n\t\tmain = 0,\n\t\treserve = 0\n\t) {\n\t\treturn this.findByIdAndUpdate(\n\t\t\tuserId,\n\t\t\t{ $inc: { 'wallet.main': main, 'wallet.reserve': reserve, 'wallet.total': main + reserve } },\n\t\t\t{ new: true }\n\t\t);\n\t}\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED