@kipicore/dbcore 1.1.711 → 1.1.713
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/joiSchemaBuilder.js +2 -14
- package/dist/constants/app.d.ts +4 -0
- package/dist/constants/app.js +11 -6
- package/dist/db/psql/migrations/20260806100100-add_type_to_facility_masters.d.ts +2 -0
- package/dist/db/psql/migrations/20260806100100-add_type_to_facility_masters.js +12 -0
- package/dist/helpers/apiError.d.ts +12 -0
- package/dist/helpers/apiError.js +16 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +2 -0
- package/dist/helpers/telegramNotification.d.ts +1 -0
- package/dist/helpers/telegramNotification.js +48 -0
- package/dist/interfaces/facilityMasterInterface.d.ts +2 -1
- package/dist/interfaces/userAmenityInterface.d.ts +4 -3
- package/dist/interfaces/userInstituteMetaInterface.d.ts +1 -0
- package/dist/models/mongodb/sportDataApproveModel.js +1 -1
- package/dist/models/mongodb/sportInfoModel.js +1 -1
- package/dist/models/mongodb/sportsAcademyModel.js +1 -1
- package/dist/models/mongodb/studentSportTestModel.js +1 -1
- package/dist/models/mongodb/userAcademyMetaModel.js +1 -1
- package/dist/models/mongodb/userAmenityModel.js +10 -9
- package/dist/models/mongodb/userInstituteMetaModel.js +5 -1
- package/dist/models/psql/facilityMasterModel.d.ts +2 -1
- package/dist/models/psql/facilityMasterModel.js +4 -0
- package/dist/types/commonType.d.ts +88 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/package.json +3 -1
|
@@ -6,19 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.buildSchema = void 0;
|
|
7
7
|
const joi_1 = __importDefault(require("joi"));
|
|
8
8
|
const httpStatusCode_1 = require("../constants/httpStatusCode");
|
|
9
|
-
|
|
10
|
-
constructor(statusCode, message, isOperational = true, stack = '') {
|
|
11
|
-
super(message);
|
|
12
|
-
this.statusCode = statusCode;
|
|
13
|
-
this.isOperational = isOperational;
|
|
14
|
-
if (stack) {
|
|
15
|
-
this.stack = stack;
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
Error.captureStackTrace(this, this.constructor);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
9
|
+
const helpers_1 = require("../helpers");
|
|
22
10
|
// GENERIC BUILDER
|
|
23
11
|
const buildSchema = (base, rules = {}) => {
|
|
24
12
|
let schema = base;
|
|
@@ -62,7 +50,7 @@ class BaseValidator {
|
|
|
62
50
|
const { error, value } = schema.validate({ ...req.body, ...req.query, ...req.params }, { ...defaultOptions, ...options });
|
|
63
51
|
if (error) {
|
|
64
52
|
const errorMessage = error.details.map(d => d.message).join(', ');
|
|
65
|
-
throw new ApiError(httpStatusCode_1.HTTP_STATUS_CODE.BAD_REQUEST, errorMessage);
|
|
53
|
+
throw new helpers_1.ApiError(httpStatusCode_1.HTTP_STATUS_CODE.BAD_REQUEST, errorMessage);
|
|
66
54
|
}
|
|
67
55
|
req.body = value;
|
|
68
56
|
}
|
package/dist/constants/app.d.ts
CHANGED
|
@@ -394,6 +394,10 @@ export declare enum FACILITY_TYPE {
|
|
|
394
394
|
BUILDING = "BUILDING",
|
|
395
395
|
CO_INFRA = "CO_INFRA"
|
|
396
396
|
}
|
|
397
|
+
export declare enum FACILITY_MASTER_TYPE {
|
|
398
|
+
FACILITY = "FACILITY",
|
|
399
|
+
AMENITY = "AMENITY"
|
|
400
|
+
}
|
|
397
401
|
export declare enum FEED_BACK_TYPE {
|
|
398
402
|
SUGGESTION = "SUGGESTION",
|
|
399
403
|
COMPLAINT = "COMPLAINT",
|
package/dist/constants/app.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OFFER_NAME = exports.OFFER_TYPE = exports.INSTITUTE_STATUS = exports.FEE_PAYMENT_STATUS = exports.STUDENT_FEE_COLLECTION_STATUS = exports.PAYMENT_TYPE = exports.FEE_TYPE_FREQUENCY = exports.FEE_REMINDER_SETTING_FREQUENCY = exports.FEE_REMINDER_SETTING_TYPE = exports.TERM_DURATION = exports.FEE_REMINDER_SETTING_STATUS = exports.GREETING_TYPE = exports.TRIP_TYPE = exports.USER_COURSE_STATUS = exports.OFFER_COMMAND_STATUS = exports.LOCATION_TYPE = exports.RMS_AMC_SERVICE_STATUS = exports.RELATION = exports.RMS_AMC_CONTRACT_STATUS = exports.RMS_BUDGET_STATUS = exports.RMS_FACILITY_STATUS = exports.PLAN_SELL_STATUS = exports.AMENITY_STATUS = exports.COMMAN_STATUS = exports.TOKEN_TYPES = exports.SUB_USER_TYPES = exports.USER_TYPES = exports.ACADEMIC_CALENDARS_TYPE = exports.RETURN_STATUS = exports.ASSIGN_TYPE = exports.GENDER = exports.SCHOOL_SUB_TYPE = exports.SCHOOL_TYPE = exports.ATTENDANCE_TYPE = exports.ATTENDANCE_STATUS = exports.USER_INVENTORY_ACTION = exports.INVENTORY_TYPE = exports.USER_STATUS = exports.PDF_MICRO_SERVICE_END_POINT = exports.MOBILE_VERIFICATION = exports.EMAIL_VERIFICATION = exports.PAGINATION_UPDATE_ORDER = exports.PAGINATION_ORDER = exports.DEFAULT_BATCH_TITLE = exports.DEFAULT_CLASS_ROOM_TITLE = exports.PAGINATION = exports.USER_INSTITUTE_META_STATUS_REJECTED_COUNT = exports.ONE_THOUSAND = exports.ONE_HUNDRED = exports.SIXTY = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.HEALTH_TEMPLATE_MODEL_TYPE = exports.MSG_FROM_TYPE = exports.AI_MODEL_KEY_TYPES = exports.AI_MODEL_KEYS = exports.CATEGORY_TYPE = exports.STUDENT_SPORT_TEST_STATUS = exports.ASSESSMENT_TEST_STATUS = void 0;
|
|
4
|
+
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.SPORT_DATA_ACTION = exports.SPORT_DATA_MODULE = exports.SPORT_DATA_APPROVAL_STATUS = 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_MASTER_TYPE = exports.FACILITY_TYPE = exports.EMPLOYMENT_TYPE = exports.PRODUCT_META_STATUS = exports.VENDOR_COMPANY_TYPE = exports.VENDOR_COMPANY_META_STATUS = exports.USER_ACADEMY_META_STATUS = 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 = exports.WORKIN_DAY_STATUS = exports.LEAVE_STATUS = exports.LEAVE = exports.LEAVE_TYPE = exports.OFFER_STATUS = exports.OFFER_CONDITION_TYPE = exports.OFFER_CATEGORY = exports.OFFER_APPLICABLE_TO = void 0;
|
|
5
|
+
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 = 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 = void 0;
|
|
6
|
+
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 = exports.DISCOUNT_TYPE = exports.CONTACT_FEED_BACK_TYPE = exports.PLANNER_SYNC_STATUS = exports.RMS_NOTIFICATION_DAYS = 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 = void 0;
|
|
7
|
+
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 = 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 = void 0;
|
|
8
|
+
exports.APK_TYPE = exports.AccountAuditAction = exports.AccountBudgetType = exports.AccountTaxDirection = exports.AccountFundType = exports.AccountSyncAction = exports.AccountIntegrationProvider = exports.AccountApprovalActionType = exports.AccountDepreciationMethod = exports.AccountMatchStatus = exports.AccountExpensePaymentStatus = exports.AccountPaymentMode = exports.AccountVoucherTypeCode = exports.AccountCostCenterRefType = exports.AccountCostCenterType = exports.AccountPartyMode = exports.AccountPartyType = exports.AccountSourceModule = exports.AccountPostingEventStatus = exports.AccountBalanceType = exports.AccountApprovalStatus = exports.AccountVoucherStatus = exports.AccountLedgerType = exports.AccountNormalBalance = exports.AccountNature = exports.CONTACT_INTEREST_STATUS = exports.CONTACT_INTEREST_TYPE = exports.RMS_EXPENSE_TYPE = exports.RMS_DIGITAL_STATUS = exports.RMS_BOOKING_STATUS = exports.RMS_TICKET_PRIORITY = exports.RMS_TICKET_STATUS = exports.REFUND_ENTITY_TYPE = exports.REFUND_STATUS = 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.RMS_ASSET_CONDITION = exports.CERTIFICATE_REQUEST_TYPE = exports.CERTIFICATE_REQUEST_STATUS = void 0;
|
|
9
|
+
exports.HEALTH_TEMPLATE_MODEL_TYPE = exports.MSG_FROM_TYPE = exports.AI_MODEL_KEY_TYPES = exports.AI_MODEL_KEYS = exports.CATEGORY_TYPE = exports.STUDENT_SPORT_TEST_STATUS = exports.ASSESSMENT_TEST_STATUS = exports.BETTER_VALUE_TYPE = void 0;
|
|
10
10
|
const env_1 = require("../configs/env");
|
|
11
11
|
exports.SIXTY = 60;
|
|
12
12
|
exports.ONE_HUNDRED = 100;
|
|
@@ -478,6 +478,11 @@ var FACILITY_TYPE;
|
|
|
478
478
|
FACILITY_TYPE["BUILDING"] = "BUILDING";
|
|
479
479
|
FACILITY_TYPE["CO_INFRA"] = "CO_INFRA";
|
|
480
480
|
})(FACILITY_TYPE || (exports.FACILITY_TYPE = FACILITY_TYPE = {}));
|
|
481
|
+
var FACILITY_MASTER_TYPE;
|
|
482
|
+
(function (FACILITY_MASTER_TYPE) {
|
|
483
|
+
FACILITY_MASTER_TYPE["FACILITY"] = "FACILITY";
|
|
484
|
+
FACILITY_MASTER_TYPE["AMENITY"] = "AMENITY";
|
|
485
|
+
})(FACILITY_MASTER_TYPE || (exports.FACILITY_MASTER_TYPE = FACILITY_MASTER_TYPE = {}));
|
|
481
486
|
var FEED_BACK_TYPE;
|
|
482
487
|
(function (FEED_BACK_TYPE) {
|
|
483
488
|
FEED_BACK_TYPE["SUGGESTION"] = "SUGGESTION";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
module.exports = {
|
|
3
|
+
async up(queryInterface, Sequelize) {
|
|
4
|
+
await queryInterface.addColumn('facility_masters', 'type', {
|
|
5
|
+
type: Sequelize.STRING,
|
|
6
|
+
allowNull: true,
|
|
7
|
+
});
|
|
8
|
+
},
|
|
9
|
+
async down(queryInterface) {
|
|
10
|
+
await queryInterface.removeColumn('facility_masters', 'type');
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const ApiError: {
|
|
2
|
+
new (statusCode: number, message: string | undefined, isOperational?: boolean, stack?: string): {
|
|
3
|
+
statusCode: number;
|
|
4
|
+
isOperational: boolean;
|
|
5
|
+
name: string;
|
|
6
|
+
message: string;
|
|
7
|
+
stack?: string;
|
|
8
|
+
};
|
|
9
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
10
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
11
|
+
stackTraceLimit: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiError = void 0;
|
|
4
|
+
const ApiError = class extends Error {
|
|
5
|
+
constructor(statusCode, message, isOperational = true, stack = '') {
|
|
6
|
+
super(message);
|
|
7
|
+
this.statusCode = statusCode;
|
|
8
|
+
this.isOperational = isOperational;
|
|
9
|
+
if (stack !== '') {
|
|
10
|
+
this.stack = stack;
|
|
11
|
+
}
|
|
12
|
+
else
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.ApiError = ApiError;
|
package/dist/helpers/index.d.ts
CHANGED
package/dist/helpers/index.js
CHANGED
|
@@ -19,3 +19,5 @@ __exportStar(require("./utils"), exports);
|
|
|
19
19
|
__exportStar(require("./sendEmail"), exports);
|
|
20
20
|
__exportStar(require("./sendNotification"), exports);
|
|
21
21
|
__exportStar(require("./sendSMS"), exports);
|
|
22
|
+
__exportStar(require("./telegramNotification"), exports);
|
|
23
|
+
__exportStar(require("./apiError"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sendErrorNotification: (errorType: string, errorMessage: string, endpoint: string, requestBody: any, headersData: any) => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
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.sendErrorNotification = void 0;
|
|
7
|
+
/* eslint-disable camelcase */
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
9
|
+
const node_telegram_bot_api_1 = __importDefault(require("node-telegram-bot-api"));
|
|
10
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
11
|
+
dotenv_1.default.config();
|
|
12
|
+
const BOT_TOKEN = process.env.BOT_TOKEN || '';
|
|
13
|
+
const ADMIN_CHAT_ID = process.env.ADMIN_CHAT_ID || '';
|
|
14
|
+
const bot = new node_telegram_bot_api_1.default(BOT_TOKEN, { polling: false });
|
|
15
|
+
const sendErrorNotification = (errorType, errorMessage, endpoint, requestBody, headersData) => {
|
|
16
|
+
const formattedMessage = `
|
|
17
|
+
⚠️ **ERROR NOTIFICATION** ⚠️
|
|
18
|
+
|
|
19
|
+
🕒 **Time:** \`${new Date().toLocaleString('en-IN', { timeZone: 'Asia/Kolkata' })}\`
|
|
20
|
+
|
|
21
|
+
❗ **Error Type:** \`${errorType.toUpperCase()}\`
|
|
22
|
+
📜 **Message:** \`${errorMessage}\`
|
|
23
|
+
|
|
24
|
+
🛠️ **Endpoint:** \`${endpoint}\`
|
|
25
|
+
|
|
26
|
+
📬 **Headers Data:**
|
|
27
|
+
\`\`\`json
|
|
28
|
+
${JSON.stringify(headersData, null, 2)}
|
|
29
|
+
\`\`\`
|
|
30
|
+
|
|
31
|
+
📩 **Request Body:**
|
|
32
|
+
\`\`\`json
|
|
33
|
+
${JSON.stringify(requestBody, null, 2)}
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
📌 **Take Action ASAP!**
|
|
37
|
+
`;
|
|
38
|
+
bot.sendMessage(ADMIN_CHAT_ID, formattedMessage, {
|
|
39
|
+
parse_mode: 'Markdown',
|
|
40
|
+
})
|
|
41
|
+
.then(() => {
|
|
42
|
+
console.log('Error notification sent to Telegram successfully.');
|
|
43
|
+
})
|
|
44
|
+
.catch((err) => {
|
|
45
|
+
console.error(`Failed to send error notification: ${err}`);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.sendErrorNotification = sendErrorNotification;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMMAN_STATUS } from '../constants/app';
|
|
1
|
+
import { COMMAN_STATUS, FACILITY_MASTER_TYPE } from '../constants/app';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
3
|
export interface IFacilityMasterModelAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
@@ -6,4 +6,5 @@ export interface IFacilityMasterModelAttributes extends IDefaultAttributes {
|
|
|
6
6
|
code: string;
|
|
7
7
|
categoryId: string;
|
|
8
8
|
status: COMMAN_STATUS;
|
|
9
|
+
type: FACILITY_MASTER_TYPE;
|
|
9
10
|
}
|
|
@@ -2,10 +2,12 @@ import { Document } from 'mongoose';
|
|
|
2
2
|
import { AMENITY_STATUS } from '../constants/app';
|
|
3
3
|
import { IDefaultAttributes } from './commonInterface';
|
|
4
4
|
export interface IUserAmenityFacilityDetail {
|
|
5
|
+
sportId: string;
|
|
5
6
|
facilityMasterId: string;
|
|
6
|
-
count: number;
|
|
7
7
|
description?: string;
|
|
8
|
-
|
|
8
|
+
amenityIds?: string[];
|
|
9
|
+
facilityName: string;
|
|
10
|
+
status: AMENITY_STATUS;
|
|
9
11
|
}
|
|
10
12
|
export interface IUserAmenityModelAttributes extends IDefaultAttributes, Document {
|
|
11
13
|
id: string;
|
|
@@ -19,6 +21,5 @@ export interface IUserAmenityModelAttributes extends IDefaultAttributes, Documen
|
|
|
19
21
|
country?: number;
|
|
20
22
|
images?: string[];
|
|
21
23
|
ownerId?: string;
|
|
22
|
-
status: AMENITY_STATUS;
|
|
23
24
|
facilities?: IUserAmenityFacilityDetail[];
|
|
24
25
|
}
|
|
@@ -63,6 +63,7 @@ export interface IUserInstituteMetaAttributes extends IDefaultAttributes, Docume
|
|
|
63
63
|
designationId?: string;
|
|
64
64
|
studentProfileImage?: string;
|
|
65
65
|
selectedSportsIds?: string[];
|
|
66
|
+
isEligibleForAdvanceTest?: boolean;
|
|
66
67
|
}
|
|
67
68
|
export interface IUserWiseData {
|
|
68
69
|
userId: string;
|
|
@@ -113,5 +113,5 @@ const sportDataApproveSchema = new mongoose_1.Schema({
|
|
|
113
113
|
versionKey: false,
|
|
114
114
|
});
|
|
115
115
|
sportDataApproveSchema.index({ moduleType: 1, status: 1 });
|
|
116
|
-
const SportDataApproveModel = mongoose_1.default.model('sportDataApprove', sportDataApproveSchema, 'sport_data_approves');
|
|
116
|
+
const SportDataApproveModel = mongoose_1.default.models['sportDataApprove'] || mongoose_1.default.model('sportDataApprove', sportDataApproveSchema, 'sport_data_approves');
|
|
117
117
|
exports.default = SportDataApproveModel;
|
|
@@ -73,5 +73,5 @@ const sportInfoSchema = new mongoose_1.Schema({
|
|
|
73
73
|
timestamps: true,
|
|
74
74
|
versionKey: false,
|
|
75
75
|
});
|
|
76
|
-
const SportInfoModel = mongoose_1.default.model('sportInfo', sportInfoSchema, 'sport_infos');
|
|
76
|
+
const SportInfoModel = mongoose_1.default.models['sportInfo'] || mongoose_1.default.model('sportInfo', sportInfoSchema, 'sport_infos');
|
|
77
77
|
exports.default = SportInfoModel;
|
|
@@ -85,5 +85,5 @@ const sportsAcademySchema = new mongoose_1.Schema({
|
|
|
85
85
|
versionKey: false,
|
|
86
86
|
virtuals: true,
|
|
87
87
|
});
|
|
88
|
-
const SportsAcademyModel = mongoose_1.default.model('sportsacademy', sportsAcademySchema);
|
|
88
|
+
const SportsAcademyModel = mongoose_1.default.models['sportsacademy'] || mongoose_1.default.model('sportsacademy', sportsAcademySchema);
|
|
89
89
|
exports.default = SportsAcademyModel;
|
|
@@ -64,5 +64,5 @@ const studentSportTestSchema = new mongoose_1.Schema({
|
|
|
64
64
|
versionKey: false,
|
|
65
65
|
virtuals: true,
|
|
66
66
|
});
|
|
67
|
-
const StudentSportTestModel = mongoose_1.default.model('studentSportTest', studentSportTestSchema);
|
|
67
|
+
const StudentSportTestModel = mongoose_1.default.models['studentSportTest'] || mongoose_1.default.model('studentSportTest', studentSportTestSchema);
|
|
68
68
|
exports.default = StudentSportTestModel;
|
|
@@ -105,5 +105,5 @@ userAcademyMetaSchema.index({
|
|
|
105
105
|
userType: 1,
|
|
106
106
|
status: 1,
|
|
107
107
|
});
|
|
108
|
-
const UserAcademyMeta = mongoose_1.default.model('userAcademyMeta', userAcademyMetaSchema);
|
|
108
|
+
const UserAcademyMeta = mongoose_1.default.models['userAcademyMeta'] || mongoose_1.default.model('userAcademyMeta', userAcademyMetaSchema);
|
|
109
109
|
exports.default = UserAcademyMeta;
|
|
@@ -46,18 +46,19 @@ const userAmenitySchema = new mongoose_1.Schema({
|
|
|
46
46
|
country: { type: Number, required: false },
|
|
47
47
|
images: { type: [String], required: false },
|
|
48
48
|
ownerId: { type: String, required: false },
|
|
49
|
-
status: {
|
|
50
|
-
type: String,
|
|
51
|
-
enum: Object.values(app_1.AMENITY_STATUS),
|
|
52
|
-
default: app_1.AMENITY_STATUS.ACTIVE,
|
|
53
|
-
required: true,
|
|
54
|
-
},
|
|
55
49
|
facilities: [
|
|
56
50
|
{
|
|
51
|
+
sportId: { type: String, required: true },
|
|
57
52
|
facilityMasterId: { type: String, required: true },
|
|
58
|
-
count: { type: Number, required: true },
|
|
59
53
|
description: { type: String, required: false },
|
|
60
|
-
|
|
54
|
+
amenityIds: { type: [String], required: false, default: [] },
|
|
55
|
+
facilityName: { type: String, required: true },
|
|
56
|
+
status: {
|
|
57
|
+
type: String,
|
|
58
|
+
enum: Object.values(app_1.AMENITY_STATUS),
|
|
59
|
+
default: app_1.AMENITY_STATUS.ACTIVE,
|
|
60
|
+
required: true,
|
|
61
|
+
},
|
|
61
62
|
},
|
|
62
63
|
],
|
|
63
64
|
createdBy: { type: String, required: false },
|
|
@@ -69,5 +70,5 @@ const userAmenitySchema = new mongoose_1.Schema({
|
|
|
69
70
|
versionKey: false,
|
|
70
71
|
virtuals: true,
|
|
71
72
|
});
|
|
72
|
-
const UserAmenityModel = mongoose_1.default.model('useramenity', userAmenitySchema);
|
|
73
|
+
const UserAmenityModel = mongoose_1.default.models['useramenity'] || mongoose_1.default.model('useramenity', userAmenitySchema);
|
|
73
74
|
exports.default = UserAmenityModel;
|
|
@@ -248,7 +248,11 @@ const userInstituteMetaSchema = new mongoose_1.Schema({
|
|
|
248
248
|
selectedSportsIds: {
|
|
249
249
|
type: [String],
|
|
250
250
|
default: [],
|
|
251
|
-
}
|
|
251
|
+
},
|
|
252
|
+
isEligibleForAdvanceTest: {
|
|
253
|
+
type: Boolean,
|
|
254
|
+
default: false,
|
|
255
|
+
},
|
|
252
256
|
}, {
|
|
253
257
|
timestamps: true,
|
|
254
258
|
versionKey: false,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Model } from 'sequelize';
|
|
2
2
|
import { IFacilityMasterModelAttributes } from '../../interfaces/facilityMasterInterface';
|
|
3
3
|
import { TFacilityMasterModelCreationAttributes } from '../../types/facilityMasterType';
|
|
4
|
-
import { COMMAN_STATUS } from '../../constants/app';
|
|
4
|
+
import { COMMAN_STATUS, FACILITY_MASTER_TYPE } from '../../constants/app';
|
|
5
5
|
export default class FacilityMasterModel extends Model<IFacilityMasterModelAttributes, TFacilityMasterModelCreationAttributes> {
|
|
6
6
|
id: string;
|
|
7
7
|
name: string;
|
|
8
8
|
code: string;
|
|
9
9
|
categoryId: string;
|
|
10
10
|
status: COMMAN_STATUS;
|
|
11
|
+
type?: FACILITY_MASTER_TYPE;
|
|
11
12
|
createdBy?: string;
|
|
12
13
|
updatedBy?: string;
|
|
13
14
|
deletedBy?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import { APP_TYPE } from '../constants/app';
|
|
2
|
+
import { APP_TYPE, SOCKET_EVENTS } from '../constants/app';
|
|
3
3
|
export type TCustomHeaders = {
|
|
4
4
|
appType?: APP_TYPE;
|
|
5
5
|
token?: string;
|
|
@@ -35,3 +35,90 @@ export interface CrudValidatorRules<TField> {
|
|
|
35
35
|
getById?: SchemaRules<TField>;
|
|
36
36
|
delete?: SchemaRules<TField>;
|
|
37
37
|
}
|
|
38
|
+
export type TApiResponse = {
|
|
39
|
+
statusCode: number;
|
|
40
|
+
status: boolean;
|
|
41
|
+
message: string;
|
|
42
|
+
data?: [] | object | null;
|
|
43
|
+
dataDetails?: [] | object | null;
|
|
44
|
+
error?: string | [] | object;
|
|
45
|
+
};
|
|
46
|
+
export type TPaginastionOptions<T> = {
|
|
47
|
+
limit: number | undefined;
|
|
48
|
+
totalRecords: number;
|
|
49
|
+
totalPages: number;
|
|
50
|
+
hasPreviousPage: boolean;
|
|
51
|
+
hasNextPage: boolean;
|
|
52
|
+
currentPage: number;
|
|
53
|
+
recordList?: T[];
|
|
54
|
+
};
|
|
55
|
+
export type TPdfOption = {
|
|
56
|
+
data: any;
|
|
57
|
+
templateName: string;
|
|
58
|
+
customPath?: string;
|
|
59
|
+
customPdfOptions?: object;
|
|
60
|
+
customFileName?: string;
|
|
61
|
+
customstoragePath?: string;
|
|
62
|
+
isNotNeedToReadFile?: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type TChangePassword = {
|
|
65
|
+
userId?: number;
|
|
66
|
+
oldPassword: string;
|
|
67
|
+
newPassword: string;
|
|
68
|
+
};
|
|
69
|
+
export type TWhereOptions<T> = {
|
|
70
|
+
[P in keyof T]?: {
|
|
71
|
+
eq?: T[P];
|
|
72
|
+
ne?: T[P];
|
|
73
|
+
gte?: T[P];
|
|
74
|
+
gt?: T[P];
|
|
75
|
+
lte?: T[P];
|
|
76
|
+
lt?: T[P];
|
|
77
|
+
is?: T[P];
|
|
78
|
+
notIn?: T[P][];
|
|
79
|
+
in?: T[P][];
|
|
80
|
+
like?: string;
|
|
81
|
+
notLike?: string;
|
|
82
|
+
iLike?: string;
|
|
83
|
+
notILike?: string;
|
|
84
|
+
startsWith?: string;
|
|
85
|
+
endsWith?: string;
|
|
86
|
+
substring?: string;
|
|
87
|
+
regexp?: string;
|
|
88
|
+
notRegexp?: string;
|
|
89
|
+
iRegexp?: string;
|
|
90
|
+
notIRegexp?: string;
|
|
91
|
+
between?: [T[P], T[P]];
|
|
92
|
+
notBetween?: [T[P], T[P]];
|
|
93
|
+
overlap?: T[P][];
|
|
94
|
+
contains?: T[P][];
|
|
95
|
+
contained?: T[P][];
|
|
96
|
+
adjacent?: T[P][];
|
|
97
|
+
strictLeft?: T[P][];
|
|
98
|
+
strictRight?: T[P][];
|
|
99
|
+
noExtendRight?: T[P][];
|
|
100
|
+
noExtendLeft?: T[P][];
|
|
101
|
+
and?: TWhereOptions<T>[];
|
|
102
|
+
or?: TWhereOptions<T>[];
|
|
103
|
+
not?: TWhereOptions<T>;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
export type TSocketEventPayload = {
|
|
107
|
+
eventName?: SOCKET_EVENTS;
|
|
108
|
+
payload: {
|
|
109
|
+
event: SOCKET_EVENTS;
|
|
110
|
+
data: any;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
export type socketPayload = {
|
|
114
|
+
event: SOCKET_EVENTS;
|
|
115
|
+
data: any;
|
|
116
|
+
};
|
|
117
|
+
export interface CrudValidatorRules<TField> {
|
|
118
|
+
create?: SchemaRules<TField>;
|
|
119
|
+
update?: SchemaRules<TField>;
|
|
120
|
+
getAll?: SchemaRules<TField>;
|
|
121
|
+
getAllWithPagination?: SchemaRules<TField>;
|
|
122
|
+
getById?: SchemaRules<TField>;
|
|
123
|
+
delete?: SchemaRules<TField>;
|
|
124
|
+
}
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -282,3 +282,4 @@ __exportStar(require("./sportDataApproveType"), exports);
|
|
|
282
282
|
__exportStar(require("./healthCheckupVisitType"), exports);
|
|
283
283
|
__exportStar(require("./healthCheckupTemplateType"), exports);
|
|
284
284
|
__exportStar(require("./healthCheckupRecordType"), exports);
|
|
285
|
+
__exportStar(require("./commonType"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kipicore/dbcore",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.713",
|
|
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",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"ioredis": "^5.11.1",
|
|
53
53
|
"joi": "^18.0.1",
|
|
54
54
|
"mongoose": "^8.5.2",
|
|
55
|
+
"node-telegram-bot-api": "^1.2.0",
|
|
55
56
|
"pg": "^8.12.0",
|
|
56
57
|
"sequelize": "^6.37.3",
|
|
57
58
|
"uuid": "^8.3.2",
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
"@types/express": "^5.0.6",
|
|
65
66
|
"@types/mongoose": "^5.11.97",
|
|
66
67
|
"@types/node": "^24.5.2",
|
|
68
|
+
"@types/node-telegram-bot-api": "^0.64.15",
|
|
67
69
|
"@types/sequelize": "^4.28.14",
|
|
68
70
|
"country-state-city": "^3.2.1",
|
|
69
71
|
"eslint": "^9.17.0",
|