@churchsoln/dbms 1.0.30 → 1.0.31

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.
@@ -67,6 +67,11 @@ const RELATIONSHIP = {
67
67
  OTHER: "Other",
68
68
  };
69
69
 
70
+ const CODE_LENGTH = {
71
+ OTP: 4,
72
+ ENV_NUMBER: 5,
73
+ };
74
+
70
75
  module.exports = {
71
76
  ROLES,
72
77
  TRANSFER_STATUS,
@@ -78,4 +83,5 @@ module.exports = {
78
83
  MEMBER_STATUS,
79
84
  GENDER,
80
85
  RELATIONSHIP,
86
+ CODE_LENGTH
81
87
  };
@@ -58,7 +58,6 @@ module.exports = (sequelize, DataTypes) => {
58
58
  "id",
59
59
  "memberId",
60
60
  "username",
61
- "password",
62
61
  "email",
63
62
  "roleId",
64
63
  "subRoleId",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@churchsoln/dbms",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "prestart": "node db-setup.js",
@@ -4,10 +4,11 @@ const errorCodes = require("../config/errorCodes");
4
4
  const errorMsgs = require("../config/errorMsgs");
5
5
  const { masterQueue, masterQueueEvents } = require("../queues");
6
6
  const churchManager = require("../utils/churchManager");
7
- const { QUEUES, ROLES, AUTH_DATA, SUBSCRIPTION_PLAN_ID } = require("../constants");
7
+ const { QUEUES, ROLES, AUTH_DATA, SUBSCRIPTION_PLAN_ID, CODE_LENGTH } = require("../constants");
8
8
  const bcrypt = require("bcrypt");
9
9
  const cryptr = require("../utils/crypto");
10
10
  const jwt = require("jsonwebtoken");
11
+ const utils = require("../utils");
11
12
 
12
13
  class ChurchService {
13
14
  async onboardChurch(params) {
@@ -89,7 +90,10 @@ class ChurchService {
89
90
  masterQueueEvents.on("completed", async (event) => {
90
91
  if (event.jobId === jobData.id) {
91
92
  const churchDb = await churchManager.getChurchDbConnectionById(churchData.id);
92
- const member = await churchDb.member.create({ ...churchAdminDetails })
93
+ const member = await churchDb.member.create({
94
+ ...churchAdminDetails,
95
+ envNumber: utils.generateCode(CODE_LENGTH.ENV_NUMBER)
96
+ })
93
97
  await churchDb.user.create({
94
98
  ...churchAdminDetails,
95
99
  status: true,