@aldb2b/common 1.0.2030 → 1.0.2032
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/build/entities/models/model.providers.d.ts +10 -0
- package/build/entities/models/subscriptions/entities/companySubscriptions/company-subscription.entity.d.ts +4 -2
- package/build/entities/models/subscriptions/entities/companySubscriptions/company-subscription.entity.js +12 -10
- package/build/entities/models/subscriptions/entities/companySubscriptions/company-subscription.entity.js.map +1 -1
- package/build/entities/models/subscriptions/entities/features/feature.entity.d.ts +1 -0
- package/build/entities/models/subscriptions/entities/features/feature.entity.js +4 -0
- package/build/entities/models/subscriptions/entities/features/feature.entity.js.map +1 -1
- package/build/entities/models/subscriptions/entities/subscription/index.d.ts +5 -0
- package/build/entities/models/subscriptions/entities/subscription/index.js +22 -0
- package/build/entities/models/subscriptions/entities/subscription/index.js.map +1 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription-category.enum.d.ts +6 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription-category.enum.js +11 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription-category.enum.js.map +1 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription-model.enum.d.ts +5 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription-model.enum.js +10 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription-model.enum.js.map +1 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription-type.enum.d.ts +5 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription-type.enum.js +10 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription-type.enum.js.map +1 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription.entity.d.ts +87 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription.entity.js +159 -0
- package/build/entities/models/subscriptions/entities/subscription/subscription.entity.js.map +1 -0
- package/build/entities/models/subscriptions/entities/subscription/user-settin-option.entity.d.ts +62 -0
- package/build/entities/models/subscriptions/entities/subscription/user-settin-option.entity.js +18 -0
- package/build/entities/models/subscriptions/entities/subscription/user-settin-option.entity.js.map +1 -0
- package/build/entities/models/subscriptions/index.d.ts +1 -0
- package/build/entities/models/subscriptions/index.js +1 -0
- package/build/entities/models/subscriptions/index.js.map +1 -1
- package/build/entities/models/subscriptions/subscriptions.provider.d.ts +6 -0
- package/build/entities/models/subscriptions/subscriptions.provider.js +6 -0
- package/build/entities/models/subscriptions/subscriptions.provider.js.map +1 -1
- package/build/entities/models/users/entities/users/user.entity.d.ts +1 -1
- package/build/entities/models/users/entities/users/user.entity.js +10 -10
- package/build/entities/models/users/entities/users/user.entity.js.map +1 -1
- package/build/entities/models/users/index.d.ts +1 -0
- package/build/entities/models/users/index.js +1 -0
- package/build/entities/models/users/index.js.map +1 -1
- package/build/entities/models/users/repositories/index.d.ts +1 -0
- package/build/entities/models/users/repositories/index.js +18 -0
- package/build/entities/models/users/repositories/index.js.map +1 -0
- package/build/entities/models/users/repositories/user-common.repository.d.ts +7 -0
- package/build/entities/models/users/repositories/user-common.repository.js +12 -0
- package/build/entities/models/users/repositories/user-common.repository.js.map +1 -0
- package/build/entities/models/users/users.provider.d.ts +9 -1
- package/build/entities/models/users/users.provider.js +7 -0
- package/build/entities/models/users/users.provider.js.map +1 -1
- package/build/enums/database-model.enum.d.ts +2 -1
- package/build/enums/database-model.enum.js +1 -0
- package/build/enums/database-model.enum.js.map +1 -1
- package/build/enums/record-type.enum.d.ts +3 -1
- package/build/enums/record-type.enum.js +2 -0
- package/build/enums/record-type.enum.js.map +1 -1
- package/build/enums/repository-provider.enum.d.ts +2 -1
- package/build/enums/repository-provider.enum.js +1 -0
- package/build/enums/repository-provider.enum.js.map +1 -1
- package/build/events/get-onboarding-survey-list.interface.d.ts +11 -0
- package/build/events/{get-order-by-id.interface.js → get-onboarding-survey-list.interface.js} +1 -1
- package/build/events/get-onboarding-survey-list.interface.js.map +1 -0
- package/build/events/queues.d.ts +1 -2
- package/build/events/queues.js +1 -2
- package/build/events/queues.js.map +1 -1
- package/build/events/send-notifications.interface.d.ts +1 -0
- package/build/events/subjects.d.ts +3 -6
- package/build/events/subjects.js +3 -6
- package/build/events/subjects.js.map +1 -1
- package/build/events/sync-registration.interface.d.ts +0 -2
- package/build/index.d.ts +160 -159
- package/build/index.js +160 -159
- package/build/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/notification-event.enum.d.ts +5 -1
- package/build/types/notification-event.enum.js +4 -0
- package/build/types/notification-event.enum.js.map +1 -1
- package/package.json +1 -1
- package/build/enums/registration-submission-status.enum.d.ts +0 -4
- package/build/enums/registration-submission-status.enum.js +0 -10
- package/build/enums/registration-submission-status.enum.js.map +0 -1
- package/build/enums/sync-registration-ticket-stripe-product-action.enum.d.ts +0 -5
- package/build/enums/sync-registration-ticket-stripe-product-action.enum.js +0 -10
- package/build/enums/sync-registration-ticket-stripe-product-action.enum.js.map +0 -1
- package/build/events/create-registration-tickets-payment.interface.d.ts +0 -18
- package/build/events/create-registration-tickets-payment.interface.js +0 -3
- package/build/events/create-registration-tickets-payment.interface.js.map +0 -1
- package/build/events/finalize-registration-submission.interface.d.ts +0 -11
- package/build/events/finalize-registration-submission.interface.js +0 -3
- package/build/events/finalize-registration-submission.interface.js.map +0 -1
- package/build/events/get-order-by-id.interface.d.ts +0 -12
- package/build/events/get-order-by-id.interface.js.map +0 -1
- package/build/events/sync-registration-ticket-stripe-product.interface.d.ts +0 -10
- package/build/events/sync-registration-ticket-stripe-product.interface.js +0 -3
- package/build/events/sync-registration-ticket-stripe-product.interface.js.map +0 -1
- package/build/types/subscription-model.enum.d.ts +0 -4
- package/build/types/subscription-model.enum.js +0 -9
- package/build/types/subscription-model.enum.js.map +0 -1
|
@@ -91,6 +91,12 @@ export declare const modelProviders: ({
|
|
|
91
91
|
_id: string;
|
|
92
92
|
}>, any>;
|
|
93
93
|
inject: import("../..").DatabaseConnection[];
|
|
94
|
+
} | {
|
|
95
|
+
provide: import("../..").DatabaseModel;
|
|
96
|
+
useFactory: (connection: import("mongoose").Connection) => import("mongoose").Model<import("./subscriptions").Subscription, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./subscriptions").Subscription> & import("./subscriptions").Subscription & Required<{
|
|
97
|
+
_id: string;
|
|
98
|
+
}>, any>;
|
|
99
|
+
inject: import("../..").DatabaseConnection[];
|
|
94
100
|
} | {
|
|
95
101
|
provide: import("../..").DatabaseModel;
|
|
96
102
|
useFactory: (connection: import("mongoose").Connection) => import("mongoose").Model<import("./subscriptions").Feature, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./subscriptions").Feature> & import("./subscriptions").Feature & Required<{
|
|
@@ -189,6 +195,10 @@ export declare const modelProviders: ({
|
|
|
189
195
|
_id: string;
|
|
190
196
|
}>, any>;
|
|
191
197
|
inject: import("../..").DatabaseConnection[];
|
|
198
|
+
} | {
|
|
199
|
+
provide: import("../..").RepositoryProvider;
|
|
200
|
+
inject: import("../..").DatabaseModel[];
|
|
201
|
+
useFactory: (userRepositoryService: import("../..").CustomModel<import("./users").User>) => import("./users").UserCommonRepository;
|
|
192
202
|
} | {
|
|
193
203
|
provide: import("../..").DatabaseModel;
|
|
194
204
|
useFactory: (connection: import("mongoose").Connection) => import("mongoose").Model<import("./events").EventType, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./events").EventType> & import("./events").EventType & Required<{
|
|
@@ -48,17 +48,18 @@
|
|
|
48
48
|
/// <reference types="mongoose/types/inferschematype" />
|
|
49
49
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
50
50
|
/// <reference types="@aldb2b/common/node_modules/mongoose/types/inferschematype" />
|
|
51
|
-
import { Connection } from 'mongoose';
|
|
51
|
+
import { Connection, Schema } from 'mongoose';
|
|
52
52
|
import { Company } from '../../../companies';
|
|
53
53
|
import { Event } from '../../../events';
|
|
54
54
|
import { CustomModel } from '../../../../../db/CustomModel';
|
|
55
55
|
import { CompanySubscriptionUser } from './company-subscription-user.entity';
|
|
56
56
|
import { Feature } from '../features/feature.entity';
|
|
57
57
|
import { CompanySubscriptionStatus } from './company-subscription-status.enum';
|
|
58
|
+
import { Subscription } from "../subscription/subscription.entity";
|
|
58
59
|
export type CompanySubscriptionModel = CustomModel<CompanySubscription>;
|
|
59
60
|
export declare class CompanySubscription {
|
|
60
61
|
_id: string;
|
|
61
|
-
subscription:
|
|
62
|
+
subscription: Subscription;
|
|
62
63
|
features: Feature[];
|
|
63
64
|
payment: any;
|
|
64
65
|
points: number;
|
|
@@ -78,6 +79,7 @@ export declare class CompanySubscription {
|
|
|
78
79
|
badges: any[];
|
|
79
80
|
stripeSubscriptionId?: string;
|
|
80
81
|
}
|
|
82
|
+
export declare const getCompanySubscriptionSchema: (connection: Connection, companyConnection: Connection, eventConnection: Connection) => Schema<CompanySubscription, CompanySubscriptionModel>;
|
|
81
83
|
export declare const companySubscriptionFactory: (connection: Connection, companyConnection: Connection, eventConnection: Connection) => import("mongoose").Model<CompanySubscription, {}, {}, {}, import("mongoose").Document<unknown, {}, CompanySubscription> & CompanySubscription & Required<{
|
|
82
84
|
_id: string;
|
|
83
85
|
}>, any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.companySubscriptionFactory = exports.CompanySubscription = void 0;
|
|
3
|
+
exports.companySubscriptionFactory = exports.getCompanySubscriptionSchema = exports.CompanySubscription = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const validateProjectionResult_1 = require("../../../../../validators/validateProjectionResult");
|
|
6
6
|
const validateProjection_1 = require("../../../../../validators/validateProjection");
|
|
@@ -15,14 +15,13 @@ const ObjectId = mongoose_1.Schema.Types.ObjectId;
|
|
|
15
15
|
class CompanySubscription {
|
|
16
16
|
}
|
|
17
17
|
exports.CompanySubscription = CompanySubscription;
|
|
18
|
-
const
|
|
18
|
+
const getCompanySubscriptionSchema = (connection, companyConnection, eventConnection) => {
|
|
19
19
|
const companySubscriptionUserSchema = (0, company_subscription_user_entity_1.getCompanySubscriptionUserSchema)(connection, companyConnection);
|
|
20
20
|
const featureSchema = (0, feature_entity_1.getFeatureSchema)();
|
|
21
|
-
|
|
21
|
+
return new mongoose_1.Schema({
|
|
22
22
|
subscription: {
|
|
23
23
|
type: ObjectId,
|
|
24
|
-
ref: 'Subscription',
|
|
25
|
-
required: true,
|
|
24
|
+
ref: (0, services_1.getModelRef)('Subscription', connection),
|
|
26
25
|
},
|
|
27
26
|
features: { type: [featureSchema], required: true, default: [] },
|
|
28
27
|
payment: {
|
|
@@ -62,6 +61,10 @@ const companySubscriptionFactory = (connection, companyConnection, eventConnecti
|
|
|
62
61
|
badges: { type: [ObjectId], default: [] },
|
|
63
62
|
stripeSubscriptionId: { type: String },
|
|
64
63
|
});
|
|
64
|
+
};
|
|
65
|
+
exports.getCompanySubscriptionSchema = getCompanySubscriptionSchema;
|
|
66
|
+
const companySubscriptionFactory = (connection, companyConnection, eventConnection) => {
|
|
67
|
+
const companySubscriptionSchema = (0, exports.getCompanySubscriptionSchema)(connection, companyConnection, eventConnection);
|
|
65
68
|
const allProjectionFieldArray = [
|
|
66
69
|
'_id',
|
|
67
70
|
'subscription',
|
|
@@ -139,11 +142,10 @@ const companySubscriptionFactory = (connection, companyConnection, eventConnecti
|
|
|
139
142
|
next();
|
|
140
143
|
});
|
|
141
144
|
companySubscriptionSchema.index({
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
guestCompanyId: 1,
|
|
145
|
+
event: 1,
|
|
146
|
+
company: 1,
|
|
147
|
+
payment: 1,
|
|
148
|
+
subscription: 1,
|
|
147
149
|
status: 1,
|
|
148
150
|
createdAt: -1,
|
|
149
151
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company-subscription.entity.js","sourceRoot":"","sources":["../../../../../../src/entities/models/subscriptions/entities/companySubscriptions/company-subscription.entity.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAC7C,iGAA6F;AAC7F,qFAAiF;AACjF,+EAA2E;AAC3E,qFAAiF;AAGjF,wEAAmE;AAEnE,yFAG2C;AAC3C,+DAAsE;AACtE,yFAA8E;AAC9E,+DAA8D;
|
|
1
|
+
{"version":3,"file":"company-subscription.entity.js","sourceRoot":"","sources":["../../../../../../src/entities/models/subscriptions/entities/companySubscriptions/company-subscription.entity.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAC7C,iGAA6F;AAC7F,qFAAiF;AACjF,+EAA2E;AAC3E,qFAAiF;AAGjF,wEAAmE;AAEnE,yFAG2C;AAC3C,+DAAsE;AACtE,yFAA8E;AAC9E,+DAA8D;AAG9D,MAAM,QAAQ,GAAG,iBAAM,CAAC,KAAK,CAAC,QAAQ,CAAA;AAGtC,MAAa,mBAAmB;CAqB/B;AArBD,kDAqBC;AAEM,MAAM,4BAA4B,GACrC,CAAC,UAAsB,EAAE,iBAA6B,EAAE,eAA2B,EAC7B,EAAE;IAC1D,MAAM,6BAA6B,GAAG,IAAA,mEAAgC,EAClE,UAAU,EACV,iBAAiB,CACpB,CAAA;IACD,MAAM,aAAa,GAAG,IAAA,iCAAgB,GAAE,CAAC;IAEzC,OAAO,IAAI,iBAAM,CAAiD;QAChE,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,IAAA,sBAAW,EAAkC,cAAc,EAAE,UAAU,CAAC;SAC9E;QACD,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QAChE,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,SAAS;SACf;QACD,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxC,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChD,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;Q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sBAAsB,EACtB,EAAE,CAAC,IAAA,mDAAwB,EAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAA;IAE9E,yBAAyB,CAAC,OAAO,CAAC,kBAAkB,GAAG,CACrD,wBAAwB,EACxB,EAAE,CAAC,IAAA,uCAAkB,EAAC,uBAAuB,EAAE,wBAAwB,CAAC,CAAA;IAE1E,yBAAyB,CAAC,OAAO,CAAC,eAAe,GAAG,CAAC,UAAU,EAAE,EAAE,CACjE,IAAA,iCAAe,EAAC,4BAA4B,EAAE,UAAU,CAAC,CAAA;IAE3D,yBAAyB,CAAC,OAAO,CAAC,kBAAkB,GAAG,CAAC,aAAa,EAAE,EAAE,CACvE,IAAA,uCAAkB,EAAC,+BAA+B,EAAE,aAAa,CAAC,CAAA;IAEpE,yBAAyB,CAAC,OAAO,CAAC,qBAAqB,GAAG,GAAG,EAAE,CAC7D,kBAAkB,CAAA;IAEpB,yBAAyB,CAAC,GAAG,CAC3B,kBAAkB,EAClB,KAAK,WAAiB,IAAI;QAGxB,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAA;QACnC,IAAI,EAAE,CAAA;IACR,CAAC,CACF,CAAA;IAED,yBAAyB,CAAC,KAAK,CAAC;QAC9B,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,CAAC;QACf,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,CAAC,CAAC;KACd,CAAC,CAAA;IAEF,OAAO,IAAA,8BAAa,EAClB,qBAAqB,EACrB,UAAU,EACV,yBAAyB,CAC1B,CAAA;AACH,CAAC,CAAA;AAxHY,QAAA,0BAA0B,8BAwHtC"}
|
|
@@ -24,6 +24,7 @@ const getFeatureSchema = () => {
|
|
|
24
24
|
tooltip: { type: String, trim: true },
|
|
25
25
|
endpoints: { type: [endpointSchema] },
|
|
26
26
|
isActive: { type: Boolean, default: true },
|
|
27
|
+
isPrimary: { type: Boolean, default: true },
|
|
27
28
|
createdAt: { type: Date, required: true, default: Date.now },
|
|
28
29
|
updatedAt: { type: Date, required: true, default: Date.now },
|
|
29
30
|
assessmentFeature: { type: Boolean, default: false, required: true },
|
|
@@ -39,6 +40,7 @@ const featureFactory = (connection) => {
|
|
|
39
40
|
'endpoints',
|
|
40
41
|
'featureType',
|
|
41
42
|
'isActive',
|
|
43
|
+
'isPrimary',
|
|
42
44
|
'tooltip',
|
|
43
45
|
'createdAt',
|
|
44
46
|
'updatedAt',
|
|
@@ -50,6 +52,7 @@ const featureFactory = (connection) => {
|
|
|
50
52
|
'endpoints',
|
|
51
53
|
'featureType',
|
|
52
54
|
'isActive',
|
|
55
|
+
'isPrimary',
|
|
53
56
|
'tooltip',
|
|
54
57
|
'createdAt',
|
|
55
58
|
'updatedAt',
|
|
@@ -61,6 +64,7 @@ const featureFactory = (connection) => {
|
|
|
61
64
|
'endpoints',
|
|
62
65
|
'featureType',
|
|
63
66
|
'isActive',
|
|
67
|
+
'isPrimary',
|
|
64
68
|
'tooltip',
|
|
65
69
|
'createdAt',
|
|
66
70
|
'updatedAt',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.entity.js","sourceRoot":"","sources":["../../../../../../src/entities/models/subscriptions/entities/features/feature.entity.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAC7C,iGAA6F;AAC7F,qFAAiF;AACjF,+EAA2E;AAC3E,qFAAiF;AAEjF,8EAAoE;AACpE,uDAA+D;AAC/D,+DAAgE;AAIhE,MAAa,OAAO;
|
|
1
|
+
{"version":3,"file":"feature.entity.js","sourceRoot":"","sources":["../../../../../../src/entities/models/subscriptions/entities/features/feature.entity.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAC7C,iGAA6F;AAC7F,qFAAiF;AACjF,+EAA2E;AAC3E,qFAAiF;AAEjF,8EAAoE;AACpE,uDAA+D;AAC/D,+DAAgE;AAIhE,MAAa,OAAO;CAWnB;AAXD,0BAWC;AAEM,M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aAAa,CACd,CAAA;AACH,CAAC,CAAA;AArEY,QAAA,cAAc,kBAqE1B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./subscription.entity"), exports);
|
|
18
|
+
__exportStar(require("./subscription-type.enum"), exports);
|
|
19
|
+
__exportStar(require("./subscription-model.enum"), exports);
|
|
20
|
+
__exportStar(require("./subscription-category.enum"), exports);
|
|
21
|
+
__exportStar(require("./user-settin-option.entity"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/entities/models/subscriptions/entities/subscription/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC;AACrC,2DAAwC;AACxC,4DAAyC;AACzC,+DAA4C;AAC5C,8DAA2C"}
|
package/build/entities/models/subscriptions/entities/subscription/subscription-category.enum.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionCategory = void 0;
|
|
4
|
+
var SubscriptionCategory;
|
|
5
|
+
(function (SubscriptionCategory) {
|
|
6
|
+
SubscriptionCategory["PROFESSIONAL"] = "Professional";
|
|
7
|
+
SubscriptionCategory["PREMIUM"] = "Premium";
|
|
8
|
+
SubscriptionCategory["CUSTOM"] = "Custom";
|
|
9
|
+
SubscriptionCategory["FREE"] = "Free";
|
|
10
|
+
})(SubscriptionCategory || (exports.SubscriptionCategory = SubscriptionCategory = {}));
|
|
11
|
+
//# sourceMappingURL=subscription-category.enum.js.map
|
package/build/entities/models/subscriptions/entities/subscription/subscription-category.enum.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-category.enum.js","sourceRoot":"","sources":["../../../../../../src/entities/models/subscriptions/entities/subscription/subscription-category.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,qDAA6B,CAAA;IAC7B,2CAAmB,CAAA;IACnB,yCAAiB,CAAA;IACjB,qCAAa,CAAA;AACf,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionModelEnum = void 0;
|
|
4
|
+
var SubscriptionModelEnum;
|
|
5
|
+
(function (SubscriptionModelEnum) {
|
|
6
|
+
SubscriptionModelEnum["EVENT"] = "Event";
|
|
7
|
+
SubscriptionModelEnum["COMPANY"] = "Company";
|
|
8
|
+
SubscriptionModelEnum["TRADE"] = "Trade";
|
|
9
|
+
})(SubscriptionModelEnum || (exports.SubscriptionModelEnum = SubscriptionModelEnum = {}));
|
|
10
|
+
//# sourceMappingURL=subscription-model.enum.js.map
|
package/build/entities/models/subscriptions/entities/subscription/subscription-model.enum.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-model.enum.js","sourceRoot":"","sources":["../../../../../../src/entities/models/subscriptions/entities/subscription/subscription-model.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,wCAAe,CAAA;AACjB,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionType = void 0;
|
|
4
|
+
var SubscriptionType;
|
|
5
|
+
(function (SubscriptionType) {
|
|
6
|
+
SubscriptionType["PUBLIC"] = "Public";
|
|
7
|
+
SubscriptionType["PRIVATE"] = "Private";
|
|
8
|
+
SubscriptionType["ON_REQUEST"] = "On_request";
|
|
9
|
+
})(SubscriptionType || (exports.SubscriptionType = SubscriptionType = {}));
|
|
10
|
+
//# sourceMappingURL=subscription-type.enum.js.map
|
package/build/entities/models/subscriptions/entities/subscription/subscription-type.enum.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-type.enum.js","sourceRoot":"","sources":["../../../../../../src/entities/models/subscriptions/entities/subscription/subscription-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;AAC3B,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/aggregate" />
|
|
25
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/callback" />
|
|
26
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/collection" />
|
|
27
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/connection" />
|
|
28
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/cursor" />
|
|
29
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/document" />
|
|
30
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/error" />
|
|
31
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/expressions" />
|
|
32
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/helpers" />
|
|
33
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/middlewares" />
|
|
34
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/indexes" />
|
|
35
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/models" />
|
|
36
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/mongooseoptions" />
|
|
37
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/pipelinestage" />
|
|
38
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/populate" />
|
|
39
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/query" />
|
|
40
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schemaoptions" />
|
|
41
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schematypes" />
|
|
42
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/session" />
|
|
43
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/types" />
|
|
44
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/utility" />
|
|
45
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/validation" />
|
|
46
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/virtuals" />
|
|
47
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose" />
|
|
48
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
49
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
50
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/inferschematype" />
|
|
51
|
+
import { Connection, Schema } from 'mongoose';
|
|
52
|
+
import { CustomModel } from '../../../../../db/CustomModel';
|
|
53
|
+
import { SubscriptionType } from "./subscription-type.enum";
|
|
54
|
+
import { SubscriptionCategory } from "./subscription-category.enum";
|
|
55
|
+
import { SubscriptionModelEnum } from "./subscription-model.enum";
|
|
56
|
+
import { UserSetterOption } from "./user-settin-option.entity";
|
|
57
|
+
import { Feature } from "../features";
|
|
58
|
+
export type SubscriptionModel = CustomModel<Subscription>;
|
|
59
|
+
export declare class Subscription {
|
|
60
|
+
_id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
type: SubscriptionType;
|
|
63
|
+
description: string;
|
|
64
|
+
subscriptionModel: SubscriptionModelEnum;
|
|
65
|
+
category: SubscriptionCategory;
|
|
66
|
+
price: number;
|
|
67
|
+
yearlyPrice: number;
|
|
68
|
+
maxUsers: number[];
|
|
69
|
+
discount: number;
|
|
70
|
+
points: number;
|
|
71
|
+
priority: number;
|
|
72
|
+
validityPeriod: number;
|
|
73
|
+
maxSubscribers: number;
|
|
74
|
+
features: Feature[];
|
|
75
|
+
actionName: string;
|
|
76
|
+
tooltip: string;
|
|
77
|
+
usersOptions: UserSetterOption[];
|
|
78
|
+
settersOptions?: UserSetterOption[];
|
|
79
|
+
createdFor?: string;
|
|
80
|
+
createdBy?: string;
|
|
81
|
+
createdAt?: Date;
|
|
82
|
+
updatedAt?: Date;
|
|
83
|
+
}
|
|
84
|
+
export declare const getSubscriptionSchema: (connection: Connection) => Schema<Subscription, SubscriptionModel>;
|
|
85
|
+
export declare const subscriptionFactory: (connection: Connection) => import("mongoose").Model<Subscription, {}, {}, {}, import("mongoose").Document<unknown, {}, Subscription> & Subscription & Required<{
|
|
86
|
+
_id: string;
|
|
87
|
+
}>, any>;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscriptionFactory = exports.getSubscriptionSchema = exports.Subscription = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const validateProjectionResult_1 = require("../../../../../validators/validateProjectionResult");
|
|
6
|
+
const validateProjection_1 = require("../../../../../validators/validateProjection");
|
|
7
|
+
const validateNewItem_1 = require("../../../../../validators/validateNewItem");
|
|
8
|
+
const validateUpdateItem_1 = require("../../../../../validators/validateUpdateItem");
|
|
9
|
+
const generate_model_1 = require("../../../../services/generate-model");
|
|
10
|
+
const subscription_type_enum_1 = require("./subscription-type.enum");
|
|
11
|
+
const subscription_category_enum_1 = require("./subscription-category.enum");
|
|
12
|
+
const subscription_model_enum_1 = require("./subscription-model.enum");
|
|
13
|
+
const user_settin_option_entity_1 = require("./user-settin-option.entity");
|
|
14
|
+
const services_1 = require("../../../../services");
|
|
15
|
+
const ObjectId = mongoose_1.Schema.Types.ObjectId;
|
|
16
|
+
class Subscription {
|
|
17
|
+
}
|
|
18
|
+
exports.Subscription = Subscription;
|
|
19
|
+
const getSubscriptionSchema = (connection) => {
|
|
20
|
+
const usersSettersOptionsSchema = (0, user_settin_option_entity_1.getUserSetterOptionSchema)();
|
|
21
|
+
return new mongoose_1.Schema({
|
|
22
|
+
name: { type: String, required: true },
|
|
23
|
+
type: {
|
|
24
|
+
type: String,
|
|
25
|
+
enum: Object.values(subscription_type_enum_1.SubscriptionType),
|
|
26
|
+
default: subscription_type_enum_1.SubscriptionType.PUBLIC,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
description: { type: String, required: true },
|
|
30
|
+
subscriptionModel: {
|
|
31
|
+
type: String,
|
|
32
|
+
enum: Object.values(subscription_model_enum_1.SubscriptionModelEnum),
|
|
33
|
+
default: subscription_model_enum_1.SubscriptionModelEnum.COMPANY,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
category: {
|
|
37
|
+
type: String,
|
|
38
|
+
enum: Object.values(subscription_category_enum_1.SubscriptionCategory),
|
|
39
|
+
default: subscription_category_enum_1.SubscriptionCategory.FREE,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
price: { type: Number, required: true },
|
|
43
|
+
yearlyPrice: { type: Number, required: true },
|
|
44
|
+
maxUsers: { type: [Number], required: true },
|
|
45
|
+
discount: { type: Number, required: true },
|
|
46
|
+
points: { type: Number, required: true },
|
|
47
|
+
priority: { type: Number, required: true },
|
|
48
|
+
validityPeriod: { type: Number, required: true },
|
|
49
|
+
maxSubscribers: { type: Number, required: true },
|
|
50
|
+
features: [{ type: ObjectId, required: true, ref: (0, services_1.getModelRef)('Feature', connection) }],
|
|
51
|
+
actionName: { type: String, required: true },
|
|
52
|
+
tooltip: { type: String, required: true },
|
|
53
|
+
usersOptions: { type: [usersSettersOptionsSchema], required: true },
|
|
54
|
+
settersOptions: { type: [usersSettersOptionsSchema], required: true },
|
|
55
|
+
createdFor: { type: String, required: true },
|
|
56
|
+
createdBy: { type: String, required: true },
|
|
57
|
+
createdAt: { type: Date, required: true, default: Date.now },
|
|
58
|
+
updatedAt: { type: Date, required: true, default: Date.now },
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
exports.getSubscriptionSchema = getSubscriptionSchema;
|
|
62
|
+
const subscriptionFactory = (connection) => {
|
|
63
|
+
const subscriptionSchema = (0, exports.getSubscriptionSchema)(connection);
|
|
64
|
+
const allProjectionFieldArray = [
|
|
65
|
+
'_id',
|
|
66
|
+
'name',
|
|
67
|
+
'type',
|
|
68
|
+
'description',
|
|
69
|
+
'subscriptionModel',
|
|
70
|
+
'category',
|
|
71
|
+
'price',
|
|
72
|
+
'yearlyPrice',
|
|
73
|
+
'maxUsers',
|
|
74
|
+
'discount',
|
|
75
|
+
'points',
|
|
76
|
+
'priority',
|
|
77
|
+
'validityPeriod',
|
|
78
|
+
'maxSubscribers',
|
|
79
|
+
'features',
|
|
80
|
+
'actionName',
|
|
81
|
+
'tooltip',
|
|
82
|
+
'usersOptions',
|
|
83
|
+
'settersOptions',
|
|
84
|
+
'createdFor',
|
|
85
|
+
'createdBy',
|
|
86
|
+
'createdAt',
|
|
87
|
+
'updatedAt',
|
|
88
|
+
];
|
|
89
|
+
const allValidateNewItemFieldArray = [
|
|
90
|
+
'_id',
|
|
91
|
+
'name',
|
|
92
|
+
'type',
|
|
93
|
+
'description',
|
|
94
|
+
'subscriptionModel',
|
|
95
|
+
'category',
|
|
96
|
+
'price',
|
|
97
|
+
'yearlyPrice',
|
|
98
|
+
'maxUsers',
|
|
99
|
+
'discount',
|
|
100
|
+
'points',
|
|
101
|
+
'priority',
|
|
102
|
+
'validityPeriod',
|
|
103
|
+
'maxSubscribers',
|
|
104
|
+
'features',
|
|
105
|
+
'actionName',
|
|
106
|
+
'tooltip',
|
|
107
|
+
'usersOptions',
|
|
108
|
+
'settersOptions',
|
|
109
|
+
'createdFor',
|
|
110
|
+
'createdBy',
|
|
111
|
+
'createdAt',
|
|
112
|
+
'updatedAt',
|
|
113
|
+
];
|
|
114
|
+
const allValidateUpdateItemFieldArray = [
|
|
115
|
+
'_id',
|
|
116
|
+
'name',
|
|
117
|
+
'type',
|
|
118
|
+
'description',
|
|
119
|
+
'subscriptionModel',
|
|
120
|
+
'category',
|
|
121
|
+
'price',
|
|
122
|
+
'yearlyPrice',
|
|
123
|
+
'maxUsers',
|
|
124
|
+
'discount',
|
|
125
|
+
'points',
|
|
126
|
+
'priority',
|
|
127
|
+
'validityPeriod',
|
|
128
|
+
'maxSubscribers',
|
|
129
|
+
'features',
|
|
130
|
+
'actionName',
|
|
131
|
+
'tooltip',
|
|
132
|
+
'usersOptions',
|
|
133
|
+
'settersOptions',
|
|
134
|
+
'createdFor',
|
|
135
|
+
'createdBy',
|
|
136
|
+
'createdAt',
|
|
137
|
+
'updatedAt',
|
|
138
|
+
];
|
|
139
|
+
const defaultPopulations = [];
|
|
140
|
+
subscriptionSchema.statics.validateProjectionResult = (necessaryProjectionObj) => (0, validateProjectionResult_1.validateProjectionResult)(allProjectionFieldArray, necessaryProjectionObj);
|
|
141
|
+
subscriptionSchema.statics.validateProjection = (necessaryProjectionArray) => (0, validateProjection_1.validateProjection)(allProjectionFieldArray, necessaryProjectionArray);
|
|
142
|
+
subscriptionSchema.statics.validateNewItem = (newItemObj) => (0, validateNewItem_1.validateNewItem)(allValidateNewItemFieldArray, newItemObj);
|
|
143
|
+
subscriptionSchema.statics.validateUpdateItem = (updateItemObj) => (0, validateUpdateItem_1.validateUpdateItem)(allValidateUpdateItemFieldArray, updateItemObj);
|
|
144
|
+
subscriptionSchema.statics.getDefaultPopulations = () => defaultPopulations;
|
|
145
|
+
subscriptionSchema.pre('findOneAndUpdate', async function (next) {
|
|
146
|
+
this._update.updatedAt = new Date();
|
|
147
|
+
next();
|
|
148
|
+
});
|
|
149
|
+
subscriptionSchema.index({
|
|
150
|
+
type: 1,
|
|
151
|
+
name: 1,
|
|
152
|
+
features: 1,
|
|
153
|
+
createdAt: -1,
|
|
154
|
+
subscriptionModel: 1,
|
|
155
|
+
});
|
|
156
|
+
return (0, generate_model_1.generateModel)('Subscription', connection, subscriptionSchema);
|
|
157
|
+
};
|
|
158
|
+
exports.subscriptionFactory = subscriptionFactory;
|
|
159
|
+
//# sourceMappingURL=subscription.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.entity.js","sourceRoot":"","sources":["../../../../../../src/entities/models/subscriptions/entities/subscription/subscription.entity.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAC7C,iGAA6F;AAC7F,qFAAiF;AACjF,+EAA2E;AAC3E,qFAAiF;AACjF,wEAAmE;AAEnE,qEAA0D;AAC1D,6EAAkE;AAClE,uEAAgE;AAChE,2EAAwF;AAExF,mDAAiD;AAEjD,MAAM,QAAQ,GAAG,iBAAM,CAAC,KAAK,CAAC,QAAQ,CAAA;AAGtC,MAAa,YAAY;CAwBxB;AAxBD,oCAwBC;AAGM,MAAM,qBAAqB,GAAG,CAAC,UAAsB,EAA2C,EAAE;IACvG,MAAM,yBAAyB,GAAG,IAAA,qDAAyB,GAAE,CAAA;IAC7D,OAAO,IAAI,iBAAM,CAAkC;QACjD,IAAI,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAC;QACpC,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,yCAAgB,CAAC;YACrC,OAAO,EAAE,yCAAgB,CAAC,MAAM;YAChC,QAAQ,EAAE,IAAI;SACf;QACD,WAAW,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAC;QAC3C,iBAAiB,EAAE;YACjB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,+CAAqB,C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E,CAAC;QACP,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,CAAC,CAAC;QACb,iBAAiB,EAAE,CAAC;KACrB,CAAC,CAAA;IAEF,OAAO,IAAA,8BAAa,EAClB,cAAc,EACd,UAAU,EACV,kBAAkB,CACnB,CAAA;AACH,CAAC,CAAA;AA9HY,QAAA,mBAAmB,uBA8H/B"}
|
package/build/entities/models/subscriptions/entities/subscription/user-settin-option.entity.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/aggregate" />
|
|
25
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/callback" />
|
|
26
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/collection" />
|
|
27
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/connection" />
|
|
28
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/cursor" />
|
|
29
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/document" />
|
|
30
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/error" />
|
|
31
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/expressions" />
|
|
32
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/helpers" />
|
|
33
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/middlewares" />
|
|
34
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/indexes" />
|
|
35
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/models" />
|
|
36
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/mongooseoptions" />
|
|
37
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/pipelinestage" />
|
|
38
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/populate" />
|
|
39
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/query" />
|
|
40
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schemaoptions" />
|
|
41
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schematypes" />
|
|
42
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/session" />
|
|
43
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/types" />
|
|
44
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/utility" />
|
|
45
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/validation" />
|
|
46
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/virtuals" />
|
|
47
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose" />
|
|
48
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
49
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
50
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/inferschematype" />
|
|
51
|
+
import { Schema } from 'mongoose';
|
|
52
|
+
import { CustomModel } from '../../../../../db/CustomModel';
|
|
53
|
+
export type UserSetterOptionModel = CustomModel<UserSetterOption>;
|
|
54
|
+
export declare class UserSetterOption {
|
|
55
|
+
_id?: string;
|
|
56
|
+
label: string;
|
|
57
|
+
value: string;
|
|
58
|
+
userCount: number;
|
|
59
|
+
priority: number;
|
|
60
|
+
lookupKey: string;
|
|
61
|
+
}
|
|
62
|
+
export declare const getUserSetterOptionSchema: () => Schema<UserSetterOption, UserSetterOptionModel>;
|