@tomei/finance 0.11.8 → 0.14.0-dev.0
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/dist/account-system-entity/account-system-entity.js +2 -5
- package/dist/account-system-entity/account-system-entity.js.map +1 -1
- package/dist/document/document-item.d.ts +6 -1
- package/dist/document/document-item.d.ts.map +1 -1
- package/dist/document/document-item.js +23 -0
- package/dist/document/document-item.js.map +1 -1
- package/dist/document/document.d.ts +4 -1
- package/dist/document/document.d.ts.map +1 -1
- package/dist/document/document.js +23 -2
- package/dist/document/document.js.map +1 -1
- package/dist/document/interfaces/document-attr.interface.d.ts +4 -1
- package/dist/document/interfaces/document-attr.interface.d.ts.map +1 -1
- package/dist/document/interfaces/document-attr.interface.js.map +1 -1
- package/dist/document/interfaces/document-item-attr.interface.d.ts +4 -0
- package/dist/document/interfaces/document-item-attr.interface.d.ts.map +1 -1
- package/dist/document/interfaces/document-item-attr.interface.js.map +1 -1
- package/dist/enum/discount-type.enum.d.ts +5 -0
- package/dist/enum/discount-type.enum.d.ts.map +1 -0
- package/dist/enum/discount-type.enum.js +9 -0
- package/dist/enum/discount-type.enum.js.map +1 -0
- package/dist/enum/index.d.ts +2 -1
- package/dist/enum/index.d.ts.map +1 -1
- package/dist/enum/index.js +3 -1
- package/dist/enum/index.js.map +1 -1
- package/dist/finance-company/finance-company.d.ts.map +1 -1
- package/dist/finance-company/finance-company.js +18 -0
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/models/document-item.entity.d.ts +6 -1
- package/dist/models/document-item.entity.d.ts.map +1 -1
- package/dist/models/document-item.entity.js +22 -0
- package/dist/models/document-item.entity.js.map +1 -1
- package/dist/models/document.entity.d.ts +8 -2
- package/dist/models/document.entity.d.ts.map +1 -1
- package/dist/models/document.entity.js +24 -1
- package/dist/models/document.entity.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/add-discount-collumn-to-document-related-table.js +91 -0
- package/package.json +30 -30
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
up: async (queryInterface, Sequelize) => {
|
|
5
|
+
const transaction = await queryInterface.sequelize.transaction();
|
|
6
|
+
try {
|
|
7
|
+
await queryInterface.addColumn(
|
|
8
|
+
'finance_Document',
|
|
9
|
+
'AmountBeforeDiscount',
|
|
10
|
+
{
|
|
11
|
+
allowNull: true,
|
|
12
|
+
type: Sequelize.DECIMAL(10, 2),
|
|
13
|
+
after: 'Currency'
|
|
14
|
+
},
|
|
15
|
+
{ transaction },
|
|
16
|
+
);
|
|
17
|
+
await queryInterface.addColumn(
|
|
18
|
+
'finance_Document',
|
|
19
|
+
'DiscountType',
|
|
20
|
+
{
|
|
21
|
+
allowNull: true,
|
|
22
|
+
type: Sequelize.ENUM('Percentage', 'Fixed'),
|
|
23
|
+
after: 'Amount'
|
|
24
|
+
},
|
|
25
|
+
{ transaction },
|
|
26
|
+
);
|
|
27
|
+
await queryInterface.addColumn(
|
|
28
|
+
'finance_Document',
|
|
29
|
+
'DiscountValue',
|
|
30
|
+
{
|
|
31
|
+
allowNull: true,
|
|
32
|
+
type: Sequelize.DECIMAL(10, 2),
|
|
33
|
+
after: 'Amount'
|
|
34
|
+
},
|
|
35
|
+
{ transaction },
|
|
36
|
+
);
|
|
37
|
+
await queryInterface.addColumn(
|
|
38
|
+
'finance_DocumentItem',
|
|
39
|
+
'AmountBeforeDiscount',
|
|
40
|
+
{
|
|
41
|
+
allowNull: true,
|
|
42
|
+
type: Sequelize.DECIMAL(10, 2),
|
|
43
|
+
after: 'QuantityUOM'
|
|
44
|
+
},
|
|
45
|
+
{ transaction },
|
|
46
|
+
);
|
|
47
|
+
await queryInterface.addColumn(
|
|
48
|
+
'finance_DocumentItem',
|
|
49
|
+
'DiscountType',
|
|
50
|
+
{
|
|
51
|
+
allowNull: true,
|
|
52
|
+
type: Sequelize.ENUM('Percentage', 'Fixed'),
|
|
53
|
+
after: 'Amount'
|
|
54
|
+
},
|
|
55
|
+
{ transaction },
|
|
56
|
+
);
|
|
57
|
+
await queryInterface.addColumn(
|
|
58
|
+
'finance_DocumentItem',
|
|
59
|
+
'DiscountValue',
|
|
60
|
+
{
|
|
61
|
+
allowNull: true,
|
|
62
|
+
type: Sequelize.DECIMAL(10, 2),
|
|
63
|
+
after: 'Amount'
|
|
64
|
+
},
|
|
65
|
+
{ transaction },
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
await transaction.commit();
|
|
69
|
+
} catch (error) {
|
|
70
|
+
await transaction.rollback();
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
down: async (queryInterface) => {
|
|
76
|
+
const transaction = await queryInterface.sequelize.transaction();
|
|
77
|
+
try {
|
|
78
|
+
await queryInterface.removeColumn('finance_Document', 'AmountBeforeDiscount', { transaction });
|
|
79
|
+
await queryInterface.removeColumn('finance_Document', 'DiscountType', { transaction });
|
|
80
|
+
await queryInterface.removeColumn('finance_Document', 'DiscountValue', { transaction });
|
|
81
|
+
await queryInterface.removeColumn('finance_DocumentItem', 'AmountBeforeDiscount', { transaction });
|
|
82
|
+
await queryInterface.removeColumn('finance_DocumentItem', 'DiscountType', { transaction });
|
|
83
|
+
await queryInterface.removeColumn('finance_DocumentItem', 'DiscountValue', { transaction });
|
|
84
|
+
|
|
85
|
+
await transaction.commit();
|
|
86
|
+
} catch (error) {
|
|
87
|
+
await transaction.rollback();
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomei/finance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0-dev.0",
|
|
4
4
|
"description": "NestJS package for finance module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -28,42 +28,42 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@nestjs/common": "^10.4.
|
|
32
|
-
"@nestjs/swagger": "^8.1.
|
|
33
|
-
"@
|
|
34
|
-
"@tomei/
|
|
35
|
-
"@tomei/
|
|
36
|
-
"@tomei/
|
|
37
|
-
"@tomei/
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"dotenv": "^16.
|
|
41
|
-
"intuit-oauth": "^4.
|
|
42
|
-
"puppeteer": "^
|
|
43
|
-
"sequelize": "^6.37.
|
|
31
|
+
"@nestjs/common": "^10.4.20",
|
|
32
|
+
"@nestjs/swagger": "^8.1.1",
|
|
33
|
+
"@paralleldrive/cuid2": "^2.2.2",
|
|
34
|
+
"@tomei/activity-history": "^0.4.4",
|
|
35
|
+
"@tomei/config": "^0.3.22",
|
|
36
|
+
"@tomei/general": "^0.21.10",
|
|
37
|
+
"@tomei/media": "^0.10.0",
|
|
38
|
+
"@tomei/sso": "^0.65.0",
|
|
39
|
+
"axios": "^1.12.2",
|
|
40
|
+
"dotenv": "^16.6.1",
|
|
41
|
+
"intuit-oauth": "^4.2.0",
|
|
42
|
+
"puppeteer": "^24.22.3",
|
|
43
|
+
"sequelize": "^6.37.7",
|
|
44
44
|
"sequelize-typescript": "^2.1.6"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@commitlint/cli": "^19.
|
|
48
|
-
"@commitlint/config-conventional": "^19.
|
|
49
|
-
"@eslint/js": "^9.
|
|
50
|
-
"@types/multer": "^1.4.
|
|
51
|
-
"@types/node": "^22.
|
|
47
|
+
"@commitlint/cli": "^19.8.1",
|
|
48
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
49
|
+
"@eslint/js": "^9.36.0",
|
|
50
|
+
"@types/multer": "^1.4.13",
|
|
51
|
+
"@types/node": "^22.18.8",
|
|
52
52
|
"@types/sequelize": "^4.28.20",
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
54
|
-
"eslint": "^9.
|
|
55
|
-
"eslint-config-prettier": "^9.1.
|
|
56
|
-
"eslint-plugin-import": "^2.
|
|
57
|
-
"eslint-plugin-prettier": "^5.
|
|
58
|
-
"globals": "^15.
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^8.45.0",
|
|
54
|
+
"eslint": "^9.36.0",
|
|
55
|
+
"eslint-config-prettier": "^9.1.2",
|
|
56
|
+
"eslint-plugin-import": "^2.32.0",
|
|
57
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
58
|
+
"globals": "^15.15.0",
|
|
59
59
|
"husky": "^9.1.7",
|
|
60
|
-
"lint-staged": "^15.
|
|
61
|
-
"prettier": "^3.
|
|
60
|
+
"lint-staged": "^15.5.2",
|
|
61
|
+
"prettier": "^3.6.2",
|
|
62
62
|
"ts-node": "^10.9.2",
|
|
63
|
-
"tsc-watch": "^6.
|
|
63
|
+
"tsc-watch": "^6.3.1",
|
|
64
64
|
"tsconfig-paths": "^4.2.0",
|
|
65
|
-
"typescript": "^5.
|
|
66
|
-
"typescript-eslint": "^8.
|
|
65
|
+
"typescript": "^5.9.3",
|
|
66
|
+
"typescript-eslint": "^8.45.0"
|
|
67
67
|
},
|
|
68
68
|
"lint-staged": {
|
|
69
69
|
"*/**/*.{js,ts,tsx}": [
|