@kipicore/dbcore 1.1.594 → 1.1.596

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 (35) hide show
  1. package/dist/constants/app.d.ts +0 -47
  2. package/dist/constants/app.js +1 -56
  3. package/dist/db/psql/migrations/20260617060730-update_rms_resource_fields.js +5 -5
  4. package/dist/db/psql/migrations/20260617061804-add_expiry_tracking_to_assets_grn_items.js +2 -2
  5. package/dist/db/psql/migrations/20260617121518-remove_product_id_from_rms_resources.d.ts +2 -0
  6. package/dist/db/psql/migrations/20260617121518-remove_product_id_from_rms_resources.js +27 -0
  7. package/dist/db/psql/migrations/20260618070420-rename_rms_timestamps_to_snake_case.d.ts +2 -0
  8. package/dist/db/psql/migrations/20260618070420-rename_rms_timestamps_to_snake_case.js +66 -0
  9. package/dist/db/psql/migrations/20260618080854-rename_grn_item_transactions_timestamps_to_snake_case.d.ts +2 -0
  10. package/dist/db/psql/migrations/20260618080854-rename_grn_item_transactions_timestamps_to_snake_case.js +34 -0
  11. package/dist/db/psql/migrations/20260618082306-set_rms_columns_allow_null.d.ts +2 -0
  12. package/dist/db/psql/migrations/20260618082306-set_rms_columns_allow_null.js +39 -0
  13. package/dist/interfaces/rmsResourceInterface.d.ts +0 -1
  14. package/dist/interfaces/userFinalResultInterface.d.ts +3 -0
  15. package/dist/models/mongodb/userFinalResultModel.js +3 -0
  16. package/dist/models/psql/rmsAssetModel.js +7 -7
  17. package/dist/models/psql/rmsAssetTransactionModel.js +1 -1
  18. package/dist/models/psql/rmsDepartmentModel.js +4 -4
  19. package/dist/models/psql/rmsGrnItemModel.js +9 -9
  20. package/dist/models/psql/rmsGrnModel.js +9 -9
  21. package/dist/models/psql/rmsLocationModel.js +5 -5
  22. package/dist/models/psql/rmsPurchaseOrderItemModel.js +10 -10
  23. package/dist/models/psql/rmsPurchaseOrderModel.js +11 -11
  24. package/dist/models/psql/rmsPurchaseRequestItemModel.js +6 -6
  25. package/dist/models/psql/rmsPurchaseRequestModel.js +9 -9
  26. package/dist/models/psql/rmsResourceModel.d.ts +0 -1
  27. package/dist/models/psql/rmsResourceModel.js +8 -15
  28. package/dist/models/psql/rmsStockModel.js +10 -10
  29. package/dist/models/psql/rmsStockTransactionModel.js +6 -6
  30. package/dist/models/psql/rmsStorageRackModel.js +1 -1
  31. package/dist/models/psql/rmsStorageSlotModel.js +1 -1
  32. package/dist/models/psql/rmsVendorDocumentModel.js +6 -6
  33. package/dist/models/psql/rmsVendorModel.js +5 -5
  34. package/dist/models/psql/testimonialModel.js +1 -1
  35. package/package.json +1 -1
@@ -1481,12 +1481,6 @@ export declare enum RMS_PRIORITY {
1481
1481
  HIGH = "HIGH",
1482
1482
  URGENT = "URGENT"
1483
1483
  }
