@kipicore/dbcore 1.1.574 → 1.1.576

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.
Files changed (135) hide show
  1. package/dist/constants/app.d.ts +122 -0
  2. package/dist/constants/app.js +141 -1
  3. package/dist/constants/errorMessages.d.ts +10 -0
  4. package/dist/constants/errorMessages.js +12 -1
  5. package/dist/constants/successMessages.d.ts +12 -0
  6. package/dist/constants/successMessages.js +14 -1
  7. package/dist/db/psql/migrations/20260615045636-add_rms_models.d.ts +2 -0
  8. package/dist/db/psql/migrations/20260615045636-add_rms_models.js +276 -0
  9. package/dist/db/psql/migrations/20260615083628-add_storage_and_asset_transactions.d.ts +2 -0
  10. package/dist/db/psql/migrations/20260615083628-add_storage_and_asset_transactions.js +60 -0
  11. package/dist/interfaces/index.d.ts +19 -0
  12. package/dist/interfaces/index.js +19 -0
  13. package/dist/interfaces/rmsAssetInterface.d.ts +15 -0
  14. package/dist/interfaces/rmsAssetInterface.js +2 -0
  15. package/dist/interfaces/rmsAssetTransactionInterface.d.ts +16 -0
  16. package/dist/interfaces/rmsAssetTransactionInterface.js +2 -0
  17. package/dist/interfaces/rmsAuditLogInterface.d.ts +17 -0
  18. package/dist/interfaces/rmsAuditLogInterface.js +2 -0
  19. package/dist/interfaces/rmsDepartmentInterface.d.ts +10 -0
  20. package/dist/interfaces/rmsDepartmentInterface.js +2 -0
  21. package/dist/interfaces/rmsGrnInterface.d.ts +14 -0
  22. package/dist/interfaces/rmsGrnInterface.js +2 -0
  23. package/dist/interfaces/rmsGrnItemInterface.d.ts +13 -0
  24. package/dist/interfaces/rmsGrnItemInterface.js +2 -0
  25. package/dist/interfaces/rmsLocationInterface.d.ts +12 -0
  26. package/dist/interfaces/rmsLocationInterface.js +2 -0
  27. package/dist/interfaces/rmsPurchaseOrderInterface.d.ts +17 -0
  28. package/dist/interfaces/rmsPurchaseOrderInterface.js +2 -0
  29. package/dist/interfaces/rmsPurchaseOrderItemInterface.d.ts +13 -0
  30. package/dist/interfaces/rmsPurchaseOrderItemInterface.js +2 -0
  31. package/dist/interfaces/rmsPurchaseRequestInterface.d.ts +14 -0
  32. package/dist/interfaces/rmsPurchaseRequestInterface.js +2 -0
  33. package/dist/interfaces/rmsPurchaseRequestItemInterface.d.ts +13 -0
  34. package/dist/interfaces/rmsPurchaseRequestItemInterface.js +2 -0
  35. package/dist/interfaces/rmsRequestApprovalInterface.d.ts +13 -0
  36. package/dist/interfaces/rmsRequestApprovalInterface.js +2 -0
  37. package/dist/interfaces/rmsResourceDetailsInterface.d.ts +19 -0
  38. package/dist/interfaces/rmsResourceDetailsInterface.js +2 -0
  39. package/dist/interfaces/rmsResourceInterface.d.ts +23 -0
  40. package/dist/interfaces/rmsResourceInterface.js +2 -0
  41. package/dist/interfaces/rmsStockInterface.d.ts +17 -0
  42. package/dist/interfaces/rmsStockInterface.js +2 -0
  43. package/dist/interfaces/rmsStockTransactionInterface.d.ts +18 -0
  44. package/dist/interfaces/rmsStockTransactionInterface.js +2 -0
  45. package/dist/interfaces/rmsStorageInterface.d.ts +17 -0
  46. package/dist/interfaces/rmsStorageInterface.js +2 -0
  47. package/dist/interfaces/rmsVendorDocumentInterface.d.ts +11 -0
  48. package/dist/interfaces/rmsVendorDocumentInterface.js +2 -0
  49. package/dist/interfaces/rmsVendorInterface.d.ts +16 -0
  50. package/dist/interfaces/rmsVendorInterface.js +2 -0
  51. package/dist/models/mongodb/index.d.ts +2 -0
  52. package/dist/models/mongodb/index.js +5 -1
  53. package/dist/models/mongodb/rmsAuditLogModel.d.ts +4 -0
  54. package/dist/models/mongodb/rmsAuditLogModel.js +99 -0
  55. package/dist/models/mongodb/rmsResourceDetailsModel.d.ts +8 -0
  56. package/dist/models/mongodb/rmsResourceDetailsModel.js +57 -0
  57. package/dist/models/psql/index.d.ts +18 -0
  58. package/dist/models/psql/index.js +39 -1
  59. package/dist/models/psql/rmsAssetModel.d.ts +25 -0
  60. package/dist/models/psql/rmsAssetModel.js +80 -0
  61. package/dist/models/psql/rmsAssetTransactionModel.d.ts +26 -0
  62. package/dist/models/psql/rmsAssetTransactionModel.js +89 -0
  63. package/dist/models/psql/rmsDepartmentModel.d.ts +20 -0
  64. package/dist/models/psql/rmsDepartmentModel.js +67 -0
  65. package/dist/models/psql/rmsGrnItemModel.d.ts +23 -0
  66. package/dist/models/psql/rmsGrnItemModel.js +75 -0
  67. package/dist/models/psql/rmsGrnModel.d.ts +24 -0
  68. package/dist/models/psql/rmsGrnModel.js +74 -0
  69. package/dist/models/psql/rmsLocationModel.d.ts +22 -0
  70. package/dist/models/psql/rmsLocationModel.js +79 -0
  71. package/dist/models/psql/rmsPurchaseOrderItemModel.d.ts +23 -0
  72. package/dist/models/psql/rmsPurchaseOrderItemModel.js +89 -0
  73. package/dist/models/psql/rmsPurchaseOrderModel.d.ts +27 -0
  74. package/dist/models/psql/rmsPurchaseOrderModel.js +108 -0
  75. package/dist/models/psql/rmsPurchaseRequestItemModel.d.ts +23 -0
  76. package/dist/models/psql/rmsPurchaseRequestItemModel.js +86 -0
  77. package/dist/models/psql/rmsPurchaseRequestModel.d.ts +24 -0
  78. package/dist/models/psql/rmsPurchaseRequestModel.js +96 -0
  79. package/dist/models/psql/rmsRequestApprovalModel.d.ts +23 -0
  80. package/dist/models/psql/rmsRequestApprovalModel.js +79 -0
  81. package/dist/models/psql/rmsResourceModel.d.ts +33 -0
  82. package/dist/models/psql/rmsResourceModel.js +147 -0
  83. package/dist/models/psql/rmsStockModel.d.ts +27 -0
  84. package/dist/models/psql/rmsStockModel.js +113 -0
  85. package/dist/models/psql/rmsStockTransactionModel.d.ts +28 -0
  86. package/dist/models/psql/rmsStockTransactionModel.js +113 -0
  87. package/dist/models/psql/rmsStorageRackModel.d.ts +20 -0
  88. package/dist/models/psql/rmsStorageRackModel.js +57 -0
  89. package/dist/models/psql/rmsStorageSlotModel.d.ts +19 -0
  90. package/dist/models/psql/rmsStorageSlotModel.js +53 -0
  91. package/dist/models/psql/rmsVendorDocumentModel.d.ts +21 -0
  92. package/dist/models/psql/rmsVendorDocumentModel.js +80 -0
  93. package/dist/models/psql/rmsVendorModel.d.ts +27 -0
  94. package/dist/models/psql/rmsVendorModel.js +95 -0
  95. package/dist/types/index.d.ts +19 -0
  96. package/dist/types/index.js +19 -0
  97. package/dist/types/rmsAssetTransactionType.d.ts +3 -0
  98. package/dist/types/rmsAssetTransactionType.js +2 -0
  99. package/dist/types/rmsAssetType.d.ts +3 -0
  100. package/dist/types/rmsAssetType.js +2 -0
  101. package/dist/types/rmsAuditLogType.d.ts +3 -0
  102. package/dist/types/rmsAuditLogType.js +2 -0
  103. package/dist/types/rmsDepartmentType.d.ts +3 -0
  104. package/dist/types/rmsDepartmentType.js +2 -0
  105. package/dist/types/rmsGrnItemType.d.ts +3 -0
  106. package/dist/types/rmsGrnItemType.js +2 -0
  107. package/dist/types/rmsGrnType.d.ts +3 -0
  108. package/dist/types/rmsGrnType.js +2 -0
  109. package/dist/types/rmsLocationType.d.ts +3 -0
  110. package/dist/types/rmsLocationType.js +2 -0
  111. package/dist/types/rmsPurchaseOrderItemType.d.ts +3 -0
  112. package/dist/types/rmsPurchaseOrderItemType.js +2 -0
  113. package/dist/types/rmsPurchaseOrderType.d.ts +3 -0
  114. package/dist/types/rmsPurchaseOrderType.js +2 -0
  115. package/dist/types/rmsPurchaseRequestItemType.d.ts +3 -0
  116. package/dist/types/rmsPurchaseRequestItemType.js +2 -0
  117. package/dist/types/rmsPurchaseRequestType.d.ts +3 -0
  118. package/dist/types/rmsPurchaseRequestType.js +2 -0
  119. package/dist/types/rmsRequestApprovalType.d.ts +3 -0
  120. package/dist/types/rmsRequestApprovalType.js +2 -0
  121. package/dist/types/rmsResourceDetailsType.d.ts +2 -0
  122. package/dist/types/rmsResourceDetailsType.js +2 -0
  123. package/dist/types/rmsResourceType.d.ts +3 -0
  124. package/dist/types/rmsResourceType.js +2 -0
  125. package/dist/types/rmsStockTransactionType.d.ts +3 -0
  126. package/dist/types/rmsStockTransactionType.js +2 -0
  127. package/dist/types/rmsStockType.d.ts +3 -0
  128. package/dist/types/rmsStockType.js +2 -0
  129. package/dist/types/rmsStorageType.d.ts +4 -0
  130. package/dist/types/rmsStorageType.js +2 -0
  131. package/dist/types/rmsVendorDocumentType.d.ts +3 -0
  132. package/dist/types/rmsVendorDocumentType.js +2 -0
  133. package/dist/types/rmsVendorType.d.ts +3 -0
  134. package/dist/types/rmsVendorType.js +2 -0
  135. package/package.json +1 -1
