@churchsoln/dbms 1.0.29 → 1.0.30

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.
@@ -38,6 +38,7 @@ module.exports = {
38
38
  },
39
39
  onDelete: "SET NULL",
40
40
  },
41
+ enableLoginAccess: { type: DataTypes.BOOLEAN, defaultValue: true },
41
42
  status: { type: DataTypes.BOOLEAN, defaultValue: true },
42
43
 
43
44
  // Metadata
@@ -40,6 +40,7 @@ module.exports = (sequelize, DataTypes) => {
40
40
  // Roles & Permissions
41
41
  roleId: { type: DataTypes.INTEGER },
42
42
  subRoleId: { type: DataTypes.INTEGER },
43
+ enableLoginAccess: { type: DataTypes.BOOLEAN, defaultValue: true },
43
44
  status: { type: DataTypes.BOOLEAN, defaultValue: true },
44
45
 
45
46
  // Metadata
@@ -61,6 +62,7 @@ module.exports = (sequelize, DataTypes) => {
61
62
  "email",
62
63
  "roleId",
63
64
  "subRoleId",
65
+ "enableLoginAccess",
64
66
  "status",
65
67
  "lastLogin",
66
68
  "createdAt",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@churchsoln/dbms",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "prestart": "node db-setup.js",
@@ -56,7 +56,9 @@
56
56
  "churchAdminDetails": {
57
57
  "username": "churchadmin",
58
58
  "email": "churchadmin@xavier.com",
59
- "password": "Church@123"
59
+ "password": "Church@123",
60
+ "firstName": "Jose",
61
+ "lastName": "Mathew"
60
62
  }
61
63
  }
62
64
  }
@@ -385,7 +387,9 @@
385
387
  "churchAdminDetails": {
386
388
  "username": "churchadmin",
387
389
  "email": "churchadmin@xavier.com",
388
- "password": "Church@123"
390
+ "password": "Church@123",
391
+ "firstName": "Jose",
392
+ "lastName": "Mathew"
389
393
  }
390
394
  }
391
395
  },
@@ -437,7 +441,7 @@
437
441
  },
438
442
  "ChurchAdminDataRequest": {
439
443
  "title": "ChurchAdminDataRequest",
440
- "required": ["username", "email", "password"],
444
+ "required": ["username", "email", "password", "firstName", "lastName"],
441
445
  "type": "object",
442
446
  "properties": {
443
447
  "username": {
@@ -448,12 +452,20 @@
448
452
  },
449
453
  "password": {
450
454
  "type": "string"
455
+ },
456
+ "firstName": {
457
+ "type": "string"
458
+ },
459
+ "lastName": {
460
+ "type": "string"
451
461
  }
452
462
  },
453
463
  "example": {
454
464
  "username": "churchadmin",
455
465
  "email": "churchadmin@xavier.com",
456
- "password": "Church@123"
466
+ "password": "Church@123",
467
+ "firstName": "Jose",
468
+ "lastName": "Mathew"
457
469
  }
458
470
  },
459
471
  "SuperAdminLoginDataRequest": {
@@ -89,11 +89,13 @@ class ChurchService {
89
89
  masterQueueEvents.on("completed", async (event) => {
90
90
  if (event.jobId === jobData.id) {
91
91
  const churchDb = await churchManager.getChurchDbConnectionById(churchData.id);
92
+ const member = await churchDb.member.create({ ...churchAdminDetails })
92
93
  await churchDb.user.create({
93
94
  ...churchAdminDetails,
94
95
  status: true,
95
96
  roleId: ROLES.CHURCH_ADMIN,
96
97
  churchId: churchData.id,
98
+ memberId: member.id
97
99
  });
98
100
  await churchDb.church.create(params)
99
101
  console.log(`Church onboarding completed for church: ${name}`);
@@ -22,6 +22,8 @@ const schemas = {
22
22
  username: BaseJoi.string().required(),
23
23
  email: BaseJoi.string().required(),
24
24
  password: BaseJoi.string().required(),
25
+ firstName: BaseJoi.string().required(),
26
+ lastName: BaseJoi.string().required()
25
27
  }).required(),
26
28
  }),
27
29
  updateChurch: BaseJoi.object({