1484
- export declare enum RMS_DECISION {
1485
- PENDING = "PENDING",
1486
- APPROVED = "APPROVED",
1487
- REJECTED = "REJECTED",
1488
- SKIPPED = "SKIPPED"
1489
- }
1490
1484
  export declare enum RMS_GRN_ACTION_TYPE {
1491
1485
  RECEIVED = "RECEIVED",
1492
1486
  ACCEPTED = "ACCEPTED",
@@ -1507,42 +1501,6 @@ export declare enum RMS_ASSET_LIFECYCLE {
1507
1501
  LOST = "LOST",
1508
1502
  DAMAGE = "DAMAGE"
1509
1503
  }
1510
- export declare enum RMS_BOOK_COPY_STATUS {
1511
- AVAILABLE = "AVAILABLE",
1512
- ISSUED = "ISSUED",
1513
- RESERVED = "RESERVED",
1514
- LOST = "LOST",
1515
- DAMAGED = "DAMAGED",
1516
- WITHDRAWN = "WITHDRAWN"
1517
- }
1518
- export declare enum RMS_TICKET_STATUS {
1519
- OPEN = "OPEN",
1520
- ASSIGNED = "ASSIGNED",
1521
- IN_PROGRESS = "IN_PROGRESS",
1522
- ON_HOLD = "ON_HOLD",
1523
- CLOSED = "CLOSED",
1524
- CANCELLED = "CANCELLED"
1525
- }
1526
- export declare enum RMS_BOOKING_STATUS {
1527
- PENDING = "PENDING",
1528
- APPROVED = "APPROVED",
1529
- REJECTED = "REJECTED",
1530
- CANCELLED = "CANCELLED",
1531
- COMPLETED = "COMPLETED"
1532
- }
1533
- export declare enum RMS_DIGITAL_STATUS {
1534
- DRAFT = "DRAFT",
1535
- ACTIVE = "ACTIVE",
1536
- EXPIRED = "EXPIRED",
1537
- ARCHIVED = "ARCHIVED"
1538
- }
1539
- export declare enum RMS_EXPENSE_TYPE {
1540
- PROCUREMENT = "PROCUREMENT",
1541
- MAINTENANCE = "MAINTENANCE",
1542
- FINE = "FINE",
1543
- DISPOSAL = "DISPOSAL",
1544
- OTHER = "OTHER"
1545
- }
1546
1504
  export declare enum RMS_AUDIT_ACTION {
1547
1505
  CREATE = "CREATE",
1548
1506
  UPDATE = "UPDATE",
@@ -1563,11 +1521,6 @@ export declare enum RMS_STOCK_SCOPE {
1563
1521
  BATCH = "BATCH",
1564
1522
  LOCATION_BATCH = "LOCATION_BATCH"
1565
1523
  }
1566
- export declare enum RMS_ENTITY_TYPE {
1567
- PURCHASE_REQUEST = "PURCHASE_REQUEST",
1568
- PURCHASE_ORDER = "PURCHASE_ORDER",
1569
- GRN = "GRN"
1570
- }
1571
1524
  export declare enum GRADE {
1572
1525
  'A+' = "A+",
1573
1526
  A = "A",
@@ -4,8 +4,7 @@ exports.WORKIN_DAY_STATUS = exports.LEAVE_STATUS = exports.LEAVE = exports.LEAVE
4
4
  exports.CHAPTER_INDEX_TYPE = exports.IMAGE__NAME = exports.INQUIRY_STATUS = exports.INQUIRY_REFERRED_BY = exports.EXAM_GROUP_STANDARD_RESULT = exports.EXAM_GROUP_STATUS = exports.SUBJECT_INDEX_TYPE = exports.LECTURE_SLOT_DURATION = exports.EXAM_ANSWER_SHEET_QUESTION_RESULT = exports.PAYMENT_TERMS_TYPE = exports.PAYMENT_TERMS_STATUS = exports.EXAM_ANSWER_SHEET_RESULT_TYPE = exports.EXAM_ANSWER_SHEET_RESULT_STATUS = exports.EXAM_ANSWER_SHEET_STATUS = exports.EXAM_VALID_ANSWER_TYPE = exports.EXAM_ANSWER_SELECTION_TYPE = exports.EXAM_STATUS = exports.COURSE_STATUS = exports.EXAM_MODE = exports.GREETING_STATUS = exports.USER_HAS_ANNOUCEMENT_STATUS = exports.ANNOUCEMENT_STATUS = exports.TYPE_OF_USER = exports.ANNOUCEMENT_SCHEDULE_TYPE = exports.APPROVE_REQUEST_STATUS = exports.APPROVE_REQUEST_ACTION = exports.TYPE_MANAGEMENT_STATUS = exports.TYPE_MANAGEMENT_TYPE = exports.FILE_TYPE = exports.ACADEMIC_CALENDARS_STATUS = exports.BANNER_TYPE = exports.APP_TYPE = exports.FEED_BACK_STATUS = exports.FEED_BACK_TYPE = exports.FACILITY_TYPE = exports.EMPLOYMENT_TYPE = exports.USER_INSTITUTE_META_STATUS = exports.USER_HAS_PARENT_STATUS = exports.GUARDIANS_USER_META_MODEL_STATUS = exports.DISABILITY_TYPE = exports.WORK_CATEGORY = exports.BLOG_STATUS = exports.WORK_TYPE = exports.USER_DETAILS = exports.NO_TYPE = exports.ADMISSION_TYPE = exports.INSTITUTE_ENTITY_TYPE_SEQUENCE = exports.INSTITUTE_ENTITY_TYPE_STATUS = exports.INSTITUTE_ENTITY_STATUS = exports.SCHOOL_SHIFT = void 0;
5
5
  exports.DISCOUNT_TYPE = exports.CONTACT_FEED_BACK_TYPE = exports.PLANNER_SYNC_STATUS = exports.NOTIFICATION_ACTION = exports.ONLINE_EXAM_NOTIFICATION_TYPE = exports.NOTIFICATION_MODULE_TYPE = exports.NOTIFICATION_STATUS = exports.NOTIFICATION_TYPE = exports.PROJECT_ASSESSMENT_OPTION_STATUS = exports.USER_BOOK_ASSESSMENT_STATUS = exports.BOOK_ASSESSMENT_DATE_STATUS = exports.TASK_MANAGEMENT_STATUS = exports.USER_DETAILS_FILED = exports.DEVICE_TYPE = exports.templateKeyWord = exports.bankAccountRegexMap = exports.EMAIL_SUBJECTS = exports.PDF_TEMPLATES = exports.EMAIL_TEMPLATES = exports.PINCODE_API_URL = exports.APPLE_AUTH = exports.META_AUTH = exports.GOOGLE_AUTH = exports.API_URL = exports.DEFAULT_USER_LOGO = exports.DEFAULT_INSTITUTED_LOGO = exports.UPLOAD_PATH = exports.SVG_URL_PATH = exports.TO_DO_STATUS = exports.LECTURE_TITLE = exports.LECTURE_STATUS = exports.SCHOOL_INFORMATION_STEP = exports.CASTE = exports.RELIGION_CASTE = exports.NATIONALITY = exports.CATEGORY = exports.IS_PRINCIPAL = exports.FEE_TYPE = exports.BOOLEAN_STATUS = exports.PROPERTY_STATUS = exports.DESIGNATION_OF_PERSON = exports.TRUST_REGISTERED_UNDER = exports.TRUST_TYPE = exports.SVA_NAME = exports.QDC_NAME = exports.USER_PAYOUT_TYPE = exports.PARENTS_CHILDREN_CURRENT = exports.CHAPTER_INDEX_FILE_TYPE = exports.FEE_HISTORY_STATUS = exports.USER_CHAPTER_INDEX_STATUS = void 0;
6
6
  exports.CERTIFICATE_FOR = exports.SHEET_TYPE = exports.COMPETITION_USER_ROLE = exports.RESULT_STATUS = exports.COMPETITION_STATUS = exports.STATUS_BY_PARENTS = exports.COMPETITION_TYPE = exports.CAMPUS_CARNIVAL_STATUS = exports.COMPETITION_TYPE_CATEGORY = exports.COMPETITION_EVENTS = exports.PAYMENT_STATUS = exports.INCOME_EXPENSE_SOURCE = exports.INCOME_EXPENSE_TYPE = exports.APPOINTMENT_STATUS = exports.MAINTENANCE_MODULE_NAME = exports.MAINTENANCE_TYPE = exports.MAINTENANCE_MODE = exports.ASSIGN_FILE_TYPE = exports.LOST_FOUND_ITEM_STATUS = exports.PAYMENT_PROCESSING_CALLBACK_URL = exports.PAYMENT_PROCESSING_PAGE_URL = exports.PAYMENT_PROCESSING_STATUS_URL = exports.WALLET_TRANSACTION_VALID_DATE_FOR_OTP_IN_MINUTES = exports.WALLET_TRANSACTION_VALID_DATE_IN_MINUTES = exports.PAYMENT_METHODS = exports.PAYMENT_GATEWAY_TYPES = exports.JOB_ACTION = exports.ONE_GB_BYTES = exports.CHARGE_PER_TRANSACTION_ITEM_UNIT = exports.INSTITUTE_SUBSCRIPTION_PLAN_STATUS = exports.WALLET_TRANSACTION_USERS_TYPE = exports.WALLET_HISTORY_STATUS = exports.WALLET_HISTORY_ACTION = exports.WALLET_HISTORY_ITEM_TYPE = exports.WALLET_HISTORY_TYPE = exports.REPLACE_TEACHER_STATUS = exports.TEACHER_TYPE = exports.INVOICE_TYPE = exports.PURCHASE_STATUS = exports.COLUMN_LIST_TITLE = exports.INVOICE_PAYMENT_TYPE = exports.PDF_CHEQUE_FREQUENCY = exports.PDF_CHEQUE_STATUS = exports.LANGUAGES = exports.HOME_WORK_STATUS = exports.SOCKET_EVENTS = exports.SUBSCRIPTION_PLAN_FILES_TYPE = exports.VALID_CURRENCY = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_PLAN_CHARGE_INTERVAL = void 0;
7
- exports.RMS_AUDIT_ACTION = exports.RMS_EXPENSE_TYPE = exports.RMS_DIGITAL_STATUS = exports.RMS_BOOKING_STATUS = exports.RMS_TICKET_STATUS = exports.RMS_BOOK_COPY_STATUS = exports.RMS_ASSET_LIFECYCLE = exports.RMS_PO_FULFILLMENT_STATUS = exports.RMS_GRN_ACTION_TYPE = exports.RMS_DECISION = exports.RMS_PRIORITY = exports.RMS_APPROVAL_STATUS = exports.RMS_TRANSACTION_TYPE = exports.RMS_RESOURCE_UNIT = exports.RMS_RESOURCE_TYPE = exports.CERTIFICATE_REQUEST_TYPE = exports.CERTIFICATE_REQUEST_STATUS = exports.FEE_SUBMISSION_STATUS = exports.VIDEO_DIRECTION_TYPE = exports.VIDEO_EVENT_TYPE = exports.USER_HAS_PENALTY_TITLE = exports.USER_HAS_PENALTY_TYPE = exports.PAYOUT_STATUS = exports.NOTICEBOARD_STATUS = exports.NOTICEBOARD_TYPE = exports.PERMISSION_TYPE = exports.NOTIFICATION_SEND_STATUS = exports.MEMBERSHIP_STATUS = exports.COMMUNITY_TYPE = exports.DESIGNATION_TYPE = exports.ADDITIONAL_PAYOUT_TYPE = exports.POSTAL_DISPATCH_STATUS = exports.CALL_TYPE = exports.SEARCH_TYPE = exports.REPORT_TYPE = exports.DEVICE_TYPE_APP_ANALYTICS = exports.APP_ANALYTICS_EVENT_TYPE = exports.EXPORT_SHEET_TYPE = exports.GRANT_AND_DONATION_TYPE = exports.TICKET_RAISE_PRIORITY = exports.TICKET_RAISE_STATUS = exports.TERM_AND_CONDITION_STATUS = exports.EDUCATION_OFFICER_TYPE = exports.HOME_WORK_TYPE = exports.STUDENT_FEE_PROCESS_STATUS = exports.FEE_COLLECTION_TYPE = exports.BANK_ACCOUNT_TYPE = exports.STUDENT_LEAVE_TYPE = exports.STUDENT_LEAVE_STATUS = exports.CERTIFICATE_TYPE = void 0;
8
- exports.FINAL_RESULT_TYPE = exports.FINAL_RESULT = exports.GRADE = exports.RMS_ENTITY_TYPE = exports.RMS_STOCK_SCOPE = void 0;
7
+ exports.FINAL_RESULT_TYPE = exports.FINAL_RESULT = exports.GRADE = exports.RMS_STOCK_SCOPE = exports.RMS_AUDIT_ACTION = exports.RMS_ASSET_LIFECYCLE = exports.RMS_PO_FULFILLMENT_STATUS = exports.RMS_GRN_ACTION_TYPE = exports.RMS_PRIORITY = exports.RMS_APPROVAL_STATUS = exports.RMS_TRANSACTION_TYPE = exports.RMS_RESOURCE_UNIT = exports.RMS_RESOURCE_TYPE = exports.CERTIFICATE_REQUEST_TYPE = exports.CERTIFICATE_REQUEST_STATUS = exports.FEE_SUBMISSION_STATUS = exports.VIDEO_DIRECTION_TYPE = exports.VIDEO_EVENT_TYPE = exports.USER_HAS_PENALTY_TITLE = exports.USER_HAS_PENALTY_TYPE = exports.PAYOUT_STATUS = exports.NOTICEBOARD_STATUS = exports.NOTICEBOARD_TYPE = exports.PERMISSION_TYPE = exports.NOTIFICATION_SEND_STATUS = exports.MEMBERSHIP_STATUS = exports.COMMUNITY_TYPE = exports.DESIGNATION_TYPE = exports.ADDITIONAL_PAYOUT_TYPE = exports.POSTAL_DISPATCH_STATUS = exports.CALL_TYPE = exports.SEARCH_TYPE = exports.REPORT_TYPE = exports.DEVICE_TYPE_APP_ANALYTICS = exports.APP_ANALYTICS_EVENT_TYPE = exports.EXPORT_SHEET_TYPE = exports.GRANT_AND_DONATION_TYPE = exports.TICKET_RAISE_PRIORITY = exports.TICKET_RAISE_STATUS = exports.TERM_AND_CONDITION_STATUS = exports.EDUCATION_OFFICER_TYPE = exports.HOME_WORK_TYPE = exports.STUDENT_FEE_PROCESS_STATUS = exports.FEE_COLLECTION_TYPE = exports.BANK_ACCOUNT_TYPE = exports.STUDENT_LEAVE_TYPE = exports.STUDENT_LEAVE_STATUS = exports.CERTIFICATE_TYPE = void 0;
9
8
  const env_1 = require("../configs/env");
10
9
  exports.SIXTY = 60;
11
10
  exports.ONE_HUNDRED = 100;
@@ -1788,13 +1787,6 @@ var RMS_PRIORITY;
1788
1787
  RMS_PRIORITY["HIGH"] = "HIGH";
1789
1788
  RMS_PRIORITY["URGENT"] = "URGENT";
1790
1789
  })(RMS_PRIORITY || (exports.RMS_PRIORITY = RMS_PRIORITY = {}));
1791
- var RMS_DECISION;
1792
- (function (RMS_DECISION) {
1793
- RMS_DECISION["PENDING"] = "PENDING";
1794
- RMS_DECISION["APPROVED"] = "APPROVED";
1795
- RMS_DECISION["REJECTED"] = "REJECTED";
1796
- RMS_DECISION["SKIPPED"] = "SKIPPED";
1797
- })(RMS_DECISION || (exports.RMS_DECISION = RMS_DECISION = {}));
1798
1790
  var RMS_GRN_ACTION_TYPE;
1799
1791
  (function (RMS_GRN_ACTION_TYPE) {
1800
1792
  RMS_GRN_ACTION_TYPE["RECEIVED"] = "RECEIVED";
@@ -1818,47 +1810,6 @@ var RMS_ASSET_LIFECYCLE;
1818
1810
  RMS_ASSET_LIFECYCLE["LOST"] = "LOST";
1819
1811
  RMS_ASSET_LIFECYCLE["DAMAGE"] = "DAMAGE";
1820
1812
  })(RMS_ASSET_LIFECYCLE || (exports.RMS_ASSET_LIFECYCLE = RMS_ASSET_LIFECYCLE = {}));
1821
- var RMS_BOOK_COPY_STATUS;
1822
- (function (RMS_BOOK_COPY_STATUS) {
1823
- RMS_BOOK_COPY_STATUS["AVAILABLE"] = "AVAILABLE";
1824
- RMS_BOOK_COPY_STATUS["ISSUED"] = "ISSUED";
1825
- RMS_BOOK_COPY_STATUS["RESERVED"] = "RESERVED";
1826
- RMS_BOOK_COPY_STATUS["LOST"] = "LOST";
1827
- RMS_BOOK_COPY_STATUS["DAMAGED"] = "DAMAGED";
1828
- RMS_BOOK_COPY_STATUS["WITHDRAWN"] = "WITHDRAWN";
1829
- })(RMS_BOOK_COPY_STATUS || (exports.RMS_BOOK_COPY_STATUS = RMS_BOOK_COPY_STATUS = {}));
1830
- var RMS_TICKET_STATUS;
1831
- (function (RMS_TICKET_STATUS) {
1832
- RMS_TICKET_STATUS["OPEN"] = "OPEN";
1833
- RMS_TICKET_STATUS["ASSIGNED"] = "ASSIGNED";
1834
- RMS_TICKET_STATUS["IN_PROGRESS"] = "IN_PROGRESS";
1835
- RMS_TICKET_STATUS["ON_HOLD"] = "ON_HOLD";
1836
- RMS_TICKET_STATUS["CLOSED"] = "CLOSED";
1837
- RMS_TICKET_STATUS["CANCELLED"] = "CANCELLED";
1838
- })(RMS_TICKET_STATUS || (exports.RMS_TICKET_STATUS = RMS_TICKET_STATUS = {}));
1839
- var RMS_BOOKING_STATUS;
1840
- (function (RMS_BOOKING_STATUS) {
1841
- RMS_BOOKING_STATUS["PENDING"] = "PENDING";
1842
- RMS_BOOKING_STATUS["APPROVED"] = "APPROVED";
1843
- RMS_BOOKING_STATUS["REJECTED"] = "REJECTED";
1844
- RMS_BOOKING_STATUS["CANCELLED"] = "CANCELLED";
1845
- RMS_BOOKING_STATUS["COMPLETED"] = "COMPLETED";
1846
- })(RMS_BOOKING_STATUS || (exports.RMS_BOOKING_STATUS = RMS_BOOKING_STATUS = {}));
1847
- var RMS_DIGITAL_STATUS;
1848
- (function (RMS_DIGITAL_STATUS) {
1849
- RMS_DIGITAL_STATUS["DRAFT"] = "DRAFT";
1850
- RMS_DIGITAL_STATUS["ACTIVE"] = "ACTIVE";
1851
- RMS_DIGITAL_STATUS["EXPIRED"] = "EXPIRED";
1852
- RMS_DIGITAL_STATUS["ARCHIVED"] = "ARCHIVED";
1853
- })(RMS_DIGITAL_STATUS || (exports.RMS_DIGITAL_STATUS = RMS_DIGITAL_STATUS = {}));
1854
- var RMS_EXPENSE_TYPE;
1855
- (function (RMS_EXPENSE_TYPE) {
1856
- RMS_EXPENSE_TYPE["PROCUREMENT"] = "PROCUREMENT";
1857
- RMS_EXPENSE_TYPE["MAINTENANCE"] = "MAINTENANCE";
1858
- RMS_EXPENSE_TYPE["FINE"] = "FINE";
1859
- RMS_EXPENSE_TYPE["DISPOSAL"] = "DISPOSAL";
1860
- RMS_EXPENSE_TYPE["OTHER"] = "OTHER";
1861
- })(RMS_EXPENSE_TYPE || (exports.RMS_EXPENSE_TYPE = RMS_EXPENSE_TYPE = {}));
1862
1813
  var RMS_AUDIT_ACTION;
1863
1814
  (function (RMS_AUDIT_ACTION) {
1864
1815
  RMS_AUDIT_ACTION["CREATE"] = "CREATE";
@@ -1881,12 +1832,6 @@ var RMS_STOCK_SCOPE;
1881
1832
  RMS_STOCK_SCOPE["BATCH"] = "BATCH";
1882
1833
  RMS_STOCK_SCOPE["LOCATION_BATCH"] = "LOCATION_BATCH";
1883
1834
  })(RMS_STOCK_SCOPE || (exports.RMS_STOCK_SCOPE = RMS_STOCK_SCOPE = {}));
1884
- var RMS_ENTITY_TYPE;
1885
- (function (RMS_ENTITY_TYPE) {
1886
- RMS_ENTITY_TYPE["PURCHASE_REQUEST"] = "PURCHASE_REQUEST";
1887
- RMS_ENTITY_TYPE["PURCHASE_ORDER"] = "PURCHASE_ORDER";
1888
- RMS_ENTITY_TYPE["GRN"] = "GRN";
1889
- })(RMS_ENTITY_TYPE || (exports.RMS_ENTITY_TYPE = RMS_ENTITY_TYPE = {}));
1890
1835
  var GRADE;
1891
1836
  (function (GRADE) {
1892
1837
  GRADE["A+"] = "A+";
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
  /** @type {import('sequelize-cli').Migration} */
3
3
  module.exports = {
4
- async up(queryInterface, Sequelize) {
4
+ async up(queryInterface) {
5
5
  const tableName = 'rms_resources';
6
6
  // 1. Drop the foreign key constraint on custodian_id if it exists
7
7
  try {
8
8
  // Sequelize default naming convention for FKs
9
9
  await queryInterface.removeConstraint(tableName, 'rms_resources_custodian_id_fkey');
10
10
  }
11
- catch (error) {
11
+ catch {
12
12
  console.log('Constraint rms_resources_custodian_id_fkey not found or already dropped. Continuing...');
13
13
  }
14
14
  // 2. Change custodian_id to ARRAY(STRING)
@@ -71,14 +71,14 @@ module.exports = {
71
71
  name: 'rms_resources_custodian_id_fkey',
72
72
  references: {
73
73
  table: 'users',
74
- field: 'id'
74
+ field: 'id',
75
75
  },
76
76
  onDelete: 'SET NULL',
77
- onUpdate: 'CASCADE'
77
+ onUpdate: 'CASCADE',
78
78
  });
79
79
  }
80
80
  catch (error) {
81
81
  console.log('Error adding constraint back:', error.message);
82
82
  }
83
- }
83
+ },
84
84
  };
@@ -23,12 +23,12 @@ module.exports = {
23
23
  allowNull: true,
24
24
  });
25
25
  },