@@ -0,0 +1,276 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ const commonFields = {
6
+ created_by: { type: Sequelize.UUID, allowNull: true },
7
+ updated_by: { type: Sequelize.UUID, allowNull: true },
8
+ deleted_by: { type: Sequelize.UUID, allowNull: true },
9
+ createdAt: { type: Sequelize.DATE, allowNull: true },
10
+ updatedAt: { type: Sequelize.DATE, allowNull: true },
11
+ deletedAt: { type: Sequelize.DATE, allowNull: true },
12
+ };
13
+ // rms_departments
14
+ if (!(await queryInterface.tableExists('rms_departments'))) {
15
+ await queryInterface.createTable('rms_departments', {
16
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
17
+ institute_id: { type: Sequelize.UUID, allowNull: true },
18
+ department_code: { type: Sequelize.STRING, allowNull: true },
19
+ department_name: { type: Sequelize.STRING, allowNull: true },
20
+ description: { type: Sequelize.TEXT, allowNull: true },
21
+ head_of_department: { type: Sequelize.UUID, allowNull: true },
22
+ status: { type: Sequelize.STRING, allowNull: true },
23
+ ...commonFields,
24
+ });
25
+ }
26
+ // rms_locations
27
+ if (!(await queryInterface.tableExists('rms_locations'))) {
28
+ await queryInterface.createTable('rms_locations', {
29
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
30
+ institute_id: { type: Sequelize.UUID, allowNull: true },
31
+ location_code: { type: Sequelize.STRING, allowNull: true },
32
+ location_name: { type: Sequelize.STRING, allowNull: true },
33
+ location_type: { type: Sequelize.STRING, allowNull: true },
34
+ parent_location_id: { type: Sequelize.UUID, allowNull: true },
35
+ capacity: { type: Sequelize.INTEGER, allowNull: true },
36
+ manager_id: { type: Sequelize.UUID, allowNull: true },
37
+ status: { type: Sequelize.STRING, allowNull: true },
38
+ ...commonFields,
39
+ });
40
+ }
41
+ // rms_vendors
42
+ if (!(await queryInterface.tableExists('rms_vendors'))) {
43
+ await queryInterface.createTable('rms_vendors', {
44
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
45
+ institute_id: { type: Sequelize.UUID, allowNull: true },
46
+ vendor_code: { type: Sequelize.STRING, allowNull: true },
47
+ vendor_name: { type: Sequelize.STRING, allowNull: true },
48
+ contact_person: { type: Sequelize.STRING, allowNull: true },
49
+ email: { type: Sequelize.STRING, allowNull: true },
50
+ phone: { type: Sequelize.STRING, allowNull: true },
51
+ address: { type: Sequelize.TEXT, allowNull: true },
52
+ tax_id: { type: Sequelize.STRING, allowNull: true },
53
+ payment_terms: { type: Sequelize.STRING, allowNull: true },
54
+ kyc_status: { type: Sequelize.STRING, allowNull: true },
55
+ rating: { type: Sequelize.DECIMAL(3, 2), allowNull: true },
56
+ status: { type: Sequelize.STRING, allowNull: true },
57
+ ...commonFields,
58
+ });
59
+ }
60
+ // rms_resources
61
+ if (!(await queryInterface.tableExists('rms_resources'))) {
62
+ await queryInterface.createTable('rms_resources', {
63
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
64
+ institute_id: { type: Sequelize.UUID, allowNull: true },
65
+ resource_code: { type: Sequelize.STRING, allowNull: true },
66
+ resource_name: { type: Sequelize.STRING, allowNull: true },
67
+ resource_type: { type: Sequelize.STRING, allowNull: true },
68
+ category_id: { type: Sequelize.UUID, allowNull: true },
69
+ sub_category_id: { type: Sequelize.UUID, allowNull: true },
70
+ product_id: { type: Sequelize.UUID, allowNull: true },
71
+ unit: { type: Sequelize.STRING, allowNull: true },
72
+ department_id: { type: Sequelize.UUID, allowNull: true },
73
+ default_location_id: { type: Sequelize.UUID, allowNull: true },
74
+ custodian_id: { type: Sequelize.UUID, allowNull: true },
75
+ description: { type: Sequelize.TEXT, allowNull: true },
76
+ min_stock_level: { type: Sequelize.INTEGER, allowNull: true },
77
+ reorder_level: { type: Sequelize.INTEGER, allowNull: true },
78
+ is_batch_tracked: { type: Sequelize.BOOLEAN, allowNull: true },
79
+ is_expiry_tracked: { type: Sequelize.BOOLEAN, allowNull: true },
80
+ metadata: { type: Sequelize.JSONB, allowNull: true },
81
+ status: { type: Sequelize.STRING, allowNull: true },
82
+ ...commonFields,
83
+ });
84
+ }
85
+ // rms_purchase_requests
86
+ if (!(await queryInterface.tableExists('rms_purchase_requests'))) {
87
+ await queryInterface.createTable('rms_purchase_requests', {
88
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
89
+ institute_id: { type: Sequelize.UUID, allowNull: true },
90
+ request_no: { type: Sequelize.STRING, allowNull: true },
91
+ department_id: { type: Sequelize.UUID, allowNull: true },
92
+ requested_by: { type: Sequelize.UUID, allowNull: true },
93
+ request_date: { type: Sequelize.DATE, allowNull: true },
94
+ required_date: { type: Sequelize.DATE, allowNull: true },
95
+ purpose: { type: Sequelize.TEXT, allowNull: true },
96
+ priority: { type: Sequelize.STRING, allowNull: true },
97
+ status: { type: Sequelize.STRING, allowNull: true },
98
+ approval_status: { type: Sequelize.STRING, allowNull: true },
99
+ ...commonFields,
100
+ });
101
+ }
102
+ // rms_purchase_request_items
103
+ if (!(await queryInterface.tableExists('rms_purchase_request_items'))) {
104
+ await queryInterface.createTable('rms_purchase_request_items', {
105
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
106
+ institute_id: { type: Sequelize.UUID, allowNull: true },
107
+ purchase_request_id: { type: Sequelize.UUID, allowNull: true },
108
+ resource_id: { type: Sequelize.UUID, allowNull: true },
109
+ requested_quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
110
+ approved_quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
111
+ estimated_price: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
112
+ unit: { type: Sequelize.STRING, allowNull: true },
113
+ remarks: { type: Sequelize.TEXT, allowNull: true },
114
+ ...commonFields,
115
+ });
116
+ }
117
+ // rms_purchase_orders
118
+ if (!(await queryInterface.tableExists('rms_purchase_orders'))) {
119
+ await queryInterface.createTable('rms_purchase_orders', {
120
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
121
+ institute_id: { type: Sequelize.UUID, allowNull: true },
122
+ po_number: { type: Sequelize.STRING, allowNull: true },
123
+ purchase_request_id: { type: Sequelize.UUID, allowNull: true },
124
+ vendor_id: { type: Sequelize.UUID, allowNull: true },
125
+ order_date: { type: Sequelize.DATE, allowNull: true },
126
+ expected_delivery_date: { type: Sequelize.DATE, allowNull: true },
127
+ total_amount: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
128
+ tax_amount: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
129
+ discount_amount: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
130
+ shipping_address: { type: Sequelize.TEXT, allowNull: true },
131
+ billing_address: { type: Sequelize.TEXT, allowNull: true },
132
+ terms_conditions: { type: Sequelize.TEXT, allowNull: true },
133
+ status: { type: Sequelize.STRING, allowNull: true },
134
+ approval_status: { type: Sequelize.STRING, allowNull: true },
135
+ fulfillment_status: { type: Sequelize.STRING, allowNull: true },
136
+ ...commonFields,
137
+ });
138
+ }
139
+ // rms_purchase_order_items
140
+ if (!(await queryInterface.tableExists('rms_purchase_order_items'))) {
141
+ await queryInterface.createTable('rms_purchase_order_items', {
142
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
143
+ institute_id: { type: Sequelize.UUID, allowNull: true },
144
+ purchase_order_id: { type: Sequelize.UUID, allowNull: true },
145
+ purchase_request_item_id: { type: Sequelize.UUID, allowNull: true },
146
+ resource_id: { type: Sequelize.UUID, allowNull: true },
147
+ ordered_quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
148
+ unit_price: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
149
+ total_price: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
150
+ tax_amount: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
151
+ discount_amount: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
152
+ unit: { type: Sequelize.STRING, allowNull: true },
153
+ remarks: { type: Sequelize.TEXT, allowNull: true },
154
+ ...commonFields,
155
+ });
156
+ }
157
+ // rms_grn
158
+ if (!(await queryInterface.tableExists('rms_grn'))) {
159
+ await queryInterface.createTable('rms_grn', {
160
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
161
+ institute_id: { type: Sequelize.UUID, allowNull: true },
162
+ grn_no: { type: Sequelize.STRING, allowNull: true },
163
+ purchase_order_id: { type: Sequelize.UUID, allowNull: true },
164
+ vendor_id: { type: Sequelize.UUID, allowNull: true },
165
+ received_date: { type: Sequelize.DATE, allowNull: true },
166
+ received_by: { type: Sequelize.UUID, allowNull: true },
167
+ status: { type: Sequelize.STRING, allowNull: true },
168
+ approval_status: { type: Sequelize.STRING, allowNull: true },
169
+ remarks: { type: Sequelize.TEXT, allowNull: true },
170
+ ...commonFields,
171
+ });
172
+ }
173
+ // rms_grn_items
174
+ if (!(await queryInterface.tableExists('rms_grn_items'))) {
175
+ await queryInterface.createTable('rms_grn_items', {
176
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
177
+ institute_id: { type: Sequelize.UUID, allowNull: true },
178
+ grn_id: { type: Sequelize.UUID, allowNull: true },
179
+ purchase_order_item_id: { type: Sequelize.UUID, allowNull: true },
180
+ resource_id: { type: Sequelize.UUID, allowNull: true },
181
+ ordered_quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
182
+ received_quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
183
+ accepted_quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
184
+ rejected_quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
185
+ unit: { type: Sequelize.STRING, allowNull: true },
186
+ remarks: { type: Sequelize.TEXT, allowNull: true },
187
+ ...commonFields,
188
+ });
189
+ }
190
+ // rms_stock
191
+ if (!(await queryInterface.tableExists('rms_stock'))) {
192
+ await queryInterface.createTable('rms_stock', {
193
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
194
+ institute_id: { type: Sequelize.UUID, allowNull: true },
195
+ resource_id: { type: Sequelize.UUID, allowNull: true },
196
+ location_id: { type: Sequelize.UUID, allowNull: true },
197
+ quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
198
+ reserved_quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
199
+ average_cost: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
200
+ last_restocked_at: { type: Sequelize.DATE, allowNull: true },
201
+ status: { type: Sequelize.STRING, allowNull: true },
202
+ ...commonFields,
203
+ });
204
+ }
205
+ // rms_stock_transactions
206
+ if (!(await queryInterface.tableExists('rms_stock_transactions'))) {
207
+ await queryInterface.createTable('rms_stock_transactions', {
208
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
209
+ institute_id: { type: Sequelize.UUID, allowNull: true },
210
+ resource_id: { type: Sequelize.UUID, allowNull: true },
211
+ location_id: { type: Sequelize.UUID, allowNull: true },
212
+ transaction_type: { type: Sequelize.STRING, allowNull: true },
213
+ transaction_date: { type: Sequelize.DATE, allowNull: true },
214
+ quantity: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
215
+ unit_cost: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
216
+ total_cost: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
217
+ reference_type: { type: Sequelize.STRING, allowNull: true },
218
+ reference_id: { type: Sequelize.UUID, allowNull: true },
219
+ batch_number: { type: Sequelize.STRING, allowNull: true },
220
+ expiry_date: { type: Sequelize.DATE, allowNull: true },
221
+ remarks: { type: Sequelize.TEXT, allowNull: true },
222
+ ...commonFields,
223
+ });
224
+ }
225
+ // rms_assets
226
+ if (!(await queryInterface.tableExists('rms_assets'))) {
227
+ await queryInterface.createTable('rms_assets', {
228
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
229
+ institute_id: { type: Sequelize.UUID, allowNull: true },
230
+ resource_id: { type: Sequelize.UUID, allowNull: true },
231
+ asset_code: { type: Sequelize.STRING, allowNull: true },
232
+ serial_number: { type: Sequelize.STRING, allowNull: true },
233
+ grn_item_id: { type: Sequelize.UUID, allowNull: true },
234
+ location_id: { type: Sequelize.UUID, allowNull: true },
235
+ assigned_to: { type: Sequelize.UUID, allowNull: true },
236
+ purchase_cost: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
237
+ purchase_date: { type: Sequelize.DATE, allowNull: true },
238
+ warranty_expiry: { type: Sequelize.DATE, allowNull: true },
239
+ lifecycle_status: { type: Sequelize.STRING, allowNull: true },
240
+ status: { type: Sequelize.STRING, allowNull: true },
241
+ ...commonFields,
242
+ });
243
+ }
244
+ // rms_request_approvals
245
+ if (!(await queryInterface.tableExists('rms_request_approvals'))) {
246
+ await queryInterface.createTable('rms_request_approvals', {
247
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
248
+ institute_id: { type: Sequelize.UUID, allowNull: true },
249
+ entity_type: { type: Sequelize.STRING, allowNull: true },
250
+ entity_id: { type: Sequelize.UUID, allowNull: true },
251
+ approval_level: { type: Sequelize.INTEGER, allowNull: true },
252
+ approver_id: { type: Sequelize.UUID, allowNull: true },
253
+ decision: { type: Sequelize.STRING, allowNull: true },
254
+ decided_at: { type: Sequelize.DATE, allowNull: true },
255
+ comments: { type: Sequelize.TEXT, allowNull: true },
256
+ ...commonFields,
257
+ });
258
+ }
259
+ },
260
+ async down(queryInterface) {
261
+ await queryInterface.dropTable('rms_request_approvals');
262
+ await queryInterface.dropTable('rms_assets');
263
+ await queryInterface.dropTable('rms_stock_transactions');
264
+ await queryInterface.dropTable('rms_stock');
265
+ await queryInterface.dropTable('rms_grn_items');
266
+ await queryInterface.dropTable('rms_grn');
267
+ await queryInterface.dropTable('rms_purchase_order_items');
268
+ await queryInterface.dropTable('rms_purchase_orders');
269
+ await queryInterface.dropTable('rms_purchase_request_items');
270
+ await queryInterface.dropTable('rms_purchase_requests');
271
+ await queryInterface.dropTable('rms_resources');
272
+ await queryInterface.dropTable('rms_vendors');
273
+ await queryInterface.dropTable('rms_locations');
274
+ await queryInterface.dropTable('rms_departments');
275
+ },
276
+ };
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("sequelize-cli").Migration;
2
+ export = _exports;
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ const commonFields = {
6
+ created_by: { type: Sequelize.UUID, allowNull: true },
7
+ updated_by: { type: Sequelize.UUID, allowNull: true },
8
+ deleted_by: { type: Sequelize.UUID, allowNull: true },
9
+ createdAt: { type: Sequelize.DATE, allowNull: true },
10
+ updatedAt: { type: Sequelize.DATE, allowNull: true },
11
+ deletedAt: { type: Sequelize.DATE, allowNull: true },
12
+ };
13
+ // rms_storage_racks
14
+ if (!(await queryInterface.tableExists('rms_storage_racks'))) {
15
+ await queryInterface.createTable('rms_storage_racks', {
16
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
17
+ institute_id: { type: Sequelize.UUID, allowNull: true },
18
+ rack_name: { type: Sequelize.STRING, allowNull: true },
19
+ rack_type: { type: Sequelize.STRING, allowNull: true },
20
+ description: { type: Sequelize.TEXT, allowNull: true },
21
+ status: { type: Sequelize.STRING, allowNull: true },
22
+ ...commonFields,
23
+ });
24
+ }
25
+ // rms_storage_slots
26
+ if (!(await queryInterface.tableExists('rms_storage_slots'))) {
27
+ await queryInterface.createTable('rms_storage_slots', {
28
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
29
+ institute_id: { type: Sequelize.UUID, allowNull: true },
30
+ rack_id: { type: Sequelize.UUID, allowNull: true },
31
+ slot_name: { type: Sequelize.STRING, allowNull: true },
32
+ status: { type: Sequelize.STRING, allowNull: true },
33
+ ...commonFields,
34
+ });
35
+ }
36
+ // rms_asset_transactions
37
+ if (!(await queryInterface.tableExists('rms_asset_transactions'))) {
38
+ await queryInterface.createTable('rms_asset_transactions', {
39
+ id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },
40
+ institute_id: { type: Sequelize.UUID, allowNull: true },
41
+ asset_id: { type: Sequelize.UUID, allowNull: true },
42
+ user_id: { type: Sequelize.UUID, allowNull: true },
43
+ transaction_type: { type: Sequelize.STRING, allowNull: true },
44
+ issue_date: { type: Sequelize.DATE, allowNull: true },
45
+ due_date: { type: Sequelize.DATE, allowNull: true },
46
+ return_date: { type: Sequelize.DATE, allowNull: true },
47
+ condition_out: { type: Sequelize.STRING, allowNull: true },
48
+ condition_in: { type: Sequelize.STRING, allowNull: true },
49
+ penalty_amount: { type: Sequelize.DECIMAL(10, 2), allowNull: true },
50
+ remarks: { type: Sequelize.TEXT, allowNull: true },
51
+ ...commonFields,
52
+ });
53
+ }
54
+ },
55
+ async down(queryInterface) {
56
+ await queryInterface.dropTable('rms_asset_transactions');
57
+ await queryInterface.dropTable('rms_storage_slots');
58
+ await queryInterface.dropTable('rms_storage_racks');
59
+ },
60
+ };
@@ -208,5 +208,24 @@ export * from './pastYearRecordTopperInterface';
208
208
  export * from './onlineLectureInterface';
209
209
  export * from './dynamicVariableInterface';
210
210
  export * from './dynamicVariableLabelInterface';
211
+ export * from './rmsResourceInterface';
212
+ export * from './rmsDepartmentInterface';
213
+ export * from './rmsLocationInterface';
214
+ export * from './rmsStockInterface';
215
+ export * from './rmsStockTransactionInterface';
216
+ export * from './rmsAuditLogInterface';
217
+ export * from './rmsVendorInterface';
218
+ export * from './rmsVendorDocumentInterface';
219
+ export * from './rmsPurchaseRequestInterface';
220
+ export * from './rmsPurchaseRequestItemInterface';
221
+ export * from './rmsPurchaseOrderInterface';
222
+ export * from './rmsPurchaseOrderItemInterface';
223
+ export * from './rmsRequestApprovalInterface';
211
224
  export * from './graceMarksInterface';
212
225
  export * from './userHasGraceMarksInterface';
226
+ export * from './rmsGrnInterface';
227
+ export * from './rmsGrnItemInterface';
228
+ export * from './rmsAssetInterface';
229
+ export * from './rmsStorageInterface';
230
+ export * from './rmsAssetTransactionInterface';
231
+ export * from './rmsResourceDetailsInterface';
@@ -224,5 +224,24 @@ __exportStar(require("./pastYearRecordTopperInterface"), exports);
224
224
  __exportStar(require("./onlineLectureInterface"), exports);
