@lyxa.ai/core 1.2.81 → 1.2.82
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.
|
@@ -10,6 +10,7 @@ import { OnlineStatus } from '../../../utilities/enum';
|
|
|
10
10
|
import { OTPFields } from './embedded/otp-fields.model';
|
|
11
11
|
import { GeoLocation } from './shared/geo-location.model';
|
|
12
12
|
import { Wallet } from './embedded/wallet.model';
|
|
13
|
+
import { ResetPasswordFields } from './embedded/rest-password.model';
|
|
13
14
|
export declare class User extends TimeStamps {
|
|
14
15
|
coreUser: Ref<CoreUser>;
|
|
15
16
|
userId: string;
|
|
@@ -33,6 +34,7 @@ export declare class User extends TimeStamps {
|
|
|
33
34
|
onlineStatus?: OnlineStatus;
|
|
34
35
|
fcmTokens?: string[];
|
|
35
36
|
wallet?: Wallet;
|
|
37
|
+
resetPassword?: ResetPasswordFields;
|
|
36
38
|
static updateWallet(this: ReturnModelType<typeof User>, userId: string, main?: number, reserve?: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject, {}> & Omit<User & {
|
|
37
39
|
_id: import("mongoose").Types.ObjectId;
|
|
38
40
|
} & {
|
|
@@ -25,6 +25,7 @@ const geo_location_model_1 = require("./shared/geo-location.model");
|
|
|
25
25
|
const id_generator_1 = require("../../../utilities/id-generator");
|
|
26
26
|
const _1 = require(".");
|
|
27
27
|
const wallet_model_1 = require("./embedded/wallet.model");
|
|
28
|
+
const rest_password_model_1 = require("./embedded/rest-password.model");
|
|
28
29
|
let User = User_1 = class User extends defaultClasses_1.TimeStamps {
|
|
29
30
|
coreUser;
|
|
30
31
|
userId;
|
|
@@ -48,6 +49,7 @@ let User = User_1 = class User extends defaultClasses_1.TimeStamps {
|
|
|
48
49
|
onlineStatus;
|
|
49
50
|
fcmTokens;
|
|
50
51
|
wallet;
|
|
52
|
+
resetPassword;
|
|
51
53
|
static async updateWallet(userId, main = 0, reserve = 0) {
|
|
52
54
|
return this.findByIdAndUpdate(userId, { $inc: { 'wallet.main': main, 'wallet.reserve': reserve, 'wallet.total': main + reserve } }, { new: true });
|
|
53
55
|
}
|
|
@@ -145,6 +147,10 @@ __decorate([
|
|
|
145
147
|
(0, typegoose_1.prop)({ type: wallet_model_1.Wallet }),
|
|
146
148
|
__metadata("design:type", wallet_model_1.Wallet)
|
|
147
149
|
], User.prototype, "wallet", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, typegoose_1.prop)({ type: rest_password_model_1.ResetPasswordFields }),
|
|
152
|
+
__metadata("design:type", rest_password_model_1.ResetPasswordFields)
|
|
153
|
+
], User.prototype, "resetPassword", void 0);
|
|
148
154
|
exports.User = User = User_1 = __decorate([
|
|
149
155
|
(0, typegoose_1.pre)('save', async function () {
|
|
150
156
|
if (this.isNew) {
|
|
@@ -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;AAC1D,kEAA6D;AAC7D,wBAAiC;AACjC,0DAAiD;
|
|
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;AAC1D,kEAA6D;AAC7D,wBAAiC;AACjC,0DAAiD;AACjD,wEAAqE;AAU9D,IAAM,IAAI,YAAV,MAAM,IAAK,SAA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C,EAAE,CAAC;GACzB,IAAI,CAsFhB","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';\nimport { ResetPasswordFields } from './embedded/rest-password.model';\n\n@pre<User>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.userId = await generateId(CounterModel, CounterType.USER);\n\t}\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, unique: true })\n\tpublic userId: 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\t@prop({ type: ResetPasswordFields })\n\tpublic resetPassword?: ResetPasswordFields;\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