26
- async down(queryInterface, Sequelize) {
26
+ async down(queryInterface) {
27
27
  // Remove columns from rms_assets
28
28
  await queryInterface.removeColumn('rms_assets', 'is_expiry_tracked');
29
29
  await queryInterface.removeColumn('rms_assets', 'expiry_date');
30
30
  // Remove columns from rms_grn_items
31
31
  await queryInterface.removeColumn('rms_grn_items', 'is_expiry_tracked');
32
32
  await queryInterface.removeColumn('rms_grn_items', 'expiry_date');
33
- }
33
+ },
34
34
  };
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("sequelize-cli").Migration;
2
+ export = _exports;
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface) {
5
+ const tableName = 'rms_resources';
6
+ // 1. Drop foreign key constraint first
7
+ try {
8
+ await queryInterface.removeConstraint(tableName, 'rms_resources_product_id_fkey');
9
+ }
10
+ catch {
11
+ console.log('Constraint rms_resources_product_id_fkey not found or already dropped. Continuing...');
12
+ }
13
+ // 2. Drop the column
14
+ const tableDescription = await queryInterface.describeTable(tableName);
15
+ if (tableDescription.product_id) {
16
+ await queryInterface.removeColumn(tableName, 'product_id');
17
+ }
18
+ },
19
+ async down(queryInterface, Sequelize) {
20
+ const tableName = 'rms_resources';
21
+ // Re-add the column
22
+ await queryInterface.addColumn(tableName, 'product_id', {
23
+ type: Sequelize.UUID,
24
+ allowNull: true,
25
+ });
26
+ },
27
+ };
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("sequelize-cli").Migration;
2
+ export = _exports;
@@ -0,0 +1,66 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface) {
5
+ const tables = [
6
+ 'rms_departments',
7
+ 'rms_locations',
8
+ 'rms_vendors',
9
+ 'rms_resources',
10
+ 'rms_purchase_requests',
11
+ 'rms_purchase_request_items',
12
+ 'rms_purchase_orders',
13
+ 'rms_purchase_order_items',
14
+ 'rms_grn',
15
+ 'rms_grn_items',
16
+ 'rms_stock',
17
+ 'rms_stock_transactions',
18
+ 'rms_assets',
19
+ ];
20
+ for (const table of tables) {
21
+ try {
22
+ const tableDesc = await queryInterface.describeTable(table);
23
+ if (tableDesc.createdAt)
24
+ await queryInterface.renameColumn(table, 'createdAt', 'created_at');
25
+ if (tableDesc.updatedAt)
26
+ await queryInterface.renameColumn(table, 'updatedAt', 'updated_at');
27
+ if (tableDesc.deletedAt)
28
+ await queryInterface.renameColumn(table, 'deletedAt', 'deleted_at');
29
+ }
30
+ catch (error) {
31
+ console.log(`Error processing table ${table}:`, error.message);
32
+ }
33
+ }
34
+ },
35
+ async down(queryInterface) {
36
+ const tables = [
37
+ 'rms_departments',
38
+ 'rms_locations',
39
+ 'rms_vendors',
40
+ 'rms_resources',
41
+ 'rms_purchase_requests',
42
+ 'rms_purchase_request_items',
43
+ 'rms_purchase_orders',
44
+ 'rms_purchase_order_items',
45
+ 'rms_grn',
46
+ 'rms_grn_items',
47
+ 'rms_stock',
48
+ 'rms_stock_transactions',
49
+ 'rms_assets',
50
+ ];
51
+ for (const table of tables) {
52
+ try {
53
+ const tableDesc = await queryInterface.describeTable(table);
54
+ if (tableDesc.created_at)
55
+ await queryInterface.renameColumn(table, 'created_at', 'createdAt');
56
+ if (tableDesc.updated_at)
57
+ await queryInterface.renameColumn(table, 'updated_at', 'updatedAt');
58
+ if (tableDesc.deleted_at)
59
+ await queryInterface.renameColumn(table, 'deleted_at', 'deletedAt');
60
+ }
61
+ catch (error) {
62
+ console.log(`Error processing table ${table}:`, error.message);
63
+ }
64
+ }
65
+ },
66
+ };
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("sequelize-cli").Migration;
2
+ export = _exports;
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ const table = 'rms_grn_item_transactions';
6
+ try {
7
+ const tableDesc = await queryInterface.describeTable(table);
8
+ if (tableDesc.createdAt)
9
+ await queryInterface.renameColumn(table, 'createdAt', 'created_at');
10
+ if (tableDesc.updatedAt)
11
+ await queryInterface.renameColumn(table, 'updatedAt', 'updated_at');
12
+ if (tableDesc.deletedAt)
13
+ await queryInterface.renameColumn(table, 'deletedAt', 'deleted_at');
14
+ }
15
+ catch (error) {
16
+ console.log(`Error processing table ${table}:`, error.message);
17
+ }
18
+ },
19
+ async down(queryInterface, Sequelize) {
20
+ const table = 'rms_grn_item_transactions';
21
+ try {
22
+ const tableDesc = await queryInterface.describeTable(table);
23
+ if (tableDesc.created_at)
24
+ await queryInterface.renameColumn(table, 'created_at', 'createdAt');
25
+ if (tableDesc.updated_at)
26
+ await queryInterface.renameColumn(table, 'updated_at', 'updatedAt');
27
+ if (tableDesc.deleted_at)
28
+ await queryInterface.renameColumn(table, 'deleted_at', 'deletedAt');
29
+ }
30
+ catch (error) {
31
+ console.log(`Error processing table ${table}:`, error.message);
32
+ }
33
+ }
34
+ };
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("sequelize-cli").Migration;
2
+ export = _exports;
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ const tables = [
6
+ 'rms_departments',
7
+ 'rms_locations',
8
+ 'rms_vendors',
9
+ 'rms_resources',
10
+ 'rms_purchase_requests',
11
+ 'rms_purchase_request_items',
12
+ 'rms_purchase_orders',
13
+ 'rms_purchase_order_items',
14
+ 'rms_grn',
15
+ 'rms_grn_items',
16
+ 'rms_stock',
17
+ 'rms_stock_transactions',
18
+ 'rms_assets',
19
+ 'rms_grn_item_transactions'
20
+ ];
21
+ for (const table of tables) {
22
+ try {
23
+ const tableDesc = await queryInterface.describeTable(table);
24
+ for (const colName in tableDesc) {
25
+ if (colName !== 'id') {
26
+ // Drop NOT NULL constraint via raw query for safety
27
+ await queryInterface.sequelize.query(`ALTER TABLE "${table}" ALTER COLUMN "${colName}" DROP NOT NULL;`);
28
+ }
29
+ }
30
+ }
31
+ catch (error) {
32
+ console.log(`Error processing table ${table}:`, error.message);
33
+ }
34
+ }
35
+ },
36
+ async down() {
37
+ console.log('Down migration skipped: Cannot safely re-add NOT NULL constraints as existing rows might be null.');
38
+ }
39
+ };
@@ -8,7 +8,6 @@ export interface IRmsResourceAttributes extends IDefaultAttributes {
8
8
  resourceType: RMS_RESOURCE_TYPE;
9
9
  categoryId?: string | null;
10
10
  subCategoryId?: string | null;
11
- productId?: string | null;
12
11
  unit: RMS_RESOURCE_UNIT;
13
12
  departmentId?: string | null;
14
13
  defaultLocationId?: string | null;
@@ -10,6 +10,8 @@ export interface IUserFinalResultSubjectSchema {
10
10
  grMarks?: number;
11
11
  disMarks?: number;
12
12
  subjectId: string;
13
+ requiredMarks: number;
14
+ result: FINAL_RESULT;
13
15
  [key: string]: any;
14
16
  }
15
17
  export interface IUserFinalResultModelAttributes extends IDefaultAttributes, Document {
@@ -32,4 +34,5 @@ export interface IUserFinalResultModelAttributes extends IDefaultAttributes, Doc
32
34
  examGroupId: string;
33
35
  failedSubjectCount: number;
34
36
  type: FINAL_RESULT_TYPE;
37
+ canPromotePass: boolean;
35
38
  }
@@ -44,6 +44,8 @@ const subjectSchema = new mongoose_1.Schema({
44
44
  grMarks: { type: Number, required: false, default: 0 },
45
45
  disMarks: { type: Number, required: false, default: 0 },
46
46
  subjectId: { type: String, required: false },
47
+ requiredMarks: { type: Number, required: false, default: 0 },
48
+ result: { type: String, enum: Object.values(constants_1.FINAL_RESULT), required: true },
47
49
  }, { _id: false, strict: false });
48
50
  const userFinalResultSchema = new mongoose_1.Schema({
49
51
  totalMarks: { type: Number, required: true },
@@ -65,6 +67,7 @@ const userFinalResultSchema = new mongoose_1.Schema({
65
67
  examGroupId: { type: String, required: false },
66
68
  failedSubjectCount: { type: Number, required: true, default: 0 },
67
69
  type: { type: String, enum: Object.values(constants_1.FINAL_RESULT_TYPE), required: true },
70
+ canPromotePass: { type: Boolean, required: false, default: false },
68
71
  }, {
69
72
  timestamps: true,
70
73
  versionKey: false,
@@ -25,24 +25,24 @@ RmsAssetModel.init({
25
25
  id: {
26
26
  type: sequelize_1.DataTypes.UUID,
27
27
  defaultValue: sequelize_1.DataTypes.UUIDV4,
28
- allowNull: false,
28
+ allowNull: true,
29
29
  primaryKey: true,
30
30
  },
31
31
  instituteId: {
32
32
  type: sequelize_1.DataTypes.UUID,
33
- allowNull: false,
33
+ allowNull: true,
34
34
  },
35
35
  assetCode: {
36
36
  type: sequelize_1.DataTypes.STRING,
37
- allowNull: false,
37
+ allowNull: true,
38
38
  },
39
39
  resourceId: {
40
40
  type: sequelize_1.DataTypes.UUID,
41
- allowNull: false,
41
+ allowNull: true,
42
42
  },
43
43
  grnItemId: {
44
44
  type: sequelize_1.DataTypes.UUID,
45
- allowNull: false,
45
+ allowNull: true,
46
46
  },
47
47
  serialNumber: {
48
48
  type: sequelize_1.DataTypes.STRING,
@@ -73,12 +73,12 @@ RmsAssetModel.init({
73
73
  },
74
74
  lifecycleStatus: {
75
75
  type: sequelize_1.DataTypes.STRING,
76
- allowNull: false,
76
+ allowNull: true,
77
77
  defaultValue: app_1.RMS_ASSET_LIFECYCLE.AVAILABLE,
78
78
  },
79
79
  status: {
80
80
  type: sequelize_1.DataTypes.STRING,
81
- allowNull: false,
81
+ allowNull: true,
82
82
  defaultValue: app_1.COMMAN_STATUS.ACTIVE,
83
83
  },
84
84
  }, {
@@ -20,7 +20,7 @@ RmsAssetTransactionModel.init({
20
20
  id: {
21
21
  type: sequelize_1.DataTypes.UUID,
22
22
  defaultValue: sequelize_1.DataTypes.UUIDV4,
23
- allowNull: false,
23
+ allowNull: true,
24
24
  primaryKey: true,
25
25
  },
26
26
  instituteId: {
@@ -20,17 +20,17 @@ RmsDepartmentModel.init({
20
20
  },
21
21
  instituteId: {
22
22
  type: sequelize_1.DataTypes.UUID,
23
- allowNull: false,
23
+ allowNull: true,
24
24
  field: 'institute_id',
25
25
  },
26
26
  departmentCode: {
27
27
  type: sequelize_1.DataTypes.STRING,
28
- allowNull: false,
28
+ allowNull: true,
29
29
  field: 'department_code',
30
30
  },
31
31
  departmentName: {
32
32
  type: sequelize_1.DataTypes.STRING,
33
- allowNull: false,
33
+ allowNull: true,
34
34
  field: 'department_name',
35
35
  },
36
36
  description: {
@@ -39,7 +39,7 @@ RmsDepartmentModel.init({
39
39
  },
40
40
  status: {
41
41
  type: sequelize_1.DataTypes.STRING,
42
- allowNull: false,
42
+ allowNull: true,
43
43
  defaultValue: 'ACTIVE',
44
44
  },
45
45
  createdBy: {
@@ -24,41 +24,41 @@ RmsGrnItemModel.init({
24
24
  id: {
25
25
  type: sequelize_1.DataTypes.UUID,
26
26
  defaultValue: sequelize_1.DataTypes.UUIDV4,
27
- allowNull: false,
27
+ allowNull: true,
28
28
  primaryKey: true,
29
29
  },
30
30
  instituteId: {
31
31
  type: sequelize_1.DataTypes.UUID,
32
- allowNull: false,
32
+ allowNull: true,
33
33
  },
34
34
  grnId: {
35
35
  type: sequelize_1.DataTypes.UUID,
36
- allowNull: false,
36
+ allowNull: true,
37
37
  },
38
38
  purchaseOrderItemId: {
39
39
  type: sequelize_1.DataTypes.UUID,
40
- allowNull: false,
40
+ allowNull: true,
41
41
  },
42
42
  resourceId: {
43
43
  type: sequelize_1.DataTypes.UUID,
44
- allowNull: false,
44
+ allowNull: true,
45
45
  },
46
46
  orderedQuantity: {
47
47
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
48
- allowNull: false,
48
+ allowNull: true,
49
49
  },
50
50
  receivedQuantity: {
51
51
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
52
- allowNull: false,
52
+ allowNull: true,
53
53
  },
54
54
  acceptedQuantity: {
55
55
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
56
- allowNull: false,
56
+ allowNull: true,
57
57
  defaultValue: 0,
58
58
  },
59
59
  rejectedQuantity: {
60
60
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
61
- allowNull: false,
61
+ allowNull: true,
62
62
  defaultValue: 0,
63
63
  },
64
64
  isExpiryTracked: {
@@ -23,41 +23,41 @@ RmsGrnModel.init({
23
23
  id: {
24
24
  type: sequelize_1.DataTypes.UUID,
25
25
  defaultValue: sequelize_1.DataTypes.UUIDV4,
26
- allowNull: false,
26
+ allowNull: true,
27
27
  primaryKey: true,
28
28
  },
29
29
  instituteId: {
30
30
  type: sequelize_1.DataTypes.UUID,
31
- allowNull: false,
31
+ allowNull: true,
32
32
  },
33
33
  grnNo: {
34
34
  type: sequelize_1.DataTypes.STRING,
35
- allowNull: false,
35
+ allowNull: true,
36
36
  },
37
37
  purchaseOrderId: {
38
38
  type: sequelize_1.DataTypes.UUID,
39
- allowNull: false,
39
+ allowNull: true,
40
40
  },
41
41
  vendorId: {
42
42
  type: sequelize_1.DataTypes.UUID,
43
- allowNull: false,
43
+ allowNull: true,
44
44
  },
45
45
  receivedDate: {
46
46
  type: sequelize_1.DataTypes.DATE,
47
- allowNull: false,
47
+ allowNull: true,
48
48
  },
49
49
  receivedBy: {
50
50
  type: sequelize_1.DataTypes.UUID,
51
- allowNull: false,
51
+ allowNull: true,
52
52
  },
53
53
  status: {
54
54
  type: sequelize_1.DataTypes.STRING,
55
- allowNull: false,
55
+ allowNull: true,
56
56
  defaultValue: app_1.COMMAN_STATUS.ACTIVE,
57
57
  },
58
58
  approvalStatus: {
59
59
  type: sequelize_1.DataTypes.STRING,
60
- allowNull: false,
60
+ allowNull: true,
61
61
  defaultValue: app_1.RMS_APPROVAL_STATUS.DRAFT,
62
62
  },
63
63
  remarks: {
@@ -22,7 +22,7 @@ RmsLocationModel.init({
22
22
  },
23
23
  instituteId: {
24
24
  type: sequelize_1.DataTypes.UUID,
25
- allowNull: false,
25
+ allowNull: true,
26
26
  field: 'institute_id',
27
27
  },
28
28
  parentLocationId: {
@@ -32,17 +32,17 @@ RmsLocationModel.init({
32
32
  },
33
33
  locationCode: {
34
34
  type: sequelize_1.DataTypes.STRING,
35
- allowNull: false,
35
+ allowNull: true,
36
36
  field: 'location_code',
37
37
  },
38
38
  locationName: {
39
39
  type: sequelize_1.DataTypes.STRING,
40
- allowNull: false,
40
+ allowNull: true,
41
41
  field: 'location_name',
42
42
  },
43
43
  locationType: {
44
44
  type: sequelize_1.DataTypes.STRING,
45
- allowNull: false,
45
+ allowNull: true,
46
46
  field: 'location_type',
47
47
  },
48
48
  capacity: {
@@ -51,7 +51,7 @@ RmsLocationModel.init({
51
51
  },
52
52
  status: {
53
53
  type: sequelize_1.DataTypes.STRING,
54
- allowNull: false,
54
+ allowNull: true,
55
55
  defaultValue: 'ACTIVE',
56
56
  },
57
57
  createdBy: {
@@ -36,47 +36,47 @@ RmsPurchaseOrderItemModel.init({
36
36
  id: {
37
37
  type: sequelize_1.DataTypes.UUID,
38
38
  defaultValue: sequelize_1.DataTypes.UUIDV4,
39
- allowNull: false,
39
+ allowNull: true,
40
40
  primaryKey: true,
41
41
  },
42
42
  instituteId: {
43
43
  type: sequelize_1.DataTypes.UUID,
44
- allowNull: false,
44
+ allowNull: true,
45
45
  },
46
46
  purchaseOrderId: {
47
47
  type: sequelize_1.DataTypes.UUID,
48
- allowNull: false,
48
+ allowNull: true,
49
49
  },
50
50
  resourceId: {
51
51
  type: sequelize_1.DataTypes.UUID,
52
- allowNull: false,
52
+ allowNull: true,
53
53
  },
54
54
  quantity: {
55
55
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
56
- allowNull: false,
56
+ allowNull: true,
57
57
  },
58
58
  receivedQuantity: {
59
59
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
60
- allowNull: false,
60
+ allowNull: true,
61
61
  defaultValue: 0,
62
62
  },
63
63
  rate: {
64
64
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
65
- allowNull: false,
65
+ allowNull: true,
66
66
  defaultValue: 0,
67
67
  },
68
68
  taxAmount: {
69
69
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
70
- allowNull: false,
70
+ allowNull: true,
71
71
  defaultValue: 0,
72
72
  },
73
73
  amount: {
74
74
  type: sequelize_1.DataTypes.DECIMAL(15, 2),
75
- allowNull: false,
75
+ allowNull: true,
76
76
  },
77
77
  status: {
78
78
  type: sequelize_1.DataTypes.STRING,
79
- allowNull: false,
79
+ allowNull: true,
80
80
  defaultValue: app_1.COMMAN_STATUS.ACTIVE,
81
81
  },
82
82
  }, {
@@ -40,16 +40,16 @@ RmsPurchaseOrderModel.init({
40
40
  id: {
41
41
  type: sequelize_1.DataTypes.UUID,
42
42
  defaultValue: sequelize_1.DataTypes.UUIDV4,
43
- allowNull: false,
43
+ allowNull: true,
44
44
  primaryKey: true,
45
45
  },
46
46
  instituteId: {
47
47
  type: sequelize_1.DataTypes.UUID,
48
- allowNull: false,
48
+ allowNull: true,
49
49
  },
50
50
  poNumber: {
51
51
  type: sequelize_1.DataTypes.STRING,
52
- allowNull: false,
52
+ allowNull: true,
53
53
  },
54
54
  purchaseRequestId: {
55
55
  type: sequelize_1.DataTypes.UUID,
@@ -57,11 +57,11 @@ RmsPurchaseOrderModel.init({
57
57
  },
58
58
  vendorId: {
59
59
  type: sequelize_1.DataTypes.UUID,
60
- allowNull: false,
60
+ allowNull: true,
61
61
  },
62
62
  orderDate: {
63
63
  type: sequelize_1.DataTypes.DATE,
64
- allowNull: false,
64
+ allowNull: true,
65
65
  defaultValue: sequelize_1.DataTypes.NOW,
66
66
  },
67
67
  expectedDeliveryDate: {
@@ -70,32 +70,32 @@ RmsPurchaseOrderModel.init({
70
70
  },
71
71
  totalAmount: {
72
72
  type: sequelize_1.DataTypes.DECIMAL(15, 2),
73
- allowNull: false,
73
+ allowNull: true,
74
74
  defaultValue: 0,
75
75
  },
76
76
  taxAmount: {
77
77
  type: sequelize_1.DataTypes.DECIMAL(15, 2),
78
- allowNull: false,
78
+ allowNull: true,
79
79
  defaultValue: 0,
80
80
  },
81
81
  discountAmount: {
82
82
  type: sequelize_1.DataTypes.DECIMAL(15, 2),
83
- allowNull: false,
83
+ allowNull: true,
84
84
  defaultValue: 0,
85
85
  },
86
86
  approvalStatus: {
87
87
  type: sequelize_1.DataTypes.STRING,
88
- allowNull: false,
88
+ allowNull: true,
89
89
  defaultValue: app_1.RMS_APPROVAL_STATUS.DRAFT,
90
90
  },
91
91
  fulfillmentStatus: {
92
92
  type: sequelize_1.DataTypes.STRING,
93
- allowNull: false,
93
+ allowNull: true,
94
94
  defaultValue: app_1.RMS_PO_FULFILLMENT_STATUS.PENDING,
95
95
  },
96
96
  status: {
97
97
  type: sequelize_1.DataTypes.STRING,
98
- allowNull: false,
98
+ allowNull: true,
99
99
  defaultValue: app_1.COMMAN_STATUS.ACTIVE,
100
100
  },
101
101
  }, {
@@ -36,20 +36,20 @@ RmsPurchaseRequestItemModel.init({
36
36
  id: {
37
37
  type: sequelize_1.DataTypes.UUID,
38
38
  defaultValue: sequelize_1.DataTypes.UUIDV4,
39
- allowNull: false,
39
+ allowNull: true,
40
40
  primaryKey: true,
41
41
  },
42
42
  instituteId: {
43
43
  type: sequelize_1.DataTypes.UUID,
44
- allowNull: false,
44
+ allowNull: true,
45
45
  },
46
46
  purchaseRequestId: {
47
47
  type: sequelize_1.DataTypes.UUID,
48
- allowNull: false,
48
+ allowNull: true,
49
49
  },
50
50
  resourceId: {
51
51
  type: sequelize_1.DataTypes.UUID,
52
- allowNull: false,
52
+ allowNull: true,
53
53
  },
54
54
  description: {
55
55
  type: sequelize_1.DataTypes.TEXT,
@@ -57,7 +57,7 @@ RmsPurchaseRequestItemModel.init({
57
57
  },
58
58
  quantity: {
59
59
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
60
- allowNull: false,
60
+ allowNull: true,
61
61
  },
62
62
  estimatedRate: {
63
63
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
@@ -73,7 +73,7 @@ RmsPurchaseRequestItemModel.init({
73
73
  },
74
74
  status: {
75
75
  type: sequelize_1.DataTypes.STRING,
76
- allowNull: false,
76
+ allowNull: true,
77
77
  defaultValue: app_1.COMMAN_STATUS.ACTIVE,
78
78
  },
79
79
  }, {
@@ -44,28 +44,28 @@ RmsPurchaseRequestModel.init({
44
44
  id: {
45
45
  type: sequelize_1.DataTypes.UUID,
46
46
  defaultValue: sequelize_1.DataTypes.UUIDV4,
47
- allowNull: false,
47
+ allowNull: true,
48
48
  primaryKey: true,
49
49
  },
50
50
  instituteId: {
51
51
  type: sequelize_1.DataTypes.UUID,
52
- allowNull: false,
52
+ allowNull: true,
53
53
  },
54
54
  requestNo: {
55
55
  type: sequelize_1.DataTypes.STRING,
56
- allowNull: false,
56
+ allowNull: true,
57
57
  },
58
58
  requestedBy: {
59
59
  type: sequelize_1.DataTypes.UUID,
60
- allowNull: false,
60
+ allowNull: true,
61
61
  },
62
62
  departmentId: {
63
63
  type: sequelize_1.DataTypes.UUID,
64
- allowNull: false,
64
+ allowNull: true,
65
65
  },
66
66
  requiredDate: {
67
67
  type: sequelize_1.DataTypes.DATE,
68
- allowNull: false,
68
+ allowNull: true,
69
69
  },
70
70
  purpose: {
71
71
  type: sequelize_1.DataTypes.TEXT,
@@ -73,12 +73,12 @@ RmsPurchaseRequestModel.init({
73
73
  },
74
74
  priority: {
75
75
  type: sequelize_1.DataTypes.STRING,
76
- allowNull: false,
76
+ allowNull: true,
77
77
  defaultValue: app_1.RMS_PRIORITY.MEDIUM,
78
78
  },
79
79
  approvalStatus: {
80
80
  type: sequelize_1.DataTypes.STRING,
81
- allowNull: false,
81
+ allowNull: true,
82
82
  defaultValue: app_1.RMS_APPROVAL_STATUS.DRAFT,
83
83
  },
84
84
  approverId: {
@@ -99,7 +99,7 @@ RmsPurchaseRequestModel.init({
99
99
  },
100
100
  status: {
101
101
  type: sequelize_1.DataTypes.STRING,
102
- allowNull: false,
102
+ allowNull: true,
103
103
  defaultValue: app_1.COMMAN_STATUS.ACTIVE,
104
104
  },
105
105
  }, {
@@ -10,7 +10,6 @@ declare class RmsResourceModel extends Model<IRmsResourceAttributes, TRmsResourc
10
10
  resourceType: RMS_RESOURCE_TYPE;
11
11
  categoryId?: string | null;
12
12
  subCategoryId?: string | null;
13
- productId?: string | null;
14
13
  unit: RMS_RESOURCE_UNIT;
15
14
  departmentId?: string | null;
16
15
  defaultLocationId?: string | null;
@@ -5,16 +5,14 @@ const index_1 = require("./index");
5
5
  const constants_1 = require("../../constants");
6
6
  class RmsResourceModel extends sequelize_1.Model {
7
7
  static associate(models) {
8
- const { UserModel, InstituteModel, CategoriesModel, SubCategoriesModel, ProductModel, RmsDepartmentModel, RmsLocationModel } = models;
8
+ const { UserModel, InstituteModel, CategoriesModel, SubCategoriesModel, RmsDepartmentModel, RmsLocationModel } = models;
9
9
  RmsResourceModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
10
10
  RmsResourceModel.belongsTo(CategoriesModel, { foreignKey: 'categoryId', as: 'category' });
11
11
  RmsResourceModel.belongsTo(SubCategoriesModel, { foreignKey: 'subCategoryId', as: 'subCategory' });
12
- RmsResourceModel.belongsTo(ProductModel, { foreignKey: 'productId', as: 'product' });
13
12
  RmsResourceModel.belongsTo(RmsDepartmentModel, { foreignKey: 'departmentId', as: 'department' });
14
13
  RmsResourceModel.belongsTo(RmsLocationModel, { foreignKey: 'defaultLocationId', as: 'defaultLocation' });
15
14
  CategoriesModel.hasMany(RmsResourceModel, { foreignKey: 'categoryId', as: 'resources' });
16
15
  SubCategoriesModel.hasMany(RmsResourceModel, { foreignKey: 'subCategoryId', as: 'resources' });
17
- ProductModel.hasMany(RmsResourceModel, { foreignKey: 'productId', as: 'resources' });
18
16
  RmsDepartmentModel.hasMany(RmsResourceModel, { foreignKey: 'departmentId', as: 'resources' });
19
17
  RmsLocationModel.hasMany(RmsResourceModel, { foreignKey: 'defaultLocationId', as: 'resources' });
20
18
  InstituteModel.hasMany(RmsResourceModel, { foreignKey: 'instituteId', as: 'resources' });
@@ -31,22 +29,22 @@ RmsResourceModel.init({
31
29
  },
32
30
  instituteId: {
33
31
  type: sequelize_1.DataTypes.UUID,
34
- allowNull: false,
32
+ allowNull: true,
35
33
  field: 'institute_id',
36
34
  },
37
35
  resourceCode: {
38
36
  type: sequelize_1.DataTypes.STRING,
39
- allowNull: false,
37
+ allowNull: true,
40
38
  field: 'resource_code',
41
39
  },
42
40
  resourceName: {
43
41
  type: sequelize_1.DataTypes.STRING,
44
- allowNull: false,
42
+ allowNull: true,
45
43
  field: 'resource_name',
46
44
  },
47
45
  resourceType: {
48
46
  type: sequelize_1.DataTypes.STRING,
49
- allowNull: false,
47
+ allowNull: true,
50
48
  field: 'resource_type',
51
49
  },
52
50
  categoryId: {
@@ -59,14 +57,9 @@ RmsResourceModel.init({
59
57
  allowNull: true,
60
58
  field: 'sub_category_id',
61
59
  },
62
- productId: {
63
- type: sequelize_1.DataTypes.UUID,
64
- allowNull: true,
65
- field: 'product_id',
66
- },
67
60
  unit: {
68
61
  type: sequelize_1.DataTypes.STRING,
69
- allowNull: false,
62
+ allowNull: true,
70
63
  },
71
64
  departmentId: {
72
65
  type: sequelize_1.DataTypes.UUID,
@@ -89,7 +82,7 @@ RmsResourceModel.init({
89
82
  },
90
83
  minStockLevel: {
91
84
  type: sequelize_1.DataTypes.INTEGER,
92
- allowNull: false,
85
+ allowNull: true,
93
86
  defaultValue: 0,
94
87
  field: 'min_stock_level',
95
88
  },
@@ -99,7 +92,7 @@ RmsResourceModel.init({
99
92
  },
100
93
  status: {
101
94
  type: sequelize_1.DataTypes.STRING,
102
- allowNull: false,
95
+ allowNull: true,
103
96
  defaultValue: constants_1.COMMAN_STATUS.ACTIVE,
104
97
  },
105
98
  createdBy: {
@@ -24,17 +24,17 @@ RmsStockModel.init({
24
24
  },
25
25
  instituteId: {
26
26
  type: sequelize_1.DataTypes.UUID,
27
- allowNull: false,
27
+ allowNull: true,
28
28
  field: 'institute_id',
29
29
  },
30
30
  resourceId: {
31
31
  type: sequelize_1.DataTypes.UUID,
32
- allowNull: false,
32
+ allowNull: true,
33
33
  field: 'resource_id',
34
34
  },
35
35
  stockScope: {
36
36
  type: sequelize_1.DataTypes.STRING,
37
- allowNull: false,
37
+ allowNull: true,
38
38
  field: 'stock_scope',
39
39
  },
40
40
  locationId: {
@@ -49,43 +49,43 @@ RmsStockModel.init({
49
49
  },
50
50
  availableQty: {
51
51
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
52
- allowNull: false,
52
+ allowNull: true,
53
53
  defaultValue: 0,
54
54
  field: 'available_qty',
55
55
  },
56
56
  reservedQty: {
57
57
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
58
- allowNull: false,
58
+ allowNull: true,
59
59
  defaultValue: 0,
60
60
  field: 'reserved_qty',
61
61
  },
62
62
  issuedQty: {
63
63
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
64
- allowNull: false,
64
+ allowNull: true,
65
65
  defaultValue: 0,
66
66
  field: 'issued_qty',
67
67
  },
68
68
  damagedQty: {
69
69
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
70
- allowNull: false,
70
+ allowNull: true,
71
71
  defaultValue: 0,
72
72
  field: 'damaged_qty',
73
73
  },
74
74
  expiredQty: {
75
75
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
76
- allowNull: false,
76
+ allowNull: true,
77
77
  defaultValue: 0,
78
78
  field: 'expired_qty',
79
79
  },
80
80
  totalQty: {
81
81
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
82
- allowNull: false,
82
+ allowNull: true,
83
83
  defaultValue: 0,
84
84
  field: 'total_qty',
85
85
  },
86
86
  status: {
87
87
  type: sequelize_1.DataTypes.STRING,
88
- allowNull: false,
88
+ allowNull: true,
89
89
  defaultValue: 'ACTIVE',
90
90
  },
91
91
  createdBy: {
@@ -26,17 +26,17 @@ RmsStockTransactionModel.init({
26
26
  },
27
27
  instituteId: {
28
28
  type: sequelize_1.DataTypes.UUID,
29
- allowNull: false,
29
+ allowNull: true,
30
30
  field: 'institute_id',
31
31
  },
32
32
  transactionNo: {
33
33
  type: sequelize_1.DataTypes.STRING,
34
- allowNull: false,
34
+ allowNull: true,
35
35
  field: 'transaction_no',
36
36
  },
37
37
  resourceId: {
38
38
  type: sequelize_1.DataTypes.UUID,
39
- allowNull: false,
39
+ allowNull: true,
40
40
  field: 'resource_id',
41
41
  },
42
42
  fromLocationId: {
@@ -56,12 +56,12 @@ RmsStockTransactionModel.init({
56
56
  },
57
57
  transactionType: {
58
58
  type: sequelize_1.DataTypes.STRING,
59
- allowNull: false,
59
+ allowNull: true,
60
60
  field: 'transaction_type',
61
61
  },
62
62
  quantity: {
63
63
  type: sequelize_1.DataTypes.DECIMAL(10, 2),
64
- allowNull: false,
64
+ allowNull: true,
65
65
  },
66
66
  unitCost: {
67
67
  type: sequelize_1.DataTypes.DECIMAL(15, 2),
@@ -84,7 +84,7 @@ RmsStockTransactionModel.init({
84
84
  },
85
85
  transactionDate: {
86
86
  type: sequelize_1.DataTypes.DATE,
87
- allowNull: false,
87
+ allowNull: true,
88
88
  defaultValue: sequelize_1.DataTypes.NOW,
89
89
  field: 'transaction_date',
90
90
  },
@@ -18,7 +18,7 @@ RmsStorageRackModel.init({
18
18
  id: {
19
19
  type: sequelize_1.DataTypes.UUID,
20
20
  defaultValue: sequelize_1.DataTypes.UUIDV4,
21
- allowNull: false,
21
+ allowNull: true,
22
22
  primaryKey: true,
23
23
  },
24
24
  instituteId: {
@@ -18,7 +18,7 @@ RmsStorageSlotModel.init({
18
18
  id: {
19
19
  type: sequelize_1.DataTypes.UUID,
20
20
  defaultValue: sequelize_1.DataTypes.UUIDV4,
21
- allowNull: false,
21
+ allowNull: true,
22
22
  primaryKey: true,
23
23
  },
24
24
  instituteId: {
@@ -38,16 +38,16 @@ RmsVendorDocumentModel.init({
38
38
  id: {
39
39
  type: sequelize_1.DataTypes.UUID,
40
40
  defaultValue: sequelize_1.DataTypes.UUIDV4,
41
- allowNull: false,
41
+ allowNull: true,
42
42
  primaryKey: true,
43
43
  },
44
44
  instituteId: {
45
45
  type: sequelize_1.DataTypes.UUID,
46
- allowNull: false,
46
+ allowNull: true,
47
47
  },
48
48
  vendorId: {
49
49
  type: sequelize_1.DataTypes.UUID,
50
- allowNull: false,
50
+ allowNull: true,
51
51
  },
52
52
  fileStorageId: {
53
53
  type: sequelize_1.DataTypes.UUID,
@@ -55,11 +55,11 @@ RmsVendorDocumentModel.init({
55
55
  },
56
56
  documentType: {
57
57
  type: sequelize_1.DataTypes.STRING,
58
- allowNull: false,
58
+ allowNull: true,
59
59
  },
60
60
  fileUrl: {
61
61
  type: sequelize_1.DataTypes.STRING,
62
- allowNull: false,
62
+ allowNull: true,
63
63
  },
64
64
  expiryDate: {
65
65
  type: sequelize_1.DataTypes.DATE,
@@ -67,7 +67,7 @@ RmsVendorDocumentModel.init({
67
67
  },
68
68
  status: {
69
69
  type: sequelize_1.DataTypes.STRING,
70
- allowNull: false,
70
+ allowNull: true,
71
71
  defaultValue: app_1.COMMAN_STATUS.ACTIVE,
72
72
  },
73
73
  }, {
@@ -29,12 +29,12 @@ RmsVendorModel.init({
29
29
  id: {
30
30
  type: sequelize_1.DataTypes.UUID,
31
31
  defaultValue: sequelize_1.DataTypes.UUIDV4,
32
- allowNull: false,
32
+ allowNull: true,
33
33
  primaryKey: true,
34
34
  },
35
35
  instituteId: {
36
36
  type: sequelize_1.DataTypes.UUID,
37
- allowNull: false,
37
+ allowNull: true,
38
38
  },
39
39
  externalVendorId: {
40
40
  type: sequelize_1.DataTypes.UUID,
@@ -42,11 +42,11 @@ RmsVendorModel.init({
42
42
  },
43
43
  vendorCode: {
44
44
  type: sequelize_1.DataTypes.STRING,
45
- allowNull: false,
45
+ allowNull: true,
46
46
  },
47
47
  vendorName: {
48
48
  type: sequelize_1.DataTypes.STRING,
49
- allowNull: false,
49
+ allowNull: true,
50
50
  },
51
51
  contactPerson: {
52
52
  type: sequelize_1.DataTypes.STRING,
@@ -82,7 +82,7 @@ RmsVendorModel.init({
82
82
  },
83
83
  status: {
84
84
  type: sequelize_1.DataTypes.STRING,
85
- allowNull: false,
85
+ allowNull: true,
86
86
  defaultValue: app_1.COMMAN_STATUS.ACTIVE,
87
87
  },
88
88
  }, {
@@ -118,7 +118,7 @@ class TestimonialModel extends sequelize_1.Model {
118
118
  if (institute?.isPlayHouse)
119
119
  className = stdDataList.find((item) => item.entityType?.title === 'SECTIONS')?.title || null;
120
120
  const mediumName = stdDataList.find((item) => item.entityType?.title === 'MEDIUM')?.title || null;
121
- testimonial.class = `${(0, utils_1.capitalizeFirst)(mediumName.substring(0, 3))} Medium ${(0, utils_1.capitalizeFirst)(className)}`;
121
+ testimonial.class = `${(0, utils_1.capitalizeFirst)(mediumName?.substring(0, 3))} Medium ${(0, utils_1.capitalizeFirst)(className || '')}`;
122
122
  }
123
123
  };
124
124
  TestimonialModel.beforeCreate(beforeCreateOrUpdateHook);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.594",
3
+ "version": "1.1.596",
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",