225
225
  __exportStar(require("./dynamicVariableInterface"), exports);
226
226
  __exportStar(require("./dynamicVariableLabelInterface"), exports);
227
+ __exportStar(require("./rmsResourceInterface"), exports);
228
+ __exportStar(require("./rmsDepartmentInterface"), exports);
229
+ __exportStar(require("./rmsLocationInterface"), exports);
230
+ __exportStar(require("./rmsStockInterface"), exports);
231
+ __exportStar(require("./rmsStockTransactionInterface"), exports);
232
+ __exportStar(require("./rmsAuditLogInterface"), exports);
233
+ __exportStar(require("./rmsVendorInterface"), exports);
234
+ __exportStar(require("./rmsVendorDocumentInterface"), exports);
235
+ __exportStar(require("./rmsPurchaseRequestInterface"), exports);
236
+ __exportStar(require("./rmsPurchaseRequestItemInterface"), exports);
237
+ __exportStar(require("./rmsPurchaseOrderInterface"), exports);
238
+ __exportStar(require("./rmsPurchaseOrderItemInterface"), exports);
239
+ __exportStar(require("./rmsRequestApprovalInterface"), exports);
227
240
  __exportStar(require("./graceMarksInterface"), exports);
228
241
  __exportStar(require("./userHasGraceMarksInterface"), exports);
