@lyxa.ai/core 1.2.82 → 1.2.84
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/core-user.model.d.ts +2 -0
- package/dist/libraries/mongo/models/core-user.model.js +6 -0
- package/dist/libraries/mongo/models/core-user.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/rider-payout.model.d.ts +5 -2
- package/dist/libraries/mongo/models/providers/rider-payout.model.js +20 -5
- package/dist/libraries/mongo/models/providers/rider-payout.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.d.ts +0 -2
- package/dist/libraries/mongo/models/user.model.js +0 -6
- 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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
2
2
|
import { Status } from '../../../utilities/enum';
|
|
3
|
+
import { ResetPasswordFields } from './embedded/rest-password.model';
|
|
3
4
|
export declare class CoreUser extends TimeStamps {
|
|
4
5
|
name: string;
|
|
5
6
|
email: string;
|
|
@@ -11,4 +12,5 @@ export declare class CoreUser extends TimeStamps {
|
|
|
11
12
|
deviceIds: string[];
|
|
12
13
|
stripeCustomerId?: string;
|
|
13
14
|
rewardPoints?: number;
|
|
15
|
+
resetPassword?: ResetPasswordFields;
|
|
14
16
|
}
|
|
@@ -13,6 +13,7 @@ exports.CoreUser = void 0;
|
|
|
13
13
|
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
|
+
const rest_password_model_1 = require("./embedded/rest-password.model");
|
|
16
17
|
let CoreUser = class CoreUser extends defaultClasses_1.TimeStamps {
|
|
17
18
|
name;
|
|
18
19
|
email;
|
|
@@ -24,6 +25,7 @@ let CoreUser = class CoreUser extends defaultClasses_1.TimeStamps {
|
|
|
24
25
|
deviceIds;
|
|
25
26
|
stripeCustomerId;
|
|
26
27
|
rewardPoints;
|
|
28
|
+
resetPassword;
|
|
27
29
|
};
|
|
28
30
|
exports.CoreUser = CoreUser;
|
|
29
31
|
__decorate([
|
|
@@ -66,6 +68,10 @@ __decorate([
|
|
|
66
68
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
67
69
|
__metadata("design:type", Number)
|
|
68
70
|
], CoreUser.prototype, "rewardPoints", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typegoose_1.prop)({ type: rest_password_model_1.ResetPasswordFields }),
|
|
73
|
+
__metadata("design:type", rest_password_model_1.ResetPasswordFields)
|
|
74
|
+
], CoreUser.prototype, "resetPassword", void 0);
|
|
69
75
|
exports.CoreUser = CoreUser = __decorate([
|
|
70
76
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'coreUsers' } })
|
|
71
77
|
], CoreUser);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/core-user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAiD;
|
|
1
|
+
{"version":3,"file":"core-user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/core-user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAiD;AACjD,wEAAqE;AAG9D,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,GAAG,CAAQ;IAGX,WAAW,CAAU;IAGrB,YAAY,CAAU;IAGtB,MAAM,CAAU;IAGhB,SAAS,CAAY;IAGrB,gBAAgB,CAAU;IAG1B,YAAY,CAAU;IAGtB,aAAa,CAAuB;CAC3C,CAAA;A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C;GAChD,QAAQ,CAiCpB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status } from '../../../utilities/enum';\nimport { ResetPasswordFields } from './embedded/rest-password.model';\n\n@modelOptions({ schemaOptions: { collection: 'coreUsers' } })\nexport class CoreUser extends TimeStamps {\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({ required: true, type: () => [String] })\n\tpublic deviceIds!: string[];\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"]}
|
|
@@ -3,9 +3,12 @@ import { PayoutType } from '../../../../utilities/enum';
|
|
|
3
3
|
import { Payout } from '../payout.model';
|
|
4
4
|
import { Rider } from '../rider.model';
|
|
5
5
|
export declare class RiderPayoutBreakdown {
|
|
6
|
-
|
|
7
|
-
companyProfitFromDelivery?: number;
|
|
6
|
+
deliveryFeePaidByUser?: number;
|
|
8
7
|
freeDeliveryByCompany?: number;
|
|
8
|
+
freeDeliveryByShop?: number;
|
|
9
|
+
deliveryFeeOfReplacementOrder?: number;
|
|
10
|
+
totalDeliveryFee?: number;
|
|
11
|
+
companyProfitFromDelivery?: number;
|
|
9
12
|
riderTips?: number;
|
|
10
13
|
addCreditToRider?: number;
|
|
11
14
|
removeCreditFromRider?: number;
|
|
@@ -15,9 +15,12 @@ const enum_1 = require("../../../../utilities/enum");
|
|
|
15
15
|
const payout_model_1 = require("../payout.model");
|
|
16
16
|
const rider_model_1 = require("../rider.model");
|
|
17
17
|
class RiderPayoutBreakdown {
|
|
18
|
-
|
|
19
|
-
companyProfitFromDelivery;
|
|
18
|
+
deliveryFeePaidByUser;
|
|
20
19
|
freeDeliveryByCompany;
|
|
20
|
+
freeDeliveryByShop;
|
|
21
|
+
deliveryFeeOfReplacementOrder;
|
|
22
|
+
totalDeliveryFee;
|
|
23
|
+
companyProfitFromDelivery;
|
|
21
24
|
riderTips;
|
|
22
25
|
addCreditToRider;
|
|
23
26
|
removeCreditFromRider;
|
|
@@ -28,15 +31,27 @@ exports.RiderPayoutBreakdown = RiderPayoutBreakdown;
|
|
|
28
31
|
__decorate([
|
|
29
32
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
30
33
|
__metadata("design:type", Number)
|
|
31
|
-
], RiderPayoutBreakdown.prototype, "
|
|
34
|
+
], RiderPayoutBreakdown.prototype, "deliveryFeePaidByUser", void 0);
|
|
32
35
|
__decorate([
|
|
33
36
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
34
37
|
__metadata("design:type", Number)
|
|
35
|
-
], RiderPayoutBreakdown.prototype, "
|
|
38
|
+
], RiderPayoutBreakdown.prototype, "freeDeliveryByCompany", void 0);
|
|
36
39
|
__decorate([
|
|
37
40
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
38
41
|
__metadata("design:type", Number)
|
|
39
|
-
], RiderPayoutBreakdown.prototype, "
|
|
42
|
+
], RiderPayoutBreakdown.prototype, "freeDeliveryByShop", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], RiderPayoutBreakdown.prototype, "deliveryFeeOfReplacementOrder", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], RiderPayoutBreakdown.prototype, "totalDeliveryFee", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], RiderPayoutBreakdown.prototype, "companyProfitFromDelivery", void 0);
|
|
40
55
|
__decorate([
|
|
41
56
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
42
57
|
__metadata("design:type", Number)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rider-payout.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/rider-payout.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAwD;AACxD,kDAAyC;AACzC,gDAAuC;AAEvC,MAAa,oBAAoB;IAEhC,
|
|
1
|
+
{"version":3,"file":"rider-payout.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/rider-payout.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAwD;AACxD,kDAAyC;AACzC,gDAAuC;AAEvC,MAAa,oBAAoB;IAEhC,qBAAqB,CAAU;IAG/B,qBAAqB,CAAU;IAG/B,kBAAkB,CAAU;IAG5B,6BAA6B,CAAU;IAGvC,gBAAgB,CAAU;IAG1B,yBAAyB,CAAU;IAGnC,SAAS,CAAU;IAGnB,gBAAgB,CAAU;IAG1B,qBAAqB,CAAU;IAG/B,iBAAiB,CAAU;IAG3B,WAAW,CAAU;CACrB;AAjCD,oDAiCC;AA/BA;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mEACJ;AAG/B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mEACJ;AAG/B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAA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ayoutType } from '../../../../utilities/enum';\nimport { Payout } from '../payout.model';\nimport { Rider } from '../rider.model';\n\nexport class RiderPayoutBreakdown {\n\t@prop({ type: Number, default: 0 })\n\tdeliveryFeePaidByUser?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tfreeDeliveryByCompany?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tfreeDeliveryByShop?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tdeliveryFeeOfReplacementOrder?: number;\n\n\t@prop({ type: Number, default: 0 })\n\ttotalDeliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tcompanyProfitFromDelivery?: number;\n\n\t@prop({ type: Number, default: 0 })\n\triderTips?: number;\n\n\t@prop({ type: Number, default: 0 })\n\taddCreditToRider?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tremoveCreditFromRider?: number;\n\n\t@prop({ type: Number, default: 0 })\n\triderWeeklyReward?: number;\n\n\t@prop({ type: Number, default: 0 })\n\triderPayout?: number;\n}\n\nexport class RiderPayout extends Payout {\n\tpublic payoutType = PayoutType.RIDER as const;\n\n\t@prop({ required: true, ref: () => Rider })\n\tpublic rider!: Ref<Rider>;\n\n\t@prop({ required: true, type: RiderPayoutBreakdown })\n\tpublic payoutBreakdown!: RiderPayoutBreakdown;\n}\n"]}
|
|
@@ -10,7 +10,6 @@ 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';
|
|
14
13
|
export declare class User extends TimeStamps {
|
|
15
14
|
coreUser: Ref<CoreUser>;
|
|
16
15
|
userId: string;
|
|
@@ -34,7 +33,6 @@ export declare class User extends TimeStamps {
|
|
|
34
33
|
onlineStatus?: OnlineStatus;
|
|
35
34
|
fcmTokens?: string[];
|
|
36
35
|
wallet?: Wallet;
|
|
37
|
-
resetPassword?: ResetPasswordFields;
|
|
38
36
|
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 & {
|
|
39
37
|
_id: import("mongoose").Types.ObjectId;
|
|
40
38
|
} & {
|
|
@@ -25,7 +25,6 @@ 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");
|
|
29
28
|
let User = User_1 = class User extends defaultClasses_1.TimeStamps {
|
|
30
29
|
coreUser;
|
|
31
30
|
userId;
|
|
@@ -49,7 +48,6 @@ let User = User_1 = class User extends defaultClasses_1.TimeStamps {
|
|
|
49
48
|
onlineStatus;
|
|
50
49
|
fcmTokens;
|
|
51
50
|
wallet;
|
|
52
|
-
resetPassword;
|
|
53
51
|
static async updateWallet(userId, main = 0, reserve = 0) {
|
|
54
52
|
return this.findByIdAndUpdate(userId, { $inc: { 'wallet.main': main, 'wallet.reserve': reserve, 'wallet.total': main + reserve } }, { new: true });
|
|
55
53
|
}
|
|
@@ -147,10 +145,6 @@ __decorate([
|
|
|
147
145
|
(0, typegoose_1.prop)({ type: wallet_model_1.Wallet }),
|
|
148
146
|
__metadata("design:type", wallet_model_1.Wallet)
|
|
149
147
|
], 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);
|
|
154
148
|
exports.User = User = User_1 = __decorate([
|
|
155
149
|
(0, typegoose_1.pre)('save', async function () {
|
|
156
150
|
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;AAU1C,IAAM,IAAI,YAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,QAAQ,CAAiB;IAGzB,MAAM,CAAS;IAGf,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,GAAG,CAAC,EACR,OAAO,GAAG,CAAC;Q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EAAE,EAAE,EAAE,CAAC;;uCAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,qBAAM,EAAE,CAAC;8BACP,qBAAM;oCAAC;eArEX,IAAI;IARhB,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK;QACvB,IAAI,IAAI,CAAC,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,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@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\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