@churchsoln/dbms 1.0.35 → 1.0.37

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.
@@ -17,6 +17,12 @@ const QUEUES = {
17
17
  SEED: "seed",
18
18
  };
19
19
 
20
+ const CONTRIBUTION_TRANSACTION_STATUS = {
21
+ PENDING: "Pending",
22
+ CLEARED: "Cleared",
23
+ VOIDED: "Voided",
24
+ REVERSED: "Reversed",
25
+ };
20
26
  const WORKERS = QUEUES;
21
27
 
22
28
  const AUTH_DATA = {
@@ -75,6 +81,7 @@ const CODE_LENGTH = {
75
81
  module.exports = {
76
82
  ROLES,
77
83
  TRANSFER_STATUS,
84
+ CONTRIBUTION_TRANSACTION_STATUS,
78
85
  QUEUES,
79
86
  WORKERS,
80
87
  AUTH_DATA,
@@ -49,6 +49,7 @@ module.exports = {
49
49
  },
50
50
  },
51
51
  },
52
+ isLoosePlate: { type: DataTypes.BOOLEAN, defaultValue: false },
52
53
  isTaxable: {
53
54
  type: DataTypes.BOOLEAN,
54
55
  defaultValue: true,
@@ -13,9 +13,9 @@ module.exports = (sequelize, DataTypes) => {
13
13
  { freezeTableName: true, timestamps: false }
14
14
  );
15
15
  accounts.associate = function (models) {
16
- accounts.hasOne(models.donation, {
16
+ accounts.hasOne(models.contributionTransactionLine, {
17
17
  foreignKey: "accountId",
18
- as: "donation",
18
+ as: "contributionTransactionLine",
19
19
  });
20
20
  }
21
21
  accounts.selectedFields = ["id", "accountHead", "accountDescription", "isLinkedWithQB"];
@@ -1,3 +1,5 @@
1
+ const { CONTRIBUTION_TRANSACTION_STATUS } = require("../../constants");
2
+
1
3
  module.exports = (sequelize, DataTypes) => {
2
4
  const contributionTransaction = sequelize.define(
3
5
  "ContributionTransaction",
@@ -36,12 +38,12 @@ module.exports = (sequelize, DataTypes) => {
36
38
  },
37
39
  fullName: { type: DataTypes.STRING },
38
40
  status: {
39
- type: DataTypes.ENUM("Pending", "Cleared", "Voided", "Reversed"),
41
+ type: DataTypes.ENUM(Object.values(CONTRIBUTION_TRANSACTION_STATUS)),
40
42
  allowNull: false,
41
43
  validate: {
42
44
  isIn: {
43
- args: [["Pending", "Cleared", "Voided", "Reversed"]],
44
- msg: "Status must be one of Pending, Cleared, Voided, Reversed",
45
+ args: [Object.values(CONTRIBUTION_TRANSACTION_STATUS)],
46
+ msg: `Status must be one of ${Object.values(CONTRIBUTION_TRANSACTION_STATUS).join(", ")}`,
45
47
  },
46
48
  },
47
49
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@churchsoln/dbms",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "prestart": "node db-setup.js",