@kipicore/dbcore 1.1.573 → 1.1.575

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 +117 -0
  2. package/dist/constants/app.js +134 -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 +18 -0
  12. package/dist/interfaces/index.js +18 -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,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ class RmsStockModel extends sequelize_1.Model {
6
+ static associate(models) {
7
+ const { UserModel, InstituteModel, RmsResourceModel, RmsLocationModel } = models;
8
+ RmsStockModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
9
+ RmsStockModel.belongsTo(RmsResourceModel, { foreignKey: 'resourceId', as: 'resource' });
10
+ RmsStockModel.belongsTo(RmsLocationModel, { foreignKey: 'locationId', as: 'location' });
11
+ InstituteModel.hasMany(RmsStockModel, { foreignKey: 'instituteId', as: 'stocks' });
12
+ RmsResourceModel.hasMany(RmsStockModel, { foreignKey: 'resourceId', as: 'stocks' });
13
+ RmsLocationModel.hasMany(RmsStockModel, { foreignKey: 'locationId', as: 'stocks' });
14
+ RmsStockModel.belongsTo(UserModel, { foreignKey: { name: 'createdBy', field: 'created_by', allowNull: true }, as: 'createdByUser' });
15
+ RmsStockModel.belongsTo(UserModel, { foreignKey: { name: 'updatedBy', field: 'updated_by', allowNull: true }, as: 'updatedByUser' });
16
+ RmsStockModel.belongsTo(UserModel, { foreignKey: { name: 'deletedBy', field: 'deleted_by', allowNull: true }, as: 'deletedByUser' });
17
+ }
18
+ }
19
+ RmsStockModel.init({
20
+ id: {
21
+ type: sequelize_1.DataTypes.UUID,
22
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
23
+ primaryKey: true,
24
+ },
25
+ instituteId: {
26
+ type: sequelize_1.DataTypes.UUID,
27
+ allowNull: false,
28
+ field: 'institute_id',
29
+ },
30
+ resourceId: {
31
+ type: sequelize_1.DataTypes.UUID,
32
+ allowNull: false,
33
+ field: 'resource_id',
34
+ },
35
+ stockScope: {
36
+ type: sequelize_1.DataTypes.STRING,
37
+ allowNull: false,
38
+ field: 'stock_scope',
39
+ },
40
+ locationId: {
41
+ type: sequelize_1.DataTypes.UUID,
42
+ allowNull: true,
43
+ field: 'location_id',
44
+ },
45
+ batchId: {
46
+ type: sequelize_1.DataTypes.UUID,
47
+ allowNull: true,
48
+ field: 'batch_id',
49
+ },
50
+ availableQty: {
51
+ type: sequelize_1.DataTypes.DECIMAL(10, 2),
52
+ allowNull: false,
53
+ defaultValue: 0,
54
+ field: 'available_qty',
55
+ },
56
+ reservedQty: {
57
+ type: sequelize_1.DataTypes.DECIMAL(10, 2),
58
+ allowNull: false,
59
+ defaultValue: 0,
60
+ field: 'reserved_qty',
61
+ },
62
+ issuedQty: {
63
+ type: sequelize_1.DataTypes.DECIMAL(10, 2),
64
+ allowNull: false,
65
+ defaultValue: 0,
66
+ field: 'issued_qty',
67
+ },
68
+ damagedQty: {
69
+ type: sequelize_1.DataTypes.DECIMAL(10, 2),
70
+ allowNull: false,
71
+ defaultValue: 0,
72
+ field: 'damaged_qty',
73
+ },
74
+ expiredQty: {
75
+ type: sequelize_1.DataTypes.DECIMAL(10, 2),
76
+ allowNull: false,
77
+ defaultValue: 0,
78
+ field: 'expired_qty',
79
+ },
80
+ totalQty: {
81
+ type: sequelize_1.DataTypes.DECIMAL(10, 2),
82
+ allowNull: false,
83
+ defaultValue: 0,
84
+ field: 'total_qty',
85
+ },
86
+ status: {
87
+ type: sequelize_1.DataTypes.STRING,
88
+ allowNull: false,
89
+ defaultValue: 'ACTIVE',
90
+ },
91
+ createdBy: {
92
+ type: sequelize_1.DataTypes.UUID,
93
+ allowNull: true,
94
+ field: 'created_by',
95
+ },
96
+ updatedBy: {
97
+ type: sequelize_1.DataTypes.UUID,
98
+ allowNull: true,
99
+ field: 'updated_by',
100
+ },
101
+ deletedBy: {
102
+ type: sequelize_1.DataTypes.UUID,
103
+ allowNull: true,
104
+ field: 'deleted_by',
105
+ },
106
+ }, {
107
+ sequelize: index_1.sequelize,
108
+ modelName: 'RmsStockModel',
109
+ tableName: 'rms_inventory_stock',
110
+ timestamps: true,
111
+ paranoid: true,
112
+ });
113
+ exports.default = RmsStockModel;
@@ -0,0 +1,28 @@
1
+ import { Model } from 'sequelize';
2
+ import { IRmsStockTransactionAttributes } from '../../interfaces/rmsStockTransactionInterface';
3
+ import { TRmsStockTransactionCreationAttributes } from '../../types/rmsStockTransactionType';
4
+ import { RMS_TRANSACTION_TYPE } from '../../constants';
5
+ declare class RmsStockTransactionModel extends Model<IRmsStockTransactionAttributes, TRmsStockTransactionCreationAttributes> implements IRmsStockTransactionAttributes {
6
+ id: string;
7
+ instituteId: string;
8
+ transactionNo: string;
9
+ resourceId: string;
10
+ fromLocationId?: string | null;
11
+ toLocationId?: string | null;
12
+ batchId?: string | null;
13
+ transactionType: RMS_TRANSACTION_TYPE;
14
+ quantity: number;
15
+ unitCost?: number | null;
16
+ referenceType?: string | null;
17
+ referenceId?: string | null;
18
+ remarks?: string | null;
19
+ transactionDate: Date;
20
+ createdBy: string;
21
+ updatedBy: string;
22
+ deletedBy: string;
23
+ readonly createdAt: Date;
24
+ readonly updatedAt: Date;
25
+ readonly deletedAt?: string;
26
+ static associate(models: any): void;
27
+ }
28
+ export default RmsStockTransactionModel;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ class RmsStockTransactionModel extends sequelize_1.Model {
6
+ static associate(models) {
7
+ const { UserModel, InstituteModel, RmsResourceModel, RmsLocationModel } = models;
8
+ RmsStockTransactionModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
9
+ RmsStockTransactionModel.belongsTo(RmsResourceModel, { foreignKey: 'resourceId', as: 'resource' });
10
+ RmsStockTransactionModel.belongsTo(RmsLocationModel, { foreignKey: 'fromLocationId', as: 'fromLocation' });
11
+ RmsStockTransactionModel.belongsTo(RmsLocationModel, { foreignKey: 'toLocationId', as: 'toLocation' });
12
+ InstituteModel.hasMany(RmsStockTransactionModel, { foreignKey: 'instituteId', as: 'transactions' });
13
+ RmsResourceModel.hasMany(RmsStockTransactionModel, { foreignKey: 'resourceId', as: 'transactions' });
14
+ RmsLocationModel.hasMany(RmsStockTransactionModel, { foreignKey: 'fromLocationId', as: 'fromTransactions' });
15
+ RmsLocationModel.hasMany(RmsStockTransactionModel, { foreignKey: 'toLocationId', as: 'toTransactions' });
16
+ RmsStockTransactionModel.belongsTo(UserModel, { foreignKey: { name: 'createdBy', field: 'created_by', allowNull: true }, as: 'createdByUser' });
17
+ RmsStockTransactionModel.belongsTo(UserModel, { foreignKey: { name: 'updatedBy', field: 'updated_by', allowNull: true }, as: 'updatedByUser' });
18
+ RmsStockTransactionModel.belongsTo(UserModel, { foreignKey: { name: 'deletedBy', field: 'deleted_by', allowNull: true }, as: 'deletedByUser' });
19
+ }
20
+ }
21
+ RmsStockTransactionModel.init({
22
+ id: {
23
+ type: sequelize_1.DataTypes.UUID,
24
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
25
+ primaryKey: true,
26
+ },
27
+ instituteId: {
28
+ type: sequelize_1.DataTypes.UUID,
29
+ allowNull: false,
30
+ field: 'institute_id',
31
+ },
32
+ transactionNo: {
33
+ type: sequelize_1.DataTypes.STRING,
34
+ allowNull: false,
35
+ field: 'transaction_no',
36
+ },
37
+ resourceId: {
38
+ type: sequelize_1.DataTypes.UUID,
39
+ allowNull: false,
40
+ field: 'resource_id',
41
+ },
42
+ fromLocationId: {
43
+ type: sequelize_1.DataTypes.UUID,
44
+ allowNull: true,
45
+ field: 'from_location_id',
46
+ },
47
+ toLocationId: {
48
+ type: sequelize_1.DataTypes.UUID,
49
+ allowNull: true,
50
+ field: 'to_location_id',
51
+ },
52
+ batchId: {
53
+ type: sequelize_1.DataTypes.UUID,
54
+ allowNull: true,
55
+ field: 'batch_id',
56
+ },
57
+ transactionType: {
58
+ type: sequelize_1.DataTypes.STRING,
59
+ allowNull: false,
60
+ field: 'transaction_type',
61
+ },
62
+ quantity: {
63
+ type: sequelize_1.DataTypes.DECIMAL(10, 2),
64
+ allowNull: false,
65
+ },
66
+ unitCost: {
67
+ type: sequelize_1.DataTypes.DECIMAL(15, 2),
68
+ allowNull: true,
69
+ field: 'unit_cost',
70
+ },
71
+ referenceType: {
72
+ type: sequelize_1.DataTypes.STRING,
73
+ allowNull: true,
74
+ field: 'reference_type',
75
+ },
76
+ referenceId: {
77
+ type: sequelize_1.DataTypes.UUID,
78
+ allowNull: true,
79
+ field: 'reference_id',
80
+ },
81
+ remarks: {
82
+ type: sequelize_1.DataTypes.TEXT,
83
+ allowNull: true,
84
+ },
85
+ transactionDate: {
86
+ type: sequelize_1.DataTypes.DATE,
87
+ allowNull: false,
88
+ defaultValue: sequelize_1.DataTypes.NOW,
89
+ field: 'transaction_date',
90
+ },
91
+ createdBy: {
92
+ type: sequelize_1.DataTypes.UUID,
93
+ allowNull: true,
94
+ field: 'created_by',
95
+ },
96
+ updatedBy: {
97
+ type: sequelize_1.DataTypes.UUID,
98
+ allowNull: true,
99
+ field: 'updated_by',
100
+ },
101
+ deletedBy: {
102
+ type: sequelize_1.DataTypes.UUID,
103
+ allowNull: true,
104
+ field: 'deleted_by',
105
+ },
106
+ }, {
107
+ sequelize: index_1.sequelize,
108
+ modelName: 'RmsStockTransactionModel',
109
+ tableName: 'rms_inventory_transactions',
110
+ timestamps: true,
111
+ paranoid: true,
112
+ });
113
+ exports.default = RmsStockTransactionModel;
@@ -0,0 +1,20 @@
1
+ import { Model } from 'sequelize';
2
+ import { IRmsStorageRackAttributes } from '../../interfaces/rmsStorageInterface';
3
+ import { TRmsStorageRackCreationAttributes } from '../../types/rmsStorageType';
4
+ import { COMMAN_STATUS, RMS_RESOURCE_TYPE } from '../../constants';
5
+ declare class RmsStorageRackModel extends Model<IRmsStorageRackAttributes, TRmsStorageRackCreationAttributes> implements IRmsStorageRackAttributes {
6
+ id: string;
7
+ instituteId: string;
8
+ rackName: string;
9
+ rackType: RMS_RESOURCE_TYPE;
10
+ description?: string | null;
11
+ status: COMMAN_STATUS;
12
+ createdBy?: string;
13
+ updatedBy?: string;
14
+ deletedBy?: string;
15
+ readonly createdAt?: Date;
16
+ readonly updatedAt?: Date;
17
+ readonly deletedAt?: Date;
18
+ static associate(models: any): void;
19
+ }
20
+ export default RmsStorageRackModel;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ const constants_1 = require("../../constants");
6
+ class RmsStorageRackModel extends sequelize_1.Model {
7
+ static associate(models) {
8
+ const { InstituteModel, UserModel, RmsStorageSlotModel } = models;
9
+ RmsStorageRackModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
10
+ InstituteModel.hasMany(RmsStorageRackModel, { foreignKey: 'instituteId', as: 'storageRacks' });
11
+ RmsStorageRackModel.hasMany(RmsStorageSlotModel, { foreignKey: 'rackId', as: 'slots' });
12
+ RmsStorageRackModel.belongsTo(UserModel, { foreignKey: 'createdBy', as: 'createdByUser' });
13
+ RmsStorageRackModel.belongsTo(UserModel, { foreignKey: 'updatedBy', as: 'updatedByUser' });
14
+ RmsStorageRackModel.belongsTo(UserModel, { foreignKey: 'deletedBy', as: 'deletedByUser' });
15
+ }
16
+ }
17
+ RmsStorageRackModel.init({
18
+ id: {
19
+ type: sequelize_1.DataTypes.UUID,
20
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
21
+ allowNull: false,
22
+ primaryKey: true,
23
+ },
24
+ instituteId: {
25
+ type: sequelize_1.DataTypes.UUID,
26
+ allowNull: true,
27
+ field: 'institute_id',
28
+ },
29
+ rackName: {
30
+ type: sequelize_1.DataTypes.STRING,
31
+ allowNull: true,
32
+ field: 'rack_name',
33
+ },
34
+ rackType: {
35
+ type: sequelize_1.DataTypes.STRING,
36
+ allowNull: true,
37
+ field: 'rack_type',
38
+ },
39
+ description: {
40
+ type: sequelize_1.DataTypes.TEXT,
41
+ allowNull: true,
42
+ field: 'description',
43
+ },
44
+ status: {
45
+ type: sequelize_1.DataTypes.STRING,
46
+ allowNull: true,
47
+ defaultValue: constants_1.COMMAN_STATUS.ACTIVE,
48
+ field: 'status',
49
+ },
50
+ }, {
51
+ sequelize: index_1.sequelize,
52
+ modelName: 'RmsStorageRackModel',
53
+ tableName: 'rms_storage_racks',
54
+ timestamps: true,
55
+ paranoid: true,
56
+ });
57
+ exports.default = RmsStorageRackModel;
@@ -0,0 +1,19 @@
1
+ import { Model } from 'sequelize';
2
+ import { IRmsStorageSlotAttributes } from '../../interfaces/rmsStorageInterface';
3
+ import { TRmsStorageSlotCreationAttributes } from '../../types/rmsStorageType';
4
+ import { COMMAN_STATUS } from '../../constants';
5
+ declare class RmsStorageSlotModel extends Model<IRmsStorageSlotAttributes, TRmsStorageSlotCreationAttributes> implements IRmsStorageSlotAttributes {
6
+ id: string;
7
+ instituteId: string;
8
+ rackId: string;
9
+ slotName: string;
10
+ status: COMMAN_STATUS;
11
+ createdBy?: string;
12
+ updatedBy?: string;
13
+ deletedBy?: string;
14
+ readonly createdAt?: Date;
15
+ readonly updatedAt?: Date;
16
+ readonly deletedAt?: Date;
17
+ static associate(models: any): void;
18
+ }
19
+ export default RmsStorageSlotModel;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ const constants_1 = require("../../constants");
6
+ class RmsStorageSlotModel extends sequelize_1.Model {
7
+ static associate(models) {
8
+ const { InstituteModel, UserModel, RmsStorageRackModel } = models;
9
+ RmsStorageSlotModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
10
+ InstituteModel.hasMany(RmsStorageSlotModel, { foreignKey: 'instituteId', as: 'storageSlots' });
11
+ RmsStorageSlotModel.belongsTo(RmsStorageRackModel, { foreignKey: 'rackId', as: 'rack' });
12
+ RmsStorageSlotModel.belongsTo(UserModel, { foreignKey: 'createdBy', as: 'createdByUser' });
13
+ RmsStorageSlotModel.belongsTo(UserModel, { foreignKey: 'updatedBy', as: 'updatedByUser' });
14
+ RmsStorageSlotModel.belongsTo(UserModel, { foreignKey: 'deletedBy', as: 'deletedByUser' });
15
+ }
16
+ }
17
+ RmsStorageSlotModel.init({
18
+ id: {
19
+ type: sequelize_1.DataTypes.UUID,
20
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
21
+ allowNull: false,
22
+ primaryKey: true,
23
+ },
24
+ instituteId: {
25
+ type: sequelize_1.DataTypes.UUID,
26
+ allowNull: true,
27
+ field: 'institute_id',
28
+ },
29
+ rackId: {
30
+ type: sequelize_1.DataTypes.UUID,
31
+ allowNull: true,
32
+ field: 'rack_id',
33
+ },
34
+ slotName: {
35
+ type: sequelize_1.DataTypes.STRING,
36
+ allowNull: true,
37
+ field: 'slot_name',
38
+ },
39
+ status: {
40
+ type: sequelize_1.DataTypes.STRING,
41
+ allowNull: true,
42
+ defaultValue: constants_1.COMMAN_STATUS.ACTIVE,
43
+ field: 'status',
44
+ },
45
+ }, {
46
+ sequelize: index_1.sequelize,
47
+ modelName: 'RmsStorageSlotModel',
48
+ tableName: 'rms_storage_slots',
49
+ timestamps: true,
50
+ paranoid: true,
51
+ underscored: true,
52
+ });
53
+ exports.default = RmsStorageSlotModel;
@@ -0,0 +1,21 @@
1
+ import { Model } from 'sequelize';
2
+ import { IRmsVendorDocumentAttributes } from '../../interfaces/rmsVendorDocumentInterface';
3
+ import { TRmsVendorDocumentCreationAttributes } from '../../types/rmsVendorDocumentType';
4
+ declare class RmsVendorDocumentModel extends Model<IRmsVendorDocumentAttributes, TRmsVendorDocumentCreationAttributes> {
5
+ id: string;
6
+ instituteId: string;
7
+ vendorId: string;
8
+ fileStorageId?: string | null;
9
+ documentType: string;
10
+ fileUrl: string;
11
+ expiryDate?: Date | null;
12
+ status: string;
13
+ createdBy?: string | null;
14
+ updatedBy?: string | null;
15
+ deletedBy?: string | null;
16
+ readonly createdAt?: Date;
17
+ readonly updatedAt?: Date;
18
+ readonly deletedAt?: Date | null;
19
+ static associate(models: any): void;
20
+ }
21
+ export default RmsVendorDocumentModel;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ const app_1 = require("../../constants/app");
6
+ class RmsVendorDocumentModel extends sequelize_1.Model {
7
+ static associate(models) {
8
+ const { InstituteModel, RmsVendorModel, FileStorageModel, UserModel } = models;
9
+ RmsVendorDocumentModel.belongsTo(InstituteModel, {
10
+ foreignKey: { name: 'instituteId', field: 'institute_id' },
11
+ as: 'institute',
12
+ });
13
+ InstituteModel.hasMany(RmsVendorDocumentModel, { foreignKey: 'instituteId', as: 'rmsVendorDocuments' });
14
+ RmsVendorDocumentModel.belongsTo(RmsVendorModel, {
15
+ foreignKey: { name: 'vendorId', field: 'vendor_id' },
16
+ as: 'vendor',
17
+ });
18
+ RmsVendorModel.hasMany(RmsVendorDocumentModel, { foreignKey: 'vendorId', as: 'documents' });
19
+ RmsVendorDocumentModel.belongsTo(FileStorageModel, {
20
+ foreignKey: { name: 'fileStorageId', field: 'file_storage_id' },
21
+ as: 'fileStorage',
22
+ });
23
+ RmsVendorDocumentModel.belongsTo(UserModel, {
24
+ foreignKey: { name: 'createdBy', field: 'created_by', allowNull: true },
25
+ as: 'createdByUser',
26
+ });
27
+ RmsVendorDocumentModel.belongsTo(UserModel, {
28
+ foreignKey: { name: 'updatedBy', field: 'updated_by', allowNull: true },
29
+ as: 'updatedByUser',
30
+ });
31
+ RmsVendorDocumentModel.belongsTo(UserModel, {
32
+ foreignKey: { name: 'deletedBy', field: 'deleted_by', allowNull: true },
33
+ as: 'deletedByUser',
34
+ });
35
+ }
36
+ }
37
+ RmsVendorDocumentModel.init({
38
+ id: {
39
+ type: sequelize_1.DataTypes.UUID,
40
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
41
+ allowNull: false,
42
+ primaryKey: true,
43
+ },
44
+ instituteId: {
45
+ type: sequelize_1.DataTypes.UUID,
46
+ allowNull: false,
47
+ },
48
+ vendorId: {
49
+ type: sequelize_1.DataTypes.UUID,
50
+ allowNull: false,
51
+ },
52
+ fileStorageId: {
53
+ type: sequelize_1.DataTypes.UUID,
54
+ allowNull: true,
55
+ },
56
+ documentType: {
57
+ type: sequelize_1.DataTypes.STRING,
58
+ allowNull: false,
59
+ },
60
+ fileUrl: {
61
+ type: sequelize_1.DataTypes.STRING,
62
+ allowNull: false,
63
+ },
64
+ expiryDate: {
65
+ type: sequelize_1.DataTypes.DATE,
66
+ allowNull: true,
67
+ },
68
+ status: {
69
+ type: sequelize_1.DataTypes.STRING,
70
+ allowNull: false,
71
+ defaultValue: app_1.COMMAN_STATUS.ACTIVE,
72
+ },
73
+ }, {
74
+ sequelize: index_1.sequelize,
75
+ modelName: 'RmsVendorDocumentModel',
76
+ tableName: 'rms_vendor_documents',
77
+ timestamps: true,
78
+ paranoid: true,
79
+ });
80
+ exports.default = RmsVendorDocumentModel;
@@ -0,0 +1,27 @@
1
+ import { Model } from 'sequelize';
2
+ import { IRmsVendorAttributes } from '../../interfaces/rmsVendorInterface';
3
+ import { TRmsVendorCreationAttributes } from '../../types/rmsVendorType';
4
+ import { COMMAN_STATUS } from '../../constants/app';
5
+ declare class RmsVendorModel extends Model<IRmsVendorAttributes, TRmsVendorCreationAttributes> {
6
+ id: string;
7
+ instituteId: string;
8
+ externalVendorId?: string | null;
9
+ vendorCode: string;
10
+ vendorName: string;
11
+ contactPerson?: string | null;
12
+ mobile?: string | null;
13
+ email?: string | null;
14
+ gstNumber?: string | null;
15
+ panNumber?: string | null;
16
+ address?: string | null;
17
+ rating?: number | null;
18
+ status: COMMAN_STATUS;
19
+ createdBy?: string | null;
20
+ updatedBy?: string | null;
21
+ deletedBy?: string | null;
22
+ readonly createdAt?: Date;
23
+ readonly updatedAt?: Date;
24
+ readonly deletedAt?: Date | null;
25
+ static associate(models: any): void;
26
+ }
27
+ export default RmsVendorModel;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ const app_1 = require("../../constants/app");
6
+ class RmsVendorModel extends sequelize_1.Model {
7
+ static associate(models) {
8
+ const { InstituteModel, UserModel } = models;
9
+ RmsVendorModel.belongsTo(InstituteModel, {
10
+ foreignKey: { name: 'instituteId', field: 'institute_id' },
11
+ as: 'institute',
12
+ });
13
+ InstituteModel.hasMany(RmsVendorModel, { foreignKey: 'instituteId', as: 'rmsVendors' });
14
+ RmsVendorModel.belongsTo(UserModel, {
15
+ foreignKey: { name: 'createdBy', field: 'created_by', allowNull: true },
16
+ as: 'createdByUser',
17
+ });
18
+ RmsVendorModel.belongsTo(UserModel, {
19
+ foreignKey: { name: 'updatedBy', field: 'updated_by', allowNull: true },
20
+ as: 'updatedByUser',
21
+ });
22
+ RmsVendorModel.belongsTo(UserModel, {
23
+ foreignKey: { name: 'deletedBy', field: 'deleted_by', allowNull: true },
24
+ as: 'deletedByUser',
25
+ });
26
+ }
27
+ }
28
+ RmsVendorModel.init({
29
+ id: {
30
+ type: sequelize_1.DataTypes.UUID,
31
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
32
+ allowNull: false,
33
+ primaryKey: true,
34
+ },
35
+ instituteId: {
36
+ type: sequelize_1.DataTypes.UUID,
37
+ allowNull: false,
38
+ },
39
+ externalVendorId: {
40
+ type: sequelize_1.DataTypes.UUID,
41
+ allowNull: true,
42
+ },
43
+ vendorCode: {
44
+ type: sequelize_1.DataTypes.STRING,
45
+ allowNull: false,
46
+ },
47
+ vendorName: {
48
+ type: sequelize_1.DataTypes.STRING,
49
+ allowNull: false,
50
+ },
51
+ contactPerson: {
52
+ type: sequelize_1.DataTypes.STRING,
53
+ allowNull: true,
54
+ },
55
+ mobile: {
56
+ type: sequelize_1.DataTypes.STRING,
57
+ allowNull: true,
58
+ },
59
+ email: {
60
+ type: sequelize_1.DataTypes.STRING,
61
+ allowNull: true,
62
+ },
63
+ gstNumber: {
64
+ type: sequelize_1.DataTypes.STRING,
65
+ allowNull: true,
66
+ },
67
+ panNumber: {
68
+ type: sequelize_1.DataTypes.STRING,
69
+ allowNull: true,
70
+ },
71
+ address: {
72
+ type: sequelize_1.DataTypes.TEXT,
73
+ allowNull: true,
74
+ },
75
+ rating: {
76
+ type: sequelize_1.DataTypes.DECIMAL(3, 2),
77
+ allowNull: true,
78
+ validate: {
79
+ min: 0,
80
+ max: 5,
81
+ },
82
+ },
83
+ status: {
84
+ type: sequelize_1.DataTypes.STRING,
85
+ allowNull: false,
86
+ defaultValue: app_1.COMMAN_STATUS.ACTIVE,
87
+ },
88
+ }, {
89
+ sequelize: index_1.sequelize,
90
+ modelName: 'RmsVendorModel',
91
+ tableName: 'rms_vendors',
92
+ timestamps: true,
93
+ paranoid: true,
94
+ });
95
+ exports.default = RmsVendorModel;
@@ -198,5 +198,24 @@ export * from './pastYearRecordTopperType';
198
198
  export * from './onlineLectureType';
