pristine-member-nest-api-database 1.0.63 → 1.0.65

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.
@@ -0,0 +1,51 @@
1
+ //Editor.PureStaticFieldsMapping.ts
2
+
3
+ import mongoose, { Document, ObjectId, Schema, Types } from "mongoose";
4
+ import { Audit } from "../interface/Audit.interface";
5
+
6
+ interface CategoryFieldMappingDocument extends Document {
7
+ categoryId: mongoose.Types.ObjectId;
8
+ fields: {
9
+ field: mongoose.Types.ObjectId;
10
+ isSystemDefined: boolean;
11
+ }[];
12
+ isSystemDefined: boolean;
13
+ isActive: boolean;
14
+ audit: Audit[];
15
+ }
16
+
17
+ const CategoryFieldMappingSchema = new Schema<CategoryFieldMappingDocument>({
18
+ categoryId: {
19
+ type: Schema.Types.ObjectId,
20
+ ref: "Field.Categories",
21
+ },
22
+ fields: [
23
+ {
24
+ field: {
25
+ type: Schema.Types.ObjectId,
26
+ ref: "Editor.Fields.Master",
27
+ },
28
+ isSystemDefined: {
29
+ type: Boolean,
30
+ default: true,
31
+ },
32
+ },
33
+ ],
34
+ isSystemDefined: { type: Boolean, default: true },
35
+ isActive: { type: Boolean, default: true },
36
+ audit: [
37
+ {
38
+ userId: { type: String },
39
+ auditedOn: { type: Date, default: null },
40
+ actionType: { type: String },
41
+ },
42
+ ],
43
+ });
44
+
45
+ const mongoCategoryFieldMappingSchema =
46
+ mongoose.model<CategoryFieldMappingDocument>(
47
+ "Editor.Category.Fields.Mapping",
48
+ CategoryFieldMappingSchema,
49
+ );
50
+
51
+ export { CategoryFieldMappingDocument, mongoCategoryFieldMappingSchema };
@@ -0,0 +1,107 @@
1
+ // import mongoose, { Document, Schema } from "mongoose";
2
+ // import { Audit } from "../interface/Audit.interface";
3
+
4
+ // interface ContainerCategoryMapping extends Document {
5
+ // ContainerId: mongoose.Types.ObjectId;
6
+ // Categories: [
7
+ // {
8
+ // category: mongoose.Types.ObjectId;
9
+ // isSystemDefined: boolean;
10
+ // },
11
+ // ];
12
+ // isSystemDefined: boolean;
13
+ // isActive: boolean;
14
+ // audit: Audit[];
15
+ // }
16
+
17
+ // const ContainerCategoryMappingSchema = new Schema<ContainerCategoryMapping>({
18
+ // ContainerId: {
19
+ // type: Schema.Types.ObjectId,
20
+ // ref: "Editor.Container", // Reference to the ontainers
21
+ // required: false,
22
+ // default: null,
23
+ // },
24
+ // Categories: [
25
+ // {
26
+ // type: Schema.Types.ObjectId,
27
+ // ref: "Field.Categories", // Reference to the Categories
28
+ // required: false,
29
+ // default: null,
30
+ // },
31
+ // isSystemDefined: {
32
+ // type: Boolean, default: true
33
+
34
+ // }
35
+ // ],
36
+ // isSystemDefined: { type: Boolean, default: false },
37
+ // isActive: { type: Boolean, default: true },
38
+ // audit: [
39
+ // {
40
+ // userId: { type: String },
41
+ // auditedOn: { type: Date, default: null },
42
+ // actionType: { type: String },
43
+ // },
44
+ // ],
45
+ // });
46
+
47
+ // const mongoEditorField = mongoose.model<ContainerCategoryMapping>(
48
+ // "Editor.Container.Category.mapping",
49
+ // ContainerCategoryMappingSchema,
50
+ // );
51
+
52
+ // export { ContainerCategoryMapping, mongoEditorField };
53
+ import mongoose, { Document, Schema } from "mongoose";
54
+ import { Audit } from "../interface/Audit.interface";
55
+
56
+ interface ContainerCategoryMapping extends Document {
57
+ ContainerId: mongoose.Types.ObjectId;
58
+ Categories: {
59
+ category: mongoose.Types.ObjectId;
60
+ isSystemDefined: boolean;
61
+ }[];
62
+ isSystemDefined: boolean;
63
+ isActive: boolean;
64
+ audit: Audit[];
65
+ }
66
+
67
+ const ContainerCategoryMappingSchema = new Schema<ContainerCategoryMapping>({
68
+ ContainerId: {
69
+ type: Schema.Types.ObjectId,
70
+ ref: "Editor.Container",
71
+ required: false,
72
+ default: null,
73
+ },
74
+
75
+ Categories: [
76
+ {
77
+ category: {
78
+ type: Schema.Types.ObjectId,
79
+ ref: "Field.Categories",
80
+ required: false,
81
+ default: null,
82
+ },
83
+ isSystemDefined: {
84
+ type: Boolean,
85
+ default: true,
86
+ },
87
+ },
88
+ ],
89
+
90
+ isSystemDefined: { type: Boolean, default: true },
91
+ isActive: { type: Boolean, default: true },
92
+
93
+ audit: [
94
+ {
95
+ userId: { type: String },
96
+ auditedOn: { type: Date, default: null },
97
+ actionType: { type: String },
98
+ },
99
+ ],
100
+ });
101
+
102
+ const mongoEditorField = mongoose.model<ContainerCategoryMapping>(
103
+ "Editor.Container.Category.mapping",
104
+ ContainerCategoryMappingSchema,
105
+ );
106
+
107
+ export { ContainerCategoryMapping, mongoEditorField };
@@ -0,0 +1,352 @@
1
+ import mongoose, { Document, Schema } from "mongoose";
2
+ import { Audit } from "../interface/Audit.interface";
3
+ import IFile from "../interface/IFile.interface";
4
+
5
+ type barcodeBranchMemberhipdetails = {
6
+ isRegisteredMembership: boolean; //field is used to check whether membership is created on first time registering
7
+ isMembershipRequested: boolean; //means membership request is waiting for approval
8
+ membershipType: mongoose.Types.ObjectId;
9
+ membershipStatus: mongoose.Types.ObjectId;
10
+ remarks: String;
11
+ requestedDate: Date;
12
+ isMembershipSynced: boolean; //used to check whether SAP sync done or not
13
+ noOfSubscriptionMonths: number;
14
+ isIssued: boolean; //means subscription is issued or not
15
+ electedDate: Date;
16
+ barcodeBranchMemberCode: string;
17
+ barCode: number;
18
+ validFrom: Date;
19
+ validTo: Date;
20
+ countryCode: number;
21
+ changeDate: Date;
22
+ isTerminationRequested: boolean;
23
+ isTerminationSynced: boolean; //used to check whether SAP sync done or not
24
+ terminationDate: Date;
25
+ terminationReason: string;
26
+ };
27
+
28
+ type noneGs1MembershipDetails = {
29
+ associationMemberCode: string;
30
+ membershipStatus: mongoose.Types.ObjectId;
31
+ membershipType: mongoose.Types.ObjectId;
32
+ isTerminated: boolean;
33
+ terminatedDate: Date;
34
+ reasonForTermination: string;
35
+ isTerminationRequested: boolean;
36
+ terminationRequestedDate: Date;
37
+ terminationRequestedBy: string;
38
+ terminationRequestRemarks: string;
39
+ onOfSubscriptionMonths: number;
40
+ isMembershipSynced: boolean;
41
+ SyncOn: Date;
42
+ electedDate: Date;
43
+ };
44
+
45
+ interface MemberDocument extends Document {
46
+ memberId: number;
47
+ memberCode: string;
48
+ memberName: string;
49
+ isMemberOfMasterBranch: boolean;
50
+
51
+ pureStaticMemberLevelFieldValues: [
52
+ {
53
+ fieldId: mongoose.Types.ObjectId;
54
+ value: string;
55
+ },
56
+ ];
57
+ //Member Level Sync
58
+ isCreatedInSAP: boolean;
59
+ isMemberSyncedWithSAP: boolean;
60
+ memberSyncedOn: Date;
61
+ isActive: boolean;
62
+
63
+ //new
64
+ memberAssociation: [
65
+ {
66
+ applicationId: mongoose.Types.ObjectId;
67
+ branchId: mongoose.Types.ObjectId;
68
+
69
+ categoryData: [
70
+ {
71
+ categoryId: mongoose.Types.ObjectId;
72
+ fieldValues: [
73
+ {
74
+ fieldId: mongoose.Types.ObjectId;
75
+ value: string;
76
+ },
77
+ ];
78
+ },
79
+ ];
80
+ membershipData: {
81
+ fieldId: mongoose.Types.ObjectId;
82
+ value: barcodeBranchMemberhipdetails[] | noneGs1MembershipDetails;
83
+ };
84
+
85
+ isCreatedInSAP: boolean;
86
+ isMemberSyncedWithSAP: boolean;
87
+ memberSyncedOn: Date;
88
+ dynamicDetails: JSON;
89
+
90
+ applicationStatus: string;
91
+ isEnrolmentCreatedInSAP: boolean;
92
+ isEnrolmentSyncedWithSAP: boolean;
93
+ enrolmentSyncedOn: Date;
94
+ salesOrderDocEntry: string; // SAP sales order doc entry when creating BP in SAP
95
+ salesOrderStatus: string; // SAP sales order status when creating BP in SAP
96
+ isActive: boolean;
97
+ createdDate: Date;
98
+ approverOneData: {
99
+ fieldId: mongoose.Types.ObjectId;
100
+ remarks: string;
101
+ userId: string;
102
+ attachment: IFile[];
103
+ };
104
+ approverTwoData: {
105
+ fieldId: mongoose.Types.ObjectId;
106
+ remarks: string;
107
+ userId: string;
108
+ attachment: IFile[];
109
+ };
110
+ },
111
+ ];
112
+ audit: Audit[];
113
+ }
114
+
115
+ mongoose.set("strictPopulate", false);
116
+
117
+ // File schema
118
+ const fileSchema = new Schema<IFile>({
119
+ baseURL: { type: String },
120
+ fileName: { type: String },
121
+ fileExtension: { type: String },
122
+ });
123
+
124
+ // const memberSchema = new Schema<MemberDocument>({
125
+ // memberId: { type: Number },
126
+ // memberCode: { type: String, default: "" },
127
+ // memberName: { type: String },
128
+ // isMemberOfMasterBranch: { type: Boolean, default: false },
129
+ // taxIdentificationNo: { type: String },
130
+ // vatNo: { type: String },
131
+ // vatAttachment: fileSchema,
132
+ // svatNo: { type: String },
133
+ // svatAttachment: fileSchema,
134
+ // brNo: { type: String, default: "" },
135
+ // brAttachment: fileSchema,
136
+ // nicNo: { type: String, default: "" },
137
+ // nicAttachment: fileSchema,
138
+ // webSite: { type: String, default: "" },
139
+ // generalTelNo: { type: String },
140
+ // generalEmail: { type: String },
141
+ // isTaxRegistered: { type: Boolean, default: false },
142
+ // conglomerateAddress: {
143
+ // addressLine1: { type: String },
144
+ // addressLine2: { type: String, default: "" },
145
+ // addressLine3: { type: String, default: "" },
146
+ // block: { type: String, default: "" },
147
+ // city: { type: String },
148
+ // country: { type: String },
149
+ // },
150
+ // otherAttachment: [fileSchema],
151
+ // typeOfOrganization: {
152
+ // type: Schema.Types.ObjectId,
153
+ // ref: "OrganizationType.Master",
154
+ // },
155
+
156
+ // natureOfBusiness: {
157
+ // type: [Schema.Types.ObjectId],
158
+ // ref: "NatureOfBusiness.Master",
159
+ // },
160
+
161
+ // mainProductsOrServices: {
162
+ // type: [Schema.Types.ObjectId],
163
+ // ref: "Products.ServicesMaster",
164
+ // },
165
+ // countryOfExportsOrImports: { type: [String], default: [] },
166
+ // noOfExecutiveEmployees: { type: Number, default: 0 },
167
+ // noOfNoneOfExecutiveEmployees: { type: Number, default: 0 },
168
+ // keyExecutivesDetails: {
169
+ // chairmanName: { type: String, default: "" },
170
+ // chairmanEmail: { type: String, default: "" },
171
+ // chairmanphone: { type: String, default: "" },
172
+ // managingDirectorName: { type: String, default: "" },
173
+ // managingDirectorEmail: { type: String, default: "" },
174
+ // managingDirectorPhone: { type: String, default: "" },
175
+ // ceoName: { type: String, default: "" },
176
+ // ceoEmail: { type: String, default: "" },
177
+ // ceoPhone: { type: String, default: "" },
178
+ // headOfHrName: { type: String, default: "" },
179
+ // headofHrEmail: { type: String, default: "" },
180
+ // headofHrPhone: { type: String, default: "" },
181
+ // headOfMarketingName: { type: String, default: "" },
182
+ // headOfMarketingEmail: { type: String, default: "" },
183
+ // headOfMarketingPhone: { type: String, default: "" },
184
+ // cfoName: { type: String, default: "" },
185
+ // cfoEmail: { type: String, default: "" },
186
+ // cfoPhone: { type: String, default: "" },
187
+ // countryManagerName: { type: String, default: "" },
188
+ // countryManagerEmail: { type: String, default: "" },
189
+ // countryManagerPhone: { type: String, default: "" },
190
+ // },
191
+
192
+ // isMemberContactSynced: { type: Boolean, default: false },
193
+ // memberContactSyncedOn: { type: Date, default: null },
194
+ // isCreatedInSAP: { type: Boolean, default: false },
195
+ // isMemberSyncedWithSAP: { type: Boolean, default: false },
196
+ // memberSyncedOn: { type: Date, default: null },
197
+ // isActive: { type: Boolean },
198
+ // memberAssociation: [
199
+ // {
200
+ // branch: {
201
+ // type: Schema.Types.ObjectId,
202
+ // ref: "Branches", // Reference to the 'Branches' model
203
+ // },
204
+ // associationMemberCode: { type: String, default: "" },
205
+ // membershipStatus: {
206
+ // type: Schema.Types.ObjectId,
207
+ // ref: "Membership.Statuses", // Reference to the 'Membership.Statuses' model
208
+ // },
209
+ // membershipType: {
210
+ // type: Schema.Types.ObjectId,
211
+ // ref: "Membership.Types", // Reference to the 'Membership.Types' model
212
+ // },
213
+ // electedDate: { type: Date, default: null },
214
+ // contactInfo: {
215
+ // bpShortCode: { type: String, default: "" },
216
+ // firstName: { type: String },
217
+ // lastName: { type: String },
218
+ // contactTelNo1: { type: String },
219
+ // contactEmail1: { type: String },
220
+ // contactDesignation: { type: String },
221
+ // contactAddress: { type: String },
222
+ // contactAddress2: { type: String },
223
+ // city: { type: String },
224
+ // isSAPSynced: { type: Boolean, default: false },
225
+ // lastSyncedOn: { type: Date, default: null },
226
+ // },
227
+ // isTerminated: { type: Boolean, default: false },
228
+ // terminatedDate: { type: Date, default: null },
229
+ // reasonForTermination: { type: String, default: "" },
230
+ // barcodeAssociation: {
231
+ // type: [
232
+ // {
233
+ // isRegisteredMembership: {
234
+ // type: Boolean,
235
+ // required: true,
236
+ // },
237
+ // isMembershipRequested: {
238
+ // type: Boolean,
239
+ // default: true,
240
+ // },
241
+ // membershipType: {
242
+ // type: mongoose.Types.ObjectId,
243
+ // ref: "Membership.Types",
244
+ // required: true,
245
+ // },
246
+ // membershipStatus: {
247
+ // type: mongoose.Types.ObjectId,
248
+ // ref: "Membership.Statuses",
249
+ // required: true,
250
+ // },
251
+ // remarks: {
252
+ // type: String,
253
+ // },
254
+ // requestedDate: {
255
+ // type: Date,
256
+ // default: Date.now,
257
+ // },
258
+ // isMembershipSynced: {
259
+ // type: Boolean,
260
+ // default: false,
261
+ // },
262
+ // noOfSubscriptionMonths: {
263
+ // type: Number,
264
+ // },
265
+ // isIssued: {
266
+ // type: Boolean,
267
+ // },
268
+ // electedDate: {
269
+ // type: Date,
270
+ // },
271
+ // barcodeBranchMemberCode: {
272
+ // type: String,
273
+ // },
274
+ // barCode: {
275
+ // type: Number,
276
+ // },
277
+ // validFrom: {
278
+ // type: Date,
279
+ // },
280
+ // validTo: {
281
+ // type: Date,
282
+ // },
283
+ // countryCode: {
284
+ // type: Number,
285
+ // },
286
+ // changeDate: {
287
+ // type: Date,
288
+ // },
289
+ // isTerminationRequested: {
290
+ // type: Boolean,
291
+ // default: false,
292
+ // },
293
+ // isTerminationSynced: {
294
+ // type: Boolean,
295
+ // default: false,
296
+ // },
297
+ // terminationRequestedDate: {
298
+ // type: Date,
299
+ // },
300
+ // terminationDate: {
301
+ // type: Date,
302
+ // },
303
+ // terminationReason: {
304
+ // type: String,
305
+ // },
306
+ // },
307
+ // ],
308
+ // },
309
+ // dynamicDetails: { type: JSON, default: null },
310
+ // isTerminationRequested: { type: Boolean, default: false },
311
+ // terminationRequestedDate: { type: Date, default: null },
312
+ // terminationRequestedBy: { type: String, default: "" },
313
+ // terminationRequestRemarks: { type: String, default: "" },
314
+ // onOfSubscriptionMonths: { type: Number, default: 0 },
315
+ // applicationStatus: { type: String, default: "PENDING" },
316
+ // reviewedBy: {
317
+ // type: Schema.Types.ObjectId,
318
+ // ref: "Users", // Reference to the 'Users' model
319
+ // default: null,
320
+ // },
321
+ // reviewedOn: { type: Date, default: null },
322
+ // isEnrolmentCreatedInSAP: { type: Boolean, default: false },
323
+ // isEnrolmentSyncedWithSAP: { type: Boolean, default: false },
324
+ // enrolmentSyncedOn: { type: Date, default: null },
325
+ // isActive: { type: Boolean, default: true },
326
+ // createdDate: {
327
+ // type: Schema.Types.Date,
328
+ // required: false,
329
+ // default: Date.now,
330
+ // },
331
+ // salesOrderDocEntry: { type: String, default: "" },
332
+ // salesOrderStatus: { type: String, default: "" },
333
+ // approveRemarks: { type: String, default: "" },
334
+ // rejectRemarks: { type: String, default: "" },
335
+ // },
336
+ // ],
337
+ // audit: [
338
+ // {
339
+ // userId: { type: String },
340
+ // auditedOn: { type: Date, default: null },
341
+ // actionType: { type: String },
342
+ // },
343
+ // ],
344
+ // });
345
+
346
+ // const mongoMember = mongoose.model<MemberDocument>("Members", memberSchema);
347
+
348
+ export {
349
+
350
+ MemberDocument,
351
+ // mongoMember,
352
+ };