@lyxa.ai/core 1.0.166 → 1.0.167
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 +1 -2
- package/dist/libraries/mongo/models/core-user.model.js +2 -7
- package/dist/libraries/mongo/models/core-user.model.js.map +1 -1
- package/dist/libraries/mongo/models/notification.model.d.ts +5 -4
- package/dist/libraries/mongo/models/notification.model.js +17 -13
- package/dist/libraries/mongo/models/notification.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.d.ts +2 -2
- package/dist/libraries/mongo/models/user.model.js +5 -5
- 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
|
@@ -6,10 +6,9 @@ export declare class CoreUser extends TimeStamps {
|
|
|
6
6
|
gender?: string;
|
|
7
7
|
dob?: Date;
|
|
8
8
|
countryISO2: string;
|
|
9
|
-
fcmTokens?: string[];
|
|
10
9
|
profilePhoto?: string;
|
|
11
10
|
status?: Status;
|
|
12
11
|
deviceIds: string[];
|
|
13
12
|
stripeCustomerId?: string;
|
|
14
|
-
|
|
13
|
+
rewardPoints?: number;
|
|
15
14
|
}
|
|
@@ -19,12 +19,11 @@ let CoreUser = class CoreUser extends defaultClasses_1.TimeStamps {
|
|
|
19
19
|
gender;
|
|
20
20
|
dob;
|
|
21
21
|
countryISO2;
|
|
22
|
-
fcmTokens;
|
|
23
22
|
profilePhoto;
|
|
24
23
|
status;
|
|
25
24
|
deviceIds;
|
|
26
25
|
stripeCustomerId;
|
|
27
|
-
|
|
26
|
+
rewardPoints;
|
|
28
27
|
};
|
|
29
28
|
exports.CoreUser = CoreUser;
|
|
30
29
|
__decorate([
|
|
@@ -47,10 +46,6 @@ __decorate([
|
|
|
47
46
|
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
48
47
|
__metadata("design:type", String)
|
|
49
48
|
], CoreUser.prototype, "countryISO2", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typegoose_1.prop)({ type: () => [String], default: [] }),
|
|
52
|
-
__metadata("design:type", Array)
|
|
53
|
-
], CoreUser.prototype, "fcmTokens", void 0);
|
|
54
49
|
__decorate([
|
|
55
50
|
(0, typegoose_1.prop)({ type: String }),
|
|
56
51
|
__metadata("design:type", String)
|
|
@@ -70,7 +65,7 @@ __decorate([
|
|
|
70
65
|
__decorate([
|
|
71
66
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
72
67
|
__metadata("design:type", Number)
|
|
73
|
-
], CoreUser.prototype, "
|
|
68
|
+
], CoreUser.prototype, "rewardPoints", void 0);
|
|
74
69
|
exports.CoreUser = CoreUser = __decorate([
|
|
75
70
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'coreUsers' } })
|
|
76
71
|
], 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;AAG1C,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,GAAG,CAAQ;IAGX,WAAW,CAAU;IAGrB,
|
|
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;AAG1C,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,CAA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/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status } from '../../../utilities/enum';\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"]}
|
|
@@ -3,7 +3,6 @@ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
|
3
3
|
import { ClickType, NotificationAccountType } from '../../../utilities/enum';
|
|
4
4
|
import { Admin } from './admin.model';
|
|
5
5
|
import { BOBFinance } from './bob-finance.model';
|
|
6
|
-
import { CoreUser } from './core-user.model';
|
|
7
6
|
import { ListContainer } from './list-container.model';
|
|
8
7
|
import { Order } from './order.model';
|
|
9
8
|
import { Parent } from './parent.model';
|
|
@@ -12,14 +11,15 @@ import { Product } from './product.model';
|
|
|
12
11
|
import { RequestArea } from './request-area.model';
|
|
13
12
|
import { Rider } from './rider.model';
|
|
14
13
|
import { Shop } from './shop.model';
|
|
14
|
+
import { User } from './user.model';
|
|
15
15
|
export declare class Notification extends TimeStamps {
|
|
16
16
|
title: string;
|
|
17
17
|
body: string;
|
|
18
18
|
image?: string;
|
|
19
19
|
sound?: string;
|
|
20
20
|
accountType: NotificationAccountType;
|
|
21
|
-
isGlobal
|
|
22
|
-
users?: Ref<
|
|
21
|
+
isGlobal: boolean;
|
|
22
|
+
users?: Ref<User>[];
|
|
23
23
|
parents?: Ref<Parent>[];
|
|
24
24
|
shops?: Ref<Shop>[];
|
|
25
25
|
riders?: Ref<Rider>[];
|
|
@@ -32,8 +32,9 @@ export declare class Notification extends TimeStamps {
|
|
|
32
32
|
clickableProduct?: Ref<Product>;
|
|
33
33
|
clickableListContainer?: Ref<ListContainer>;
|
|
34
34
|
clickablePayout?: Ref<Payout>;
|
|
35
|
-
|
|
35
|
+
clickableBobFinance?: Ref<BOBFinance>;
|
|
36
36
|
clickableRequestArea?: Ref<RequestArea>;
|
|
37
37
|
isSendByAdmin?: boolean;
|
|
38
|
+
createdBy?: Ref<Admin>;
|
|
38
39
|
seenBy?: mongoose.Types.ObjectId[];
|
|
39
40
|
}
|
|
@@ -15,7 +15,6 @@ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
|
15
15
|
const enum_1 = require("../../../utilities/enum");
|
|
16
16
|
const admin_model_1 = require("./admin.model");
|
|
17
17
|
const bob_finance_model_1 = require("./bob-finance.model");
|
|
18
|
-
const core_user_model_1 = require("./core-user.model");
|
|
19
18
|
const list_container_model_1 = require("./list-container.model");
|
|
20
19
|
const order_model_1 = require("./order.model");
|
|
21
20
|
const parent_model_1 = require("./parent.model");
|
|
@@ -24,6 +23,7 @@ const product_model_1 = require("./product.model");
|
|
|
24
23
|
const request_area_model_1 = require("./request-area.model");
|
|
25
24
|
const rider_model_1 = require("./rider.model");
|
|
26
25
|
const shop_model_1 = require("./shop.model");
|
|
26
|
+
const user_model_1 = require("./user.model");
|
|
27
27
|
let Notification = class Notification extends defaultClasses_1.TimeStamps {
|
|
28
28
|
title;
|
|
29
29
|
body;
|
|
@@ -44,18 +44,19 @@ let Notification = class Notification extends defaultClasses_1.TimeStamps {
|
|
|
44
44
|
clickableProduct;
|
|
45
45
|
clickableListContainer;
|
|
46
46
|
clickablePayout;
|
|
47
|
-
|
|
47
|
+
clickableBobFinance;
|
|
48
48
|
clickableRequestArea;
|
|
49
49
|
isSendByAdmin;
|
|
50
|
+
createdBy;
|
|
50
51
|
seenBy;
|
|
51
52
|
};
|
|
52
53
|
exports.Notification = Notification;
|
|
53
54
|
__decorate([
|
|
54
|
-
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
55
|
+
(0, typegoose_1.prop)({ required: true, type: String, maxlength: 50 }),
|
|
55
56
|
__metadata("design:type", String)
|
|
56
57
|
], Notification.prototype, "title", void 0);
|
|
57
58
|
__decorate([
|
|
58
|
-
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
59
|
+
(0, typegoose_1.prop)({ required: true, type: String, maxlength: 250 }),
|
|
59
60
|
__metadata("design:type", String)
|
|
60
61
|
], Notification.prototype, "body", void 0);
|
|
61
62
|
__decorate([
|
|
@@ -71,11 +72,11 @@ __decorate([
|
|
|
71
72
|
__metadata("design:type", String)
|
|
72
73
|
], Notification.prototype, "accountType", void 0);
|
|
73
74
|
__decorate([
|
|
74
|
-
(0, typegoose_1.prop)({
|
|
75
|
+
(0, typegoose_1.prop)({ required: true, type: Boolean }),
|
|
75
76
|
__metadata("design:type", Boolean)
|
|
76
77
|
], Notification.prototype, "isGlobal", void 0);
|
|
77
78
|
__decorate([
|
|
78
|
-
(0, typegoose_1.prop)({ ref: () =>
|
|
79
|
+
(0, typegoose_1.prop)({ ref: () => user_model_1.User, default: [] }),
|
|
79
80
|
__metadata("design:type", Array)
|
|
80
81
|
], Notification.prototype, "users", void 0);
|
|
81
82
|
__decorate([
|
|
@@ -129,7 +130,7 @@ __decorate([
|
|
|
129
130
|
__decorate([
|
|
130
131
|
(0, typegoose_1.prop)({ ref: () => bob_finance_model_1.BOBFinance }),
|
|
131
132
|
__metadata("design:type", Object)
|
|
132
|
-
], Notification.prototype, "
|
|
133
|
+
], Notification.prototype, "clickableBobFinance", void 0);
|
|
133
134
|
__decorate([
|
|
134
135
|
(0, typegoose_1.prop)({ ref: () => request_area_model_1.RequestArea }),
|
|
135
136
|
__metadata("design:type", Object)
|
|
@@ -138,17 +139,20 @@ __decorate([
|
|
|
138
139
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
139
140
|
__metadata("design:type", Boolean)
|
|
140
141
|
], Notification.prototype, "isSendByAdmin", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
|
|
144
|
+
__metadata("design:type", Object)
|
|
145
|
+
], Notification.prototype, "createdBy", void 0);
|
|
141
146
|
__decorate([
|
|
142
147
|
(0, typegoose_1.prop)({ type: () => [typegoose_1.mongoose.Types.ObjectId], default: [] }),
|
|
143
148
|
__metadata("design:type", Array)
|
|
144
149
|
], Notification.prototype, "seenBy", void 0);
|
|
145
150
|
exports.Notification = Notification = __decorate([
|
|
146
151
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'notifications' } }),
|
|
147
|
-
(0, typegoose_1.index)({
|
|
148
|
-
(0, typegoose_1.index)({
|
|
149
|
-
(0, typegoose_1.index)({
|
|
150
|
-
(0, typegoose_1.index)({
|
|
151
|
-
(0, typegoose_1.index)({
|
|
152
|
-
(0, typegoose_1.index)({ accountType: 1, type: 1, createdAt: 1 })
|
|
152
|
+
(0, typegoose_1.index)({ isGlobal: 1, users: 1, createdAt: -1 }, { partialFilterExpression: { accountType: enum_1.NotificationAccountType.USER, deletedAt: null } }),
|
|
153
|
+
(0, typegoose_1.index)({ isGlobal: 1, shops: 1, createdAt: -1 }, { partialFilterExpression: { accountType: enum_1.NotificationAccountType.SHOP, deletedAt: null } }),
|
|
154
|
+
(0, typegoose_1.index)({ isGlobal: 1, riders: 1, createdAt: -1 }, { partialFilterExpression: { accountType: enum_1.NotificationAccountType.RIDER, deletedAt: null } }),
|
|
155
|
+
(0, typegoose_1.index)({ isGlobal: 1, admins: 1, createdAt: -1 }, { partialFilterExpression: { accountType: enum_1.NotificationAccountType.ADMIN, deletedAt: null } }),
|
|
156
|
+
(0, typegoose_1.index)({ isGlobal: 1, parents: 1, createdAt: -1 }, { partialFilterExpression: { accountType: enum_1.NotificationAccountType.PARENT, deletedAt: null } })
|
|
153
157
|
], Notification);
|
|
154
158
|
//# sourceMappingURL=notification.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.model.js","sourceRoot":"/","sources":["libraries/mongo/models/notification.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,kDAA6E;AAC7E,+CAAsC;AACtC,2DAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"notification.model.js","sourceRoot":"/","sources":["libraries/mongo/models/notification.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,kDAA6E;AAC7E,+CAAsC;AACtC,2DAAiD;AACjD,iEAAuD;AACvD,+CAAsC;AACtC,iDAAwC;AACxC,iDAAwC;AACxC,mDAA0C;AAC1C,6DAAmD;AACnD,+CAAsC;AACtC,6CAAoC;AACpC,6CAAoC;AAuB7B,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2BAAU;IAEpC,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,KAAK,CAAU;IAGf,WAAW,CAA2B;IAGtC,QAAQ,CAAW;IAGnB,KAAK,CAAe;IAGpB,OAAO,CAAiB;IAGxB,KAAK,CAAe;IAGpB,MAAM,CAAgB;IAGtB,MAAM,CAAgB;IAGtB,WAAW,CAAW;IAGtB,SAAS,CAAa;IAGtB,YAAY,CAAU;IAGtB,cAAc,CAAc;IAG5B,aAAa,CAAa;IAG1B,gBAAgB,CAAgB;IAGhC,sBAAsB,CAAsB;IAG5C,eAAe,CAAe;IAG9B,mBAAmB,CAAmB;IAGtC,oBAAoB,CAAoB;IAGxC,aAAa,CAAW;IAGxB,SAAS,CAAc;IAGvB,MAAM,CAA6B;CAC1C,CAAA;AAxEY,oCAAY;AAEjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,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ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ClickType, NotificationAccountType } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\nimport { BOBFinance } from './bob-finance.model';\nimport { ListContainer } from './list-container.model';\nimport { Order } from './order.model';\nimport { Parent } from './parent.model';\nimport { Payout } from './payout.model';\nimport { Product } from './product.model';\nimport { RequestArea } from './request-area.model';\nimport { Rider } from './rider.model';\nimport { Shop } from './shop.model';\nimport { User } from './user.model';\n\n@modelOptions({ schemaOptions: { collection: 'notifications' } })\n@index(\n\t{ isGlobal: 1, users: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.USER, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, shops: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.SHOP, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, riders: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.RIDER, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, admins: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.ADMIN, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, parents: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.PARENT, deletedAt: null } }\n)\nexport class Notification extends TimeStamps {\n\t@prop({ required: true, type: String, maxlength: 50 })\n\tpublic title!: string;\n\n\t@prop({ required: true, type: String, maxlength: 250 })\n\tpublic body!: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String })\n\tpublic sound?: string;\n\n\t@prop({ required: true, type: String, enum: NotificationAccountType })\n\tpublic accountType!: NotificationAccountType;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isGlobal!: boolean;\n\n\t@prop({ ref: () => User, default: [] })\n\tpublic users?: Ref<User>[];\n\n\t@prop({ ref: () => Parent, default: [] })\n\tpublic parents?: Ref<Parent>[];\n\n\t@prop({ ref: () => Shop, default: [] })\n\tpublic shops?: Ref<Shop>[];\n\n\t@prop({ ref: () => Rider, default: [] })\n\tpublic riders?: Ref<Rider>[];\n\n\t@prop({ ref: () => Admin, default: [] })\n\tpublic admins?: Ref<Admin>[];\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isClickable?: boolean;\n\n\t@prop({ type: String, enum: ClickType })\n\tpublic clickType?: ClickType;\n\n\t@prop({ type: String, trim: true })\n\tpublic clickableUrl?: string;\n\n\t@prop({ ref: () => Order })\n\tpublic clickableOrder?: Ref<Order>;\n\n\t@prop({ ref: () => Shop })\n\tpublic clickableShop?: Ref<Shop>;\n\n\t@prop({ ref: () => Product })\n\tpublic clickableProduct?: Ref<Product>;\n\n\t@prop({ ref: () => ListContainer })\n\tpublic clickableListContainer?: Ref<ListContainer>;\n\n\t@prop({ ref: () => Payout })\n\tpublic clickablePayout?: Ref<Payout>;\n\n\t@prop({ ref: () => BOBFinance })\n\tpublic clickableBobFinance?: Ref<BOBFinance>;\n\n\t@prop({ ref: () => RequestArea })\n\tpublic clickableRequestArea?: Ref<RequestArea>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSendByAdmin?: boolean;\n\n\t@prop({ ref: () => Admin })\n\tpublic createdBy?: Ref<Admin>;\n\n\t@prop({ type: () => [mongoose.Types.ObjectId], default: [] })\n\tpublic seenBy?: mongoose.Types.ObjectId[];\n}\n"]}
|
|
@@ -6,14 +6,13 @@ import { Shop } from './shop.model';
|
|
|
6
6
|
import { UserAddress } from './shared/address.model';
|
|
7
7
|
import { Coupon } from './coupon.model';
|
|
8
8
|
import { Subscription } from './subscription.model';
|
|
9
|
-
import { OnlineStatus
|
|
9
|
+
import { OnlineStatus } from '../../../utilities/enum';
|
|
10
10
|
import { OTPFields } from './embedded/otp-fields.model';
|
|
11
11
|
export declare class User extends TimeStamps {
|
|
12
12
|
coreUser: Ref<CoreUser>;
|
|
13
13
|
favoriteProducts?: Ref<Product>[];
|
|
14
14
|
favoriteShops?: Ref<Shop>[];
|
|
15
15
|
addresses?: UserAddress[];
|
|
16
|
-
status?: Status;
|
|
17
16
|
orderCompleted?: number;
|
|
18
17
|
repeatedOrderAt?: Date;
|
|
19
18
|
walletBalance?: number;
|
|
@@ -29,6 +28,7 @@ export declare class User extends TimeStamps {
|
|
|
29
28
|
phoneOtpInfo?: OTPFields;
|
|
30
29
|
isPhoneVerified?: boolean;
|
|
31
30
|
onlineStatus?: OnlineStatus;
|
|
31
|
+
fcmTokens?: string[];
|
|
32
32
|
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 & {
|
|
33
33
|
_id: import("mongoose").Types.ObjectId;
|
|
34
34
|
} & {
|
|
@@ -26,7 +26,6 @@ let User = User_1 = class User extends defaultClasses_1.TimeStamps {
|
|
|
26
26
|
favoriteProducts;
|
|
27
27
|
favoriteShops;
|
|
28
28
|
addresses;
|
|
29
|
-
status;
|
|
30
29
|
orderCompleted;
|
|
31
30
|
repeatedOrderAt;
|
|
32
31
|
walletBalance;
|
|
@@ -42,6 +41,7 @@ let User = User_1 = class User extends defaultClasses_1.TimeStamps {
|
|
|
42
41
|
phoneOtpInfo;
|
|
43
42
|
isPhoneVerified;
|
|
44
43
|
onlineStatus;
|
|
44
|
+
fcmTokens;
|
|
45
45
|
static async updateWallet(userId, amount) {
|
|
46
46
|
return this.findByIdAndUpdate(userId, { $inc: { walletBalance: amount } }, { new: true });
|
|
47
47
|
}
|
|
@@ -63,10 +63,6 @@ __decorate([
|
|
|
63
63
|
(0, typegoose_1.prop)({ type: () => [address_model_1.UserAddress] }),
|
|
64
64
|
__metadata("design:type", Array)
|
|
65
65
|
], User.prototype, "addresses", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
68
|
-
__metadata("design:type", String)
|
|
69
|
-
], User.prototype, "status", void 0);
|
|
70
66
|
__decorate([
|
|
71
67
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
72
68
|
__metadata("design:type", Number)
|
|
@@ -131,6 +127,10 @@ __decorate([
|
|
|
131
127
|
}),
|
|
132
128
|
__metadata("design:type", String)
|
|
133
129
|
], User.prototype, "onlineStatus", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, typegoose_1.prop)({ type: () => [String], default: [] }),
|
|
132
|
+
__metadata("design:type", Array)
|
|
133
|
+
], User.prototype, "fcmTokens", void 0);
|
|
134
134
|
exports.User = User = User_1 = __decorate([
|
|
135
135
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'users' } }),
|
|
136
136
|
(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,oDAAuF;AACvF,4EAAqE;AACrE,uDAA6C;AAC7C,mDAA0C;AAC1C,6CAAoC;AACpC,0DAAqD;AACrD,iDAAwC;AACxC,6DAAoD;AACpD,kDAAiF;AACjF,kEAAwD;AAIjD,IAAM,IAAI,YAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,QAAQ,CAAiB;IAGzB,gBAAgB,CAAkB;IAGlC,aAAa,CAAe;IAG5B,SAAS,CAAiB;IAG1B,
|
|
1
|
+
{"version":3,"file":"user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oDAAuF;AACvF,4EAAqE;AACrE,uDAA6C;AAC7C,mDAA0C;AAC1C,6CAAoC;AACpC,0DAAqD;AACrD,iDAAwC;AACxC,6DAAoD;AACpD,kDAAiF;AACjF,kEAAwD;AAIjD,IAAM,IAAI,YAAV,MAAM,IAAK,SAAQ,2BAA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IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;6CACP;AAO1B;IALN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,mBAAY;QAClB,OAAO,EAAE,mBAAY,CAAC,OAAO;KAC7B,CAAC;;0CACiC;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;uCAChB;eA/DhB,IAAI;IAFhB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;IACxD,IAAA,iBAAK,EAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;GACzB,IAAI,CAoEhB","sourcesContent":["import { index, modelOptions, 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 { OnlineStatus, ShopOnlineStatus, Status } from '../../../utilities/enum';\nimport { OTPFields } from './embedded/otp-fields.model';\n\n@modelOptions({ schemaOptions: { collection: 'users' } })\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], 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] })\n\tpublic addresses?: UserAddress[];\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({ type: Number, default: 0 })\n\tpublic walletBalance?: number;\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\tpublic static async updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number) {\n\t\treturn this.findByIdAndUpdate(userId, { $inc: { walletBalance: amount } }, { new: true });\n\t}\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED