@kipicore/dbcore 1.1.693 → 1.1.695
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.
- package/dist/commonValidator/commandValidator.d.ts +27 -0
- package/dist/commonValidator/commandValidator.js +225 -0
- package/dist/commonValidator/index.d.ts +3 -0
- package/dist/commonValidator/index.js +24 -0
- package/dist/commonValidator/joiCommonValidator.d.ts +12 -0
- package/dist/commonValidator/joiCommonValidator.js +47 -0
- package/dist/commonValidator/joiSchemaBuilder.d.ts +6 -0
- package/dist/commonValidator/joiSchemaBuilder.js +70 -0
- package/dist/configs/env.d.ts +2 -0
- package/dist/configs/env.js +4 -0
- package/dist/configs/index.d.ts +2 -0
- package/dist/configs/index.js +2 -0
- package/dist/configs/logger.d.ts +2 -0
- package/dist/configs/logger.js +44 -0
- package/dist/configs/redisConfig.d.ts +4 -0
- package/dist/configs/redisConfig.js +32 -0
- package/dist/constants/app.d.ts +30 -43
- package/dist/constants/app.js +34 -48
- package/dist/constants/defaultModelAttributes.js +2 -1
- package/dist/constants/errorMessages.d.ts +20 -1
- package/dist/constants/errorMessages.js +22 -1
- package/dist/constants/successMessages.d.ts +14 -0
- package/dist/constants/successMessages.js +17 -1
- package/dist/db/psql/migrations/20260714111425-change_status_enum_to_string_in_institutes.js +46 -0
- package/dist/db/psql/migrations/20260714131500-add_note_to_institutes.js +20 -0
- package/dist/db/psql/migrations/20260715150000-create-ai-model-keys.js +156 -0
- package/dist/db/psql/migrations/20260717071354-add_type_to_categories.d.ts +2 -0
- package/dist/db/psql/migrations/20260717071354-add_type_to_categories.js +19 -0
- package/dist/db/psql/migrations/20260717072745-add_type_to_sub_categories.d.ts +2 -0
- package/dist/db/psql/migrations/20260717072745-add_type_to_sub_categories.js +19 -0
- package/dist/db/psql/migrations/20260717095051-add_status_to_users.d.ts +2 -0
- package/dist/db/psql/migrations/20260717095051-add_status_to_users.js +19 -0
- package/dist/db/psql/migrations/20260721000001-add-deleted-at-to-rms-maintenance-activities.d.ts +2 -0
- package/dist/db/psql/migrations/20260721000001-add-deleted-at-to-rms-maintenance-activities.js +12 -0
- package/dist/db/psql/migrations/20260721000002-change-uploaded-from-enum-to-string-in-file-storage.d.ts +2 -0
- package/dist/db/psql/migrations/20260721000002-change-uploaded-from-enum-to-string-in-file-storage.js +42 -0
- package/dist/db/psql/migrations/20260722130134-add_portfolio_theme_to_users.d.ts +2 -0
- package/dist/db/psql/migrations/20260722130134-add_portfolio_theme_to_users.js +22 -0
- package/dist/db/psql/migrations/20260727123149-add_vendorCompanyId_to_institute_ownership_histories.js +23 -0
- package/dist/db/psql/migrations/20260727130802-add_vendorCompanyId_to_institute_partners.d.ts +2 -0
- package/dist/db/psql/migrations/20260727130802-add_vendorCompanyId_to_institute_partners.js +23 -0
- package/dist/db/psql/migrations/20260727132312-make_instituteId_and_vendorCompanyId_optional_in_institute_partners.d.ts +2 -0
- package/dist/db/psql/migrations/20260727132312-make_instituteId_and_vendorCompanyId_optional_in_institute_partners.js +28 -0
- package/dist/db/psql/migrations/20260727132747-make_instituteId_and_vendorCompanyId_optional_in_institute_ownership_histories.d.ts +2 -0
- package/dist/db/psql/migrations/20260727132747-make_instituteId_and_vendorCompanyId_optional_in_institute_ownership_histories.js +25 -0
- package/dist/db/psql/migrations/20260729055118-institutePartners.d.ts +2 -0
- package/dist/db/psql/migrations/20260729055118-institutePartners.js +28 -0
- package/dist/db/psql/migrations/20260729055121-instituteOwnershipHistory.d.ts +2 -0
- package/dist/db/psql/migrations/20260729055121-instituteOwnershipHistory.js +25 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.js +3 -0
- package/dist/helpers/sendEmail.d.ts +3 -0
- package/dist/helpers/sendEmail.js +117 -0
- package/dist/helpers/sendNotification.d.ts +4 -0
- package/dist/helpers/sendNotification.js +34 -0
- package/dist/helpers/sendSMS.d.ts +5 -0
- package/dist/helpers/sendSMS.js +34 -0
- package/dist/helpers/utils.d.ts +5 -3
- package/dist/helpers/utils.js +58 -31
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/aiModelKeysInterface.d.ts +15 -0
- package/dist/interfaces/categoriesInterface.d.ts +2 -1
- package/dist/interfaces/index.d.ts +1 -17
- package/dist/interfaces/index.js +1 -18
- package/dist/interfaces/instituteInterface.d.ts +1 -0
- package/dist/interfaces/instituteOwnershipHistoryInterface.d.ts +2 -1
- package/dist/interfaces/institutePartnersInterface.d.ts +2 -1
- package/dist/interfaces/photosGalleryInterface.d.ts +1 -3
- package/dist/interfaces/sendNotificationInerface.d.ts +0 -2
- package/dist/interfaces/subCategoriesInterface.d.ts +2 -1
- package/dist/interfaces/subscriptionPlanInterface.d.ts +2 -1
- package/dist/interfaces/testimonialInterface.d.ts +0 -1
- package/dist/interfaces/userInstituteMetaInterface.d.ts +1 -1
- package/dist/interfaces/userInterface.d.ts +3 -1
- package/dist/interfaces/vendorCompanyMetaInterface.d.ts +5 -2
- package/dist/models/mongodb/index.d.ts +0 -6
- package/dist/models/mongodb/index.js +1 -14
- package/dist/models/mongodb/photosGalleryModel.js +1 -5
- package/dist/models/mongodb/productMetaModel.js +9 -1
- package/dist/models/mongodb/subscriptionPlanModel.js +5 -0
- package/dist/models/mongodb/userInstituteMetaModel.js +0 -4
- package/dist/models/mongodb/vendorCompanyMetaModel.js +15 -1
- package/dist/models/psql/SubCategoriesModel.d.ts +2 -1
- package/dist/models/psql/SubCategoriesModel.js +5 -0
- package/dist/models/psql/aiModelKeysModel.d.ts +20 -0
- package/dist/models/psql/aiModelKeysModel.js +70 -0
- package/dist/models/psql/categoriesModel.d.ts +2 -1
- package/dist/models/psql/categoriesModel.js +5 -0
- package/dist/models/psql/fileStorageModel.js +3 -4
- package/dist/models/psql/index.d.ts +1 -11
- package/dist/models/psql/index.js +4 -25
- package/dist/models/psql/instituteModel.d.ts +1 -0
- package/dist/models/psql/instituteModel.js +5 -2
- package/dist/models/psql/instituteOwnershipHistoryModel.d.ts +2 -1
- package/dist/models/psql/instituteOwnershipHistoryModel.js +8 -3
- package/dist/models/psql/institutePartnersModel.d.ts +2 -1
- package/dist/models/psql/institutePartnersModel.js +8 -3
- package/dist/models/psql/sendNotificationModel.d.ts +0 -1
- package/dist/models/psql/sendNotificationModel.js +0 -5
- package/dist/models/psql/testimonialModel.d.ts +0 -1
- package/dist/models/psql/testimonialModel.js +7 -8
- package/dist/models/psql/userModel.d.ts +3 -1
- package/dist/models/psql/userModel.js +2 -2
- package/dist/queues/emailQueue.d.ts +3 -0
- package/dist/queues/emailQueue.js +22 -0
- package/dist/queues/emailWorker.d.ts +3 -0
- package/dist/queues/emailWorker.js +33 -0
- package/dist/queues/index.d.ts +2 -0
- package/dist/queues/index.js +18 -0
- package/dist/types/aiModelKeysType.d.ts +3 -0
- package/dist/types/commonType.d.ts +29 -1
- package/dist/types/index.d.ts +1 -17
- package/dist/types/index.js +1 -18
- package/package.json +10 -2
- package/dist/db/psql/migrations/20260714095754-create-arena-models.js +0 -642
- package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.d.ts +0 -2
- package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.js +0 -138
- package/dist/db/psql/migrations/20260722143500-create-school_has_sports.js +0 -71
- package/dist/db/psql/migrations/20260728170500-add_sports_academy_id_to_testimonials.js +0 -21
- package/dist/db/psql/migrations/20260729150700-add_sports_academy_id_to_notifications.js +0 -21
- package/dist/interfaces/ageGroupInterface.d.ts +0 -12
- package/dist/interfaces/assessmentTestInterface.d.ts +0 -23
- package/dist/interfaces/equipmentInterface.d.ts +0 -10
- package/dist/interfaces/equipmentInterface.js +0 -2
- package/dist/interfaces/facilityMasterInterface.d.ts +0 -9
- package/dist/interfaces/facilityMasterInterface.js +0 -2
- package/dist/interfaces/schoolHasSportInterface.d.ts +0 -7
- package/dist/interfaces/schoolHasSportInterface.js +0 -2
- package/dist/interfaces/skillInterface.d.ts +0 -19
- package/dist/interfaces/skillInterface.js +0 -2
- package/dist/interfaces/sportCategoryInterface.d.ts +0 -9
- package/dist/interfaces/sportCategoryInterface.js +0 -2
- package/dist/interfaces/sportGroupDataInterface.d.ts +0 -7
- package/dist/interfaces/sportGroupDataInterface.js +0 -2
- package/dist/interfaces/sportInfoInterface.d.ts +0 -23
- package/dist/interfaces/sportInfoInterface.js +0 -2
- package/dist/interfaces/sportInterface.d.ts +0 -10
- package/dist/interfaces/sportInterface.js +0 -2
- package/dist/interfaces/sportRoleInterface.d.ts +0 -11
- package/dist/interfaces/sportRoleInterface.js +0 -2
- package/dist/interfaces/sportSubCategoryInterface.d.ts +0 -10
- package/dist/interfaces/sportSubCategoryInterface.js +0 -2
- package/dist/interfaces/sportsAcademyInterface.d.ts +0 -39
- package/dist/interfaces/sportsAcademyInterface.js +0 -2
- package/dist/interfaces/studentSportTestInterface.d.ts +0 -20
- package/dist/interfaces/studentSportTestInterface.js +0 -2
- package/dist/interfaces/unitInterface.d.ts +0 -10
- package/dist/interfaces/unitInterface.js +0 -2
- package/dist/interfaces/userAcademyMetaInterface.d.ts +0 -17
- package/dist/interfaces/userAcademyMetaInterface.js +0 -2
- package/dist/interfaces/userAmenityInterface.d.ts +0 -24
- package/dist/interfaces/userAmenityInterface.js +0 -2
- package/dist/models/mongodb/assessmentTestModel.d.ts +0 -4
- package/dist/models/mongodb/assessmentTestModel.js +0 -72
- package/dist/models/mongodb/sportInfoModel.d.ts +0 -4
- package/dist/models/mongodb/sportInfoModel.js +0 -71
- package/dist/models/mongodb/sportsAcademyModel.d.ts +0 -4
- package/dist/models/mongodb/sportsAcademyModel.js +0 -89
- package/dist/models/mongodb/studentSportTestModel.d.ts +0 -4
- package/dist/models/mongodb/studentSportTestModel.js +0 -68
- package/dist/models/mongodb/userAcademyMetaModel.d.ts +0 -4
- package/dist/models/mongodb/userAcademyMetaModel.js +0 -109
- package/dist/models/mongodb/userAmenityModel.d.ts +0 -4
- package/dist/models/mongodb/userAmenityModel.js +0 -73
- package/dist/models/psql/ageGroupModel.d.ts +0 -22
- package/dist/models/psql/ageGroupModel.js +0 -76
- package/dist/models/psql/equipmentModel.d.ts +0 -20
- package/dist/models/psql/equipmentModel.js +0 -57
- package/dist/models/psql/facilityMasterModel.d.ts +0 -18
- package/dist/models/psql/facilityMasterModel.js +0 -64
- package/dist/models/psql/schoolHasSportModel.d.ts +0 -17
- package/dist/models/psql/schoolHasSportModel.js +0 -76
- package/dist/models/psql/skillModel.d.ts +0 -25
- package/dist/models/psql/skillModel.js +0 -99
- package/dist/models/psql/sportCategoryModel.d.ts +0 -19
- package/dist/models/psql/sportCategoryModel.js +0 -53
- package/dist/models/psql/sportGroupDataModel.d.ts +0 -13
- package/dist/models/psql/sportGroupDataModel.js +0 -64
- package/dist/models/psql/sportModel.d.ts +0 -20
- package/dist/models/psql/sportModel.js +0 -58
- package/dist/models/psql/sportRoleModel.d.ts +0 -21
- package/dist/models/psql/sportRoleModel.js +0 -71
- package/dist/models/psql/sportSubCategoryModel.d.ts +0 -20
- package/dist/models/psql/sportSubCategoryModel.js +0 -75
- package/dist/models/psql/unitModel.d.ts +0 -20
- package/dist/models/psql/unitModel.js +0 -57
- package/dist/types/ageGroupType.d.ts +0 -2
- package/dist/types/ageGroupType.js +0 -2
- package/dist/types/assessmentTestType.d.ts +0 -2
- package/dist/types/assessmentTestType.js +0 -2
- package/dist/types/equipmentType.d.ts +0 -2
- package/dist/types/equipmentType.js +0 -2
- package/dist/types/facilityMasterType.d.ts +0 -3
- package/dist/types/facilityMasterType.js +0 -2
- package/dist/types/schoolHasSportType.d.ts +0 -2
- package/dist/types/schoolHasSportType.js +0 -2
- package/dist/types/skillType.d.ts +0 -2
- package/dist/types/skillType.js +0 -2
- package/dist/types/sportCategoryType.d.ts +0 -2
- package/dist/types/sportCategoryType.js +0 -2
- package/dist/types/sportGroupDataType.d.ts +0 -3
- package/dist/types/sportGroupDataType.js +0 -2
- package/dist/types/sportInfoType.d.ts +0 -2
- package/dist/types/sportInfoType.js +0 -2
- package/dist/types/sportRoleType.d.ts +0 -2
- package/dist/types/sportRoleType.js +0 -2
- package/dist/types/sportSubCategoryType.d.ts +0 -2
- package/dist/types/sportSubCategoryType.js +0 -2
- package/dist/types/sportType.d.ts +0 -2
- package/dist/types/sportType.js +0 -2
- package/dist/types/sportsAcademyType.d.ts +0 -2
- package/dist/types/sportsAcademyType.js +0 -2
- package/dist/types/studentSportTestType.d.ts +0 -2
- package/dist/types/studentSportTestType.js +0 -2
- package/dist/types/unitType.d.ts +0 -2
- package/dist/types/unitType.js +0 -2
- package/dist/types/userAcademyMetaType.d.ts +0 -2
- package/dist/types/userAcademyMetaType.js +0 -2
- package/dist/types/userAmenityType.d.ts +0 -2
- package/dist/types/userAmenityType.js +0 -2
- /package/dist/db/psql/migrations/{20260714095754-create-arena-models.d.ts → 20260714111425-change_status_enum_to_string_in_institutes.d.ts} +0 -0
- /package/dist/db/psql/migrations/{20260722143500-create-school_has_sports.d.ts → 20260714131500-add_note_to_institutes.d.ts} +0 -0
- /package/dist/db/psql/migrations/{20260728170500-add_sports_academy_id_to_testimonials.d.ts → 20260715150000-create-ai-model-keys.d.ts} +0 -0
- /package/dist/db/psql/migrations/{20260729150700-add_sports_academy_id_to_notifications.d.ts → 20260727123149-add_vendorCompanyId_to_institute_ownership_histories.d.ts} +0 -0
- /package/dist/interfaces/{ageGroupInterface.js → aiModelKeysInterface.js} +0 -0
- /package/dist/{interfaces/assessmentTestInterface.js → types/aiModelKeysType.js} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendPushNotification = void 0;
|
|
4
|
+
const app_1 = require("firebase-admin/app");
|
|
5
|
+
const messaging_1 = require("firebase-admin/messaging");
|
|
6
|
+
const env_1 = require("../configs/env");
|
|
7
|
+
// Initialize Firebase if not already initialized
|
|
8
|
+
if (!(0, app_1.getApps)().length) {
|
|
9
|
+
(0, app_1.initializeApp)({
|
|
10
|
+
credential: (0, app_1.cert)({
|
|
11
|
+
projectId: env_1.ENV_VARIABLE.FIREBASE_PROJECT_ID,
|
|
12
|
+
clientEmail: env_1.ENV_VARIABLE.FIREBASE_CLIENT_EMAIL,
|
|
13
|
+
privateKey: env_1.ENV_VARIABLE.FIREBASE_PRIVATE_KEY.replace(/\\n/g, '\n'),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const sendPushNotification = async (deviceToken, notification) => {
|
|
18
|
+
try {
|
|
19
|
+
const payload = {
|
|
20
|
+
notification: {
|
|
21
|
+
title: notification.title,
|
|
22
|
+
body: notification.message,
|
|
23
|
+
},
|
|
24
|
+
token: deviceToken,
|
|
25
|
+
};
|
|
26
|
+
const response = await (0, messaging_1.getMessaging)().send(payload);
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error('Error sending push notification:', error);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.sendPushNotification = sendPushNotification;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendSMSDirect = void 0;
|
|
4
|
+
const client_sns_1 = require("@aws-sdk/client-sns");
|
|
5
|
+
const index_1 = require("../index");
|
|
6
|
+
const sendSMSDirect = async (smsOptions) => {
|
|
7
|
+
try {
|
|
8
|
+
const snsClient = await index_1.awsClient.sns();
|
|
9
|
+
// const command = new PublishCommand({
|
|
10
|
+
// Message: smsOptions.message,
|
|
11
|
+
// PhoneNumber: '+918469665568',
|
|
12
|
+
// MessageAttributes: {
|
|
13
|
+
// 'AWS.SNS.SMS.SenderID': {
|
|
14
|
+
// DataType: 'String',
|
|
15
|
+
// StringValue: 'KIPI',
|
|
16
|
+
// },
|
|
17
|
+
// 'AWS.SNS.SMS.SMSType': {
|
|
18
|
+
// DataType: 'String',
|
|
19
|
+
// StringValue: 'Transactional',
|
|
20
|
+
// },
|
|
21
|
+
// },
|
|
22
|
+
// });
|
|
23
|
+
const command = new client_sns_1.PublishCommand({
|
|
24
|
+
Message: smsOptions.message,
|
|
25
|
+
PhoneNumber: `+91${smsOptions.to}`,
|
|
26
|
+
});
|
|
27
|
+
await snsClient.send(command);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error('SMS sending failed:', error);
|
|
31
|
+
// throw error;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.sendSMSDirect = sendSMSDirect;
|
package/dist/helpers/utils.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Request } from 'express';
|
|
2
|
+
import { TCustomHeaders } from '../types/commonType';
|
|
1
3
|
import { GRADE } from '../constants/app';
|
|
2
4
|
import Joi from 'joi';
|
|
3
5
|
import { OrderItem } from 'sequelize';
|
|
@@ -156,9 +158,6 @@ export declare function extractFromObject(data: any[], config: {
|
|
|
156
158
|
userdata: any[];
|
|
157
159
|
columns: string[];
|
|
158
160
|
};
|
|
159
|
-
export declare const enumAlternatives: (enumObj: Record<string, string>, isRequired?: boolean, allowArray?: boolean) => Joi.StringSchema<string> | Joi.AlternativesSchema<any>;
|
|
160
|
-
export declare const objectIdAlternatives: (isRequired?: boolean, allowArray?: boolean) => Joi.AlternativesSchema<any> | undefined;
|
|
161
|
-
export declare const uuidIdAlternatives: (isRequired?: boolean, allowArray?: boolean) => Joi.AlternativesSchema<any> | undefined;
|
|
162
161
|
export declare const customPagination: <T>(data: T[], page: number, limit: number, totalRecords: number) => Promise<{
|
|
163
162
|
limit: number;
|
|
164
163
|
totalRecords: number;
|
|
@@ -179,4 +178,7 @@ export declare const calculateGrade: (subject: {
|
|
|
179
178
|
obtained: number;
|
|
180
179
|
}) => GRADE;
|
|
181
180
|
export declare const getOverallGrade: (subjects: Subject[]) => GRADE;
|
|
181
|
+
export declare const readEmailTemplate: (templateName: string) => Promise<string>;
|
|
182
|
+
export declare const readEmailTemplateWithOutGlobal: (data: any, templateName?: string) => Promise<string>;
|
|
183
|
+
export declare const assignHeaderValues: <T extends Record<string, any>>(bodyData: T, req: Request, fields: Array<keyof TCustomHeaders>) => T;
|
|
182
184
|
export {};
|
package/dist/helpers/utils.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.assignHeaderValues = exports.readEmailTemplateWithOutGlobal = exports.readEmailTemplate = exports.getOverallGrade = exports.calculateGrade = exports.getNextLetter = exports.getCityAreas = exports.generateVoucherCode = exports.verifyHmacSHA256 = exports.generateHmacSHA256 = exports.customPagination = exports.fromSnakeCaseToNormalText = exports.normalizeToArray = exports.capitalizeFirst = exports.parseOrderOptions = exports.isValidUUID = exports.removeFalsyValues = exports.flattenNestedStructure = exports.buildNestedStructure = exports.getParentsByChildrenId = exports.getChildrenByParentId = exports.sortArray = exports.groupByFields = exports.endOfDay = exports.generateUuidToNumber = exports.startOfDay = exports.isDateWithinRange = exports.isTimeWithinRange = exports.keyByFieldOrFields = exports.getUniqueArrayByFields = exports.generateTempPassword = exports.generateAlphaNumericCode = exports.generateOtp = exports.ensureDirectoryExists = exports.omit = exports.isValidMongoDbId = exports.pick = void 0;
|
|
40
40
|
exports.groupByFieldOrFields = groupByFieldOrFields;
|
|
41
41
|
exports.slugify = slugify;
|
|
42
42
|
exports.assignNonNull = assignNonNull;
|
|
@@ -51,6 +51,8 @@ const uuid = require('uuid');
|
|
|
51
51
|
const crypto_1 = __importDefault(require("crypto"));
|
|
52
52
|
const sequelize_1 = require("sequelize");
|
|
53
53
|
const axios_1 = __importDefault(require("axios"));
|
|
54
|
+
const ejs_1 = __importDefault(require("ejs"));
|
|
55
|
+
const path_1 = __importDefault(require("path"));
|
|
54
56
|
const PASSWORD_REGEX = new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!.@#$%^&*])(?=.{8,})');
|
|
55
57
|
const pick = (objOrArray, keys) => {
|
|
56
58
|
const pickObject = (obj) => keys.reduce((acc, key) => {
|
|
@@ -506,9 +508,10 @@ const parseOrderOptions = (inputOrder, defaultOrder = [['createdAt', 'DESC']]) =
|
|
|
506
508
|
return order;
|
|
507
509
|
};
|
|
508
510
|
exports.parseOrderOptions = parseOrderOptions;
|
|
511
|
+
const configs_1 = require("../configs");
|
|
509
512
|
const capitalizeFirst = (str) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
510
513
|
exports.capitalizeFirst = capitalizeFirst;
|
|
511
|
-
const normalizeToArray = (value) => value ? (Array.isArray(value) ? value : [value]) : undefined;
|
|
514
|
+
const normalizeToArray = (value) => (value ? (Array.isArray(value) ? value : [value]) : undefined);
|
|
512
515
|
exports.normalizeToArray = normalizeToArray;
|
|
513
516
|
/**
|
|
514
517
|
* Converts a snake_case string to Normal Text
|
|
@@ -541,8 +544,7 @@ function assignNonNull(target, source) {
|
|
|
541
544
|
});
|
|
542
545
|
}
|
|
543
546
|
function isUserSchoolInfoUpdate(institute, reqUser) {
|
|
544
|
-
return
|
|
545
|
-
(reqUser.isAddDetails || reqUser.type === app_1.USER_TYPES.INSTITUTE_MASTER_ADMIN || reqUser.type === app_1.USER_TYPES.INSTITUTE_ADMIN));
|
|
547
|
+
return !!(institute.type || institute.subType) && (reqUser.isAddDetails || reqUser.type === app_1.USER_TYPES.INSTITUTE_MASTER_ADMIN || reqUser.type === app_1.USER_TYPES.INSTITUTE_ADMIN);
|
|
546
548
|
}
|
|
547
549
|
function chunkArray(array, size) {
|
|
548
550
|
const chunks = [];
|
|
@@ -614,33 +616,6 @@ function extractFromObject(data, config) {
|
|
|
614
616
|
});
|
|
615
617
|
return { tableTitle: config.tableTitle, userdata, columns };
|
|
616
618
|
}
|
|
617
|
-
const enumAlternatives = (enumObj, isRequired = false, allowArray = true) => {
|
|
618
|
-
const base = joi_1.default.string().valid(...Object.values(enumObj));
|
|
619
|
-
if (allowArray) {
|
|
620
|
-
const alt = joi_1.default.alternatives().try(base, joi_1.default.array().items(base));
|
|
621
|
-
return isRequired ? alt.required() : alt.optional();
|
|
622
|
-
}
|
|
623
|
-
return isRequired ? base.required() : base.optional();
|
|
624
|
-
};
|
|
625
|
-
exports.enumAlternatives = enumAlternatives;
|
|
626
|
-
const objectIdAlternatives = (isRequired = false, allowArray = true) => {
|
|
627
|
-
const base = joi_1.default.string()
|
|
628
|
-
.pattern(/^[0-9a-fA-F]{24}$/)
|
|
629
|
-
.message('Invalid ObjectId format');
|
|
630
|
-
if (allowArray) {
|
|
631
|
-
const alt = joi_1.default.alternatives().try(base, joi_1.default.array().items(base));
|
|
632
|
-
return isRequired ? alt.required() : alt.optional();
|
|
633
|
-
}
|
|
634
|
-
};
|
|
635
|
-
exports.objectIdAlternatives = objectIdAlternatives;
|
|
636
|
-
const uuidIdAlternatives = (isRequired = false, allowArray = true) => {
|
|
637
|
-
const base = joi_1.default.string().uuid().message('Invalid Uuid format');
|
|
638
|
-
if (allowArray) {
|
|
639
|
-
const alt = joi_1.default.alternatives().try(base, joi_1.default.array().items(base));
|
|
640
|
-
return isRequired ? alt.required() : alt.optional();
|
|
641
|
-
}
|
|
642
|
-
};
|
|
643
|
-
exports.uuidIdAlternatives = uuidIdAlternatives;
|
|
644
619
|
const customPagination = async (data, page, limit, totalRecords) => {
|
|
645
620
|
page = Math.max(1, page || app_1.PAGINATION.PAGE);
|
|
646
621
|
limit = Math.max(1, limit || app_1.PAGINATION.LIMIT);
|
|
@@ -761,3 +736,55 @@ const getOverallGrade = (subjects) => {
|
|
|
761
736
|
return worstGrade;
|
|
762
737
|
};
|
|
763
738
|
exports.getOverallGrade = getOverallGrade;
|
|
739
|
+
const readEmailTemplate = async (templateName) => {
|
|
740
|
+
const globalFilePath = path_1.default.join(process.cwd(), 'emailTemplates', `globalEmailTemplate.ejs`);
|
|
741
|
+
const filePath = path_1.default.join(process.cwd(), 'emailTemplates', `${templateName}.ejs`);
|
|
742
|
+
let globalEmailTemplate = await fs_1.default.readFileSync(globalFilePath, 'utf-8');
|
|
743
|
+
const html = ejs_1.default.render(globalEmailTemplate, {
|
|
744
|
+
data: {
|
|
745
|
+
kipiLogo: `${configs_1.ENV_VARIABLE.SERVER_URL}/public/kipilogo.png`,
|
|
746
|
+
googlePlayLogo: `${configs_1.ENV_VARIABLE.SERVER_URL}/public/googleplaylogo.png`,
|
|
747
|
+
applePlayLogo: `${configs_1.ENV_VARIABLE.SERVER_URL}/public/appleplaylogo.png`,
|
|
748
|
+
},
|
|
749
|
+
});
|
|
750
|
+
globalEmailTemplate = html.replace(/\r\n/g, '');
|
|
751
|
+
return new Promise((resolve, reject) => {
|
|
752
|
+
fs_1.default.readFile(filePath, 'utf-8', (err, content) => {
|
|
753
|
+
if (err) {
|
|
754
|
+
return reject(err);
|
|
755
|
+
}
|
|
756
|
+
resolve(globalEmailTemplate.replace(/{{content}}/g, content));
|
|
757
|
+
});
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
exports.readEmailTemplate = readEmailTemplate;
|
|
761
|
+
const readEmailTemplateWithOutGlobal = async (data, templateName) => {
|
|
762
|
+
return new Promise((resolve, reject) => {
|
|
763
|
+
const templatePath = path_1.default.join(process.cwd(), 'emailTemplates', `${templateName || app_1.EMAIL_TEMPLATES.COMMON_TEMPLATE}.ejs`);
|
|
764
|
+
fs_1.default.readFile(templatePath, 'utf-8', (err, templateContent) => {
|
|
765
|
+
if (err) {
|
|
766
|
+
return reject(err);
|
|
767
|
+
}
|
|
768
|
+
const html = ejs_1.default.render(templateContent, {
|
|
769
|
+
logoUrl: data.instituteLogo,
|
|
770
|
+
content: data.content,
|
|
771
|
+
googlePlayLogo: `${process.env.SERVER_URL}/public/googleplaylogo.png`,
|
|
772
|
+
appStoreLogo: `${process.env.SERVER_URL}/public/appleplaylogo.png`,
|
|
773
|
+
});
|
|
774
|
+
resolve(html);
|
|
775
|
+
});
|
|
776
|
+
});
|
|
777
|
+
};
|
|
778
|
+
exports.readEmailTemplateWithOutGlobal = readEmailTemplateWithOutGlobal;
|
|
779
|
+
const assignHeaderValues = (bodyData, req, fields) => {
|
|
780
|
+
fields.forEach(field => {
|
|
781
|
+
const key = field;
|
|
782
|
+
if (bodyData[key] !== undefined && bodyData[key] !== null)
|
|
783
|
+
return;
|
|
784
|
+
if (req.customHeaders?.[field] !== undefined && req.customHeaders?.[field] !== null) {
|
|
785
|
+
bodyData[key] = req.customHeaders[field];
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
return bodyData;
|
|
789
|
+
};
|
|
790
|
+
exports.assignHeaderValues = assignHeaderValues;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,3 +15,7 @@ export * from './models/mongodb/index';
|
|
|
15
15
|
export * from './models/psql/index';
|
|
16
16
|
/************ types *************/
|
|
17
17
|
export * from './types/index';
|
|
18
|
+
/************ validator ********** */
|
|
19
|
+
export * from './commonValidator';
|
|
20
|
+
/************ queues *************/
|
|
21
|
+
export * from './queues/index';
|
package/dist/index.js
CHANGED
|
@@ -31,3 +31,7 @@ __exportStar(require("./models/mongodb/index"), exports);
|
|
|
31
31
|
__exportStar(require("./models/psql/index"), exports);
|
|
32
32
|
/************ types *************/
|
|
33
33
|
__exportStar(require("./types/index"), exports);
|
|
34
|
+
/************ validator ********** */
|
|
35
|
+
__exportStar(require("./commonValidator"), exports);
|
|
36
|
+
/************ queues *************/
|
|
37
|
+
__exportStar(require("./queues/index"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AI_MODEL_KEYS, AI_MODEL_KEY_TYPES } from "../constants";
|
|
2
|
+
export interface IAiModelKeyAttributes {
|
|
3
|
+
id: string;
|
|
4
|
+
key: AI_MODEL_KEYS;
|
|
5
|
+
hasValue: string;
|
|
6
|
+
type: AI_MODEL_KEY_TYPES;
|
|
7
|
+
description: string;
|
|
8
|
+
version: number;
|
|
9
|
+
createdBy?: string;
|
|
10
|
+
updatedBy?: string;
|
|
11
|
+
deletedBy?: string;
|
|
12
|
+
createdAt?: Date;
|
|
13
|
+
updatedAt?: Date;
|
|
14
|
+
deletedAt?: Date;
|
|
15
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IDefaultAttributes } from './commonInterface';
|
|
2
|
-
import { COMMAN_STATUS } from '../constants/app';
|
|
2
|
+
import { CATEGORY_TYPE, COMMAN_STATUS } from '../constants/app';
|
|
3
3
|
export interface ICategoriesModelAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
6
|
status: COMMAN_STATUS;
|
|
7
7
|
instituteId?: string;
|
|
8
|
+
type?: CATEGORY_TYPE;
|
|
8
9
|
}
|
|
@@ -244,6 +244,7 @@ export * from './userFinalResultInterface';
|
|
|
244
244
|
export * from './refundInterface';
|
|
245
245
|
export * from './kipiverseContactFormInterface';
|
|
246
246
|
export * from './moduleDocsInterface';
|
|
247
|
+
export * from './aiModelKeysInterface';
|
|
247
248
|
export * from './accountFinancialYearInterface';
|
|
248
249
|
export * from './accountPeriodLockInterface';
|
|
249
250
|
export * from './accountNumberSequenceInterface';
|
|
@@ -254,20 +255,3 @@ export * from './accountCostCenterInterface';
|
|
|
254
255
|
export * from './accountVoucherTypeInterface';
|
|
255
256
|
export * from './vendorCompanyMetaInterface';
|
|
256
257
|
export * from './productMetaInterface';
|
|
257
|
-
export * from './sportInterface';
|
|
258
|
-
export * from './sportCategoryInterface';
|
|
259
|
-
export * from './sportSubCategoryInterface';
|
|
260
|
-
export * from './sportRoleInterface';
|
|
261
|
-
export * from './equipmentInterface';
|
|
262
|
-
export * from './facilityMasterInterface';
|
|
263
|
-
export * from './sportGroupDataInterface';
|
|
264
|
-
export * from './unitInterface';
|
|
265
|
-
export * from './skillInterface';
|
|
266
|
-
export * from './ageGroupInterface';
|
|
267
|
-
export * from './assessmentTestInterface';
|
|
268
|
-
export * from './sportInfoInterface';
|
|
269
|
-
export * from './schoolHasSportInterface';
|
|
270
|
-
export * from './studentSportTestInterface';
|
|
271
|
-
export * from './sportsAcademyInterface';
|
|
272
|
-
export * from './userAmenityInterface';
|
|
273
|
-
export * from './userAcademyMetaInterface';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -260,6 +260,7 @@ __exportStar(require("./userFinalResultInterface"), exports);
|
|
|
260
260
|
__exportStar(require("./refundInterface"), exports);
|
|
261
261
|
__exportStar(require("./kipiverseContactFormInterface"), exports);
|
|
262
262
|
__exportStar(require("./moduleDocsInterface"), exports);
|
|
263
|
+
__exportStar(require("./aiModelKeysInterface"), exports);
|
|
263
264
|
__exportStar(require("./accountFinancialYearInterface"), exports);
|
|
264
265
|
__exportStar(require("./accountPeriodLockInterface"), exports);
|
|
265
266
|
__exportStar(require("./accountNumberSequenceInterface"), exports);
|
|
@@ -270,21 +271,3 @@ __exportStar(require("./accountCostCenterInterface"), exports);
|
|
|
270
271
|
__exportStar(require("./accountVoucherTypeInterface"), exports);
|
|
271
272
|
__exportStar(require("./vendorCompanyMetaInterface"), exports);
|
|
272
273
|
__exportStar(require("./productMetaInterface"), exports);
|
|
273
|
-
// Arena Module
|
|
274
|
-
__exportStar(require("./sportInterface"), exports);
|
|
275
|
-
__exportStar(require("./sportCategoryInterface"), exports);
|
|
276
|
-
__exportStar(require("./sportSubCategoryInterface"), exports);
|
|
277
|
-
__exportStar(require("./sportRoleInterface"), exports);
|
|
278
|
-
__exportStar(require("./equipmentInterface"), exports);
|
|
279
|
-
__exportStar(require("./facilityMasterInterface"), exports);
|
|
280
|
-
__exportStar(require("./sportGroupDataInterface"), exports);
|
|
281
|
-
__exportStar(require("./unitInterface"), exports);
|
|
282
|
-
__exportStar(require("./skillInterface"), exports);
|
|
283
|
-
__exportStar(require("./ageGroupInterface"), exports);
|
|
284
|
-
__exportStar(require("./assessmentTestInterface"), exports);
|
|
285
|
-
__exportStar(require("./sportInfoInterface"), exports);
|
|
286
|
-
__exportStar(require("./schoolHasSportInterface"), exports);
|
|
287
|
-
__exportStar(require("./studentSportTestInterface"), exports);
|
|
288
|
-
__exportStar(require("./sportsAcademyInterface"), exports);
|
|
289
|
-
__exportStar(require("./userAmenityInterface"), exports);
|
|
290
|
-
__exportStar(require("./userAcademyMetaInterface"), exports);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IDefaultAttributes } from './commonInterface';
|
|
2
2
|
export interface IInstituteOwnershipHistoryAttributes extends IDefaultAttributes {
|
|
3
3
|
id: string;
|
|
4
|
-
instituteId
|
|
4
|
+
instituteId?: string;
|
|
5
|
+
vendorCompanyId?: string;
|
|
5
6
|
oldOwnerUserId: string;
|
|
6
7
|
newOwnerUserId: string;
|
|
7
8
|
}
|
|
@@ -3,7 +3,8 @@ import { IDefaultAttributes } from './commonInterface';
|
|
|
3
3
|
export interface IInstitutePartnersAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
5
5
|
partnerUserId: string;
|
|
6
|
-
instituteId
|
|
6
|
+
instituteId?: string;
|
|
7
|
+
vendorCompanyId?: string;
|
|
7
8
|
status?: COMMAN_STATUS;
|
|
8
9
|
startDate?: Date;
|
|
9
10
|
endDate?: Date;
|
|
@@ -10,7 +10,6 @@ export interface INotificationModelAttributes extends IDefaultAttributes {
|
|
|
10
10
|
viewDate?: Date;
|
|
11
11
|
status: NOTIFICATION_STATUS;
|
|
12
12
|
instituteId?: string;
|
|
13
|
-
sportsAcademyId?: string;
|
|
14
13
|
moduleType: NOTIFICATION_MODULE_TYPE;
|
|
15
14
|
}
|
|
16
15
|
export interface INotification {
|
|
@@ -19,5 +18,4 @@ export interface INotification {
|
|
|
19
18
|
senderId: string;
|
|
20
19
|
deviceToken: string;
|
|
21
20
|
instituteId?: string;
|
|
22
|
-
sportsAcademyId?: string;
|
|
23
21
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IDefaultAttributes } from './commonInterface';
|
|
2
|
-
import { COMMAN_STATUS } from '../constants/app';
|
|
2
|
+
import { CATEGORY_TYPE, COMMAN_STATUS } from '../constants/app';
|
|
3
3
|
export interface ISubCategoriesModelAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
6
|
categoryId: string;
|
|
7
7
|
instituteId?: string;
|
|
8
8
|
status: COMMAN_STATUS;
|
|
9
|
+
type: CATEGORY_TYPE;
|
|
9
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from 'mongoose';
|
|
2
|
-
import { APP_TYPE, COMMAN_STATUS, SUBSCRIPTION_PLAN_CHARGE_INTERVAL, DISCOUNT_TYPE, SUBSCRIPTION_PLAN_FILES_TYPE, VALID_CURRENCY, USER_TYPES, SUBSCRIPTION_PLAN_TYPE } from '../constants/app';
|
|
2
|
+
import { APP_TYPE, COMMAN_STATUS, SUBSCRIPTION_PLAN_CHARGE_INTERVAL, DISCOUNT_TYPE, SUBSCRIPTION_PLAN_FILES_TYPE, VALID_CURRENCY, USER_TYPES, SUBSCRIPTION_PLAN_TYPE, PLAN_SELL_STATUS } from '../constants/app';
|
|
3
3
|
import { IDefaultAttributes } from './commonInterface';
|
|
4
4
|
export interface ISubscriptionPlanFiles {
|
|
5
5
|
type: SUBSCRIPTION_PLAN_FILES_TYPE;
|
|
@@ -33,4 +33,5 @@ export interface ISubscriptionPlanModelAttributes extends IDefaultAttributes, Do
|
|
|
33
33
|
maxFreeCourses?: number;
|
|
34
34
|
maxFreeCoursePrice?: number;
|
|
35
35
|
maxNumberOfSchool?: number;
|
|
36
|
+
sellStatus?: PLAN_SELL_STATUS;
|
|
36
37
|
}
|
|
@@ -62,7 +62,6 @@ export interface IUserInstituteMetaAttributes extends IDefaultAttributes, Docume
|
|
|
62
62
|
isFeeCollectionCreated: boolean;
|
|
63
63
|
designationId?: string;
|
|
64
64
|
studentProfileImage?: string;
|
|
65
|
-
selectedSportsIds?: string[];
|
|
66
65
|
}
|
|
67
66
|
export interface IUserWiseData {
|
|
68
67
|
userId: string;
|
|
@@ -84,4 +83,5 @@ export interface IUserWiseData {
|
|
|
84
83
|
section: string | null;
|
|
85
84
|
subSection: string | null;
|
|
86
85
|
userInstituteMetaId: string;
|
|
86
|
+
isActive: COMMAN_STATUS;
|
|
87
87
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APP_TYPE, EMAIL_VERIFICATION, MOBILE_VERIFICATION, USER_TYPES } from '../constants/app';
|
|
1
|
+
import { APP_TYPE, EMAIL_VERIFICATION, MOBILE_VERIFICATION, USER_STATUS, USER_TYPES } from '../constants/app';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
3
|
export interface IUserAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
@@ -42,4 +42,6 @@ export interface IUserAttributes extends IDefaultAttributes {
|
|
|
42
42
|
district?: string;
|
|
43
43
|
area?: string;
|
|
44
44
|
taluka?: string;
|
|
45
|
+
status?: USER_STATUS;
|
|
46
|
+
portfolioTheme?: string;
|
|
45
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Document } from 'mongoose';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
|
-
import { VENDOR_COMPANY_META_STATUS } from '../constants/app';
|
|
3
|
+
import { VENDOR_COMPANY_META_STATUS, VENDOR_COMPANY_TYPE } from '../constants/app';
|
|
4
4
|
export interface IBankDetails {
|
|
5
5
|
accountHolderName: string;
|
|
6
6
|
accountNumber: string;
|
|
@@ -28,7 +28,7 @@ export interface IVendorCompanyMetaAttributes extends IDefaultAttributes, Docume
|
|
|
28
28
|
logo?: string;
|
|
29
29
|
banner?: string;
|
|
30
30
|
address1: string;
|
|
31
|
-
address2
|
|
31
|
+
address2?: string;
|
|
32
32
|
area: string;
|
|
33
33
|
district?: string;
|
|
34
34
|
pinCode: string;
|
|
@@ -40,4 +40,7 @@ export interface IVendorCompanyMetaAttributes extends IDefaultAttributes, Docume
|
|
|
40
40
|
description?: string;
|
|
41
41
|
documents: ICompanyDocument[];
|
|
42
42
|
bankDetails: IBankDetails;
|
|
43
|
+
partnersIds?: string[];
|
|
44
|
+
type: VENDOR_COMPANY_TYPE;
|
|
45
|
+
isActive?: boolean;
|
|
43
46
|
}
|
|
@@ -79,9 +79,3 @@ export { default as UserFinalResultModel } from './userFinalResultModel';
|
|
|
79
79
|
export { default as KipiverseContactFormModel } from './kipiverseContactFormModel';
|
|
80
80
|
export { default as vendorCompanyMetaModel } from './vendorCompanyMetaModel';
|
|
81
81
|
export { default as productMetaModel } from './productMetaModel';
|
|
82
|
-
export { default as AssessmentTestModel } from './assessmentTestModel';
|
|
83
|
-
export { default as SportInfoModel } from './sportInfoModel';
|
|
84
|
-
export { default as StudentSportTestModel } from './studentSportTestModel';
|
|
85
|
-
export { default as SportsAcademyModel } from './sportsAcademyModel';
|
|
86
|
-
export { default as UserAmenityModel } from './userAmenityModel';
|
|
87
|
-
export { default as UserAcademyMetaModel } from './userAcademyMetaModel';
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PollSelectionModel = exports.CreatePollModel = exports.SheetFieldMappingModel = exports.FileUploadUserDetails = exports.CompetitionUsersModel = exports.CompetitionGroupModel = exports.CompetitionModel = exports.CampusCarnivalModel = exports.AppointmentHistoryModel = exports.AppointmentModel = exports.SeatingArrangementModel = exports.AssignFileModel = exports.ThemeModel = exports.BDayWishModel = exports.AdditionalDetailModel = exports.CanteenModel = exports.WalletTransactionModel = exports.VideoAnalystModel = exports.UserSchoolMetaModel = exports.UserInstituteMetaModel = exports.UserDetailsModel = exports.UniqueNumberCounterModel = exports.TaskManagementModel = exports.SubscriptionPlanModel = exports.SubjectIndexModel = exports.ReplaceTeacherModel = exports.PlannerModel = exports.PhotosGalleryModel = exports.JobApplyModel = exports.InvoiceModel = exports.InquiryModel = exports.InformationSupportModel = exports.HolidayModel = exports.GenerateIdCardModel = exports.FeedBackModel = exports.FeeReminderTypeModel = exports.ExamModel = exports.ExamHasAnswerSheetModel = exports.ExamGroupModel = exports.EventModel = exports.DashboardManagementModel = exports.DailyBookModel = exports.ColumnModel = exports.CertificatesManagementModel = exports.CertificatesHistoryModel = exports.CareerModel = exports.BlogModel = exports.AttendanceModel = exports.ApprovalRequestModel = exports.connectMongoDb = void 0;
|
|
7
|
-
exports.
|
|
7
|
+
exports.productMetaModel = exports.vendorCompanyMetaModel = exports.KipiverseContactFormModel = exports.UserFinalResultModel = exports.RmsDigitalResourceAccessModel = exports.RmsDigitalResourceModel = exports.RmsAmcContractModel = exports.RmsResourceDetailsModel = exports.RmsAuditLogModel = exports.OnlineLectureModel = exports.PastYearRecordTopperModel = exports.FeeSubmissionModel = exports.AdvertisementModel = exports.RoleHasPermissionModel = exports.CommunityMessageModel = exports.CommunityGroupMemberModel = exports.CommunityGroupModel = exports.OfferAndDiscountModel = exports.SubscriptionConfigurationModel = exports.ModulePriceModel = exports.PdcChequeConfigurationModel = exports.FinalMarkSheetModel = exports.MarkSheetConfigurationModel = exports.AppAnalyticsEventModel = exports.GrantAndDonationModel = exports.TicketRaiseModel = exports.EducationOfficerModel = exports.InstituteFeeModel = exports.SchoolFee1Model = exports.FeeConfigModel = exports.EventTemplatesModel = void 0;
|
|
8
8
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
9
9
|
const env_1 = require("../../configs/env");
|
|
10
10
|
const transformIdInQueryPlugin_1 = __importDefault(require("./plugin/transformIdInQueryPlugin"));
|
|
@@ -185,16 +185,3 @@ var vendorCompanyMetaModel_1 = require("./vendorCompanyMetaModel");
|
|
|
185
185
|
Object.defineProperty(exports, "vendorCompanyMetaModel", { enumerable: true, get: function () { return __importDefault(vendorCompanyMetaModel_1).default; } });
|
|
186
186
|
var productMetaModel_1 = require("./productMetaModel");
|
|
187
187
|
Object.defineProperty(exports, "productMetaModel", { enumerable: true, get: function () { return __importDefault(productMetaModel_1).default; } });
|
|
188
|
-
// Arena Module
|
|
189
|
-
var assessmentTestModel_1 = require("./assessmentTestModel");
|
|
190
|
-
Object.defineProperty(exports, "AssessmentTestModel", { enumerable: true, get: function () { return __importDefault(assessmentTestModel_1).default; } });
|
|
191
|
-
var sportInfoModel_1 = require("./sportInfoModel");
|
|
192
|
-
Object.defineProperty(exports, "SportInfoModel", { enumerable: true, get: function () { return __importDefault(sportInfoModel_1).default; } });
|
|
193
|
-
var studentSportTestModel_1 = require("./studentSportTestModel");
|
|
194
|
-
Object.defineProperty(exports, "StudentSportTestModel", { enumerable: true, get: function () { return __importDefault(studentSportTestModel_1).default; } });
|
|
195
|
-
var sportsAcademyModel_1 = require("./sportsAcademyModel");
|
|
196
|
-
Object.defineProperty(exports, "SportsAcademyModel", { enumerable: true, get: function () { return __importDefault(sportsAcademyModel_1).default; } });
|
|
197
|
-
var userAmenityModel_1 = require("./userAmenityModel");
|
|
198
|
-
Object.defineProperty(exports, "UserAmenityModel", { enumerable: true, get: function () { return __importDefault(userAmenityModel_1).default; } });
|
|
199
|
-
var userAcademyMetaModel_1 = require("./userAcademyMetaModel");
|
|
200
|
-
Object.defineProperty(exports, "UserAcademyMetaModel", { enumerable: true, get: function () { return __importDefault(userAcademyMetaModel_1).default; } });
|
|
@@ -72,16 +72,12 @@ const PhotosGalleryModelSchema = new mongoose_1.Schema({
|
|
|
72
72
|
},
|
|
73
73
|
instituteId: {
|
|
74
74
|
type: String,
|
|
75
|
-
required:
|
|
75
|
+
required: true,
|
|
76
76
|
},
|
|
77
77
|
academicCalendarId: {
|
|
78
78
|
type: String,
|
|
79
79
|
required: false,
|
|
80
80
|
},
|
|
81
|
-
sportsAcademyId: {
|
|
82
|
-
type: String,
|
|
83
|
-
required: false,
|
|
84
|
-
},
|
|
85
81
|
}, { timestamps: true, versionKey: false });
|
|
86
82
|
PhotosGalleryModelSchema.index({
|
|
87
83
|
instituteId: 1,
|
|
@@ -42,7 +42,7 @@ const ProductMetaSchema = new mongoose_1.Schema({
|
|
|
42
42
|
},
|
|
43
43
|
categoryId: {
|
|
44
44
|
type: String,
|
|
45
|
-
required:
|
|
45
|
+
required: false,
|
|
46
46
|
},
|
|
47
47
|
subCategoryId: {
|
|
48
48
|
type: String,
|
|
@@ -83,6 +83,14 @@ const ProductMetaSchema = new mongoose_1.Schema({
|
|
|
83
83
|
enum: Object.values(constants_1.PRODUCT_META_STATUS),
|
|
84
84
|
default: constants_1.PRODUCT_META_STATUS.ACTIVE,
|
|
85
85
|
},
|
|
86
|
+
description: {
|
|
87
|
+
type: String,
|
|
88
|
+
required: false,
|
|
89
|
+
},
|
|
90
|
+
shortDescription: {
|
|
91
|
+
type: String,
|
|
92
|
+
required: false,
|
|
93
|
+
},
|
|
86
94
|
createdBy: {
|
|
87
95
|
type: String,
|
|
88
96
|
},
|
|
@@ -153,6 +153,11 @@ const subscriptionPlanModelSchema = new mongoose_1.Schema({
|
|
|
153
153
|
type: Number,
|
|
154
154
|
required: false,
|
|
155
155
|
},
|
|
156
|
+
sellStatus: {
|
|
157
|
+
type: String,
|
|
158
|
+
default: app_1.PLAN_SELL_STATUS.AVAILABLE,
|
|
159
|
+
required: false,
|
|
160
|
+
},
|
|
156
161
|
}, {
|
|
157
162
|
timestamps: true,
|
|
158
163
|
versionKey: false,
|
|
@@ -137,7 +137,7 @@ const vendorCompanyMetaSchema = new mongoose_1.Schema({
|
|
|
137
137
|
},
|
|
138
138
|
address2: {
|
|
139
139
|
type: String,
|
|
140
|
-
required:
|
|
140
|
+
required: false,
|
|
141
141
|
},
|
|
142
142
|
area: {
|
|
143
143
|
type: String,
|
|
@@ -180,11 +180,25 @@ const vendorCompanyMetaSchema = new mongoose_1.Schema({
|
|
|
180
180
|
type: bankDetailsSchema,
|
|
181
181
|
required: true,
|
|
182
182
|
},
|
|
183
|
+
partnersIds: {
|
|
184
|
+
type: [String],
|
|
185
|
+
required: false,
|
|
186
|
+
},
|
|
183
187
|
status: {
|
|
184
188
|
type: String,
|
|
185
189
|
enum: Object.values(constants_1.VENDOR_COMPANY_META_STATUS),
|
|
186
190
|
default: constants_1.VENDOR_COMPANY_META_STATUS.PENDING,
|
|
187
191
|
},
|
|
192
|
+
type: {
|
|
193
|
+
type: String,
|
|
194
|
+
enum: Object.values(constants_1.VENDOR_COMPANY_TYPE),
|
|
195
|
+
required: true
|
|
196
|
+
},
|
|
197
|
+
isActive: {
|
|
198
|
+
type: Boolean,
|
|
199
|
+
required: false,
|
|
200
|
+
default: true,
|
|
201
|
+
},
|
|
188
202
|
createdBy: {
|
|
189
203
|
type: String,
|
|
190
204
|
},
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Model } from 'sequelize';
|
|
2
2
|
import { ISubCategoriesModelAttributes } from '../../interfaces/subCategoriesInterface';
|
|
3
3
|
import { TSubCategoriesModelCreationAttributes } from '../../types/subCategoryType';
|
|
4
|
-
import { COMMAN_STATUS } from '../../constants/app';
|
|
4
|
+
import { CATEGORY_TYPE, COMMAN_STATUS } from '../../constants/app';
|
|
5
5
|
declare class SubCategoriesModel extends Model<ISubCategoriesModelAttributes, TSubCategoriesModelCreationAttributes> {
|
|
6
6
|
id: string;
|
|
7
7
|
name: string;
|
|
8
8
|
status: COMMAN_STATUS;
|
|
9
9
|
instituteId?: string;
|
|
10
|
+
type?: CATEGORY_TYPE;
|
|
10
11
|
createdBy: string;
|
|
11
12
|
updatedBy: string;
|
|
12
13
|
deletedBy: string;
|