@kipicore/dbcore 1.1.601 → 1.1.602

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,2 @@
1
+ declare const _exports: import("sequelize-cli").Migration;
2
+ export = _exports;
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ const table = 'rms_purchase_request_items';
6
+ const column = 'description';
7
+ const tableInfo = await queryInterface.describeTable(table);
8
+ if (!tableInfo[column]) {
9
+ await queryInterface.addColumn(table, column, {
10
+ type: Sequelize.TEXT,
11
+ allowNull: true,
12
+ });
13
+ }
14
+ },
15
+ async down(queryInterface) {
16
+ const table = 'rms_purchase_request_items';
17
+ const column = 'description';
18
+ const tableInfo = await queryInterface.describeTable(table);
19
+ if (tableInfo[column]) {
20
+ await queryInterface.removeColumn(table, column);
21
+ }
22
+ }
23
+ };
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("sequelize-cli").Migration;
2
+ export = _exports;
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ const table = 'rms_purchase_request_items';
6
+ const tableInfo = await queryInterface.describeTable(table);
7
+ if (tableInfo['requested_quantity']) {
8
+ await queryInterface.renameColumn(table, 'requested_quantity', 'quantity');
9
+ }
10
+ if (tableInfo['estimated_price']) {
11
+ await queryInterface.renameColumn(table, 'estimated_price', 'estimated_rate');
12
+ }
13
+ if (!tableInfo['estimated_amount']) {
14
+ await queryInterface.addColumn(table, 'estimated_amount', {
15
+ type: Sequelize.DECIMAL(15, 2),
16
+ allowNull: true,
17
+ });
18
+ }
19
+ if (!tableInfo['status']) {
20
+ await queryInterface.addColumn(table, 'status', {
21
+ type: Sequelize.STRING,
22
+ allowNull: true,
23
+ defaultValue: 'ACTIVE',
24
+ });
25
+ }
26
+ },
27
+ async down(queryInterface, Sequelize) {
28
+ const table = 'rms_purchase_request_items';
29
+ const tableInfo = await queryInterface.describeTable(table);
30
+ if (tableInfo['status']) {
31
+ await queryInterface.removeColumn(table, 'status');
32
+ }
33
+ if (tableInfo['estimated_amount']) {
34
+ await queryInterface.removeColumn(table, 'estimated_amount');
35
+ }
36
+ if (tableInfo['estimated_rate']) {
37
+ await queryInterface.renameColumn(table, 'estimated_rate', 'estimated_price');
38
+ }
39
+ if (tableInfo['quantity']) {
40
+ await queryInterface.renameColumn(table, 'quantity', 'requested_quantity');
41
+ }
42
+ }
43
+ };
@@ -42,14 +42,17 @@ RmsPurchaseRequestItemModel.init({
42
42
  instituteId: {
43
43
  type: sequelize_1.DataTypes.UUID,
44
44
  allowNull: true,
45
+ field: 'institute_id',
45
46
  },
46
47
  purchaseRequestId: {
47
48
  type: sequelize_1.DataTypes.UUID,
48
49
  allowNull: true,
50
+ field: 'purchase_request_id',
49
51
  },
50
52
  resourceId: {
51
53
  type: sequelize_1.DataTypes.UUID,
52
54
  allowNull: true,
55
+ field: 'resource_id',
53
56
  },
54
57
  description: {
55
58
  type: sequelize_1.DataTypes.TEXT,
@@ -62,14 +65,17 @@ RmsPurchaseRequestItemModel.init({
62
65
  estimatedRate: {
63
66
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
64
67
  allowNull: true,
68
+ field: 'estimated_rate',
65
69
  },
66
70
  estimatedAmount: {
67
71
  type: sequelize_1.DataTypes.DECIMAL(15, 2),
68
72
  allowNull: true,
73
+ field: 'estimated_amount',
69
74
  },
70
75
  approvedQuantity: {
71
76
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
72
77
  allowNull: true,
78
+ field: 'approved_quantity',
73
79
  },
74
80
  status: {
75
81
  type: sequelize_1.DataTypes.STRING,
@@ -50,22 +50,27 @@ RmsPurchaseRequestModel.init({
50
50
  instituteId: {
51
51
  type: sequelize_1.DataTypes.UUID,
52
52
  allowNull: true,
53
+ field: 'institute_id',
53
54
  },
54
55
  requestNo: {
55
56
  type: sequelize_1.DataTypes.STRING,
56
57
  allowNull: true,
58
+ field: 'request_no',
57
59
  },
58
60
  requestedBy: {
59
61
  type: sequelize_1.DataTypes.UUID,
60
62
  allowNull: true,
63
+ field: 'requested_by',
61
64
  },
62
65
  departmentId: {
63
66
  type: sequelize_1.DataTypes.UUID,
64
67
  allowNull: true,
68
+ field: 'department_id',
65
69
  },
66
70
  requiredDate: {
67
71
  type: sequelize_1.DataTypes.DATE,
68
72
  allowNull: true,
73
+ field: 'required_date',
69
74
  },
70
75
  purpose: {
71
76
  type: sequelize_1.DataTypes.TEXT,
@@ -80,22 +85,27 @@ RmsPurchaseRequestModel.init({
80
85
  type: sequelize_1.DataTypes.STRING,
81
86
  allowNull: true,
82
87
  defaultValue: app_1.RMS_APPROVAL_STATUS.DRAFT,
88
+ field: 'approval_status',
83
89
  },
84
90
  approverId: {
85
91
  type: sequelize_1.DataTypes.UUID,
86
92
  allowNull: true,
93
+ field: 'approver_id',
87
94
  },
88
95
  approvedAt: {
89
96
  type: sequelize_1.DataTypes.DATE,
90
97
  allowNull: true,
98
+ field: 'approved_at',
91
99
  },
92
100
  approvalRemarks: {
93
101
  type: sequelize_1.DataTypes.TEXT,
94
102
  allowNull: true,
103
+ field: 'approval_remarks',
95
104
  },
96
105
  approvalHistory: {
97
106
  type: sequelize_1.DataTypes.TEXT,
98
107
  allowNull: true,
108
+ field: 'approval_history',
99
109
  },
100
110
  status: {
101
111
  type: sequelize_1.DataTypes.STRING,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.601",
3
+ "version": "1.1.602",
4
4
  "description": "Reusable DB core package with Postgres, MongoDB, models, services, interfaces, and types",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",