199
199
  export * from './dynamicVariableType';
200
200
  export * from './dynamicVariableLabelType';
201
+ export * from './rmsResourceType';
202
+ export * from './rmsDepartmentType';
203
+ export * from './rmsLocationType';
204
+ export * from './rmsStockType';
205
+ export * from './rmsStockTransactionType';
206
+ export * from './rmsAuditLogType';
207
+ export * from './rmsVendorType';
208
+ export * from './rmsVendorDocumentType';
209
+ export * from './rmsPurchaseRequestType';
210
+ export * from './rmsPurchaseRequestItemType';
211
+ export * from './rmsPurchaseOrderType';
212
+ export * from './rmsPurchaseOrderItemType';
213
+ export * from './rmsRequestApprovalType';
214
+ export * from './rmsGrnType';
215
+ export * from './rmsGrnItemType';
216
+ export * from './rmsAssetType';
201
217
  export * from './graceMarksType';
202
218
  export * from './userHasGraceMarksType';
219
+ export * from './rmsStorageType';
220
+ export * from './rmsAssetTransactionType';
221
+ export * from './rmsResourceDetailsType';
@@ -214,5 +214,24 @@ __exportStar(require("./pastYearRecordTopperType"), exports);
214
214
  __exportStar(require("./onlineLectureType"), exports);
