@kipicore/dbcore 1.1.685 → 1.1.687

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 (208) hide show
  1. package/dist/commonValidator/commandValidator.d.ts +27 -0
  2. package/dist/commonValidator/commandValidator.js +225 -0
  3. package/dist/commonValidator/index.d.ts +3 -0
  4. package/dist/commonValidator/index.js +24 -0
  5. package/dist/commonValidator/joiCommonValidator.d.ts +12 -0
  6. package/dist/commonValidator/joiCommonValidator.js +47 -0
  7. package/dist/commonValidator/joiSchemaBuilder.d.ts +6 -0
  8. package/dist/commonValidator/joiSchemaBuilder.js +70 -0
  9. package/dist/configs/env.d.ts +2 -0
  10. package/dist/configs/env.js +4 -0
  11. package/dist/configs/index.d.ts +2 -0
  12. package/dist/configs/index.js +2 -0
  13. package/dist/configs/logger.d.ts +2 -0
  14. package/dist/configs/logger.js +44 -0
  15. package/dist/configs/redisConfig.d.ts +4 -0
  16. package/dist/configs/redisConfig.js +32 -0
  17. package/dist/constants/app.d.ts +27 -29
  18. package/dist/constants/app.js +37 -39
  19. package/dist/constants/errorMessages.d.ts +20 -1
  20. package/dist/constants/errorMessages.js +22 -1
  21. package/dist/constants/successMessages.d.ts +14 -0
  22. package/dist/constants/successMessages.js +17 -1
  23. package/dist/db/psql/migrations/20260714111425-change_status_enum_to_string_in_institutes.js +46 -0
  24. package/dist/db/psql/migrations/20260714131500-add_note_to_institutes.js +20 -0
  25. package/dist/db/psql/migrations/20260715150000-create-ai-model-keys.d.ts +2 -0
  26. package/dist/db/psql/migrations/20260715150000-create-ai-model-keys.js +156 -0
  27. package/dist/db/psql/migrations/20260717071354-add_type_to_categories.d.ts +2 -0
  28. package/dist/db/psql/migrations/20260717071354-add_type_to_categories.js +19 -0
  29. package/dist/db/psql/migrations/20260717072745-add_type_to_sub_categories.d.ts +2 -0
  30. package/dist/db/psql/migrations/20260717072745-add_type_to_sub_categories.js +19 -0
  31. package/dist/db/psql/migrations/20260717095051-add_status_to_users.d.ts +2 -0
  32. package/dist/db/psql/migrations/20260717095051-add_status_to_users.js +19 -0
  33. package/dist/db/psql/migrations/20260721000001-add-deleted-at-to-rms-maintenance-activities.d.ts +2 -0
  34. package/dist/db/psql/migrations/20260721000001-add-deleted-at-to-rms-maintenance-activities.js +12 -0
  35. package/dist/db/psql/migrations/20260721000002-change-uploaded-from-enum-to-string-in-file-storage.d.ts +2 -0
  36. package/dist/db/psql/migrations/20260721000002-change-uploaded-from-enum-to-string-in-file-storage.js +42 -0
  37. package/dist/db/psql/migrations/20260722130134-add_portfolio_theme_to_users.d.ts +2 -0
  38. package/dist/db/psql/migrations/20260722130134-add_portfolio_theme_to_users.js +22 -0
  39. package/dist/db/psql/migrations/20260727123149-add_vendorCompanyId_to_institute_ownership_histories.d.ts +2 -0
  40. package/dist/db/psql/migrations/20260727123149-add_vendorCompanyId_to_institute_ownership_histories.js +23 -0
  41. package/dist/db/psql/migrations/20260727130802-add_vendorCompanyId_to_institute_partners.d.ts +2 -0
  42. package/dist/db/psql/migrations/20260727130802-add_vendorCompanyId_to_institute_partners.js +23 -0
  43. package/dist/db/psql/migrations/20260727132312-make_instituteId_and_vendorCompanyId_optional_in_institute_partners.d.ts +2 -0
  44. package/dist/db/psql/migrations/20260727132312-make_instituteId_and_vendorCompanyId_optional_in_institute_partners.js +28 -0
  45. package/dist/db/psql/migrations/20260727132747-make_instituteId_and_vendorCompanyId_optional_in_institute_ownership_histories.d.ts +2 -0
  46. package/dist/db/psql/migrations/20260727132747-make_instituteId_and_vendorCompanyId_optional_in_institute_ownership_histories.js +25 -0
  47. package/dist/helpers/index.d.ts +3 -0
  48. package/dist/helpers/index.js +3 -0
  49. package/dist/helpers/sendEmail.d.ts +3 -0
  50. package/dist/helpers/sendEmail.js +117 -0
  51. package/dist/helpers/sendNotification.d.ts +4 -0
  52. package/dist/helpers/sendNotification.js +34 -0
  53. package/dist/helpers/sendSMS.d.ts +5 -0
  54. package/dist/helpers/sendSMS.js +34 -0
  55. package/dist/helpers/utils.d.ts +5 -3
  56. package/dist/helpers/utils.js +58 -31
  57. package/dist/index.d.ts +4 -0
  58. package/dist/index.js +4 -0
  59. package/dist/interfaces/aiModelKeysInterface.d.ts +15 -0
  60. package/dist/interfaces/categoriesInterface.d.ts +2 -1
  61. package/dist/interfaces/index.d.ts +1 -16
  62. package/dist/interfaces/index.js +1 -17
  63. package/dist/interfaces/instituteInterface.d.ts +1 -0
  64. package/dist/interfaces/instituteOwnershipHistoryInterface.d.ts +2 -1
  65. package/dist/interfaces/institutePartnersInterface.d.ts +2 -1
  66. package/dist/interfaces/subCategoriesInterface.d.ts +2 -1
  67. package/dist/interfaces/subscriptionPlanInterface.d.ts +2 -1
  68. package/dist/interfaces/userInterface.d.ts +3 -1
  69. package/dist/interfaces/vendorCompanyMetaInterface.d.ts +5 -2
  70. package/dist/models/mongodb/index.d.ts +0 -5
  71. package/dist/models/mongodb/index.js +1 -12
  72. package/dist/models/mongodb/productMetaModel.js +9 -1
  73. package/dist/models/mongodb/subscriptionPlanModel.js +5 -0
  74. package/dist/models/mongodb/vendorCompanyMetaModel.js +15 -1
  75. package/dist/models/psql/SubCategoriesModel.d.ts +2 -1
  76. package/dist/models/psql/SubCategoriesModel.js +5 -0
  77. package/dist/models/psql/aiModelKeysModel.d.ts +20 -0
  78. package/dist/models/psql/aiModelKeysModel.js +70 -0
  79. package/dist/models/psql/categoriesModel.d.ts +2 -1
  80. package/dist/models/psql/categoriesModel.js +5 -0
  81. package/dist/models/psql/fileStorageModel.js +3 -4
  82. package/dist/models/psql/index.d.ts +1 -11
  83. package/dist/models/psql/index.js +4 -25
  84. package/dist/models/psql/instituteModel.d.ts +1 -0
  85. package/dist/models/psql/instituteModel.js +5 -2
  86. package/dist/models/psql/instituteOwnershipHistoryModel.d.ts +2 -1
  87. package/dist/models/psql/instituteOwnershipHistoryModel.js +8 -3
  88. package/dist/models/psql/institutePartnersModel.d.ts +2 -1
  89. package/dist/models/psql/institutePartnersModel.js +8 -3
  90. package/dist/models/psql/userModel.d.ts +3 -1
  91. package/dist/models/psql/userModel.js +2 -2
  92. package/dist/queues/emailQueue.d.ts +3 -0
  93. package/dist/queues/emailQueue.js +22 -0
  94. package/dist/queues/emailWorker.d.ts +3 -0
  95. package/dist/queues/emailWorker.js +33 -0
  96. package/dist/queues/index.d.ts +2 -0
  97. package/dist/queues/index.js +18 -0
  98. package/dist/types/aiModelKeysType.d.ts +3 -0
  99. package/dist/types/commonType.d.ts +29 -1
  100. package/dist/types/index.d.ts +1 -16
  101. package/dist/types/index.js +1 -17
  102. package/package.json +10 -2
  103. package/dist/db/psql/migrations/20260714095754-create-arena-models.js +0 -642
  104. package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.d.ts +0 -2
  105. package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.js +0 -138
  106. package/dist/db/psql/migrations/20260722143500-create-school_has_sports.js +0 -71
  107. package/dist/interfaces/ageGroupInterface.d.ts +0 -12
  108. package/dist/interfaces/amenityInterface.d.ts +0 -23
  109. package/dist/interfaces/assessmentTestInterface.d.ts +0 -23
  110. package/dist/interfaces/assessmentTestInterface.js +0 -2
  111. package/dist/interfaces/equipmentInterface.d.ts +0 -10
  112. package/dist/interfaces/equipmentInterface.js +0 -2
  113. package/dist/interfaces/facilityMasterInterface.d.ts +0 -9
  114. package/dist/interfaces/facilityMasterInterface.js +0 -2
  115. package/dist/interfaces/schoolHasSportInterface.d.ts +0 -7
  116. package/dist/interfaces/schoolHasSportInterface.js +0 -2
  117. package/dist/interfaces/skillInterface.d.ts +0 -19
  118. package/dist/interfaces/skillInterface.js +0 -2
  119. package/dist/interfaces/sportCategoryInterface.d.ts +0 -9
  120. package/dist/interfaces/sportCategoryInterface.js +0 -2
  121. package/dist/interfaces/sportGroupDataInterface.d.ts +0 -7
  122. package/dist/interfaces/sportGroupDataInterface.js +0 -2
  123. package/dist/interfaces/sportInfoInterface.d.ts +0 -23
  124. package/dist/interfaces/sportInfoInterface.js +0 -2
  125. package/dist/interfaces/sportInterface.d.ts +0 -10
  126. package/dist/interfaces/sportInterface.js +0 -2
  127. package/dist/interfaces/sportRoleInterface.d.ts +0 -11
  128. package/dist/interfaces/sportRoleInterface.js +0 -2
  129. package/dist/interfaces/sportSubCategoryInterface.d.ts +0 -10
  130. package/dist/interfaces/sportSubCategoryInterface.js +0 -2
  131. package/dist/interfaces/sportsAcademyInterface.d.ts +0 -39
  132. package/dist/interfaces/sportsAcademyInterface.js +0 -2
  133. package/dist/interfaces/studentSportTestInterface.d.ts +0 -20
  134. package/dist/interfaces/studentSportTestInterface.js +0 -2
  135. package/dist/interfaces/unitInterface.d.ts +0 -10
  136. package/dist/interfaces/unitInterface.js +0 -2
  137. package/dist/interfaces/userAmenityInterface.d.ts +0 -23
  138. package/dist/interfaces/userAmenityInterface.js +0 -2
  139. package/dist/models/mongodb/amenityModel.d.ts +0 -4
  140. package/dist/models/mongodb/amenityModel.js +0 -72
  141. package/dist/models/mongodb/assessmentTestModel.d.ts +0 -4
  142. package/dist/models/mongodb/assessmentTestModel.js +0 -72
  143. package/dist/models/mongodb/sportInfoModel.d.ts +0 -4
  144. package/dist/models/mongodb/sportInfoModel.js +0 -71
  145. package/dist/models/mongodb/sportsAcademyModel.d.ts +0 -4
  146. package/dist/models/mongodb/sportsAcademyModel.js +0 -89
  147. package/dist/models/mongodb/studentSportTestModel.d.ts +0 -4
  148. package/dist/models/mongodb/studentSportTestModel.js +0 -68
  149. package/dist/models/mongodb/userAmenityModel.d.ts +0 -4
  150. package/dist/models/mongodb/userAmenityModel.js +0 -72
  151. package/dist/models/psql/ageGroupModel.d.ts +0 -22
  152. package/dist/models/psql/ageGroupModel.js +0 -76
  153. package/dist/models/psql/equipmentModel.d.ts +0 -20
  154. package/dist/models/psql/equipmentModel.js +0 -57
  155. package/dist/models/psql/facilityMasterModel.d.ts +0 -18
  156. package/dist/models/psql/facilityMasterModel.js +0 -64
  157. package/dist/models/psql/schoolHasSportModel.d.ts +0 -17
  158. package/dist/models/psql/schoolHasSportModel.js +0 -76
  159. package/dist/models/psql/skillModel.d.ts +0 -25
  160. package/dist/models/psql/skillModel.js +0 -99
  161. package/dist/models/psql/sportCategoryModel.d.ts +0 -19
  162. package/dist/models/psql/sportCategoryModel.js +0 -53
  163. package/dist/models/psql/sportGroupDataModel.d.ts +0 -13
  164. package/dist/models/psql/sportGroupDataModel.js +0 -64
  165. package/dist/models/psql/sportModel.d.ts +0 -20
  166. package/dist/models/psql/sportModel.js +0 -58
  167. package/dist/models/psql/sportRoleModel.d.ts +0 -21
  168. package/dist/models/psql/sportRoleModel.js +0 -71
  169. package/dist/models/psql/sportSubCategoryModel.d.ts +0 -20
  170. package/dist/models/psql/sportSubCategoryModel.js +0 -75
  171. package/dist/models/psql/unitModel.d.ts +0 -20
  172. package/dist/models/psql/unitModel.js +0 -57
  173. package/dist/types/ageGroupType.d.ts +0 -2
  174. package/dist/types/ageGroupType.js +0 -2
  175. package/dist/types/assessmentTestType.d.ts +0 -2
  176. package/dist/types/assessmentTestType.js +0 -2
  177. package/dist/types/equipmentType.d.ts +0 -2
  178. package/dist/types/equipmentType.js +0 -2
  179. package/dist/types/facilityMasterType.d.ts +0 -3
  180. package/dist/types/facilityMasterType.js +0 -2
  181. package/dist/types/schoolHasSportType.d.ts +0 -2
  182. package/dist/types/schoolHasSportType.js +0 -2
  183. package/dist/types/skillType.d.ts +0 -2
  184. package/dist/types/skillType.js +0 -2
  185. package/dist/types/sportCategoryType.d.ts +0 -2
  186. package/dist/types/sportCategoryType.js +0 -2
  187. package/dist/types/sportGroupDataType.d.ts +0 -3
  188. package/dist/types/sportGroupDataType.js +0 -2
  189. package/dist/types/sportInfoType.d.ts +0 -2
  190. package/dist/types/sportInfoType.js +0 -2
  191. package/dist/types/sportRoleType.d.ts +0 -2
  192. package/dist/types/sportRoleType.js +0 -2
  193. package/dist/types/sportSubCategoryType.d.ts +0 -2
  194. package/dist/types/sportSubCategoryType.js +0 -2
  195. package/dist/types/sportType.d.ts +0 -2
  196. package/dist/types/sportType.js +0 -2
  197. package/dist/types/sportsAcademyType.d.ts +0 -2
  198. package/dist/types/sportsAcademyType.js +0 -2
  199. package/dist/types/studentSportTestType.d.ts +0 -2
  200. package/dist/types/studentSportTestType.js +0 -2
  201. package/dist/types/unitType.d.ts +0 -2
  202. package/dist/types/unitType.js +0 -2
  203. package/dist/types/userAmenityType.d.ts +0 -2
  204. package/dist/types/userAmenityType.js +0 -2
  205. /package/dist/db/psql/migrations/{20260714095754-create-arena-models.d.ts → 20260714111425-change_status_enum_to_string_in_institutes.d.ts} +0 -0
  206. /package/dist/db/psql/migrations/{20260722143500-create-school_has_sports.d.ts → 20260714131500-add_note_to_institutes.d.ts} +0 -0
  207. /package/dist/interfaces/{ageGroupInterface.js → aiModelKeysInterface.js} +0 -0
  208. /package/dist/{interfaces/amenityInterface.js → types/aiModelKeysType.js} +0 -0
