@churchsoln/dbms 1.0.13 → 1.0.15

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.
Files changed (2) hide show
  1. package/models/church/user.js +117 -14
  2. package/package.json +1 -1
@@ -12,7 +12,12 @@ module.exports = (sequelize, DataTypes) => {
12
12
  familyCode: { type: DataTypes.STRING },
13
13
  familyName: { type: DataTypes.STRING },
14
14
  memberCode: { type: DataTypes.STRING },
15
- email: { type: DataTypes.STRING },
15
+ email: {
16
+ type: DataTypes.STRING,
17
+ get() {
18
+ return this.getDataValue("showEmail") ? this.getDataValue("email") : undefined;
19
+ },
20
+ },
16
21
  showEmail: { type: DataTypes.BOOLEAN, defaultValue: false },
17
22
  password: {
18
23
  type: DataTypes.STRING,
@@ -23,23 +28,64 @@ module.exports = (sequelize, DataTypes) => {
23
28
  }
24
29
  },
25
30
  },
26
- phone: { type: DataTypes.STRING },
31
+ phone: {
32
+ type: DataTypes.STRING,
33
+ get() {
34
+ return this.getDataValue("showPhone") ? this.getDataValue("phone") : undefined;
35
+ },
36
+ },
27
37
  showPhone: { type: DataTypes.BOOLEAN, defaultValue: false },
28
- firstName: { type: DataTypes.STRING },
38
+ firstName: {
39
+ type: DataTypes.STRING,
40
+ get() {
41
+ return this.getDataValue("showFirstName")
42
+ ? this.getDataValue("firstName")
43
+ : undefined;
44
+ },
45
+ },
29
46
  showFirstName: { type: DataTypes.BOOLEAN, defaultValue: false },
30
- lastName: { type: DataTypes.STRING },
47
+ lastName: {
48
+ type: DataTypes.STRING,
49
+ get() {
50
+ return this.getDataValue("showLastName")
51
+ ? this.getDataValue("lastName")
52
+ : undefined;
53
+ },
54
+ },
31
55
  showLastName: { type: DataTypes.BOOLEAN, defaultValue: false },
32
- gender: { type: DataTypes.STRING },
56
+ gender: {
57
+ type: DataTypes.STRING,
58
+ get() {
59
+ return this.getDataValue("showGender")
60
+ ? this.getDataValue("gender")
61
+ : undefined;
62
+ },
63
+ },
33
64
  showGender: { type: DataTypes.BOOLEAN, defaultValue: false },
34
- dob: { type: DataTypes.DATEONLY },
65
+ dob: {
66
+ type: DataTypes.DATEONLY,
67
+ get() {
68
+ return this.getDataValue("showDob") ? this.getDataValue("dob") : undefined;
69
+ },
70
+ },
35
71
  showDob: { type: DataTypes.BOOLEAN, defaultValue: false },
36
- education: { type: DataTypes.STRING },
72
+ education: {
73
+ type: DataTypes.STRING,
74
+ get() {
75
+ return this.getDataValue("showEducation") ? this.getDataValue("education") : undefined;
76
+ },
77
+ },
37
78
  showEducation: { type: DataTypes.BOOLEAN, defaultValue: false },
38
79
  relationshipId: {
39
80
  type: DataTypes.INTEGER,
40
81
  set(relationshipId) {
41
82
  this.setDataValue("relationshipId", relationshipId?.id || relationshipId);
42
83
  },
84
+ get() {
85
+ return this.getDataValue("showRelationship")
86
+ ? this.getDataValue("relationshipId")
87
+ : undefined;
88
+ },
43
89
  },
