pristine-member-nest-api-database 1.0.62 → 1.0.64

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