pristine-member-nest-api-database 1.0.18 → 1.0.19
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 +56 -18
- package/models/Member.model.ts +264 -183
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.mongoMember = void 0;
|
|
27
27
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
28
|
-
mongoose_1.default.set(
|
|
28
|
+
mongoose_1.default.set("strictPopulate", false);
|
|
29
29
|
const memberSchema = new mongoose_1.Schema({
|
|
30
30
|
memberId: { type: Number },
|
|
31
31
|
memberCode: { type: String, default: "" },
|
|
@@ -46,7 +46,45 @@ const memberSchema = new mongoose_1.Schema({
|
|
|
46
46
|
addressLine3: { type: String, default: "" },
|
|
47
47
|
block: { type: String, default: "" },
|
|
48
48
|
city: { type: String },
|
|
49
|
-
country: { type: String }
|
|
49
|
+
country: { type: String },
|
|
50
|
+
},
|
|
51
|
+
typeOfOrganization: {
|
|
52
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
53
|
+
ref: "OrganizationType.Master",
|
|
54
|
+
},
|
|
55
|
+
natureOfBusiness: {
|
|
56
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
57
|
+
ref: "NatureOfBusiness.Master",
|
|
58
|
+
},
|
|
59
|
+
mainProductsOrServices: {
|
|
60
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
61
|
+
ref: "Products.ServicesMaster",
|
|
62
|
+
},
|
|
63
|
+
countryOfExportsOrImports: { type: String, default: "" },
|
|
64
|
+
noOfExecutiveEmployees: { type: Number, default: 0 },
|
|
65
|
+
noOfNoneOfExecutiveEmployees: { type: Number, default: 0 },
|
|
66
|
+
keyExecutivesDetails: {
|
|
67
|
+
chairmanName: { type: String, default: "" },
|
|
68
|
+
chairmanEmail: { type: String, default: "" },
|
|
69
|
+
chairmanphone: { type: String, default: "" },
|
|
70
|
+
managingDirectorName: { type: String, default: "" },
|
|
71
|
+
managingDirectorEmail: { type: String, default: "" },
|
|
72
|
+
managingDirectorPhone: { type: String, default: "" },
|
|
73
|
+
ceoName: { type: String, default: "" },
|
|
74
|
+
ceoEmail: { type: String, default: "" },
|
|
75
|
+
ceoPhone: { type: String, default: "" },
|
|
76
|
+
headOfHrName: { type: String, default: "" },
|
|
77
|
+
headofHrEmail: { type: String, default: "" },
|
|
78
|
+
headofHrPhone: { type: String, default: "" },
|
|
79
|
+
headOfMarketingName: { type: String, default: "" },
|
|
80
|
+
headOfMarketingEmail: { type: String, default: "" },
|
|
81
|
+
headOfMarketingPhone: { type: String, default: "" },
|
|
82
|
+
cfoName: { type: String, default: "" },
|
|
83
|
+
cfoEmail: { type: String, default: "" },
|
|
84
|
+
cfoPhone: { type: String, default: "" },
|
|
85
|
+
countryManagerName: { type: String, default: "" },
|
|
86
|
+
countryManagerEmail: { type: String, default: "" },
|
|
87
|
+
countryManagerPhone: { type: String, default: "" },
|
|
50
88
|
},
|
|
51
89
|
isMemberContactSynced: { type: Boolean, default: false },
|
|
52
90
|
memberContactSyncedOn: { type: Date, default: null },
|
|
@@ -58,16 +96,16 @@ const memberSchema = new mongoose_1.Schema({
|
|
|
58
96
|
{
|
|
59
97
|
branch: {
|
|
60
98
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
61
|
-
ref:
|
|
99
|
+
ref: "Branches", // Reference to the 'Branches' model
|
|
62
100
|
},
|
|
63
101
|
associationMemberCode: { type: String, default: "" },
|
|
64
102
|
membershipStatus: {
|
|
65
103
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
66
|
-
ref:
|
|
104
|
+
ref: "Membership.Statuses", // Reference to the 'Membership.Statuses' model
|
|
67
105
|
},
|
|
68
106
|
membershipType: {
|
|
69
107
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
70
|
-
ref:
|
|
108
|
+
ref: "Membership.Types", // Reference to the 'Membership.Types' model
|
|
71
109
|
},
|
|
72
110
|
electedDate: { type: Date, default: null },
|
|
73
111
|
contactInfo: {
|
|
@@ -79,7 +117,7 @@ const memberSchema = new mongoose_1.Schema({
|
|
|
79
117
|
contactDesignation: { type: String },
|
|
80
118
|
contactAddress: { type: String },
|
|
81
119
|
isSAPSynced: { type: Boolean, default: false },
|
|
82
|
-
lastSyncedOn: { type: Date, default: null }
|
|
120
|
+
lastSyncedOn: { type: Date, default: null },
|
|
83
121
|
},
|
|
84
122
|
isTerminated: { type: Boolean, default: false },
|
|
85
123
|
terminatedDate: { type: Date, default: null },
|
|
@@ -89,21 +127,21 @@ const memberSchema = new mongoose_1.Schema({
|
|
|
89
127
|
barcodeBranchMemberCode: { type: String, default: "" },
|
|
90
128
|
barcodeCategory: {
|
|
91
129
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
92
|
-
ref:
|
|
130
|
+
ref: "Barcode.Categories",
|
|
93
131
|
},
|
|
94
132
|
issueDate: { type: Date, default: null },
|
|
95
133
|
isIssued: { type: Boolean, default: true },
|
|
96
134
|
country: {
|
|
97
135
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
98
|
-
ref:
|
|
136
|
+
ref: "Countries",
|
|
99
137
|
},
|
|
100
138
|
barCode: { type: String, default: "" },
|
|
101
139
|
changeDate: { type: Date, default: null },
|
|
102
140
|
validFrom: { type: Date, default: null },
|
|
103
141
|
validTo: { type: Date, default: null },
|
|
104
142
|
registeredDate: { type: Date, default: null },
|
|
105
|
-
remarks: { type: String, default: "" }
|
|
106
|
-
}
|
|
143
|
+
remarks: { type: String, default: "" },
|
|
144
|
+
},
|
|
107
145
|
],
|
|
108
146
|
dynamicDetails: { type: JSON, default: null },
|
|
109
147
|
isTerminationRequested: { type: Boolean, default: false },
|
|
@@ -114,23 +152,23 @@ const memberSchema = new mongoose_1.Schema({
|
|
|
114
152
|
applicationStatus: { type: String, default: "PENDING" },
|
|
115
153
|
reviewedBy: {
|
|
116
154
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
117
|
-
ref:
|
|
118
|
-
default: null
|
|
155
|
+
ref: "Users", // Reference to the 'Users' model
|
|
156
|
+
default: null,
|
|
119
157
|
},
|
|
120
158
|
reviewedOn: { type: Date, default: null },
|
|
121
159
|
isEnrolmentCreatedInSAP: { type: Boolean, default: false },
|
|
122
160
|
isEnrolmentSyncedWithSAP: { type: Boolean, default: false },
|
|
123
161
|
enrolmentSyncedOn: { type: Date, default: null },
|
|
124
|
-
isActive: { type: Boolean, default: true }
|
|
125
|
-
}
|
|
162
|
+
isActive: { type: Boolean, default: true },
|
|
163
|
+
},
|
|
126
164
|
],
|
|
127
165
|
audit: [
|
|
128
166
|
{
|
|
129
167
|
userId: { type: String },
|
|
130
168
|
auditedOn: { type: Date, default: null },
|
|
131
|
-
actionType: { type: String }
|
|
132
|
-
}
|
|
133
|
-
]
|
|
169
|
+
actionType: { type: String },
|
|
170
|
+
},
|
|
171
|
+
],
|
|
134
172
|
});
|
|
135
|
-
const mongoMember = mongoose_1.default.model(
|
|
173
|
+
const mongoMember = mongoose_1.default.model("Members", memberSchema);
|
|
136
174
|
exports.mongoMember = mongoMember;
|
package/models/Member.model.ts
CHANGED
|
@@ -1,201 +1,282 @@
|
|
|
1
|
-
import mongoose, { Document, Schema } from
|
|
2
|
-
import { Audit } from
|
|
1
|
+
import mongoose, { Document, Schema } from "mongoose";
|
|
2
|
+
import { Audit } from "../interface/Audit.interface";
|
|
3
|
+
|
|
4
|
+
type keyExecutivesDetails = {
|
|
5
|
+
chairmanName: string;
|
|
6
|
+
chairmanEmail: string;
|
|
7
|
+
chairmanphone: string;
|
|
8
|
+
managingDirectorName: string;
|
|
9
|
+
managingDirectorEmail: string;
|
|
10
|
+
managingDirectorPhone: string;
|
|
11
|
+
ceoName: string;
|
|
12
|
+
ceoEmail: string;
|
|
13
|
+
ceoPhone: string;
|
|
14
|
+
headOfHrName: string;
|
|
15
|
+
headofHrEmail: string;
|
|
16
|
+
headofHrPhone: string;
|
|
17
|
+
headOfMarketingName: string;
|
|
18
|
+
headOfMarketingEmail: string;
|
|
19
|
+
headOfMarketingPhone: string;
|
|
20
|
+
cfoName: string;
|
|
21
|
+
cfoEmail: string;
|
|
22
|
+
cfoPhone: string;
|
|
23
|
+
countryManagerName: string;
|
|
24
|
+
countryManagerEmail: string;
|
|
25
|
+
countryManagerPhone: string;
|
|
26
|
+
};
|
|
3
27
|
|
|
4
28
|
type ConglomerateAddress = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
29
|
+
addressLine1: string;
|
|
30
|
+
addressLine2: string;
|
|
31
|
+
addressLine3: string;
|
|
32
|
+
block: string;
|
|
33
|
+
city: string;
|
|
34
|
+
country: string;
|
|
35
|
+
};
|
|
12
36
|
|
|
13
37
|
type MemberContactInfo = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
38
|
+
bpShortCode: string;
|
|
39
|
+
firstName: string;
|
|
40
|
+
lastName: string;
|
|
41
|
+
contactTelNo1: string;
|
|
42
|
+
contactEmail1: string;
|
|
43
|
+
contactDesignation: string;
|
|
44
|
+
contactAddress: string;
|
|
45
|
+
isSAPSynced: boolean;
|
|
46
|
+
lastSyncedOn: Date;
|
|
47
|
+
};
|
|
24
48
|
|
|
25
49
|
type barcodeBranch = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
50
|
+
barcodeBranchMemberCode: string;
|
|
51
|
+
barcodeCategoryCode: string;
|
|
52
|
+
issueDate: Date;
|
|
53
|
+
isIssued: boolean;
|
|
54
|
+
countryCodeCode: string;
|
|
55
|
+
barCode: string;
|
|
56
|
+
changeDate: Date;
|
|
57
|
+
validFrom: Date;
|
|
58
|
+
validTo: Date;
|
|
59
|
+
registeredDate: Date;
|
|
60
|
+
remarks: string;
|
|
61
|
+
};
|
|
38
62
|
|
|
39
63
|
type MemberAssociation = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
+
branch: mongoose.Types.ObjectId;
|
|
65
|
+
associationMemberCode: string;
|
|
66
|
+
membershipStatus: mongoose.Types.ObjectId;
|
|
67
|
+
membershipType: mongoose.Types.ObjectId;
|
|
68
|
+
electedDate: Date;
|
|
69
|
+
contactInfo: MemberContactInfo;
|
|
70
|
+
isTerminated: boolean;
|
|
71
|
+
terminatedDate: Date;
|
|
72
|
+
reasonForTermination: string;
|
|
73
|
+
barcodeAssociation: barcodeBranch[];
|
|
74
|
+
dynamicDetails: JSON;
|
|
75
|
+
isTerminationRequested: boolean;
|
|
76
|
+
terminationRequestedDate: Date;
|
|
77
|
+
terminationRequestedBy: string;
|
|
78
|
+
terminationRequestRemarks: string;
|
|
79
|
+
onOfSubscriptionMonths: number;
|
|
80
|
+
applicationStatus: string;
|
|
81
|
+
reviewedBy: mongoose.Types.ObjectId;
|
|
82
|
+
reviewedOn: Date;
|
|
83
|
+
isEnrolmentCreatedInSAP: boolean;
|
|
84
|
+
isEnrolmentSyncedWithSAP: boolean;
|
|
85
|
+
enrolmentSyncedOn: Date;
|
|
86
|
+
isActive: boolean;
|
|
87
|
+
};
|
|
64
88
|
|
|
65
89
|
interface MemberDocument extends Document {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
memberId: number;
|
|
91
|
+
memberCode: string;
|
|
92
|
+
memberName: string;
|
|
93
|
+
isMemberOfMasterBranch: boolean;
|
|
94
|
+
taxIdentificationNo: string;
|
|
95
|
+
vatNo: string;
|
|
96
|
+
svatNo: string;
|
|
97
|
+
brNo: string;
|
|
98
|
+
nicNo: string;
|
|
99
|
+
webSite: string;
|
|
100
|
+
generalTelNo: string;
|
|
101
|
+
generalEmail: string;
|
|
102
|
+
isTaxRegistered: boolean;
|
|
103
|
+
conglomerateAddress: ConglomerateAddress;
|
|
104
|
+
|
|
105
|
+
typeOfOrganization: mongoose.Types.ObjectId;
|
|
106
|
+
natureOfBusiness: mongoose.Types.ObjectId;
|
|
107
|
+
mainProductsOrServices: mongoose.Types.ObjectId;
|
|
108
|
+
countryOfExportsOrImports: string;
|
|
109
|
+
noOfExecutiveEmployees: number;
|
|
110
|
+
noOfNoneOfExecutiveEmployees: number;
|
|
111
|
+
keyExecutivesDetails: keyExecutivesDetails;
|
|
112
|
+
|
|
113
|
+
isMemberContactSynced: boolean;
|
|
114
|
+
memberContactSyncedOn: Date;
|
|
115
|
+
isCreatedInSAP: boolean;
|
|
116
|
+
isMemberSyncedWithSAP: boolean;
|
|
117
|
+
memberSyncedOn: Date;
|
|
118
|
+
isActive: boolean;
|
|
119
|
+
memberAssociation: MemberAssociation[];
|
|
120
|
+
audit: Audit[];
|
|
88
121
|
}
|
|
89
122
|
|
|
90
|
-
mongoose.set(
|
|
123
|
+
mongoose.set("strictPopulate", false);
|
|
91
124
|
|
|
92
125
|
const memberSchema = new Schema<MemberDocument>({
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
126
|
+
memberId: { type: Number },
|
|
127
|
+
memberCode: { type: String, default: "" },
|
|
128
|
+
memberName: { type: String },
|
|
129
|
+
isMemberOfMasterBranch: { type: Boolean, default: false },
|
|
130
|
+
taxIdentificationNo: { type: String },
|
|
131
|
+
vatNo: { type: String },
|
|
132
|
+
svatNo: { type: String },
|
|
133
|
+
brNo: { type: String, default: "" },
|
|
134
|
+
nicNo: { type: String, default: "" },
|
|
135
|
+
webSite: { type: String, default: "" },
|
|
136
|
+
generalTelNo: { type: String },
|
|
137
|
+
generalEmail: { type: String },
|
|
138
|
+
isTaxRegistered: { type: Boolean, default: false },
|
|
139
|
+
conglomerateAddress: {
|
|
140
|
+
addressLine1: { type: String },
|
|
141
|
+
addressLine2: { type: String, default: "" },
|
|
142
|
+
addressLine3: { type: String, default: "" },
|
|
143
|
+
block: { type: String, default: "" },
|
|
144
|
+
city: { type: String },
|
|
145
|
+
country: { type: String },
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
typeOfOrganization: {
|
|
149
|
+
type: Schema.Types.ObjectId,
|
|
150
|
+
ref: "OrganizationType.Master",
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
natureOfBusiness: {
|
|
154
|
+
type: Schema.Types.ObjectId,
|
|
155
|
+
ref: "NatureOfBusiness.Master",
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
mainProductsOrServices: {
|
|
159
|
+
type: Schema.Types.ObjectId,
|
|
160
|
+
ref: "Products.ServicesMaster",
|
|
161
|
+
},
|
|
162
|
+
countryOfExportsOrImports: { type: String, default: "" },
|
|
163
|
+
noOfExecutiveEmployees: { type: Number, default: 0 },
|
|
164
|
+
noOfNoneOfExecutiveEmployees: { type: Number, default: 0 },
|
|
165
|
+
keyExecutivesDetails: {
|
|
166
|
+
chairmanName: { type: String, default: "" },
|
|
167
|
+
chairmanEmail: { type: String, default: "" },
|
|
168
|
+
chairmanphone: { type: String, default: "" },
|
|
169
|
+
managingDirectorName: { type: String, default: "" },
|
|
170
|
+
managingDirectorEmail: { type: String, default: "" },
|
|
171
|
+
managingDirectorPhone: { type: String, default: "" },
|
|
172
|
+
ceoName: { type: String, default: "" },
|
|
173
|
+
ceoEmail: { type: String, default: "" },
|
|
174
|
+
ceoPhone: { type: String, default: "" },
|
|
175
|
+
headOfHrName: { type: String, default: "" },
|
|
176
|
+
headofHrEmail: { type: String, default: "" },
|
|
177
|
+
headofHrPhone: { type: String, default: "" },
|
|
178
|
+
headOfMarketingName: { type: String, default: "" },
|
|
179
|
+
headOfMarketingEmail: { type: String, default: "" },
|
|
180
|
+
headOfMarketingPhone: { type: String, default: "" },
|
|
181
|
+
cfoName: { type: String, default: "" },
|
|
182
|
+
cfoEmail: { type: String, default: "" },
|
|
183
|
+
cfoPhone: { type: String, default: "" },
|
|
184
|
+
countryManagerName: { type: String, default: "" },
|
|
185
|
+
countryManagerEmail: { type: String, default: "" },
|
|
186
|
+
countryManagerPhone: { type: String, default: "" },
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
isMemberContactSynced: { type: Boolean, default: false },
|
|
190
|
+
memberContactSyncedOn: { type: Date, default: null },
|
|
191
|
+
isCreatedInSAP: { type: Boolean, default: false },
|
|
192
|
+
isMemberSyncedWithSAP: { type: Boolean, default: false },
|
|
193
|
+
memberSyncedOn: { type: Date, default: null },
|
|
194
|
+
isActive: { type: Boolean },
|
|
195
|
+
memberAssociation: [
|
|
196
|
+
{
|
|
197
|
+
branch: {
|
|
198
|
+
type: Schema.Types.ObjectId,
|
|
199
|
+
ref: "Branches", // Reference to the 'Branches' model
|
|
200
|
+
},
|
|
201
|
+
associationMemberCode: { type: String, default: "" },
|
|
202
|
+
membershipStatus: {
|
|
203
|
+
type: Schema.Types.ObjectId,
|
|
204
|
+
ref: "Membership.Statuses", // Reference to the 'Membership.Statuses' model
|
|
205
|
+
},
|
|
206
|
+
membershipType: {
|
|
207
|
+
type: Schema.Types.ObjectId,
|
|
208
|
+
ref: "Membership.Types", // Reference to the 'Membership.Types' model
|
|
209
|
+
},
|
|
210
|
+
electedDate: { type: Date, default: null },
|
|
211
|
+
contactInfo: {
|
|
212
|
+
bpShortCode: { type: String, default: "" },
|
|
213
|
+
firstName: { type: String },
|
|
214
|
+
lastName: { type: String },
|
|
215
|
+
contactTelNo1: { type: String },
|
|
216
|
+
contactEmail1: { type: String },
|
|
217
|
+
contactDesignation: { type: String },
|
|
218
|
+
contactAddress: { type: String },
|
|
219
|
+
isSAPSynced: { type: Boolean, default: false },
|
|
220
|
+
lastSyncedOn: { type: Date, default: null },
|
|
221
|
+
},
|
|
222
|
+
isTerminated: { type: Boolean, default: false },
|
|
223
|
+
terminatedDate: { type: Date, default: null },
|
|
224
|
+
reasonForTermination: { type: String, default: "" },
|
|
225
|
+
barcodeAssociation: [
|
|
191
226
|
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
227
|
+
barcodeBranchMemberCode: { type: String, default: "" },
|
|
228
|
+
barcodeCategory: {
|
|
229
|
+
type: Schema.Types.ObjectId,
|
|
230
|
+
ref: "Barcode.Categories",
|
|
231
|
+
},
|
|
232
|
+
issueDate: { type: Date, default: null },
|
|
233
|
+
isIssued: { type: Boolean, default: true },
|
|
234
|
+
country: {
|
|
235
|
+
type: Schema.Types.ObjectId,
|
|
236
|
+
ref: "Countries",
|
|
237
|
+
},
|
|
238
|
+
barCode: { type: String, default: "" },
|
|
239
|
+
changeDate: { type: Date, default: null },
|
|
240
|
+
validFrom: { type: Date, default: null },
|
|
241
|
+
validTo: { type: Date, default: null },
|
|
242
|
+
registeredDate: { type: Date, default: null },
|
|
243
|
+
remarks: { type: String, default: "" },
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
dynamicDetails: { type: JSON, default: null },
|
|
247
|
+
isTerminationRequested: { type: Boolean, default: false },
|
|
248
|
+
terminationRequestedDate: { type: Date, default: null },
|
|
249
|
+
terminationRequestedBy: { type: String, default: "" },
|
|
250
|
+
terminationRequestRemarks: { type: String, default: "" },
|
|
251
|
+
onOfSubscriptionMonths: { type: Number, default: 0 },
|
|
252
|
+
applicationStatus: { type: String, default: "PENDING" },
|
|
253
|
+
reviewedBy: {
|
|
254
|
+
type: Schema.Types.ObjectId,
|
|
255
|
+
ref: "Users", // Reference to the 'Users' model
|
|
256
|
+
default: null,
|
|
257
|
+
},
|
|
258
|
+
reviewedOn: { type: Date, default: null },
|
|
259
|
+
isEnrolmentCreatedInSAP: { type: Boolean, default: false },
|
|
260
|
+
isEnrolmentSyncedWithSAP: { type: Boolean, default: false },
|
|
261
|
+
enrolmentSyncedOn: { type: Date, default: null },
|
|
262
|
+
isActive: { type: Boolean, default: true },
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
audit: [
|
|
266
|
+
{
|
|
267
|
+
userId: { type: String },
|
|
268
|
+
auditedOn: { type: Date, default: null },
|
|
269
|
+
actionType: { type: String },
|
|
270
|
+
},
|
|
271
|
+
],
|
|
197
272
|
});
|
|
198
273
|
|
|
199
|
-
const mongoMember = mongoose.model<MemberDocument>(
|
|
274
|
+
const mongoMember = mongoose.model<MemberDocument>("Members", memberSchema);
|
|
200
275
|
|
|
201
|
-
export {
|
|
276
|
+
export {
|
|
277
|
+
MemberDocument,
|
|
278
|
+
ConglomerateAddress,
|
|
279
|
+
MemberContactInfo,
|
|
280
|
+
MemberAssociation,
|
|
281
|
+
mongoMember,
|
|
282
|
+
};
|