44
90
  partnerId: {
45
91
  type: DataTypes.INTEGER,
@@ -53,13 +99,39 @@ module.exports = (sequelize, DataTypes) => {
53
99
  set(maritalStatusId) {
54
100
  this.setDataValue("maritalStatusId", maritalStatusId?.id || maritalStatusId);
55
101
  },
102
+ get() {
103
+ return this.getDataValue("showMaritalStatus")
104
+ ? this.getDataValue("maritalStatusId")
105
+ : undefined;
106
+ },
56
107
  },
57
108
  showMaritalStatus: { type: DataTypes.BOOLEAN, defaultValue: false },
58
- dateJoined: { type: DataTypes.DATEONLY },
109
+ dateJoined: {
110
+ type: DataTypes.DATEONLY,
111
+ get() {
112
+ return this.getDataValue("showDateJoined")
113
+ ? this.getDataValue("dateJoined")
114
+ : undefined;
115
+ },
116
+ },
59
117
  showDateJoined: { type: DataTypes.BOOLEAN, defaultValue: false },
60
- emergencyContact: { type: DataTypes.STRING },
118
+ emergencyContact: {
119
+ type: DataTypes.STRING,
120
+ get() {
121
+ return this.getDataValue("showEmergencyContact")
122
+ ? this.getDataValue("emergencyContact")
123
+ : undefined;
124
+ },
125
+ },
61
126
  showEmergencyContact: { type: DataTypes.BOOLEAN, defaultValue: false },
62
- emergencyContactName: { type: DataTypes.STRING },
127
+ emergencyContactName: {
128
+ type: DataTypes.STRING,
129
+ get() {
130
+ return this.getDataValue("showEmergencyContactName")
131
+ ? this.getDataValue("emergencyContactName")
132
+ : undefined;
133
+ },
134
+ },
63
135
  showEmergencyContactName: { type: DataTypes.BOOLEAN, defaultValue: false },
64
136
  emergencyContactRelationshipId: {
65
137
  type: DataTypes.INTEGER,
@@ -69,13 +141,37 @@ module.exports = (sequelize, DataTypes) => {
69
141
  emergencyContactRelationshipId?.id || emergencyContactRelationshipId
70
142
  );
71
143
  },
144
+ get() {
145
+ return this.getDataValue("showEmergencyContactRelationship")
146
+ ? this.getDataValue("emergencyContactRelationshipId")
147
+ : undefined;
148
+ },
72
149
  },
73
150
  showEmergencyContactRelationship: { type: DataTypes.BOOLEAN, defaultValue: false },
74
- imageUrl: { type: DataTypes.TEXT },
151
+ imageUrl: {
152
+ type: DataTypes.TEXT,
153
+ get() {
154
+ return this.getDataValue("showImage")
155
+ ? this.getDataValue("imageUrl")
156
+ : undefined;
157
+ },
158
+ },
75
159
  showImage: { type: DataTypes.BOOLEAN, defaultValue: false },
76
- address: { type: DataTypes.STRING },
160
+ address: {
161
+ type: DataTypes.STRING,
162
+ get() {
163
+ return this.getDataValue("showAddress")
164
+ ? this.getDataValue("address")
165
+ : undefined;
166
+ },
167
+ },
77
168
  showAddress: { type: DataTypes.BOOLEAN, defaultValue: false },
78
- cityId: { type: DataTypes.STRING },
169
+ cityId: {
170
+ type: DataTypes.STRING,
171
+ get() {
172
+ return this.getDataValue("showCity") ? this.getDataValue("cityId") : undefined;
173
+ },
174
+ },
79
175
  showCity: { type: DataTypes.BOOLEAN, defaultValue: false },
80
176
  provinceId: {
81
177
  type: DataTypes.INTEGER,
@@ -83,7 +179,14 @@ module.exports = (sequelize, DataTypes) => {
83
179
  this.setDataValue("provinceId", provinceId?.id || provinceId);
84
180
  },
85
181
  },
86
- postalCode: { type: DataTypes.STRING },
182
+ postalCode: {
183
+ type: DataTypes.STRING,
184
+ get() {
185
+ return this.getDataValue("showPostal")
186
+ ? this.getDataValue("postalCode")
187
+ : undefined;
188
+ },
189
+ },
87
190
  showPostal: { type: DataTypes.BOOLEAN, defaultValue: false },
88
191
  otp: { type: DataTypes.INTEGER },
89
192
  membershipTypeId: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@churchsoln/dbms",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "prestart": "node db-setup.js",