pristine-member-nest-api-database 1.0.90 → 1.0.92
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/models/Member.model.js +615 -105
- package/dist/models/User.model.js +2 -0
- package/models/Member.model.ts +693 -129
- package/models/User.model.ts +4 -0
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// import mongoose, { Document, Schema } from "mongoose";
|
|
3
|
+
// import { Audit } from "../interface/Audit.interface";
|
|
4
|
+
// import IFile from "../interface/IFile.interface";
|
|
2
5
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
6
|
if (k2 === undefined) k2 = k;
|
|
4
7
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -24,19 +27,560 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
27
|
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.mongoMember = void 0;
|
|
30
|
+
// type barcodeBranchMemberhipdetails = {
|
|
31
|
+
// isRegisteredMembership: boolean; //field is used to check whether membership is created on first time registering
|
|
32
|
+
// isMembershipRequested: boolean; //means membership request is waiting for approval
|
|
33
|
+
// membershipType: mongoose.Types.ObjectId;
|
|
34
|
+
// membershipStatus: mongoose.Types.ObjectId;
|
|
35
|
+
// remarks: String;
|
|
36
|
+
// requestedDate: Date;
|
|
37
|
+
// isMembershipSynced: boolean; //used to check whether SAP sync done or not
|
|
38
|
+
// noOfSubscriptionMonths: number;
|
|
39
|
+
// isIssued: boolean; //means subscription is issued or not
|
|
40
|
+
// electedDate: Date;
|
|
41
|
+
// barcodeBranchMemberCode: string;
|
|
42
|
+
// barCode: number;
|
|
43
|
+
// validFrom: Date;
|
|
44
|
+
// validTo: Date;
|
|
45
|
+
// countryCode: number;
|
|
46
|
+
// changeDate: Date;
|
|
47
|
+
// isTerminationRequested: boolean;
|
|
48
|
+
// isTerminationSynced: boolean; //used to check whether SAP sync done or not
|
|
49
|
+
// terminationDate: Date;
|
|
50
|
+
// terminationReason: string;
|
|
51
|
+
// };
|
|
52
|
+
// type noneGs1MembershipDetails = {
|
|
53
|
+
// associationMemberCode: string;
|
|
54
|
+
// membershipStatus: mongoose.Types.ObjectId;
|
|
55
|
+
// membershipType: mongoose.Types.ObjectId;
|
|
56
|
+
// isTerminated: boolean;
|
|
57
|
+
// terminatedDate: Date;
|
|
58
|
+
// reasonForTermination: string;
|
|
59
|
+
// isTerminationRequested: boolean;
|
|
60
|
+
// terminationRequestedDate: Date;
|
|
61
|
+
// terminationRequestedBy: string;
|
|
62
|
+
// terminationRequestRemarks: string;
|
|
63
|
+
// onOfSubscriptionMonths: number;
|
|
64
|
+
// isMembershipSynced: boolean;
|
|
65
|
+
// SyncOn: Date;
|
|
66
|
+
// electedDate: Date;
|
|
67
|
+
// };
|
|
68
|
+
// interface MemberDocument extends Document {
|
|
69
|
+
// memberId: number;
|
|
70
|
+
// memberCode: string;
|
|
71
|
+
// memberName: string;
|
|
72
|
+
// isMemberOfMasterBranch: boolean;
|
|
73
|
+
// pureStaticMemberLevelFieldValues: [
|
|
74
|
+
// {
|
|
75
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
76
|
+
// value: string;
|
|
77
|
+
// },
|
|
78
|
+
// ];
|
|
79
|
+
// //Member Level Sync
|
|
80
|
+
// isCreatedInSAP: boolean;
|
|
81
|
+
// isMemberSyncedWithSAP: boolean;
|
|
82
|
+
// memberSyncedOn: Date;
|
|
83
|
+
// isActive: boolean;
|
|
84
|
+
// //new
|
|
85
|
+
// memberAssociation: [
|
|
86
|
+
// {
|
|
87
|
+
// applicationId: mongoose.Types.ObjectId;
|
|
88
|
+
// branchId: mongoose.Types.ObjectId;
|
|
89
|
+
// categoryData: [
|
|
90
|
+
// {
|
|
91
|
+
// categoryId: mongoose.Types.ObjectId;
|
|
92
|
+
// fieldValues: [
|
|
93
|
+
// {
|
|
94
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
95
|
+
// value: string | number | any;
|
|
96
|
+
// },
|
|
97
|
+
// ];
|
|
98
|
+
// },
|
|
99
|
+
// ];
|
|
100
|
+
// membershipData: {
|
|
101
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
102
|
+
// value: barcodeBranchMemberhipdetails[] | noneGs1MembershipDetails;
|
|
103
|
+
// };
|
|
104
|
+
// isCreatedInSAP: boolean;
|
|
105
|
+
// isMemberSyncedWithSAP: boolean;
|
|
106
|
+
// memberSyncedOn: Date;
|
|
107
|
+
// dynamicDetails: JSON;
|
|
108
|
+
// applicationStatus: string;
|
|
109
|
+
// isEnrolmentCreatedInSAP: boolean;
|
|
110
|
+
// isEnrolmentSyncedWithSAP: boolean;
|
|
111
|
+
// enrolmentSyncedOn: Date;
|
|
112
|
+
// salesOrderDocEntry: string; // SAP sales order doc entry when creating BP in SAP
|
|
113
|
+
// salesOrderStatus: string; // SAP sales order status when creating BP in SAP
|
|
114
|
+
// isActive: boolean;
|
|
115
|
+
// createdDate: Date;
|
|
116
|
+
// approverOneData: {
|
|
117
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
118
|
+
// remarks: string;
|
|
119
|
+
// userId: string;
|
|
120
|
+
// attachment: IFile[];
|
|
121
|
+
// };
|
|
122
|
+
// approverTwoData: {
|
|
123
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
124
|
+
// remarks: string;
|
|
125
|
+
// userId: string;
|
|
126
|
+
// attachment: IFile[];
|
|
127
|
+
// };
|
|
128
|
+
// },
|
|
129
|
+
// ];
|
|
130
|
+
// audit: Audit[];
|
|
131
|
+
// }
|
|
132
|
+
// mongoose.set("strictPopulate", false);
|
|
133
|
+
// /* ------------------------------------------------ */
|
|
134
|
+
// /* File Schema */
|
|
135
|
+
// /* ------------------------------------------------ */
|
|
136
|
+
// const fileSchema = new Schema<IFile>({
|
|
137
|
+
// baseURL: { type: String },
|
|
138
|
+
// fileName: { type: String },
|
|
139
|
+
// fileExtension: { type: String },
|
|
140
|
+
// });
|
|
141
|
+
// /* ------------------------------------------------ */
|
|
142
|
+
// /* Barcode Membership Schema */
|
|
143
|
+
// /* ------------------------------------------------ */
|
|
144
|
+
// const barcodeMembershipSchema = new Schema({
|
|
145
|
+
// isRegisteredMembership: { type: Boolean, required: true },
|
|
146
|
+
// isMembershipRequested: { type: Boolean, default: true },
|
|
147
|
+
// membershipType: {
|
|
148
|
+
// type: Schema.Types.ObjectId,
|
|
149
|
+
// ref: "Membership.Types",
|
|
150
|
+
// required: true,
|
|
151
|
+
// },
|
|
152
|
+
// membershipStatus: {
|
|
153
|
+
// type: Schema.Types.ObjectId,
|
|
154
|
+
// ref: "Membership.Statuses",
|
|
155
|
+
// required: true,
|
|
156
|
+
// },
|
|
157
|
+
// remarks: { type: String },
|
|
158
|
+
// requestedDate: { type: Date, default: Date.now },
|
|
159
|
+
// isMembershipSynced: { type: Boolean, default: false },
|
|
160
|
+
// noOfSubscriptionMonths: { type: Number },
|
|
161
|
+
// isIssued: { type: Boolean },
|
|
162
|
+
// electedDate: { type: Date },
|
|
163
|
+
// barcodeBranchMemberCode: { type: String },
|
|
164
|
+
// barCode: { type: Number },
|
|
165
|
+
// validFrom: { type: Date },
|
|
166
|
+
// validTo: { type: Date },
|
|
167
|
+
// countryCode: { type: Number },
|
|
168
|
+
// changeDate: { type: Date },
|
|
169
|
+
// isTerminationRequested: { type: Boolean, default: false },
|
|
170
|
+
// isTerminationSynced: { type: Boolean, default: false },
|
|
171
|
+
// terminationDate: { type: Date },
|
|
172
|
+
// terminationReason: { type: String },
|
|
173
|
+
// });
|
|
174
|
+
// /* ------------------------------------------------ */
|
|
175
|
+
// /* None GS1 Membership Schema */
|
|
176
|
+
// /* ------------------------------------------------ */
|
|
177
|
+
// const noneGs1MembershipSchema = new Schema({
|
|
178
|
+
// associationMemberCode: { type: String },
|
|
179
|
+
// membershipStatus: {
|
|
180
|
+
// type: Schema.Types.ObjectId,
|
|
181
|
+
// ref: "Membership.Statuses",
|
|
182
|
+
// },
|
|
183
|
+
// membershipType: {
|
|
184
|
+
// type: Schema.Types.ObjectId,
|
|
185
|
+
// ref: "Membership.Types",
|
|
186
|
+
// },
|
|
187
|
+
// isTerminated: { type: Boolean },
|
|
188
|
+
// terminatedDate: { type: Date },
|
|
189
|
+
// reasonForTermination: { type: String },
|
|
190
|
+
// isTerminationRequested: { type: Boolean },
|
|
191
|
+
// terminationRequestedDate: { type: Date },
|
|
192
|
+
// terminationRequestedBy: { type: String },
|
|
193
|
+
// terminationRequestRemarks: { type: String },
|
|
194
|
+
// onOfSubscriptionMonths: { type: Number },
|
|
195
|
+
// isMembershipSynced: { type: Boolean },
|
|
196
|
+
// SyncOn: { type: Date },
|
|
197
|
+
// electedDate: { type: Date },
|
|
198
|
+
// });
|
|
199
|
+
// /* ------------------------------------------------ */
|
|
200
|
+
// /* Category Field Value */
|
|
201
|
+
// /* ------------------------------------------------ */
|
|
202
|
+
// const fieldValueSchema = new Schema({
|
|
203
|
+
// fieldId: {
|
|
204
|
+
// type: Schema.Types.ObjectId,
|
|
205
|
+
// ref: "Editor.Fields.Master",
|
|
206
|
+
// },
|
|
207
|
+
// value: { type: Schema.Types.Mixed },
|
|
208
|
+
// });
|
|
209
|
+
// /* ------------------------------------------------ */
|
|
210
|
+
// /* Category Schema */
|
|
211
|
+
// /* ------------------------------------------------ */
|
|
212
|
+
// const categorySchema = new Schema({
|
|
213
|
+
// categoryId: {
|
|
214
|
+
// type: Schema.Types.ObjectId,
|
|
215
|
+
// ref: "Field.Categories",
|
|
216
|
+
// },
|
|
217
|
+
// fieldValues: [fieldValueSchema],
|
|
218
|
+
// });
|
|
219
|
+
// /* ------------------------------------------------ */
|
|
220
|
+
// /* Membership Data */
|
|
221
|
+
// /* ------------------------------------------------ */
|
|
222
|
+
// const membershipDataSchema = new Schema({
|
|
223
|
+
// fieldId: {
|
|
224
|
+
// type: Schema.Types.ObjectId,
|
|
225
|
+
// },
|
|
226
|
+
// barcodeBranchMembership: [barcodeMembershipSchema],
|
|
227
|
+
// noneGs1Membership: noneGs1MembershipSchema,
|
|
228
|
+
// });
|
|
229
|
+
// /* ------------------------------------------------ */
|
|
230
|
+
// /* Approver Schema */
|
|
231
|
+
// /* ------------------------------------------------ */
|
|
232
|
+
// const approverSchema = new Schema({
|
|
233
|
+
// fieldId: { type: Schema.Types.ObjectId },
|
|
234
|
+
// remarks: { type: String },
|
|
235
|
+
// userId: { type: String },
|
|
236
|
+
// attachment: [fileSchema],
|
|
237
|
+
// });
|
|
238
|
+
// /* ------------------------------------------------ */
|
|
239
|
+
// /* Member Association */
|
|
240
|
+
// /* ------------------------------------------------ */
|
|
241
|
+
// const memberAssociationSchema = new Schema({
|
|
242
|
+
// applicationId: {
|
|
243
|
+
// type: Schema.Types.ObjectId,
|
|
244
|
+
// },
|
|
245
|
+
// branchId: {
|
|
246
|
+
// type: Schema.Types.ObjectId,
|
|
247
|
+
// ref: "Branches",
|
|
248
|
+
// },
|
|
249
|
+
// categoryData: [categorySchema],
|
|
250
|
+
// membershipData: membershipDataSchema,
|
|
251
|
+
// isCreatedInSAP: { type: Boolean, default: false },
|
|
252
|
+
// isMemberSyncedWithSAP: { type: Boolean, default: false },
|
|
253
|
+
// memberSyncedOn: { type: Date },
|
|
254
|
+
// dynamicDetails: { type: JSON, default: null },
|
|
255
|
+
// applicationStatus: { type: String },
|
|
256
|
+
// isEnrolmentCreatedInSAP: { type: Boolean, default: false },
|
|
257
|
+
// isEnrolmentSyncedWithSAP: { type: Boolean, default: false },
|
|
258
|
+
// enrolmentSyncedOn: { type: Date },
|
|
259
|
+
// salesOrderDocEntry: { type: String },
|
|
260
|
+
// salesOrderStatus: { type: String },
|
|
261
|
+
// isActive: { type: Boolean, default: true },
|
|
262
|
+
// createdDate: {
|
|
263
|
+
// type: Date,
|
|
264
|
+
// default: Date.now,
|
|
265
|
+
// },
|
|
266
|
+
// approverOneData: approverSchema,
|
|
267
|
+
// approverTwoData: approverSchema,
|
|
268
|
+
// });
|
|
269
|
+
// /* ------------------------------------------------ */
|
|
270
|
+
// /* Member Schema */
|
|
271
|
+
// /* ------------------------------------------------ */
|
|
272
|
+
// const memberSchema = new Schema<MemberDocument>({
|
|
273
|
+
// memberId: { type: Number },
|
|
274
|
+
// memberCode: { type: String, default: "" },
|
|
275
|
+
// memberName: { type: String },
|
|
276
|
+
// isMemberOfMasterBranch: { type: Boolean, default: false },
|
|
277
|
+
// pureStaticMemberLevelFieldValues: [
|
|
278
|
+
// {
|
|
279
|
+
// fieldId: {
|
|
280
|
+
// type: Schema.Types.ObjectId,
|
|
281
|
+
// ref: "Editor.Fields.Master",
|
|
282
|
+
// },
|
|
283
|
+
// value: { type: String },
|
|
284
|
+
// },
|
|
285
|
+
// ],
|
|
286
|
+
// isCreatedInSAP: { type: Boolean, default: false },
|
|
287
|
+
// isMemberSyncedWithSAP: { type: Boolean, default: false },
|
|
288
|
+
// memberSyncedOn: { type: Date },
|
|
289
|
+
// isActive: { type: Boolean },
|
|
290
|
+
// memberAssociation: [memberAssociationSchema],
|
|
291
|
+
// audit: [
|
|
292
|
+
// {
|
|
293
|
+
// userId: { type: String },
|
|
294
|
+
// auditedOn: { type: Date },
|
|
295
|
+
// actionType: { type: String },
|
|
296
|
+
// },
|
|
297
|
+
// ],
|
|
298
|
+
// });
|
|
299
|
+
// const mongoMember = mongoose.model<MemberDocument>("Members", memberSchema);
|
|
300
|
+
// export { mongoMember };
|
|
301
|
+
// import mongoose, { Document, Schema } from "mongoose";
|
|
302
|
+
// import { Audit } from "../interface/Audit.interface";
|
|
303
|
+
// import IFile from "../interface/IFile.interface";
|
|
304
|
+
// type barcodeBranchMemberhipdetails = {
|
|
305
|
+
// isRegisteredMembership: boolean; //field is used to check whether membership is created on first time registering
|
|
306
|
+
// isMembershipRequested: boolean; //means membership request is waiting for approval
|
|
307
|
+
// membershipType: mongoose.Types.ObjectId;
|
|
308
|
+
// membershipStatus: mongoose.Types.ObjectId;
|
|
309
|
+
// remarks: String;
|
|
310
|
+
// requestedDate: Date;
|
|
311
|
+
// isMembershipSynced: boolean; //used to check whether SAP sync done or not
|
|
312
|
+
// noOfSubscriptionMonths: number;
|
|
313
|
+
// isIssued: boolean; //means subscription is issued or not
|
|
314
|
+
// electedDate: Date;
|
|
315
|
+
// barcodeBranchMemberCode: string;
|
|
316
|
+
// barCode: number;
|
|
317
|
+
// validFrom: Date;
|
|
318
|
+
// validTo: Date;
|
|
319
|
+
// countryCode: number;
|
|
320
|
+
// changeDate: Date;
|
|
321
|
+
// isTerminationRequested: boolean;
|
|
322
|
+
// isTerminationSynced: boolean; //used to check whether SAP sync done or not
|
|
323
|
+
// terminationDate: Date;
|
|
324
|
+
// terminationReason: string;
|
|
325
|
+
// };
|
|
326
|
+
// type noneGs1MembershipDetails = {
|
|
327
|
+
// associationMemberCode: string;
|
|
328
|
+
// membershipStatus: mongoose.Types.ObjectId;
|
|
329
|
+
// membershipType: mongoose.Types.ObjectId;
|
|
330
|
+
// isTerminated: boolean;
|
|
331
|
+
// terminatedDate: Date;
|
|
332
|
+
// reasonForTermination: string;
|
|
333
|
+
// isTerminationRequested: boolean;
|
|
334
|
+
// terminationRequestedDate: Date;
|
|
335
|
+
// terminationRequestedBy: string;
|
|
336
|
+
// terminationRequestRemarks: string;
|
|
337
|
+
// onOfSubscriptionMonths: number;
|
|
338
|
+
// isMembershipSynced: boolean;
|
|
339
|
+
// SyncOn: Date;
|
|
340
|
+
// electedDate: Date;
|
|
341
|
+
// };
|
|
342
|
+
// interface MemberDocument extends Document {
|
|
343
|
+
// memberId: number;
|
|
344
|
+
// memberCode: string;
|
|
345
|
+
// memberName: string;
|
|
346
|
+
// isMemberOfMasterBranch: boolean;
|
|
347
|
+
// pureStaticMemberLevelFieldValues: [
|
|
348
|
+
// {
|
|
349
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
350
|
+
// value: string;
|
|
351
|
+
// },
|
|
352
|
+
// ];
|
|
353
|
+
// //Member Level Sync
|
|
354
|
+
// isCreatedInSAP: boolean;
|
|
355
|
+
// isMemberSyncedWithSAP: boolean;
|
|
356
|
+
// memberSyncedOn: Date;
|
|
357
|
+
// isActive: boolean;
|
|
358
|
+
// //new
|
|
359
|
+
// memberAssociation: [
|
|
360
|
+
// {
|
|
361
|
+
// applicationId: mongoose.Types.ObjectId;
|
|
362
|
+
// branchId: mongoose.Types.ObjectId;
|
|
363
|
+
// categoryData: [
|
|
364
|
+
// {
|
|
365
|
+
// categoryId: mongoose.Types.ObjectId;
|
|
366
|
+
// fieldValues: [
|
|
367
|
+
// {
|
|
368
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
369
|
+
// value: string | number | any;
|
|
370
|
+
// },
|
|
371
|
+
// ];
|
|
372
|
+
// },
|
|
373
|
+
// ];
|
|
374
|
+
// membershipData: {
|
|
375
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
376
|
+
// value: barcodeBranchMemberhipdetails[] | noneGs1MembershipDetails;
|
|
377
|
+
// };
|
|
378
|
+
// isCreatedInSAP: boolean;
|
|
379
|
+
// isMemberSyncedWithSAP: boolean;
|
|
380
|
+
// memberSyncedOn: Date;
|
|
381
|
+
// dynamicDetails: JSON;
|
|
382
|
+
// applicationStatus: string;
|
|
383
|
+
// isEnrolmentCreatedInSAP: boolean;
|
|
384
|
+
// isEnrolmentSyncedWithSAP: boolean;
|
|
385
|
+
// enrolmentSyncedOn: Date;
|
|
386
|
+
// salesOrderDocEntry: string; // SAP sales order doc entry when creating BP in SAP
|
|
387
|
+
// salesOrderStatus: string; // SAP sales order status when creating BP in SAP
|
|
388
|
+
// isActive: boolean;
|
|
389
|
+
// createdDate: Date;
|
|
390
|
+
// approverOneData: {
|
|
391
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
392
|
+
// remarks: string;
|
|
393
|
+
// userId: string;
|
|
394
|
+
// attachment: IFile[];
|
|
395
|
+
// };
|
|
396
|
+
// approverTwoData: {
|
|
397
|
+
// fieldId: mongoose.Types.ObjectId;
|
|
398
|
+
// remarks: string;
|
|
399
|
+
// userId: string;
|
|
400
|
+
// attachment: IFile[];
|
|
401
|
+
// };
|
|
402
|
+
// },
|
|
403
|
+
// ];
|
|
404
|
+
// audit: Audit[];
|
|
405
|
+
// }
|
|
406
|
+
// mongoose.set("strictPopulate", false);
|
|
407
|
+
// /* ------------------------------------------------ */
|
|
408
|
+
// /* File Schema */
|
|
409
|
+
// /* ------------------------------------------------ */
|
|
410
|
+
// const fileSchema = new Schema<IFile>({
|
|
411
|
+
// baseURL: { type: String },
|
|
412
|
+
// fileName: { type: String },
|
|
413
|
+
// fileExtension: { type: String },
|
|
414
|
+
// });
|
|
415
|
+
// /* ------------------------------------------------ */
|
|
416
|
+
// /* Barcode Membership Schema */
|
|
417
|
+
// /* ------------------------------------------------ */
|
|
418
|
+
// const barcodeMembershipSchema = new Schema({
|
|
419
|
+
// isRegisteredMembership: { type: Boolean, required: true },
|
|
420
|
+
// isMembershipRequested: { type: Boolean, default: true },
|
|
421
|
+
// membershipType: {
|
|
422
|
+
// type: Schema.Types.ObjectId,
|
|
423
|
+
// ref: "Membership.Types",
|
|
424
|
+
// required: true,
|
|
425
|
+
// },
|
|
426
|
+
// membershipStatus: {
|
|
427
|
+
// type: Schema.Types.ObjectId,
|
|
428
|
+
// ref: "Membership.Statuses",
|
|
429
|
+
// required: true,
|
|
430
|
+
// },
|
|
431
|
+
// remarks: { type: String },
|
|
432
|
+
// requestedDate: { type: Date, default: Date.now },
|
|
433
|
+
// isMembershipSynced: { type: Boolean, default: false },
|
|
434
|
+
// noOfSubscriptionMonths: { type: Number },
|
|
435
|
+
// isIssued: { type: Boolean },
|
|
436
|
+
// electedDate: { type: Date },
|
|
437
|
+
// barcodeBranchMemberCode: { type: String },
|
|
438
|
+
// barCode: { type: Number },
|
|
439
|
+
// validFrom: { type: Date },
|
|
440
|
+
// validTo: { type: Date },
|
|
441
|
+
// countryCode: { type: Number },
|
|
442
|
+
// changeDate: { type: Date },
|
|
443
|
+
// isTerminationRequested: { type: Boolean, default: false },
|
|
444
|
+
// isTerminationSynced: { type: Boolean, default: false },
|
|
445
|
+
// terminationDate: { type: Date },
|
|
446
|
+
// terminationReason: { type: String },
|
|
447
|
+
// });
|
|
448
|
+
// /* ------------------------------------------------ */
|
|
449
|
+
// /* None GS1 Membership Schema */
|
|
450
|
+
// /* ------------------------------------------------ */
|
|
451
|
+
// const noneGs1MembershipSchema = new Schema({
|
|
452
|
+
// associationMemberCode: { type: String },
|
|
453
|
+
// membershipStatus: {
|
|
454
|
+
// type: Schema.Types.ObjectId,
|
|
455
|
+
// ref: "Membership.Statuses",
|
|
456
|
+
// },
|
|
457
|
+
// membershipType: {
|
|
458
|
+
// type: Schema.Types.ObjectId,
|
|
459
|
+
// ref: "Membership.Types",
|
|
460
|
+
// },
|
|
461
|
+
// isTerminated: { type: Boolean },
|
|
462
|
+
// terminatedDate: { type: Date },
|
|
463
|
+
// reasonForTermination: { type: String },
|
|
464
|
+
// isTerminationRequested: { type: Boolean },
|
|
465
|
+
// terminationRequestedDate: { type: Date },
|
|
466
|
+
// terminationRequestedBy: { type: String },
|
|
467
|
+
// terminationRequestRemarks: { type: String },
|
|
468
|
+
// onOfSubscriptionMonths: { type: Number },
|
|
469
|
+
// isMembershipSynced: { type: Boolean },
|
|
470
|
+
// SyncOn: { type: Date },
|
|
471
|
+
// electedDate: { type: Date },
|
|
472
|
+
// });
|
|
473
|
+
// /* ------------------------------------------------ */
|
|
474
|
+
// /* Category Field Value */
|
|
475
|
+
// /* ------------------------------------------------ */
|
|
476
|
+
// const fieldValueSchema = new Schema({
|
|
477
|
+
// fieldId: {
|
|
478
|
+
// type: Schema.Types.ObjectId,
|
|
479
|
+
// ref: "Editor.Fields.Master",
|
|
480
|
+
// },
|
|
481
|
+
// value: { type: Schema.Types.Mixed },
|
|
482
|
+
// });
|
|
483
|
+
// /* ------------------------------------------------ */
|
|
484
|
+
// /* Category Schema */
|
|
485
|
+
// /* ------------------------------------------------ */
|
|
486
|
+
// const categorySchema = new Schema({
|
|
487
|
+
// categoryId: {
|
|
488
|
+
// type: Schema.Types.ObjectId,
|
|
489
|
+
// ref: "Field.Categories",
|
|
490
|
+
// },
|
|
491
|
+
// fieldValues: [fieldValueSchema],
|
|
492
|
+
// });
|
|
493
|
+
// /* ------------------------------------------------ */
|
|
494
|
+
// /* Membership Data */
|
|
495
|
+
// /* ------------------------------------------------ */
|
|
496
|
+
// const membershipDataSchema = new Schema({
|
|
497
|
+
// fieldId: {
|
|
498
|
+
// type: Schema.Types.ObjectId,
|
|
499
|
+
// },
|
|
500
|
+
// barcodeBranchMembership: [barcodeMembershipSchema],
|
|
501
|
+
// noneGs1Membership: noneGs1MembershipSchema,
|
|
502
|
+
// });
|
|
503
|
+
// /* ------------------------------------------------ */
|
|
504
|
+
// /* Approver Schema */
|
|
505
|
+
// /* ------------------------------------------------ */
|
|
506
|
+
// const approverSchema = new Schema({
|
|
507
|
+
// fieldId: { type: Schema.Types.ObjectId },
|
|
508
|
+
// remarks: { type: String },
|
|
509
|
+
// userId: { type: String },
|
|
510
|
+
// attachment: [fileSchema],
|
|
511
|
+
// });
|
|
512
|
+
// /* ------------------------------------------------ */
|
|
513
|
+
// /* Member Association */
|
|
514
|
+
// /* ------------------------------------------------ */
|
|
515
|
+
// const memberAssociationSchema = new Schema({
|
|
516
|
+
// applicationId: {
|
|
517
|
+
// type: Schema.Types.ObjectId,
|
|
518
|
+
// },
|
|
519
|
+
// branchId: {
|
|
520
|
+
// type: Schema.Types.ObjectId,
|
|
521
|
+
// ref: "Branches",
|
|
522
|
+
// },
|
|
523
|
+
// categoryData: [categorySchema],
|
|
524
|
+
// membershipData: membershipDataSchema,
|
|
525
|
+
// isCreatedInSAP: { type: Boolean, default: false },
|
|
526
|
+
// isMemberSyncedWithSAP: { type: Boolean, default: false },
|
|
527
|
+
// memberSyncedOn: { type: Date },
|
|
528
|
+
// dynamicDetails: { type: JSON, default: null },
|
|
529
|
+
// applicationStatus: { type: String },
|
|
530
|
+
// isEnrolmentCreatedInSAP: { type: Boolean, default: false },
|
|
531
|
+
// isEnrolmentSyncedWithSAP: { type: Boolean, default: false },
|
|
532
|
+
// enrolmentSyncedOn: { type: Date },
|
|
533
|
+
// salesOrderDocEntry: { type: String },
|
|
534
|
+
// salesOrderStatus: { type: String },
|
|
535
|
+
// isActive: { type: Boolean, default: true },
|
|
536
|
+
// createdDate: {
|
|
537
|
+
// type: Date,
|
|
538
|
+
// default: Date.now,
|
|
539
|
+
// },
|
|
540
|
+
// approverOneData: approverSchema,
|
|
541
|
+
// approverTwoData: approverSchema,
|
|
542
|
+
// });
|
|
543
|
+
// /* ------------------------------------------------ */
|
|
544
|
+
// /* Member Schema */
|
|
545
|
+
// /* ------------------------------------------------ */
|
|
546
|
+
// const memberSchema = new Schema<MemberDocument>({
|
|
547
|
+
// memberId: { type: Number },
|
|
548
|
+
// memberCode: { type: String, default: "" },
|
|
549
|
+
// memberName: { type: String },
|
|
550
|
+
// isMemberOfMasterBranch: { type: Boolean, default: false },
|
|
551
|
+
// pureStaticMemberLevelFieldValues: [
|
|
552
|
+
// {
|
|
553
|
+
// fieldId: {
|
|
554
|
+
// type: Schema.Types.ObjectId,
|
|
555
|
+
// ref: "Editor.Fields.Master",
|
|
556
|
+
// },
|
|
557
|
+
// value: { type: String },
|
|
558
|
+
// },
|
|
559
|
+
// ],
|
|
560
|
+
// isCreatedInSAP: { type: Boolean, default: false },
|
|
561
|
+
// isMemberSyncedWithSAP: { type: Boolean, default: false },
|
|
562
|
+
// memberSyncedOn: { type: Date },
|
|
563
|
+
// isActive: { type: Boolean },
|
|
564
|
+
// memberAssociation: [memberAssociationSchema],
|
|
565
|
+
// audit: [
|
|
566
|
+
// {
|
|
567
|
+
// userId: { type: String },
|
|
568
|
+
// auditedOn: { type: Date },
|
|
569
|
+
// actionType: { type: String },
|
|
570
|
+
// },
|
|
571
|
+
// ],
|
|
572
|
+
// });
|
|
573
|
+
// const mongoMember = mongoose.model<MemberDocument>("Members", memberSchema);
|
|
574
|
+
// export { mongoMember };
|
|
27
575
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
28
576
|
mongoose_1.default.set("strictPopulate", false);
|
|
29
|
-
|
|
30
|
-
/* File Schema */
|
|
31
|
-
/* ------------------------------------------------ */
|
|
577
|
+
// ------------------ File ------------------
|
|
32
578
|
const fileSchema = new mongoose_1.Schema({
|
|
33
|
-
baseURL:
|
|
34
|
-
fileName:
|
|
35
|
-
fileExtension:
|
|
579
|
+
baseURL: String,
|
|
580
|
+
fileName: String,
|
|
581
|
+
fileExtension: String,
|
|
36
582
|
});
|
|
37
|
-
|
|
38
|
-
/* Barcode Membership Schema */
|
|
39
|
-
/* ------------------------------------------------ */
|
|
583
|
+
// ------------------ Barcode Membership ------------------
|
|
40
584
|
const barcodeMembershipSchema = new mongoose_1.Schema({
|
|
41
585
|
isRegisteredMembership: { type: Boolean, required: true },
|
|
42
586
|
isMembershipRequested: { type: Boolean, default: true },
|
|
@@ -50,145 +594,111 @@ const barcodeMembershipSchema = new mongoose_1.Schema({
|
|
|
50
594
|
ref: "Membership.Statuses",
|
|
51
595
|
required: true,
|
|
52
596
|
},
|
|
53
|
-
remarks:
|
|
597
|
+
remarks: String,
|
|
54
598
|
requestedDate: { type: Date, default: Date.now },
|
|
55
599
|
isMembershipSynced: { type: Boolean, default: false },
|
|
56
|
-
noOfSubscriptionMonths:
|
|
57
|
-
isIssued:
|
|
58
|
-
electedDate:
|
|
59
|
-
barcodeBranchMemberCode:
|
|
60
|
-
barCode:
|
|
61
|
-
validFrom:
|
|
62
|
-
validTo:
|
|
63
|
-
countryCode:
|
|
64
|
-
changeDate:
|
|
600
|
+
noOfSubscriptionMonths: Number,
|
|
601
|
+
isIssued: Boolean,
|
|
602
|
+
electedDate: Date,
|
|
603
|
+
barcodeBranchMemberCode: String,
|
|
604
|
+
barCode: Number,
|
|
605
|
+
validFrom: Date,
|
|
606
|
+
validTo: Date,
|
|
607
|
+
countryCode: Number,
|
|
608
|
+
changeDate: Date,
|
|
65
609
|
isTerminationRequested: { type: Boolean, default: false },
|
|
66
610
|
isTerminationSynced: { type: Boolean, default: false },
|
|
67
|
-
terminationDate:
|
|
68
|
-
terminationReason:
|
|
611
|
+
terminationDate: Date,
|
|
612
|
+
terminationReason: String,
|
|
69
613
|
});
|
|
70
|
-
|
|
71
|
-
/* None GS1 Membership Schema */
|
|
72
|
-
/* ------------------------------------------------ */
|
|
614
|
+
// ------------------ None GS1 Membership ------------------
|
|
73
615
|
const noneGs1MembershipSchema = new mongoose_1.Schema({
|
|
74
|
-
associationMemberCode:
|
|
75
|
-
membershipStatus: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
terminationRequestedBy: { type: String },
|
|
89
|
-
terminationRequestRemarks: { type: String },
|
|
90
|
-
onOfSubscriptionMonths: { type: Number },
|
|
91
|
-
isMembershipSynced: { type: Boolean },
|
|
92
|
-
SyncOn: { type: Date },
|
|
93
|
-
electedDate: { type: Date },
|
|
616
|
+
associationMemberCode: String,
|
|
617
|
+
membershipStatus: { type: mongoose_1.Schema.Types.ObjectId, ref: "Membership.Statuses" },
|
|
618
|
+
membershipType: { type: mongoose_1.Schema.Types.ObjectId, ref: "Membership.Types" },
|
|
619
|
+
isTerminated: Boolean,
|
|
620
|
+
terminatedDate: Date,
|
|
621
|
+
reasonForTermination: String,
|
|
622
|
+
isTerminationRequested: Boolean,
|
|
623
|
+
terminationRequestedDate: Date,
|
|
624
|
+
terminationRequestedBy: String,
|
|
625
|
+
terminationRequestRemarks: String,
|
|
626
|
+
onOfSubscriptionMonths: Number,
|
|
627
|
+
isMembershipSynced: Boolean,
|
|
628
|
+
SyncOn: Date,
|
|
629
|
+
electedDate: Date,
|
|
94
630
|
});
|
|
95
|
-
|
|
96
|
-
/* Category Field Value */
|
|
97
|
-
/* ------------------------------------------------ */
|
|
631
|
+
// ------------------ Field Values ------------------
|
|
98
632
|
const fieldValueSchema = new mongoose_1.Schema({
|
|
99
|
-
fieldId: {
|
|
100
|
-
|
|
101
|
-
ref: "Editor.Fields.Master",
|
|
102
|
-
},
|
|
103
|
-
value: { type: mongoose_1.Schema.Types.Mixed },
|
|
633
|
+
fieldId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Editor.Fields.Master" },
|
|
634
|
+
value: mongoose_1.Schema.Types.Mixed,
|
|
104
635
|
});
|
|
105
|
-
|
|
106
|
-
/* Category Schema */
|
|
107
|
-
/* ------------------------------------------------ */
|
|
636
|
+
// ------------------ Category ------------------
|
|
108
637
|
const categorySchema = new mongoose_1.Schema({
|
|
109
|
-
categoryId: {
|
|
110
|
-
type: mongoose_1.Schema.Types.ObjectId,
|
|
111
|
-
ref: "Field.Categories",
|
|
112
|
-
},
|
|
638
|
+
categoryId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Field.Categories" },
|
|
113
639
|
fieldValues: [fieldValueSchema],
|
|
114
640
|
});
|
|
115
|
-
|
|
116
|
-
/* Membership Data */
|
|
117
|
-
/* ------------------------------------------------ */
|
|
641
|
+
// ------------------ Membership Data ------------------
|
|
118
642
|
const membershipDataSchema = new mongoose_1.Schema({
|
|
119
|
-
fieldId:
|
|
120
|
-
type: mongoose_1.Schema.Types.ObjectId,
|
|
121
|
-
},
|
|
643
|
+
fieldId: mongoose_1.Schema.Types.ObjectId,
|
|
122
644
|
barcodeBranchMembership: [barcodeMembershipSchema],
|
|
123
645
|
noneGs1Membership: noneGs1MembershipSchema,
|
|
124
646
|
});
|
|
125
|
-
|
|
126
|
-
/* Approver Schema */
|
|
127
|
-
/* ------------------------------------------------ */
|
|
647
|
+
// ------------------ Approver ------------------
|
|
128
648
|
const approverSchema = new mongoose_1.Schema({
|
|
129
|
-
fieldId:
|
|
130
|
-
remarks:
|
|
131
|
-
userId:
|
|
649
|
+
fieldId: mongoose_1.Schema.Types.ObjectId,
|
|
650
|
+
remarks: String,
|
|
651
|
+
userId: String,
|
|
132
652
|
attachment: [fileSchema],
|
|
133
653
|
});
|
|
134
|
-
|
|
135
|
-
/* Member Association */
|
|
136
|
-
/* ------------------------------------------------ */
|
|
654
|
+
// ------------------ Member Association ------------------
|
|
137
655
|
const memberAssociationSchema = new mongoose_1.Schema({
|
|
138
|
-
applicationId:
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
branchId: {
|
|
142
|
-
type: mongoose_1.Schema.Types.ObjectId,
|
|
143
|
-
ref: "Branches",
|
|
144
|
-
},
|
|
656
|
+
applicationId: mongoose_1.Schema.Types.ObjectId,
|
|
657
|
+
branchId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Branches" },
|
|
145
658
|
categoryData: [categorySchema],
|
|
146
659
|
membershipData: membershipDataSchema,
|
|
147
660
|
isCreatedInSAP: { type: Boolean, default: false },
|
|
148
661
|
isMemberSyncedWithSAP: { type: Boolean, default: false },
|
|
149
|
-
memberSyncedOn:
|
|
662
|
+
memberSyncedOn: Date,
|
|
150
663
|
dynamicDetails: { type: JSON, default: null },
|
|
151
|
-
applicationStatus:
|
|
664
|
+
applicationStatus: String,
|
|
152
665
|
isEnrolmentCreatedInSAP: { type: Boolean, default: false },
|
|
153
666
|
isEnrolmentSyncedWithSAP: { type: Boolean, default: false },
|
|
154
|
-
enrolmentSyncedOn:
|
|
155
|
-
salesOrderDocEntry:
|
|
156
|
-
salesOrderStatus:
|
|
667
|
+
enrolmentSyncedOn: Date,
|
|
668
|
+
salesOrderDocEntry: String,
|
|
669
|
+
salesOrderStatus: String,
|
|
157
670
|
isActive: { type: Boolean, default: true },
|
|
158
|
-
createdDate: {
|
|
159
|
-
type: Date,
|
|
160
|
-
default: Date.now,
|
|
161
|
-
},
|
|
671
|
+
createdDate: { type: Date, default: Date.now },
|
|
162
672
|
approverOneData: approverSchema,
|
|
163
673
|
approverTwoData: approverSchema,
|
|
164
674
|
});
|
|
165
|
-
|
|
166
|
-
/* Member Schema */
|
|
167
|
-
/* ------------------------------------------------ */
|
|
675
|
+
// ------------------ Member ------------------
|
|
168
676
|
const memberSchema = new mongoose_1.Schema({
|
|
169
|
-
memberId:
|
|
677
|
+
memberId: Number,
|
|
170
678
|
memberCode: { type: String, default: "" },
|
|
171
|
-
memberName:
|
|
679
|
+
memberName: String,
|
|
172
680
|
isMemberOfMasterBranch: { type: Boolean, default: false },
|
|
173
681
|
pureStaticMemberLevelFieldValues: [
|
|
174
682
|
{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
683
|
+
categoryId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Field.Categories" },
|
|
684
|
+
fieldValues: [
|
|
685
|
+
{
|
|
686
|
+
fieldId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Editor.Fields.Master" },
|
|
687
|
+
value: mongoose_1.Schema.Types.Mixed,
|
|
688
|
+
},
|
|
689
|
+
],
|
|
180
690
|
},
|
|
181
691
|
],
|
|
182
692
|
isCreatedInSAP: { type: Boolean, default: false },
|
|
183
693
|
isMemberSyncedWithSAP: { type: Boolean, default: false },
|
|
184
|
-
memberSyncedOn:
|
|
185
|
-
isActive:
|
|
694
|
+
memberSyncedOn: Date,
|
|
695
|
+
isActive: Boolean,
|
|
186
696
|
memberAssociation: [memberAssociationSchema],
|
|
187
697
|
audit: [
|
|
188
698
|
{
|
|
189
|
-
userId:
|
|
190
|
-
auditedOn:
|
|
191
|
-
actionType:
|
|
699
|
+
userId: String,
|
|
700
|
+
auditedOn: Date,
|
|
701
|
+
actionType: String,
|
|
192
702
|
},
|
|
193
703
|
],
|
|
194
704
|
});
|