@@ -11,11 +11,11 @@ class InstitutePartnersModel extends sequelize_1.Model {
11
11
  as: 'partnerUser',
12
12
  });
13
13
  InstitutePartnersModel.belongsTo(InstituteModel, {
14
- foreignKey: { name: 'instituteId', allowNull: false, field: 'institute_id' },
14
+ foreignKey: { name: 'instituteId', allowNull: true, field: 'institute_id' },
15
15
  as: 'institute',
16
16
  });
17
17
  InstituteModel.hasMany(InstitutePartnersModel, {
18
- foreignKey: { name: 'instituteId', allowNull: false, field: 'institute_id' },
18
+ foreignKey: { name: 'instituteId', allowNull: true, field: 'institute_id' },
19
19
  as: 'partners',
20
20
  });
21
21
  InstitutePartnersModel.belongsTo(UserModel, {
@@ -47,7 +47,12 @@ InstitutePartnersModel.init({
47
47
  instituteId: {
48
48
  type: sequelize_1.DataTypes.UUID,
49
49
  field: 'institute_id',
50
- allowNull: false,
50
+ allowNull: true,
51
+ },
52
+ vendorCompanyId: {
53
+ type: sequelize_1.DataTypes.STRING,
54
+ field: 'vendor_company_id',
55
+ allowNull: true,
51
56
  },
52
57
  status: {
53
58
  type: sequelize_1.DataTypes.STRING(30),
@@ -1,5 +1,5 @@
1
1
  import { Model } from 'sequelize';
2
- import { APP_TYPE, EMAIL_VERIFICATION, MOBILE_VERIFICATION, USER_TYPES } from '../../constants/app';
2
+ import { APP_TYPE, EMAIL_VERIFICATION, MOBILE_VERIFICATION, USER_STATUS, USER_TYPES } from '../../constants/app';
3
3
  import { IUserAttributes } from '../../interfaces/userInterface';
4
4
  import { TUserCreationAttributes } from '../../types/userType';
5
5
  declare class UserModel extends Model<IUserAttributes, TUserCreationAttributes> implements IUserAttributes {
@@ -44,6 +44,8 @@ declare class UserModel extends Model<IUserAttributes, TUserCreationAttributes>
44
44
  district?: string;
45
45
  area?: string;
46
46
  taluka?: string;
47
+ status?: USER_STATUS;
48
+ portfolioTheme?: string;
47
49
  readonly createdAt: Date;
48
50
  readonly deletedAt: string;
49
51
  readonly updatedAt: Date;
@@ -75,8 +75,6 @@ class UserModel extends sequelize_1.Model {
75
75
  [app_1.USER_TYPES.PARENTS]: 'K-PAR',
76
76
  [app_1.USER_TYPES.DRIVER]: 'K-DRI',
77
77
  [app_1.USER_TYPES.VENDOR]: 'K-VEN',
78
- [app_1.USER_TYPES.SPORT_INSTITUTE_OWNER]: 'K-SIO',
79
- [app_1.USER_TYPES.SPORT_TRAINER]: 'K-ST',
80
78
  };
81
79
  const prefix = USER_TYPE_PREFIXES[userType] || `K-${userType.substring(0, 3).toUpperCase()}`;
82
80
  let data = await uniqueNumberCounterModel_1.default.findOne({ type, userType, instituteId: null });
@@ -188,6 +186,8 @@ UserModel.init({
188
186
  medications: { type: sequelize_1.DataTypes.STRING, allowNull: true, field: 'medications' },
189
187
  relation: { type: sequelize_1.DataTypes.STRING, allowNull: true },
190
188
  taluka: { type: sequelize_1.DataTypes.STRING, allowNull: true },
189
+ status: { type: sequelize_1.DataTypes.STRING, allowNull: true, defaultValue: app_1.USER_STATUS.ACTIVE },
190
+ portfolioTheme: { type: sequelize_1.DataTypes.STRING, allowNull: true, field: 'portfolio_theme' }
191
191
  }, {
192
192
  modelName: 'UserModel',
193
193
  tableName: 'users',
@@ -0,0 +1,3 @@
1
+ import { Queue } from 'bullmq';
2
+ export declare const EMAIL_QUEUE_NAME = "email-queue";
3
+ export declare const emailQueue: Queue<any, any, string, any, any, string>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.emailQueue = exports.EMAIL_QUEUE_NAME = void 0;
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ const bullmq_1 = require("bullmq");
9
+ const redisConfig_1 = __importDefault(require("../configs/redisConfig"));
10
+ exports.EMAIL_QUEUE_NAME = 'email-queue';
11
+ exports.emailQueue = new bullmq_1.Queue(exports.EMAIL_QUEUE_NAME, {
12
+ connection: redisConfig_1.default,
13
+ defaultJobOptions: {
14
+ attempts: 3,
15
+ backoff: {
16
+ type: 'exponential',
17
+ delay: 1000,
18
+ },
19
+ removeOnComplete: true,
20
+ removeOnFail: false,
21
+ },
22
+ });
@@ -0,0 +1,3 @@
1
+ import { Worker } from 'bullmq';
2
+ import { IEmailOptions } from '../index';
3
+ export declare const emailWorker: Worker<IEmailOptions, any, string>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.emailWorker = void 0;
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ const bullmq_1 = require("bullmq");
9
+ const redisConfig_1 = __importDefault(require("../configs/redisConfig"));
10
+ const sendEmail_1 = require("../helpers/sendEmail");
11
+ const logger_1 = require("../configs/logger");
12
+ const emailQueue_1 = require("./emailQueue");
13
+ exports.emailWorker = new bullmq_1.Worker(emailQueue_1.EMAIL_QUEUE_NAME, async (job) => {
14
+ const emailOptions = job.data;
15
+ logger_1.logger.info(`Processing email job ${job.id} to ${emailOptions.to}`);
16
+ try {
17
+ await (0, sendEmail_1.sendEmailDirect)(emailOptions);
18
+ logger_1.logger.info(`Email job ${job.id} sent successfully`);
19
+ }
20
+ catch (error) {
21
+ logger_1.logger.error(`Failed to send email job ${job.id}:`, error);
22
+ throw error;
23
+ }
24
+ }, {
25
+ connection: redisConfig_1.default,
26
+ concurrency: 5,
27
+ });
28
+ exports.emailWorker.on('completed', job => {
29
+ logger_1.logger.info(`Job ${job.id} completed successfully`);
30
+ });
31
+ exports.emailWorker.on('failed', (job, err) => {
32
+ logger_1.logger.error(`Job ${job?.id} failed with error: ${err.message}`);
33
+ });
@@ -0,0 +1,2 @@
1
+ export * from './emailQueue';
2
+ export * from './emailWorker';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./emailQueue"), exports);
18
+ __exportStar(require("./emailWorker"), exports);
@@ -0,0 +1,3 @@
1
+ import { Optional } from 'sequelize';
2
+ import { IAiModelKeyAttributes } from '../interfaces/aiModelKeysInterface';
3
+ export type TAiModelKeyCreationAttributes = Optional<IAiModelKeyAttributes, 'id' | 'version' | 'createdBy' | 'updatedBy' | 'deletedBy' | 'createdAt' | 'updatedAt' | 'deletedAt'>;
@@ -1,3 +1,13 @@
1
+ import Joi from 'joi';
2
+ import { APP_TYPE } from '../constants/app';
3
+ export type TCustomHeaders = {
4
+ appType?: APP_TYPE;
5
+ token?: string;
6
+ deviceId?: string;
7
+ deviceToken?: string;
8
+ academicCalendarId?: string;
9
+ instituteId?: string;
10
+ };
1
11
  export type TPaginationOptions<T> = {
2
12
  limit: number | undefined;
3
13
  totalRecords: number;
@@ -5,5 +15,23 @@ export type TPaginationOptions<T> = {
5
15
  hasPreviousPage: boolean;
6
16
  hasNextPage: boolean;
7
17
  currentPage: number;
8
- recordList: T[];
18
+ recordList?: T[];
19
+ };
20
+ export type SchemaRules<TField> = {
21
+ required?: TField[];
22
+ optional?: TField[];
23
+ allowNull?: TField[];
24
+ forbidden?: TField[];
25
+ singleOrArray?: TField[];
26
+ singleOrArrayOrNull?: TField[];
27
+ customFields?: Record<string, Joi.Schema>;
28
+ nestedRequired?: string[];
9
29
  };
30
+ export interface CrudValidatorRules<TField> {
31
+ create?: SchemaRules<TField>;
32
+ update?: SchemaRules<TField>;
33
+ getAll?: SchemaRules<TField>;
34
+ getAllWithPagination?: SchemaRules<TField>;
35
+ getById?: SchemaRules<TField>;
36
+ delete?: SchemaRules<TField>;
37
+ }
@@ -233,6 +233,7 @@ export * from './userFinalResultType';
233
233
  export * from './refundType';
234
234
  export * from './kipiverseContactFormType';
235
235
  export * from './moduleDocsType';
236
+ export * from './aiModelKeysType';
236
237
  export * from './accountFinancialYearType';
237
238
  export * from './accountPeriodLockType';
238
239
  export * from './accountNumberSequenceType';
@@ -243,19 +244,3 @@ export * from './accountCostCenterType';
243
244
  export * from './accountVoucherTypeType';
244
245
  export * from './vendorCompanyMetaType';
245
246
  export * from './productMetaType';
246
- export * from './sportType';
247
- export * from './sportCategoryType';
248
- export * from './sportSubCategoryType';
249
- export * from './sportRoleType';
250
- export * from './equipmentType';
251
- export * from './facilityMasterType';
252
- export * from './sportGroupDataType';
253
- export * from './unitType';
254
- export * from './skillType';
255
- export * from './ageGroupType';
256
- export * from './assessmentTestType';
257
- export * from './sportInfoType';
258
- export * from './schoolHasSportType';
259
- export * from './studentSportTestType';
260
- export * from './sportsAcademyType';
261
- export * from './userAmenityType';
@@ -249,6 +249,7 @@ __exportStar(require("./userFinalResultType"), exports);
249
249
  __exportStar(require("./refundType"), exports);
250
250
  __exportStar(require("./kipiverseContactFormType"), exports);
251
251
  __exportStar(require("./moduleDocsType"), exports);
252
+ __exportStar(require("./aiModelKeysType"), exports);
252
253
  __exportStar(require("./accountFinancialYearType"), exports);
253
254
  __exportStar(require("./accountPeriodLockType"), exports);
254
255
  __exportStar(require("./accountNumberSequenceType"), exports);
@@ -259,20 +260,3 @@ __exportStar(require("./accountCostCenterType"), exports);
259
260
  __exportStar(require("./accountVoucherTypeType"), exports);
260
261
  __exportStar(require("./vendorCompanyMetaType"), exports);
261
262
  __exportStar(require("./productMetaType"), exports);
262
- // Arena Module
263
- __exportStar(require("./sportType"), exports);
264
- __exportStar(require("./sportCategoryType"), exports);
265
- __exportStar(require("./sportSubCategoryType"), exports);
266
- __exportStar(require("./sportRoleType"), exports);
267
- __exportStar(require("./equipmentType"), exports);
268
- __exportStar(require("./facilityMasterType"), exports);
269
- __exportStar(require("./sportGroupDataType"), exports);
270
- __exportStar(require("./unitType"), exports);
271
- __exportStar(require("./skillType"), exports);
272
- __exportStar(require("./ageGroupType"), exports);
273
- __exportStar(require("./assessmentTestType"), exports);
274
- __exportStar(require("./sportInfoType"), exports);
275
- __exportStar(require("./schoolHasSportType"), exports);
276
- __exportStar(require("./studentSportTestType"), exports);
277
- __exportStar(require("./sportsAcademyType"), exports);
278
- __exportStar(require("./userAmenityType"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.685",
3
+ "version": "1.1.687",
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",
@@ -44,16 +44,24 @@
44
44
  "@aws-sdk/client-sts": "^3.1017.0",
45
45
  "@aws-sdk/s3-request-presigner": "^3.895.0",
46
46
  "axios": "^1.12.2",
47
+ "bullmq": "^5.80.9",
47
48
  "date-fns": "^4.1.0",
48
49
  "dotenv": "^17.2.2",
50
+ "ejs": "^3.1.10",
51
+ "firebase-admin": "^13.4.0",
52
+ "ioredis": "^5.11.1",
49
53
  "joi": "^18.0.1",
50
54
  "mongoose": "^8.5.2",
51
55
  "pg": "^8.12.0",
52
56
  "sequelize": "^6.37.3",
53
- "uuid": "^8.3.2"
57
+ "uuid": "^8.3.2",
58
+ "winston": "^3.19.0",
59
+ "winston-daily-rotate-file": "^5.0.0"
54
60
  },
55
61
  "devDependencies": {
56
62
  "@eslint/js": "^9.17.0",
63
+ "@types/ejs": "^3.1.5",
64
+ "@types/express": "^5.0.6",
57
65
  "@types/mongoose": "^5.11.97",
58
66
  "@types/node": "^24.5.2",
59
67
  "@types/sequelize": "^4.28.14",