242
+ __exportStar(require("./rmsGrnInterface"), exports);
243
+ __exportStar(require("./rmsGrnItemInterface"), exports);
244
+ __exportStar(require("./rmsAssetInterface"), exports);
245
+ __exportStar(require("./rmsStorageInterface"), exports);
246
+ __exportStar(require("./rmsAssetTransactionInterface"), exports);
247
+ __exportStar(require("./rmsResourceDetailsInterface"), exports);
@@ -0,0 +1,15 @@
1
+ import { RMS_ASSET_LIFECYCLE } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IRmsAssetAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ assetCode: string;
7
+ resourceId: string;
8
+ grnItemId: string;
9
+ serialNumber?: string | null;
10
+ condition?: string | null;
11
+ assignedTo?: string | null;
12
+ locationId?: string | null;
13
+ lifecycleStatus: RMS_ASSET_LIFECYCLE;
14
+ status: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ import { IDefaultAttributes } from './commonInterface';
2
+ import { RMS_TRANSACTION_TYPE } from '../constants/app';
3
+ export interface IRmsAssetTransactionAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ assetId: string;
7
+ userId: string;
8
+ transactionType: RMS_TRANSACTION_TYPE;
9
+ issueDate?: Date | null;
10
+ dueDate?: Date | null;
11
+ returnDate?: Date | null;
12
+ conditionOut?: string | null;
13
+ conditionIn?: string | null;
14
+ penaltyAmount?: number | null;
15
+ remarks?: string | null;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { Document } from 'mongoose';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ import { RMS_AUDIT_ACTION } from '../constants/app';
4
+ export interface IRmsAuditLogAttributes extends IDefaultAttributes, Document {
5
+ id: string;
6
+ instituteId: string;
7
+ entityName: string;
8
+ entityId: string;
9
+ action: RMS_AUDIT_ACTION;
10
+ performedBy: string;
11
+ performedAt: Date;
12
+ ipAddress?: string | null;
13
+ userAgent?: string | null;
14
+ oldValue?: object | null;
15
+ newValue?: object | null;
16
+ requestId?: string | null;
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { IDefaultAttributes } from './commonInterface';
2
+ import { COMMAN_STATUS } from '../constants/app';
3
+ export interface IRmsDepartmentAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ departmentCode: string;
7
+ departmentName: string;
8
+ description?: string | null;
9
+ status: COMMAN_STATUS;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { RMS_APPROVAL_STATUS } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IRmsGrnAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ grnNo: string;
7
+ purchaseOrderId: string;
8
+ vendorId: string;
9
+ receivedDate: Date;
10
+ receivedBy: string;
11
+ status: string;
12
+ approvalStatus: RMS_APPROVAL_STATUS;
13
+ remarks?: string | null;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { IDefaultAttributes } from './commonInterface';
2
+ export interface IRmsGrnItemAttributes extends IDefaultAttributes {
3
+ id: string;
4
+ instituteId: string;
5
+ grnId: string;
6
+ purchaseOrderItemId: string;
7
+ resourceId: string;
8
+ orderedQuantity: number;
9
+ receivedQuantity: number;
10
+ acceptedQuantity: number;
11
+ rejectedQuantity: number;
12
+ remarks?: string | null;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import { IDefaultAttributes } from './commonInterface';
2
+ import { COMMAN_STATUS } from '../constants/app';
3
+ export interface IRmsLocationAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ parentLocationId?: string | null;
7
+ locationCode: string;
8
+ locationName: string;
9
+ locationType: string;
10
+ capacity?: number | null;
11
+ status: COMMAN_STATUS;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { RMS_APPROVAL_STATUS, RMS_PO_FULFILLMENT_STATUS } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IRmsPurchaseOrderAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ poNumber: string;
7
+ purchaseRequestId?: string | null;
8
+ vendorId: string;
9
+ orderDate: Date;
10
+ expectedDeliveryDate?: Date | null;
11
+ totalAmount: number;
12
+ taxAmount: number;
13
+ discountAmount: number;
14
+ approvalStatus: RMS_APPROVAL_STATUS;
15
+ fulfillmentStatus: RMS_PO_FULFILLMENT_STATUS;
16
+ status: string;
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { IDefaultAttributes } from './commonInterface';
2
+ export interface IRmsPurchaseOrderItemAttributes extends IDefaultAttributes {
3
+ id: string;
4
+ instituteId: string;
5
+ purchaseOrderId: string;
6
+ resourceId: string;
7
+ quantity: number;
8
+ receivedQuantity: number;
9
+ rate: number;
10
+ taxAmount: number;
11
+ amount: number;
12
+ status: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { RMS_APPROVAL_STATUS, RMS_PRIORITY } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IRmsPurchaseRequestAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ requestNo: string;
7
+ requestedBy: string;
8
+ departmentId: string;
9
+ requiredDate: Date;
10
+ purpose?: string | null;
11
+ priority: RMS_PRIORITY;
12
+ approvalStatus: RMS_APPROVAL_STATUS;
13
+ status: string;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { IDefaultAttributes } from './commonInterface';
2
+ export interface IRmsPurchaseRequestItemAttributes extends IDefaultAttributes {
3
+ id: string;
4
+ instituteId: string;
5
+ purchaseRequestId: string;
6
+ resourceId: string;
7
+ description?: string | null;
8
+ quantity: number;
9
+ estimatedRate?: number | null;
10
+ estimatedAmount?: number | null;
11
+ approvedQuantity?: number | null;
12
+ status: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { RMS_DECISION } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IRmsRequestApprovalAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ entityType: string;
7
+ entityId: string;
8
+ approvalLevel: number;
9
+ approverId: string;
10
+ decision: RMS_DECISION;
11
+ comments?: string | null;
12
+ decidedAt?: Date | null;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ import { Document } from 'mongoose';
2
+ import { RMS_RESOURCE_TYPE } from '../constants/app';
3
+ export interface IStorageAllocation {
4
+ rackId: string;
5
+ slotIds: string[];
6
+ }
7
+ export interface IRmsResourceDetailsDocument extends Document {
8
+ instituteId: string;
9
+ resourceId: string;
10
+ type: RMS_RESOURCE_TYPE;
11
+ metadata: Record<string, any>;
12
+ storageAllocations: IStorageAllocation[];
13
+ createdBy?: string;
14
+ updatedBy?: string;
15
+ deletedBy?: string;
16
+ createdAt?: Date;
17
+ updatedAt?: Date;
18
+ deletedAt?: Date | null;
19
+ }