215
215
  __exportStar(require("./dynamicVariableType"), exports);
216
216
  __exportStar(require("./dynamicVariableLabelType"), exports);
217
+ __exportStar(require("./rmsResourceType"), exports);
218
+ __exportStar(require("./rmsDepartmentType"), exports);
219
+ __exportStar(require("./rmsLocationType"), exports);
220
+ __exportStar(require("./rmsStockType"), exports);
221
+ __exportStar(require("./rmsStockTransactionType"), exports);
222
+ __exportStar(require("./rmsAuditLogType"), exports);
223
+ __exportStar(require("./rmsVendorType"), exports);
224
+ __exportStar(require("./rmsVendorDocumentType"), exports);
225
+ __exportStar(require("./rmsPurchaseRequestType"), exports);
226
+ __exportStar(require("./rmsPurchaseRequestItemType"), exports);
227
+ __exportStar(require("./rmsPurchaseOrderType"), exports);
228
+ __exportStar(require("./rmsPurchaseOrderItemType"), exports);
229
+ __exportStar(require("./rmsRequestApprovalType"), exports);
230
+ __exportStar(require("./rmsGrnType"), exports);
231
+ __exportStar(require("./rmsGrnItemType"), exports);
232
+ __exportStar(require("./rmsAssetType"), exports);
217
233
  __exportStar(require("./graceMarksType"), exports);
218
234
  __exportStar(require("./userHasGraceMarksType"), exports);
235
+ __exportStar(require("./rmsStorageType"), exports);
236
+ __exportStar(require("./rmsAssetTransactionType"), exports);
237
+ __exportStar(require("./rmsResourceDetailsType"), exports);