@kipicore/dbcore 1.1.601 → 1.1.603

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
+ };
@@ -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_requests';
6
+ const column = 'remarks';
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_requests';
17
+ const column = 'remarks';
18
+ const tableInfo = await queryInterface.describeTable(table);
19
+ if (tableInfo[column]) {
20
+ await queryInterface.removeColumn(table, column);
21
+ }
22
+ }
23
+ };
@@ -14,5 +14,6 @@ export interface IRmsPurchaseRequestAttributes extends IDefaultAttributes {
14
14
  approvedAt?: Date | null;
15
15
  approvalRemarks?: string | null;
16
16
  approvalHistory?: string;
17
+ remarks?: string | null;
17
18
  status: string;
18
19
  }
@@ -9,5 +9,6 @@ export interface IRmsPurchaseRequestItemAttributes extends IDefaultAttributes {
9
9
  estimatedRate?: number | null;
10
10
  estimatedAmount?: number | null;
11
11
  approvedQuantity?: number | null;
12
+ remarks?: string | null;
12
13
  status: string;
13
14
  }
@@ -7,6 +7,7 @@ declare class RmsPurchaseRequestItemModel extends Model<IRmsPurchaseRequestItemA
7
7
  purchaseRequestId: string;
8
8
  resourceId: string;
9
9
  description?: string | null;
10
+ remarks?: string | null;
10
11
  quantity: number;
11
12
  estimatedRate?: number | null;
12
13
  estimatedAmount?: number | null;
@@ -42,19 +42,26 @@ 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,
56
59
  allowNull: true,
57
60
  },
61
+ remarks: {
62
+ type: sequelize_1.DataTypes.TEXT,
63
+ allowNull: true,
64
+ },
58
65
  quantity: {
59
66
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
60
67
  allowNull: true,
@@ -62,14 +69,17 @@ RmsPurchaseRequestItemModel.init({
62
69
  estimatedRate: {
63
70
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
64
71
  allowNull: true,
72
+ field: 'estimated_rate',
65
73
  },
66
74
  estimatedAmount: {
67
75
  type: sequelize_1.DataTypes.DECIMAL(15, 2),
68
76
  allowNull: true,
77
+ field: 'estimated_amount',
69
78
  },
70
79
  approvedQuantity: {
71
80
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
72
81
  allowNull: true,
82
+ field: 'approved_quantity',
73
83
  },
74
84
  status: {
75
85
  type: sequelize_1.DataTypes.STRING,
@@ -16,6 +16,7 @@ declare class RmsPurchaseRequestModel extends Model<IRmsPurchaseRequestAttribute
16
16
  approvedAt?: Date | null;
17
17
  approvalRemarks?: string | null;
18
18
  approvalHistory?: string | null;
19
+ remarks?: string | null;
19
20
  status: string;
20
21
  createdBy?: string | null;
21
22
  updatedBy?: string | null;
@@ -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,31 @@ 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',
109
+ },
110
+ remarks: {
111
+ type: sequelize_1.DataTypes.TEXT,
112
+ allowNull: true,
99
113
  },
100
114
  status: {
101
115
  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.603",
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",