@churchsoln/dbms 1.0.24 → 1.0.26

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.
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, DataTypes) => {
5
+ return Promise.all([
6
+ queryInterface.addColumn("Donation", "fullName", {
7
+ type: DataTypes.STRING,
8
+ })
9
+ ]);
10
+ },
11
+ down: async (queryInterface) => {},
12
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, DataTypes) => {
5
+ return Promise.all([
6
+ queryInterface.addColumn("Church", "emailAppPassword", {
7
+ type: DataTypes.STRING,
8
+ })
9
+ ]);
10
+ },
11
+ down: async (queryInterface) => {},
12
+ };
@@ -12,6 +12,7 @@ module.exports = (sequelize, DataTypes) => {
12
12
  country: { type: DataTypes.STRING },
13
13
  postalCode: { type: DataTypes.STRING },
14
14
  email: { type: DataTypes.STRING },
15
+ emailAppPassword: { type: DataTypes.STRING },
15
16
  phoneNumber: { type: DataTypes.STRING },
16
17
  contactPerson: { type: DataTypes.STRING },
17
18
  currency: { type: DataTypes.STRING },
@@ -33,6 +34,7 @@ module.exports = (sequelize, DataTypes) => {
33
34
  "country",
34
35
  "postalCode",
35
36
  "email",
37
+ "emailAppPassword",
36
38
  "phoneNumber",
37
39
  "contactPerson",
38
40
  "currency",
@@ -26,6 +26,7 @@ module.exports = (sequelize, DataTypes) => {
26
26
  isTaxable: { type: DataTypes.BOOLEAN, defaultValue: false },
27
27
  isLoosePlate: { type: DataTypes.BOOLEAN, defaultValue: false },
28
28
  note: { type: DataTypes.TEXT },
29
+ fullName: { type: DataTypes.STRING },
29
30
  status: { type: DataTypes.BOOLEAN, defaultValue: true },
30
31
  createdAt: {
31
32
  type: DataTypes.DATE,
@@ -62,6 +63,7 @@ module.exports = (sequelize, DataTypes) => {
62
63
  "isTaxable",
63
64
  "isLoosePlate",
64
65
  "note",
66
+ "fullName",
65
67
  "status",
66
68
  "createdAt"
67
69
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@churchsoln/dbms",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "prestart": "node db-setup.js",
@@ -3,7 +3,7 @@
3
3
  module.exports = {
4
4
  up: async (queryInterface, Sequelize) => {
5
5
  const membershipTypes = [
6
- { name: "Subscription", isDefault: true },
6
+ { name: "Member", isDefault: true },
7
7
  ];
8
8
 
9
9
  for (const membershipType of membershipTypes) {
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ const transferTypes = [
6
+ { name: "Cash", status: true },
7
+ { name: "Cheque", status: true },
8
+ ];
9
+
10
+ for (const transferType of transferTypes) {
11
+ const existingStatus = await queryInterface.rawSelect(
12
+ "TransferType",
13
+ {
14
+ where: { name: transferType.name },
15
+ },
16
+ ["id"]
17
+ );
18
+
19
+ if (existingStatus) {
20
+ await queryInterface.bulkUpdate(
21
+ "TransferType",
22
+ { status: transferType.status },
23
+ { name: transferType.name }
24
+ );
25
+ } else {
26
+ await queryInterface.bulkInsert("TransferType", [transferType], {});
27
+ }
28
+ }
29
+ },
30
+
31
+ down: async (queryInterface, Sequelize) => {
32
+ await queryInterface.bulkDelete(
33
+ "TransferType",
34
+ {
35
+ name: transferTypes.map((transferType) => transferType.name),
36
+ },
37
+ {}
38
+ );
39
+ },
40
+ };