@churchsoln/dbms 1.0.49 → 1.0.51
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.
- package/migrations/church/20241204170637-update-contributionTransactionLineAccount.js +33 -0
- package/migrations/church/20241204170638-update-member.js +62 -0
- package/models/church/accounts.js +4 -0
- package/models/church/contributionTransactionLine.js +7 -7
- package/models/church/member.js +12 -0
- package/models/church/pledgeAccount.js +0 -4
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
up: async (queryInterface, DataTypes) => {
|
|
5
|
+
await queryInterface.removeColumn(
|
|
6
|
+
"ContributionTransactionLine",
|
|
7
|
+
"pledgeAccountId",
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
await queryInterface.addColumn(
|
|
11
|
+
"ContributionTransactionLine",
|
|
12
|
+
"accountId",
|
|
13
|
+
{
|
|
14
|
+
type: DataTypes.INTEGER,
|
|
15
|
+
allowNull: true
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
await queryInterface.addConstraint("ContributionTransactionLine", {
|
|
20
|
+
fields: ["accountId"],
|
|
21
|
+
type: "foreign key",
|
|
22
|
+
name: "ContributionTxnLine_AccountId_Fkey",
|
|
23
|
+
references: {
|
|
24
|
+
table: "Accounts",
|
|
25
|
+
field: "id",
|
|
26
|
+
},
|
|
27
|
+
onDelete: "cascade",
|
|
28
|
+
onUpdate: "cascade",
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
down: async (queryInterface, DataTypes) => {}
|
|
33
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
up: async (queryInterface, DataTypes) => {
|
|
5
|
+
|
|
6
|
+
await queryInterface.addColumn(
|
|
7
|
+
"Member",
|
|
8
|
+
"showAddress",
|
|
9
|
+
{
|
|
10
|
+
type: DataTypes.BOOLEAN,
|
|
11
|
+
defaultValue: false
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
await queryInterface.addColumn(
|
|
16
|
+
"Member",
|
|
17
|
+
"showCity",
|
|
18
|
+
{
|
|
19
|
+
type: DataTypes.BOOLEAN,
|
|
20
|
+
defaultValue: false
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
await queryInterface.addColumn(
|
|
25
|
+
"Member",
|
|
26
|
+
"showProvince",
|
|
27
|
+
{
|
|
28
|
+
type: DataTypes.BOOLEAN,
|
|
29
|
+
defaultValue: false
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
await queryInterface.addColumn(
|
|
34
|
+
"Member",
|
|
35
|
+
"showCellPhone",
|
|
36
|
+
{
|
|
37
|
+
type: DataTypes.BOOLEAN,
|
|
38
|
+
defaultValue: false
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
await queryInterface.addColumn(
|
|
43
|
+
"Member",
|
|
44
|
+
"showEmail",
|
|
45
|
+
{
|
|
46
|
+
type: DataTypes.BOOLEAN,
|
|
47
|
+
defaultValue: false
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
await queryInterface.addColumn(
|
|
52
|
+
"Member",
|
|
53
|
+
"showZipCode",
|
|
54
|
+
{
|
|
55
|
+
type: DataTypes.BOOLEAN,
|
|
56
|
+
defaultValue: false
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
down: async (queryInterface, DataTypes) => {}
|
|
62
|
+
};
|
|
@@ -17,6 +17,10 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
17
17
|
foreignKey: "accountId",
|
|
18
18
|
as: "pledgeAccount",
|
|
19
19
|
});
|
|
20
|
+
accounts.hasMany(models.contributionTransactionLine, {
|
|
21
|
+
foreignKey: "accountId",
|
|
22
|
+
as: "contributionTransactionLine",
|
|
23
|
+
});
|
|
20
24
|
}
|
|
21
25
|
accounts.selectedFields = ["id", "accountHead", "accountDescription", "isLinkedWithQB"];
|
|
22
26
|
return accounts;
|
|
@@ -16,12 +16,12 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
16
16
|
isInt: { msg: "Transaction ID must be an integer" },
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
accountId: {
|
|
20
20
|
type: DataTypes.INTEGER,
|
|
21
21
|
allowNull: false,
|
|
22
22
|
validate: {
|
|
23
|
-
notNull: { msg: "
|
|
24
|
-
isInt: { msg: "
|
|
23
|
+
notNull: { msg: "Account ID is required" },
|
|
24
|
+
isInt: { msg: "Account ID must be an integer" },
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
isLoosePlate: { type: DataTypes.BOOLEAN, defaultValue: false },
|
|
@@ -57,9 +57,9 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
57
57
|
{ freezeTableName: true, timestamps: false }
|
|
58
58
|
);
|
|
59
59
|
contributionTransactionLine.associate = function (models) {
|
|
60
|
-
contributionTransactionLine.belongsTo(models.
|
|
61
|
-
foreignKey: "
|
|
62
|
-
as: "
|
|
60
|
+
contributionTransactionLine.belongsTo(models.accounts, {
|
|
61
|
+
foreignKey: "accountId",
|
|
62
|
+
as: "accounts",
|
|
63
63
|
});
|
|
64
64
|
contributionTransactionLine.belongsTo(models.contributionTransaction, {
|
|
65
65
|
foreignKey: "contributionTransactionId",
|
|
@@ -69,7 +69,7 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
69
69
|
contributionTransactionLine.selectedFields = [
|
|
70
70
|
"id",
|
|
71
71
|
"contributionTransactionId",
|
|
72
|
-
"
|
|
72
|
+
"accountId",
|
|
73
73
|
"isLoosePlate",
|
|
74
74
|
"amount",
|
|
75
75
|
"isTaxable",
|
package/models/church/member.js
CHANGED
|
@@ -31,23 +31,29 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
31
31
|
|
|
32
32
|
// Contact Info
|
|
33
33
|
address: { type: DataTypes.TEXT },
|
|
34
|
+
showAddress: { type: DataTypes.BOOLEAN, defaultValue: false },
|
|
34
35
|
cityId: {
|
|
35
36
|
type: DataTypes.INTEGER,
|
|
36
37
|
set(cityId) {
|
|
37
38
|
this.setDataValue("cityId", cityId?.id || cityId);
|
|
38
39
|
},
|
|
39
40
|
},
|
|
41
|
+
showCity: { type: DataTypes.BOOLEAN },
|
|
40
42
|
provinceId: {
|
|
41
43
|
type: DataTypes.INTEGER,
|
|
42
44
|
set(provinceId) {
|
|
43
45
|
this.setDataValue("provinceId", provinceId?.id || provinceId);
|
|
44
46
|
},
|
|
45
47
|
},
|
|
48
|
+
showProvince: { type: DataTypes.BOOLEAN, defaultValue: false },
|
|
46
49
|
zipCode: { type: DataTypes.STRING },
|
|
50
|
+
showZipCode: { type: DataTypes.BOOLEAN, defaultValue: false },
|
|
47
51
|
homePhone: { type: DataTypes.STRING },
|
|
48
52
|
cellPhone: { type: DataTypes.STRING },
|
|
53
|
+
showCellPhone: { type: DataTypes.BOOLEAN, defaultValue: false },
|
|
49
54
|
workPhone: { type: DataTypes.STRING },
|
|
50
55
|
email: { type: DataTypes.STRING, validate: { isEmail: true } },
|
|
56
|
+
showEmail: { type: DataTypes.BOOLEAN, defaultValue: false },
|
|
51
57
|
|
|
52
58
|
// Other Personal Info
|
|
53
59
|
occupation: { type: DataTypes.STRING },
|
|
@@ -129,13 +135,19 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
129
135
|
"preferredName",
|
|
130
136
|
"profileImage",
|
|
131
137
|
"address",
|
|
138
|
+
"showAddress",
|
|
132
139
|
"cityId",
|
|
140
|
+
"showCity",
|
|
133
141
|
"provinceId",
|
|
142
|
+
"showProvince",
|
|
134
143
|
"zipCode",
|
|
144
|
+
"showZipCode",
|
|
135
145
|
"homePhone",
|
|
136
146
|
"cellPhone",
|
|
147
|
+
"showCellPhone",
|
|
137
148
|
"workPhone",
|
|
138
149
|
"email",
|
|
150
|
+
"showEmail",
|
|
139
151
|
"occupation",
|
|
140
152
|
"employer",
|
|
141
153
|
"schoolGrade",
|
|
@@ -25,10 +25,6 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
25
25
|
foreignKey: "pledgeAccountId",
|
|
26
26
|
as: "pledge",
|
|
27
27
|
});
|
|
28
|
-
pledgeAccount.hasMany(models.contributionTransactionLine, {
|
|
29
|
-
foreignKey: "pledgeAccountId",
|
|
30
|
-
as: "contributionTransactionLine",
|
|
31
|
-
});
|
|
32
28
|
};
|
|
33
29
|
pledgeAccount.selectedFields = [
|
|
34
30
|
"id",
|