@kipicore/dbcore 1.1.19 → 1.1.21
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/.sequelizerc +13 -0
- package/dist/.sequelizerc +13 -0
- package/dist/configs/aws.js +4 -4
- package/dist/configs/index.d.ts +2 -0
- package/dist/configs/index.js +18 -0
- package/dist/constants/app.js +13 -13
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.js +21 -0
- package/dist/constants/successMessages.d.ts +1 -1
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +18 -0
- package/dist/helpers/s3Uploader.d.ts +1 -1
- package/dist/helpers/s3Uploader.js +6 -6
- package/dist/helpers/utils.d.ts +3 -3
- package/dist/helpers/utils.js +4 -4
- package/dist/index.d.ts +17 -419
- package/dist/index.js +30 -755
- package/dist/interfaces/academicCalendarInterface.d.ts +2 -2
- package/dist/interfaces/accountHasReceiptDetailsInterface.d.ts +1 -1
- package/dist/interfaces/announcementInterface.d.ts +2 -2
- package/dist/interfaces/approvalRequestInterface.d.ts +2 -2
- package/dist/interfaces/attendanceInterface.d.ts +2 -2
- package/dist/interfaces/bankAccountDetailsInterface.d.ts +2 -2
- package/dist/interfaces/bannerInterface.d.ts +2 -2
- package/dist/interfaces/batchInterface.d.ts +2 -2
- package/dist/interfaces/batchSubjectBookAssessmentInterface.d.ts +1 -1
- package/dist/interfaces/batchSubjectProjectAssessmentInterface.d.ts +1 -1
- package/dist/interfaces/blogInterface.d.ts +2 -2
- package/dist/interfaces/bookAssessmentDateInterface.d.ts +2 -2
- package/dist/interfaces/careerInterface.d.ts +2 -2
- package/dist/interfaces/categoriesInterface.d.ts +2 -2
- package/dist/interfaces/certificatesHistoryInterface.d.ts +1 -1
- package/dist/interfaces/certificatesManagementInterface.d.ts +2 -2
- package/dist/interfaces/cityInterface.d.ts +1 -1
- package/dist/interfaces/classRoomInterface.d.ts +2 -2
- package/dist/interfaces/cloudStorageInterface.d.ts +2 -2
- package/dist/interfaces/coinPurchaseOfferInterface.d.ts +2 -2
- package/dist/interfaces/columnInterface.d.ts +2 -2
- package/dist/interfaces/contactFeedBackInterface.d.ts +2 -2
- package/dist/interfaces/countryInterface.d.ts +1 -1
- package/dist/interfaces/courseHasVisitorsInterface.d.ts +1 -1
- package/dist/interfaces/courseInterface.d.ts +2 -2
- package/dist/interfaces/dailyBookInterface.d.ts +1 -1
- package/dist/interfaces/dashboardManagementInterface.d.ts +2 -2
- package/dist/interfaces/driverInterface.d.ts +2 -2
- package/dist/interfaces/entityGroupInterface.d.ts +2 -2
- package/dist/interfaces/eventInterface.d.ts +2 -2
- package/dist/interfaces/examGroupInterface.d.ts +3 -3
- package/dist/interfaces/examHasAnswerSheetInterface.d.ts +2 -2
- package/dist/interfaces/examInterface.d.ts +2 -2
- package/dist/interfaces/facilityInterface.d.ts +2 -2
- package/dist/interfaces/featureActionInterface.d.ts +2 -2
- package/dist/interfaces/feeHistoryDetailsInterface.d.ts +2 -2
- package/dist/interfaces/feeHistoryInterface.d.ts +2 -2
- package/dist/interfaces/feeReminderInterface.d.ts +1 -1
- package/dist/interfaces/feeReminderSettingInterface.d.ts +2 -2
- package/dist/interfaces/feeReminderTypeInterface.d.ts +2 -2
- package/dist/interfaces/feeTypeHasTermsInterface.d.ts +2 -2
- package/dist/interfaces/feeTypeInterface.d.ts +2 -2
- package/dist/interfaces/feedBackInterface.d.ts +2 -2
- package/dist/interfaces/feesCollectionInterface.d.ts +2 -2
- package/dist/interfaces/fileStorageInterface.d.ts +2 -2
- package/dist/interfaces/floorManagementInterface.d.ts +2 -2
- package/dist/interfaces/generateIdCardInterface.d.ts +1 -1
- package/dist/interfaces/greetingsInterface.d.ts +2 -2
- package/dist/interfaces/holidayInterface.d.ts +2 -2
- package/dist/interfaces/homeworkInterface.d.ts +2 -2
- package/dist/interfaces/index.d.ts +137 -0
- package/dist/interfaces/index.js +153 -0
- package/dist/interfaces/informationSupportInterface.d.ts +2 -2
- package/dist/interfaces/inquiryInterface.d.ts +3 -3
- package/dist/interfaces/instituteEntityInterface.d.ts +2 -2
- package/dist/interfaces/instituteEntityTypeInterface.d.ts +2 -2
- package/dist/interfaces/instituteInterface.d.ts +2 -2
- package/dist/interfaces/instituteSubscriptionPlanInterface.d.ts +2 -2
- package/dist/interfaces/inventoryHistoryInterface.d.ts +2 -2
- package/dist/interfaces/inventoryInterface.d.ts +2 -2
- package/dist/interfaces/invoiceInterface.d.ts +2 -2
- package/dist/interfaces/jobApplyInterface.d.ts +2 -2
- package/dist/interfaces/lectureHistoryInterface.d.ts +2 -2
- package/dist/interfaces/lectureInterface.d.ts +2 -2
- package/dist/interfaces/masterLeaveInterface.d.ts +2 -2
- package/dist/interfaces/moduleFeatureInterface.d.ts +2 -2
- package/dist/interfaces/moduleInterface.d.ts +2 -2
- package/dist/interfaces/offersInterface.d.ts +2 -2
- package/dist/interfaces/paymentTermsInterface.d.ts +2 -2
- package/dist/interfaces/pdcChequeInterface.d.ts +2 -2
- package/dist/interfaces/pdcHistoryInterface.d.ts +2 -2
- package/dist/interfaces/photosGalleryInterface.d.ts +2 -2
- package/dist/interfaces/pincodeInterface.d.ts +1 -1
- package/dist/interfaces/plannerInterface.d.ts +2 -2
- package/dist/interfaces/productInterface.d.ts +2 -2
- package/dist/interfaces/projectAssessmentOptionInterface.d.ts +1 -1
- package/dist/interfaces/replaceTeacherInterface.d.ts +2 -2
- package/dist/interfaces/roleInterface.d.ts +4 -4
- package/dist/interfaces/rulesRegulationInterface.d.ts +2 -2
- package/dist/interfaces/schoolFeeCollectionInterface.d.ts +1 -1
- package/dist/interfaces/schoolFeeInterface.d.ts +2 -2
- package/dist/interfaces/schoolOfferInterface.d.ts +2 -2
- package/dist/interfaces/sendNotificationInerface.d.ts +2 -2
- package/dist/interfaces/slotInterface.d.ts +2 -2
- package/dist/interfaces/stateInterface.d.ts +1 -1
- package/dist/interfaces/subCategoriesInterface.d.ts +2 -2
- package/dist/interfaces/subjectHasFeeInterface.d.ts +1 -1
- package/dist/interfaces/subjectHasPayFeeHistoryInterface.d.ts +1 -1
- package/dist/interfaces/subjectIndexInterface.d.ts +2 -2
- package/dist/interfaces/subscriptionPlanInterface.d.ts +2 -2
- package/dist/interfaces/syllabusInterface.d.ts +2 -2
- package/dist/interfaces/taskManagementInterface.d.ts +2 -2
- package/dist/interfaces/testimonialInterface.d.ts +2 -2
- package/dist/interfaces/toDoInterface.d.ts +2 -2
- package/dist/interfaces/tokenInterface.d.ts +2 -2
- package/dist/interfaces/tripInterface.d.ts +2 -2
- package/dist/interfaces/typeManagementInterface.d.ts +2 -2
- package/dist/interfaces/uniqueNumberCounterInterface.d.ts +2 -2
- package/dist/interfaces/userBookAssessmentInterface.d.ts +2 -2
- package/dist/interfaces/userDetailsInterface.d.ts +2 -2
- package/dist/interfaces/userFeeTypeByAccountInterface.d.ts +2 -2
- package/dist/interfaces/userFeeTypeInterface.d.ts +2 -2
- package/dist/interfaces/userHasAnnouncementInterface.d.ts +2 -2
- package/dist/interfaces/userHasBatchInterface.d.ts +1 -1
- package/dist/interfaces/userHasCourseInterface.d.ts +2 -2
- package/dist/interfaces/userHasDeviceInterface.d.ts +2 -2
- package/dist/interfaces/userHasFeeTermsInterface.d.ts +2 -2
- package/dist/interfaces/userHasFileInterface.d.ts +2 -2
- package/dist/interfaces/userHasHomeWorkInterface.d.ts +2 -2
- package/dist/interfaces/userHasInventoryHistoryInterface.d.ts +2 -2
- package/dist/interfaces/userHasInventoryInterface.d.ts +2 -2
- package/dist/interfaces/userHasLeaveHistoryInterface.d.ts +2 -2
- package/dist/interfaces/userHasLeaveInterface.d.ts +2 -2
- package/dist/interfaces/userHasOfferInterface.d.ts +1 -1
- package/dist/interfaces/userHasParentInterface.d.ts +2 -2
- package/dist/interfaces/userHasRoleInterface.d.ts +2 -2
- package/dist/interfaces/userHasRollNumberInterface.d.ts +1 -1
- package/dist/interfaces/userHasStorageInterface.d.ts +2 -2
- package/dist/interfaces/userHasSubjectFeeInterface.d.ts +1 -1
- package/dist/interfaces/userInstituteMetaInterface.d.ts +2 -2
- package/dist/interfaces/userInterface.d.ts +2 -2
- package/dist/interfaces/userLeaveRequestInterface.d.ts +2 -2
- package/dist/interfaces/userMetaInterface.d.ts +2 -2
- package/dist/interfaces/userPayoutDetailsInterface.d.ts +2 -2
- package/dist/interfaces/userPayoutHistoryInterface.d.ts +2 -2
- package/dist/interfaces/userPayoutInterface.d.ts +2 -2
- package/dist/interfaces/userProjectAssessmentOptionInterface.d.ts +2 -2
- package/dist/interfaces/userRequiredStepsInterface.d.ts +2 -2
- package/dist/interfaces/userSchoolMetaInterface.d.ts +2 -2
- package/dist/interfaces/vehicleInterface.d.ts +2 -2
- package/dist/interfaces/vendorManagementInterface.d.ts +2 -2
- package/dist/interfaces/videoAnalystInterface.d.ts +1 -1
- package/dist/interfaces/walletHistoryInterface.d.ts +2 -2
- package/dist/interfaces/walletInterface.d.ts +2 -2
- package/dist/interfaces/walletTransactionInterface.d.ts +3 -3
- package/dist/interfaces/workingDayInterface.d.ts +2 -2
- package/dist/interfaces/workingShiftInterface.d.ts +2 -2
- package/dist/models/mongodb/approvalRequestModel.d.ts +1 -1
- package/dist/models/mongodb/approvalRequestModel.js +4 -4
- package/dist/models/mongodb/attendanceModel.d.ts +1 -1
- package/dist/models/mongodb/attendanceModel.js +23 -23
- package/dist/models/mongodb/blogModel.d.ts +1 -1
- package/dist/models/mongodb/blogModel.js +3 -3
- package/dist/models/mongodb/careerModel.d.ts +1 -1
- package/dist/models/mongodb/careerModel.js +3 -3
- package/dist/models/mongodb/certificatesHistoryModel.d.ts +1 -1
- package/dist/models/mongodb/certificatesManagementModel.d.ts +1 -1
- package/dist/models/mongodb/certificatesManagementModel.js +3 -3
- package/dist/models/mongodb/columnModel.d.ts +1 -1
- package/dist/models/mongodb/columnModel.js +5 -5
- package/dist/models/mongodb/dailyBookModel.d.ts +1 -1
- package/dist/models/mongodb/dashboardManagementModel.d.ts +1 -1
- package/dist/models/mongodb/dashboardManagementModel.js +6 -6
- package/dist/models/mongodb/eventModel.d.ts +1 -1
- package/dist/models/mongodb/eventModel.js +15 -15
- package/dist/models/mongodb/examGroupModel.d.ts +1 -1
- package/dist/models/mongodb/examGroupModel.js +18 -18
- package/dist/models/mongodb/examHasAnswerSheetModel.d.ts +1 -1
- package/dist/models/mongodb/examHasAnswerSheetModel.js +12 -12
- package/dist/models/mongodb/examModel.d.ts +1 -1
- package/dist/models/mongodb/examModel.js +28 -28
- package/dist/models/mongodb/feeReminderTypeModel.d.ts +1 -1
- package/dist/models/mongodb/feeReminderTypeModel.js +3 -3
- package/dist/models/mongodb/feedBackModel.d.ts +1 -1
- package/dist/models/mongodb/feedBackModel.js +3 -3
- package/dist/models/mongodb/generateIdCardModel.d.ts +1 -1
- package/dist/models/mongodb/holidayModel.d.ts +1 -1
- package/dist/models/mongodb/holidayModel.js +15 -15
- package/dist/models/mongodb/index.d.ts +36 -2
- package/dist/models/mongodb/index.js +60 -10
- package/dist/models/mongodb/informationSupportModel.d.ts +1 -1
- package/dist/models/mongodb/informationSupportModel.js +2 -2
- package/dist/models/mongodb/inquiryModel.d.ts +1 -1
- package/dist/models/mongodb/inquiryModel.js +18 -18
- package/dist/models/mongodb/invoiceModel.d.ts +1 -1
- package/dist/models/mongodb/invoiceModel.js +7 -7
- package/dist/models/mongodb/jobApplyModel.d.ts +1 -1
- package/dist/models/mongodb/jobApplyModel.js +7 -7
- package/dist/models/mongodb/photosGalleryModel.d.ts +1 -1
- package/dist/models/mongodb/photosGalleryModel.js +6 -6
- package/dist/models/mongodb/plannerModel.d.ts +1 -1
- package/dist/models/mongodb/plannerModel.js +3 -3
- package/dist/models/mongodb/replaceTeacherModel.d.ts +1 -1
- package/dist/models/mongodb/replaceTeacherModel.js +6 -6
- package/dist/models/mongodb/schoolFeeModel.d.ts +1 -1
- package/dist/models/mongodb/schoolFeeModel.js +12 -12
- package/dist/models/mongodb/subjectIndexModel.d.ts +1 -1
- package/dist/models/mongodb/subjectIndexModel.js +88 -88
- package/dist/models/mongodb/subscriptionPlanModel.d.ts +1 -1
- package/dist/models/mongodb/subscriptionPlanModel.js +6 -6
- package/dist/models/mongodb/taskManagementModel.d.ts +1 -1
- package/dist/models/mongodb/taskManagementModel.js +10 -10
- package/dist/models/mongodb/uniqueNumberCounterModel.d.ts +1 -1
- package/dist/models/mongodb/uniqueNumberCounterModel.js +3 -3
- package/dist/models/mongodb/userDetailsModel.d.ts +1 -1
- package/dist/models/mongodb/userDetailsModel.js +19 -19
- package/dist/models/mongodb/userInstituteMetaModel.d.ts +1 -1
- package/dist/models/mongodb/userInstituteMetaModel.js +14 -14
- package/dist/models/mongodb/userSchoolMetaModel.d.ts +1 -1
- package/dist/models/mongodb/userSchoolMetaModel.js +30 -30
- package/dist/models/mongodb/videoAnalystModel.d.ts +1 -1
- package/dist/models/mongodb/walletTransactionModel.d.ts +1 -1
- package/dist/models/mongodb/walletTransactionModel.js +12 -12
- package/dist/models/psql/SubCategoriesModel.d.ts +3 -3
- package/dist/models/psql/SubCategoriesModel.js +14 -14
- package/dist/models/psql/academicCalendarModel.d.ts +3 -3
- package/dist/models/psql/academicCalendarModel.js +13 -13
- package/dist/models/psql/accountHasReceiptDetailsModel.d.ts +2 -2
- package/dist/models/psql/accountHasReceiptDetailsModel.js +15 -15
- package/dist/models/psql/announcementModel.d.ts +3 -3
- package/dist/models/psql/announcementModel.js +30 -30
- package/dist/models/psql/areaModel.d.ts +2 -2
- package/dist/models/psql/areaModel.js +5 -5
- package/dist/models/psql/bankAccountDetailsModel.d.ts +3 -3
- package/dist/models/psql/bankAccountDetailsModel.js +16 -16
- package/dist/models/psql/bannerModel.d.ts +3 -3
- package/dist/models/psql/bannerModel.js +20 -20
- package/dist/models/psql/batchModel.d.ts +3 -3
- package/dist/models/psql/batchModel.js +27 -27
- package/dist/models/psql/batchSubjectBookAssessmentModel.d.ts +2 -2
- package/dist/models/psql/batchSubjectBookAssessmentModel.js +20 -20
- package/dist/models/psql/batchSubjectProjectAssessmentModel.d.ts +2 -2
- package/dist/models/psql/batchSubjectProjectAssessmentModel.js +17 -17
- package/dist/models/psql/bookAssessmentDateModel.d.ts +3 -3
- package/dist/models/psql/bookAssessmentDateModel.js +12 -12
- package/dist/models/psql/categoriesModel.d.ts +3 -3
- package/dist/models/psql/categoriesModel.js +11 -11
- package/dist/models/psql/cityModel.d.ts +1 -1
- package/dist/models/psql/cityModel.js +8 -8
- package/dist/models/psql/classRoomModel.d.ts +3 -3
- package/dist/models/psql/classRoomModel.js +18 -18
- package/dist/models/psql/cloudStorageModel.d.ts +3 -3
- package/dist/models/psql/cloudStorageModel.js +10 -10
- package/dist/models/psql/coinPurchaseOfferModel.d.ts +3 -3
- package/dist/models/psql/coinPurchaseOfferModel.js +10 -10
- package/dist/models/psql/contactFeedBackModel.d.ts +3 -3
- package/dist/models/psql/contactFeedBackModel.js +16 -16
- package/dist/models/psql/countryModel.d.ts +1 -1
- package/dist/models/psql/countryModel.js +2 -2
- package/dist/models/psql/courseHasVisitorsModel.d.ts +2 -2
- package/dist/models/psql/courseHasVisitorsModel.js +9 -9
- package/dist/models/psql/courseModel.d.ts +3 -3
- package/dist/models/psql/courseModel.js +18 -18
- package/dist/models/psql/driverModel.d.ts +3 -3
- package/dist/models/psql/driverModel.js +25 -25
- package/dist/models/psql/entityGroupModel.d.ts +3 -3
- package/dist/models/psql/entityGroupModel.js +12 -12
- package/dist/models/psql/facilityModel.d.ts +3 -3
- package/dist/models/psql/facilityModel.js +20 -20
- package/dist/models/psql/featureActionModel.d.ts +3 -3
- package/dist/models/psql/featureActionModel.js +10 -10
- package/dist/models/psql/feeHistoryDetailsModel.d.ts +3 -3
- package/dist/models/psql/feeHistoryDetailsModel.js +23 -23
- package/dist/models/psql/feeHistoryModel.d.ts +3 -3
- package/dist/models/psql/feeHistoryModel.js +49 -49
- package/dist/models/psql/feeReminderModel.d.ts +2 -2
- package/dist/models/psql/feeReminderModel.js +41 -41
- package/dist/models/psql/feeReminderSettingModel.d.ts +3 -3
- package/dist/models/psql/feeReminderSettingModel.js +14 -14
- package/dist/models/psql/feeTypeHasTermsModel.d.ts +3 -3
- package/dist/models/psql/feeTypeHasTermsModel.js +14 -14
- package/dist/models/psql/feeTypeModel.d.ts +3 -3
- package/dist/models/psql/feeTypeModel.js +24 -24
- package/dist/models/psql/feesCollectionModel.d.ts +3 -3
- package/dist/models/psql/feesCollectionModel.js +30 -30
- package/dist/models/psql/fileStorageModel.d.ts +2 -2
- package/dist/models/psql/fileStorageModel.js +8 -8
- package/dist/models/psql/floorManagementModel.d.ts +3 -3
- package/dist/models/psql/floorManagementModel.js +11 -11
- package/dist/models/psql/greetingsModel.d.ts +3 -3
- package/dist/models/psql/greetingsModel.js +17 -17
- package/dist/models/psql/homeWorkModel.d.ts +3 -3
- package/dist/models/psql/homeWorkModel.js +18 -18
- package/dist/models/psql/index.js +2 -2
- package/dist/models/psql/instituteEntityModel.d.ts +3 -3
- package/dist/models/psql/instituteEntityModel.js +14 -14
- package/dist/models/psql/instituteEntityTypeModel.d.ts +3 -3
- package/dist/models/psql/instituteEntityTypeModel.js +10 -10
- package/dist/models/psql/instituteModel.d.ts +3 -3
- package/dist/models/psql/instituteModel.js +30 -30
- package/dist/models/psql/instituteSubscriptionPlanModel.d.ts +3 -3
- package/dist/models/psql/instituteSubscriptionPlanModel.js +16 -16
- package/dist/models/psql/inventoryHistoryModel.d.ts +3 -3
- package/dist/models/psql/inventoryHistoryModel.js +20 -20
- package/dist/models/psql/inventoryModel.d.ts +3 -3
- package/dist/models/psql/inventoryModel.js +16 -16
- package/dist/models/psql/lectureHistoryModel.d.ts +3 -3
- package/dist/models/psql/lectureHistoryModel.js +33 -33
- package/dist/models/psql/lectureModel.d.ts +3 -3
- package/dist/models/psql/lectureModel.js +74 -74
- package/dist/models/psql/masterLeaveModel.d.ts +3 -3
- package/dist/models/psql/masterLeaveModel.js +23 -23
- package/dist/models/psql/modelIndex.d.ts +101 -0
- package/dist/models/psql/modelIndex.js +117 -0
- package/dist/models/psql/moduleFeatureModel.d.ts +3 -3
- package/dist/models/psql/moduleFeatureModel.js +12 -12
- package/dist/models/psql/moduleModel.d.ts +3 -3
- package/dist/models/psql/moduleModel.js +14 -14
- package/dist/models/psql/offerModel.d.ts +3 -3
- package/dist/models/psql/offerModel.js +16 -16
- package/dist/models/psql/paymentTermsModel.d.ts +2 -2
- package/dist/models/psql/paymentTermsModel.js +15 -15
- package/dist/models/psql/pdcChequeModel.d.ts +3 -3
- package/dist/models/psql/pdcChequeModel.js +19 -19
- package/dist/models/psql/pdcHistoryModel.d.ts +3 -3
- package/dist/models/psql/pdcHistoryModel.js +22 -22
- package/dist/models/psql/pincodeModel.d.ts +1 -1
- package/dist/models/psql/pincodeModel.js +8 -8
- package/dist/models/psql/productModel.d.ts +3 -3
- package/dist/models/psql/productModel.js +17 -17
- package/dist/models/psql/projectAssessmentOptionModel.d.ts +2 -2
- package/dist/models/psql/projectAssessmentOptionModel.js +9 -9
- package/dist/models/psql/roleModel.d.ts +3 -3
- package/dist/models/psql/roleModel.js +9 -9
- package/dist/models/psql/rulesRegulationModel.d.ts +3 -3
- package/dist/models/psql/rulesRegulationModel.js +8 -8
- package/dist/models/psql/schoolFeeCollectionModel.d.ts +2 -2
- package/dist/models/psql/schoolFeeCollectionModel.js +14 -14
- package/dist/models/psql/schoolOfferModel.d.ts +3 -3
- package/dist/models/psql/schoolOfferModel.js +18 -18
- package/dist/models/psql/sendNotificationModel.d.ts +3 -3
- package/dist/models/psql/sendNotificationModel.js +14 -14
- package/dist/models/psql/slotModel.d.ts +3 -3
- package/dist/models/psql/slotModel.js +14 -14
- package/dist/models/psql/stateModel.d.ts +1 -1
- package/dist/models/psql/stateModel.js +5 -5
- package/dist/models/psql/subjectHasFeeModel.d.ts +2 -2
- package/dist/models/psql/subjectHasFeeModel.js +12 -12
- package/dist/models/psql/subjectHasPayFeeHistoryModel.d.ts +2 -2
- package/dist/models/psql/subjectHasPayFeeHistoryModel.js +17 -17
- package/dist/models/psql/syllabusModel.d.ts +3 -3
- package/dist/models/psql/syllabusModel.js +17 -17
- package/dist/models/psql/testimonialModel.d.ts +3 -3
- package/dist/models/psql/testimonialModel.js +31 -31
- package/dist/models/psql/toDoModel.d.ts +3 -3
- package/dist/models/psql/toDoModel.js +19 -19
- package/dist/models/psql/tokenModel.d.ts +2 -2
- package/dist/models/psql/tokenModel.js +2 -2
- package/dist/models/psql/tripModel.d.ts +3 -3
- package/dist/models/psql/tripModel.js +16 -16
- package/dist/models/psql/typeManagementModel.d.ts +3 -3
- package/dist/models/psql/typeManagementModel.js +16 -16
- package/dist/models/psql/userBookAssessmentModel.d.ts +3 -3
- package/dist/models/psql/userBookAssessmentModel.js +20 -20
- package/dist/models/psql/userFeeTypeByAccountModel.d.ts +2 -2
- package/dist/models/psql/userFeeTypeByAccountModel.js +22 -22
- package/dist/models/psql/userFeeTypeModel.d.ts +3 -3
- package/dist/models/psql/userFeeTypeModel.js +23 -23
- package/dist/models/psql/userHasAnnouncementModel.d.ts +3 -3
- package/dist/models/psql/userHasAnnouncementModel.js +17 -17
- package/dist/models/psql/userHasBatchModel.d.ts +2 -2
- package/dist/models/psql/userHasBatchModel.js +11 -11
- package/dist/models/psql/userHasCourseModel.d.ts +3 -3
- package/dist/models/psql/userHasCourseModel.js +17 -17
- package/dist/models/psql/userHasDeviceModel.d.ts +3 -3
- package/dist/models/psql/userHasDeviceModel.js +11 -11
- package/dist/models/psql/userHasFeeTermsModel.d.ts +3 -3
- package/dist/models/psql/userHasFeeTermsModel.js +23 -23
- package/dist/models/psql/userHasFileModel.d.ts +2 -2
- package/dist/models/psql/userHasFileModel.js +15 -15
- package/dist/models/psql/userHasHomeWorkModel.d.ts +3 -3
- package/dist/models/psql/userHasHomeWorkModel.js +20 -20
- package/dist/models/psql/userHasInventoryHistoryModel.d.ts +3 -3
- package/dist/models/psql/userHasInventoryHistoryModel.js +16 -16
- package/dist/models/psql/userHasInventoryModel.d.ts +3 -3
- package/dist/models/psql/userHasInventoryModel.js +19 -19
- package/dist/models/psql/userHasLeaveHistoryModel.d.ts +3 -3
- package/dist/models/psql/userHasLeaveHistoryModel.js +20 -20
- package/dist/models/psql/userHasLeaveModel.d.ts +3 -3
- package/dist/models/psql/userHasLeaveModel.js +17 -17
- package/dist/models/psql/userHasOfferModel.d.ts +2 -2
- package/dist/models/psql/userHasOfferModel.js +20 -20
- package/dist/models/psql/userHasParentModel.d.ts +3 -3
- package/dist/models/psql/userHasParentModel.js +12 -12
- package/dist/models/psql/userHasRoleModel.d.ts +3 -3
- package/dist/models/psql/userHasRoleModel.js +13 -13
- package/dist/models/psql/userHasRollNumberModel.d.ts +2 -2
- package/dist/models/psql/userHasRollNumberModel.js +14 -14
- package/dist/models/psql/userHasStorageModel.d.ts +3 -3
- package/dist/models/psql/userHasStorageModel.js +11 -11
- package/dist/models/psql/userHasSubjectFeeModel.d.ts +2 -2
- package/dist/models/psql/userHasSubjectFeeModel.js +12 -12
- package/dist/models/psql/userLeaveRequestModel.d.ts +3 -3
- package/dist/models/psql/userLeaveRequestModel.js +23 -23
- package/dist/models/psql/userModel.d.ts +3 -3
- package/dist/models/psql/userModel.js +43 -43
- package/dist/models/psql/userPayoutDetailsModel.d.ts +3 -3
- package/dist/models/psql/userPayoutDetailsModel.js +22 -22
- package/dist/models/psql/userPayoutHistoryModel.d.ts +3 -3
- package/dist/models/psql/userPayoutHistoryModel.js +17 -17
- package/dist/models/psql/userPayoutModel.d.ts +3 -3
- package/dist/models/psql/userPayoutModel.js +31 -31
- package/dist/models/psql/userProjectAssessmentOptionModel.d.ts +3 -3
- package/dist/models/psql/userProjectAssessmentOptionModel.js +17 -17
- package/dist/models/psql/userRequiredStepsModel.d.ts +2 -2
- package/dist/models/psql/userRequiredStepsModel.js +8 -8
- package/dist/models/psql/vehicleModel.d.ts +3 -3
- package/dist/models/psql/vehicleModel.js +14 -14
- package/dist/models/psql/vendorManagementModel.d.ts +3 -3
- package/dist/models/psql/vendorManagementModel.js +20 -20
- package/dist/models/psql/walletHistoryModel.d.ts +3 -3
- package/dist/models/psql/walletHistoryModel.js +13 -13
- package/dist/models/psql/walletModel.d.ts +3 -3
- package/dist/models/psql/walletModel.js +10 -10
- package/dist/models/psql/workingDayModel.d.ts +3 -3
- package/dist/models/psql/workingDayModel.js +8 -8
- package/dist/models/psql/workingShiftModel.d.ts +3 -3
- package/dist/models/psql/workingShiftModel.js +17 -17
- package/dist/services/Concrete/mongooseCommonService.d.ts +2 -2
- package/dist/services/Concrete/mongooseCommonService.js +4 -4
- package/dist/services/Concrete/sequelizeCommonService.d.ts +2 -2
- package/dist/services/Concrete/sequelizeCommonService.js +5 -5
- package/dist/services/Contracts/IMongooseCommonService.d.ts +1 -1
- package/dist/services/Contracts/ISequelizeCommonService.d.ts +1 -1
- package/dist/types/academicCalendarType.d.ts +1 -1
- package/dist/types/accountHasReceiptDetailsType.d.ts +2 -2
- package/dist/types/announcementType.d.ts +1 -1
- package/dist/types/approveRequestType.d.ts +1 -1
- package/dist/types/areaType.d.ts +1 -1
- package/dist/types/attendanceType.d.ts +1 -1
- package/dist/types/bankAccountDetailsType.d.ts +1 -1
- package/dist/types/bannerType.d.ts +2 -2
- package/dist/types/batchSubjectBookAssessmentType.d.ts +2 -2
- package/dist/types/batchSubjectProjectAssessmentType.d.ts +2 -2
- package/dist/types/batchType.d.ts +2 -2
- package/dist/types/blogType.d.ts +1 -1
- package/dist/types/bookAssessmentDateType.d.ts +2 -2
- package/dist/types/careerType.d.ts +1 -1
- package/dist/types/categoriesType.d.ts +1 -1
- package/dist/types/certificatesHistoryType.d.ts +1 -1
- package/dist/types/certificatesManagementType.d.ts +1 -1
- package/dist/types/classRoomType.d.ts +1 -1
- package/dist/types/cloudStorageType.d.ts +1 -1
- package/dist/types/coinPurchaseOfferType.d.ts +1 -1
- package/dist/types/contactFeedBackType.d.ts +1 -1
- package/dist/types/courseHasVisitorsType.d.ts +1 -1
- package/dist/types/courseType.d.ts +1 -1
- package/dist/types/dailyBookType.d.ts +1 -1
- package/dist/types/dashboardManagementType.d.ts +1 -1
- package/dist/types/driverType.d.ts +2 -2
- package/dist/types/entityGroupType.d.ts +1 -1
- package/dist/types/eventType.d.ts +1 -1
- package/dist/types/examGroupType.d.ts +1 -1
- package/dist/types/examHasAnswerSheetType.d.ts +1 -1
- package/dist/types/examType.d.ts +2 -2
- package/dist/types/facilityType.d.ts +1 -1
- package/dist/types/featureActionType.d.ts +1 -1
- package/dist/types/feeHistoryDetailsType.d.ts +2 -2
- package/dist/types/feeHistoryType.d.ts +3 -3
- package/dist/types/feeReminderSettingType.d.ts +1 -1
- package/dist/types/feeReminderType.d.ts +1 -1
- package/dist/types/feeReminderTypeType.d.ts +1 -1
- package/dist/types/feeTypeHasTermsType.d.ts +1 -1
- package/dist/types/feeTypeType.d.ts +1 -1
- package/dist/types/feedBackType.d.ts +1 -1
- package/dist/types/feesCollectionType.d.ts +1 -1
- package/dist/types/fileStorageType.d.ts +1 -1
- package/dist/types/floormanagementType.d.ts +1 -1
- package/dist/types/generateIdCardType.d.ts +1 -1
- package/dist/types/greetingsType.d.ts +2 -2
- package/dist/types/holidayType.d.ts +1 -1
- package/dist/types/homeWorkType.d.ts +1 -1
- package/dist/types/index.d.ts +129 -0
- package/dist/types/index.js +145 -0
- package/dist/types/informationSupportType.d.ts +1 -1
- package/dist/types/inquiryType.d.ts +1 -1
- package/dist/types/instituteEntityType.d.ts +1 -1
- package/dist/types/instituteEntityTypeType.d.ts +1 -1
- package/dist/types/instituteSubscriptionPlanType.d.ts +1 -1
- package/dist/types/instituteType.d.ts +1 -1
- package/dist/types/inventoryHistoryType.d.ts +1 -1
- package/dist/types/inventoryType.d.ts +1 -1
- package/dist/types/jobApply.d.ts +1 -1
- package/dist/types/lectureHistoryType.d.ts +2 -2
- package/dist/types/lectureType.d.ts +2 -2
- package/dist/types/masterLeaveType.d.ts +1 -1
- package/dist/types/moduleFeatureType.d.ts +1 -1
- package/dist/types/moduleType.d.ts +1 -1
- package/dist/types/offerType.d.ts +1 -1
- package/dist/types/paymentTermsType.d.ts +1 -1
- package/dist/types/pdcChequeType.d.ts +2 -2
- package/dist/types/pdcHistoryType.d.ts +1 -1
- package/dist/types/photosGalleryType.d.ts +1 -1
- package/dist/types/plannerType.d.ts +1 -1
- package/dist/types/productType.d.ts +1 -1
- package/dist/types/projectAssessmentOptionType.d.ts +2 -2
- package/dist/types/roleType.d.ts +4 -4
- package/dist/types/rulesRegulationType.d.ts +1 -1
- package/dist/types/schoolFeeCollectionType.d.ts +1 -1
- package/dist/types/schoolFeeType.d.ts +1 -1
- package/dist/types/schoolOfferType.d.ts +1 -1
- package/dist/types/sendNotificationType.d.ts +1 -1
- package/dist/types/slotType.d.ts +1 -1
- package/dist/types/subCategoryType.d.ts +1 -1
- package/dist/types/subjectHasFeeType.d.ts +1 -1
- package/dist/types/subjectHasPayFeeHistoryType.d.ts +1 -1
- package/dist/types/subjectIndexType.d.ts +2 -2
- package/dist/types/subscriptionPlanType.d.ts +1 -1
- package/dist/types/syllabusType.d.ts +2 -2
- package/dist/types/taskManagementType.d.ts +1 -1
- package/dist/types/testimonialType.d.ts +2 -2
- package/dist/types/toDoType.d.ts +2 -2
- package/dist/types/tripType.d.ts +1 -1
- package/dist/types/typeManagementType.d.ts +1 -1
- package/dist/types/uniqueNumberCounterType.d.ts +1 -1
- package/dist/types/userBookAssessmentType.d.ts +2 -2
- package/dist/types/userDetailsType.d.ts +1 -1
- package/dist/types/userFeeTypeByAccountType.d.ts +1 -1
- package/dist/types/userFeeTypeType.d.ts +1 -1
- package/dist/types/userHasAnnouncementType.d.ts +1 -1
- package/dist/types/userHasBatchType.d.ts +3 -3
- package/dist/types/userHasCourseType.d.ts +1 -1
- package/dist/types/userHasDeviceType.d.ts +1 -1
- package/dist/types/userHasFeeTermsType.d.ts +1 -1
- package/dist/types/userHasFileType.d.ts +1 -1
- package/dist/types/userHasHomeWorkType.d.ts +1 -1
- package/dist/types/userHasInventoryHistoryType.d.ts +1 -1
- package/dist/types/userHasInventoryType.d.ts +1 -1
- package/dist/types/userHasLeaveHistoryType.d.ts +1 -1
- package/dist/types/userHasLeaveType.d.ts +1 -1
- package/dist/types/userHasOffer.d.ts +1 -1
- package/dist/types/userHasParentType.d.ts +1 -1
- package/dist/types/userHasRoleType.d.ts +1 -1
- package/dist/types/userHasRollNumberType.d.ts +1 -1
- package/dist/types/userHasStorageType.d.ts +1 -1
- package/dist/types/userHasSubjectFeeType.d.ts +1 -1
- package/dist/types/userInstituteMetaType.d.ts +1 -1
- package/dist/types/userLeaveRequestType.d.ts +1 -1
- package/dist/types/userMetaType.d.ts +2 -2
- package/dist/types/userPayoutDetailsType.d.ts +1 -1
- package/dist/types/userPayoutHistoryType.d.ts +1 -1
- package/dist/types/userPayoutType.d.ts +2 -2
- package/dist/types/userProjectAssessmentOptionType.d.ts +2 -2
- package/dist/types/userRequiredStepsType.d.ts +1 -1
- package/dist/types/userSchoolMetaType.d.ts +1 -1
- package/dist/types/userType.d.ts +3 -3
- package/dist/types/vehicleType.d.ts +1 -1
- package/dist/types/vendorType.d.ts +1 -1
- package/dist/types/videoAnalystType.d.ts +1 -1
- package/dist/types/walletHistoryType.d.ts +1 -1
- package/dist/types/walletTransactionType.d.ts +1 -1
- package/dist/types/walletType.d.ts +1 -1
- package/dist/types/workingDayType.d.ts +1 -1
- package/dist/types/workingShiftType.d.ts +1 -1
- package/package.json +5 -4
- /package/dist/interfaces/{commanInterface.d.ts → commonInterface.d.ts} +0 -0
- /package/dist/interfaces/{commanInterface.js → commonInterface.js} +0 -0
|
@@ -38,21 +38,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
40
40
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
41
|
-
const
|
|
42
|
-
const
|
|
41
|
+
const app_1 = require("../../constants/app");
|
|
42
|
+
const utils_1 = require("../../helpers/utils");
|
|
43
43
|
const sequelize_1 = require("sequelize");
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
44
|
+
const env_1 = require("../../configs/env");
|
|
45
|
+
const errorMessages_1 = require("../../constants/errorMessages");
|
|
46
|
+
const batchModel_1 = __importDefault(require("../psql/batchModel"));
|
|
47
|
+
const instituteModel_1 = __importDefault(require("../psql/instituteModel"));
|
|
48
|
+
const userModel_1 = __importDefault(require("../psql/userModel"));
|
|
49
|
+
const defaultModelAttributes_1 = require("../../constants/defaultModelAttributes");
|
|
50
|
+
const instituteEntityModel_1 = __importDefault(require("../psql/instituteEntityModel"));
|
|
51
|
+
const fileStorageModel_1 = __importDefault(require("../psql/fileStorageModel"));
|
|
52
|
+
const typeManagementModel_1 = __importDefault(require("../psql/typeManagementModel"));
|
|
53
|
+
const lectureModel_1 = __importDefault(require("../psql/lectureModel"));
|
|
54
|
+
const s3Uploader_1 = require("../../helpers/s3Uploader");
|
|
55
|
+
const userInstituteMetaModel_1 = __importDefault(require("./userInstituteMetaModel"));
|
|
56
56
|
// Define the schema for IChapterFileAttributes
|
|
57
57
|
const ChapterFileSchema = new mongoose_1.Schema({
|
|
58
58
|
id: {
|
|
@@ -61,7 +61,7 @@ const ChapterFileSchema = new mongoose_1.Schema({
|
|
|
61
61
|
},
|
|
62
62
|
type: {
|
|
63
63
|
type: String,
|
|
64
|
-
enum: Object.values(
|
|
64
|
+
enum: Object.values(app_1.CHAPTER_INDEX_FILE_TYPE),
|
|
65
65
|
required: true,
|
|
66
66
|
},
|
|
67
67
|
fileStorageId: {
|
|
@@ -100,8 +100,8 @@ const assignedUsersSchema = new mongoose_1.Schema({
|
|
|
100
100
|
},
|
|
101
101
|
status: {
|
|
102
102
|
type: String,
|
|
103
|
-
enum: Object.values(
|
|
104
|
-
default:
|
|
103
|
+
enum: Object.values(app_1.USER_CHAPTER_INDEX_STATUS),
|
|
104
|
+
default: app_1.USER_CHAPTER_INDEX_STATUS.NOT_COMPLETED,
|
|
105
105
|
required: false,
|
|
106
106
|
},
|
|
107
107
|
statusUpdatedAt: {
|
|
@@ -143,7 +143,7 @@ const ChapterIndexSchema = new mongoose_1.Schema({
|
|
|
143
143
|
},
|
|
144
144
|
type: {
|
|
145
145
|
type: String,
|
|
146
|
-
enum: Object.values(
|
|
146
|
+
enum: Object.values(app_1.CHAPTER_INDEX_TYPE),
|
|
147
147
|
required: true,
|
|
148
148
|
},
|
|
149
149
|
parentId: {
|
|
@@ -179,7 +179,7 @@ const SubjectIndexSchema = new mongoose_1.Schema({
|
|
|
179
179
|
},
|
|
180
180
|
type: {
|
|
181
181
|
type: String,
|
|
182
|
-
enum: Object.values(
|
|
182
|
+
enum: Object.values(app_1.SUBJECT_INDEX_TYPE),
|
|
183
183
|
required: true,
|
|
184
184
|
},
|
|
185
185
|
chapterIndex: {
|
|
@@ -188,8 +188,8 @@ const SubjectIndexSchema = new mongoose_1.Schema({
|
|
|
188
188
|
},
|
|
189
189
|
status: {
|
|
190
190
|
type: String,
|
|
191
|
-
enum: Object.values(
|
|
192
|
-
default:
|
|
191
|
+
enum: Object.values(app_1.COMMAN_STATUS),
|
|
192
|
+
default: app_1.COMMAN_STATUS.ACTIVE,
|
|
193
193
|
required: false,
|
|
194
194
|
},
|
|
195
195
|
instituteId: {
|
|
@@ -227,61 +227,61 @@ const SubjectIndexSchema = new mongoose_1.Schema({
|
|
|
227
227
|
const creatOrUpdateHook = async (subjectIndex) => {
|
|
228
228
|
try {
|
|
229
229
|
if (subjectIndex.instituteId) {
|
|
230
|
-
const institute = await
|
|
230
|
+
const institute = await instituteModel_1.default.findByPk(subjectIndex.instituteId);
|
|
231
231
|
if (!institute)
|
|
232
|
-
throw new Error(
|
|
232
|
+
throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
233
233
|
}
|
|
234
234
|
if (subjectIndex.sharedInstituteId?.length) {
|
|
235
235
|
subjectIndex.sharedInstituteId = [...new Set(subjectIndex.sharedInstituteId)];
|
|
236
|
-
const count = await
|
|
236
|
+
const count = await instituteModel_1.default.count({
|
|
237
237
|
where: {
|
|
238
238
|
id: { [sequelize_1.Op.in]: subjectIndex.sharedInstituteId },
|
|
239
239
|
},
|
|
240
240
|
});
|
|
241
241
|
if (count !== subjectIndex.sharedInstituteId.length)
|
|
242
|
-
throw new Error(
|
|
242
|
+
throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
243
243
|
}
|
|
244
244
|
if (subjectIndex.sharedUnverifiedInstituteId?.length) {
|
|
245
245
|
subjectIndex.sharedUnverifiedInstituteId = [...new Set(subjectIndex.sharedUnverifiedInstituteId)].filter(instituteId => !subjectIndex?.sharedInstituteId?.includes(instituteId));
|
|
246
|
-
const count = await
|
|
246
|
+
const count = await instituteModel_1.default.count({
|
|
247
247
|
where: {
|
|
248
248
|
id: { [sequelize_1.Op.in]: subjectIndex.sharedUnverifiedInstituteId },
|
|
249
249
|
},
|
|
250
250
|
});
|
|
251
251
|
if (count !== subjectIndex.sharedUnverifiedInstituteId.length)
|
|
252
|
-
throw new Error(
|
|
252
|
+
throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
253
253
|
}
|
|
254
254
|
if (subjectIndex.subject) {
|
|
255
|
-
const subject = await
|
|
255
|
+
const subject = await instituteEntityModel_1.default.findOne({
|
|
256
256
|
where: { id: subjectIndex.subject },
|
|
257
257
|
include: [
|
|
258
258
|
{
|
|
259
259
|
association: 'entityType',
|
|
260
|
-
where: { sequence:
|
|
260
|
+
where: { sequence: app_1.INSTITUTE_ENTITY_TYPE_SEQUENCE.LAST },
|
|
261
261
|
},
|
|
262
262
|
],
|
|
263
263
|
});
|
|
264
264
|
if (!subject)
|
|
265
|
-
throw new Error(
|
|
265
|
+
throw new Error(errorMessages_1.INSTITUTE_ENTITY_ERROR_MESSAGES.NOT_FOUND);
|
|
266
266
|
}
|
|
267
267
|
if (subjectIndex.batch) {
|
|
268
|
-
const batch = await
|
|
268
|
+
const batch = await batchModel_1.default.findOne({
|
|
269
269
|
where: {
|
|
270
270
|
id: subjectIndex.batch,
|
|
271
271
|
subjects: { [sequelize_1.Op.overlap]: [subjectIndex.subject] },
|
|
272
272
|
},
|
|
273
273
|
});
|
|
274
274
|
if (!batch)
|
|
275
|
-
throw new Error(
|
|
275
|
+
throw new Error(errorMessages_1.BATCH_ERROR_MESSAGES.NOT_FOUND);
|
|
276
276
|
}
|
|
277
277
|
if (subjectIndex.userId) {
|
|
278
|
-
const userId = await
|
|
278
|
+
const userId = await userModel_1.default.findOne({
|
|
279
279
|
where: {
|
|
280
280
|
id: subjectIndex.userId,
|
|
281
281
|
},
|
|
282
282
|
});
|
|
283
283
|
if (!userId) {
|
|
284
|
-
throw new Error(
|
|
284
|
+
throw new Error(errorMessages_1.USER_ERROR_MESSAGES.NOT_FOUND);
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
if (subjectIndex.chapterIndex && subjectIndex.chapterIndex.length) {
|
|
@@ -307,17 +307,17 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
307
307
|
}
|
|
308
308
|
return true;
|
|
309
309
|
};
|
|
310
|
-
const chapterList = subjectIndex.chapterIndex.filter(chapter => chapter.type ===
|
|
310
|
+
const chapterList = subjectIndex.chapterIndex.filter(chapter => chapter.type === app_1.CHAPTER_INDEX_TYPE.CHAPTER);
|
|
311
311
|
if (!isValidIndex(chapterList))
|
|
312
|
-
throw new Error(
|
|
312
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_INDEX);
|
|
313
313
|
for (const chapter of chapterList) {
|
|
314
|
-
const topicList = subjectIndex.chapterIndex.filter(topic => topic.type ===
|
|
314
|
+
const topicList = subjectIndex.chapterIndex.filter(topic => topic.type === app_1.CHAPTER_INDEX_TYPE.TOPIC && topic.parentId === chapter.id);
|
|
315
315
|
if (!isValidIndex(topicList))
|
|
316
|
-
throw new Error(
|
|
316
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
317
317
|
for (const topic of topicList) {
|
|
318
|
-
const subTopicList = subjectIndex.chapterIndex.filter(subTopic => subTopic.type ===
|
|
318
|
+
const subTopicList = subjectIndex.chapterIndex.filter(subTopic => subTopic.type === app_1.CHAPTER_INDEX_TYPE.SUB_TOPIC && subTopic.parentId === topic.id);
|
|
319
319
|
if (!isValidIndex(subTopicList))
|
|
320
|
-
throw new Error(
|
|
320
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
|
|
321
321
|
const topicIndex = subjectIndex.chapterIndex.findIndex(c => c.id === topic.id);
|
|
322
322
|
if (!subTopicList.length && topic.teachingTime) {
|
|
323
323
|
subjectIndex.chapterIndex[topicIndex].teachingTime = topic.teachingTime;
|
|
@@ -337,15 +337,15 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
337
337
|
for (const chapterIndex of subjectIndex.chapterIndex) {
|
|
338
338
|
if (!chapterIndex.id)
|
|
339
339
|
chapterIndex.id = crypto.randomUUID();
|
|
340
|
-
if (chapterIndex.type !==
|
|
340
|
+
if (chapterIndex.type !== app_1.CHAPTER_INDEX_TYPE.CHAPTER) {
|
|
341
341
|
const parentChapterIndex = subjectIndex.chapterIndex.find(index => index.id === chapterIndex.parentId);
|
|
342
342
|
if (!parentChapterIndex)
|
|
343
|
-
throw new Error(
|
|
344
|
-
if (chapterIndex.type ===
|
|
345
|
-
throw new Error(
|
|
343
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
344
|
+
if (chapterIndex.type === app_1.CHAPTER_INDEX_TYPE.SUB_TOPIC && parentChapterIndex.type !== app_1.CHAPTER_INDEX_TYPE.TOPIC) {
|
|
345
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
346
346
|
}
|
|
347
|
-
if (chapterIndex.type ===
|
|
348
|
-
throw new Error(
|
|
347
|
+
if (chapterIndex.type === app_1.CHAPTER_INDEX_TYPE.TOPIC && parentChapterIndex.type !== app_1.CHAPTER_INDEX_TYPE.CHAPTER) {
|
|
348
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
if (chapterIndex.files && chapterIndex.files.length) {
|
|
@@ -363,7 +363,7 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
if (subjectIndex.assignedUsers && subjectIndex.assignedUsers.length) {
|
|
366
|
-
subjectIndex.assignedUsers = (0,
|
|
366
|
+
subjectIndex.assignedUsers = (0, utils_1.getUniqueArrayByFields)(subjectIndex.assignedUsers, ['userId', 'chapterIndexId']);
|
|
367
367
|
const chapterIndex = [...(subjectIndex.chapterIndex || [])];
|
|
368
368
|
const chapterIndexIdList = chapterIndex
|
|
369
369
|
// .filter(chapter => chapter.type === CHAPTER_INDEX_TYPE.CHAPTER)
|
|
@@ -379,17 +379,17 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
379
379
|
chapter.teachingTime = found.teachingTime;
|
|
380
380
|
return chapter;
|
|
381
381
|
});
|
|
382
|
-
const chapterList = chapterIndexList.filter(chapter => chapter.type ===
|
|
382
|
+
const chapterList = chapterIndexList.filter(chapter => chapter.type === app_1.CHAPTER_INDEX_TYPE.CHAPTER);
|
|
383
383
|
if (!chapterList.length)
|
|
384
|
-
throw new Error(
|
|
384
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_INDEX);
|
|
385
385
|
for (const chapter of chapterList) {
|
|
386
|
-
const topicList = chapterIndexList.filter(topic => topic.type ===
|
|
386
|
+
const topicList = chapterIndexList.filter(topic => topic.type === app_1.CHAPTER_INDEX_TYPE.TOPIC && topic.parentId === chapter.id);
|
|
387
387
|
if (!topicList)
|
|
388
|
-
throw new Error(
|
|
388
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
389
389
|
for (const topic of topicList) {
|
|
390
|
-
const subTopicList = chapterIndexList.filter(subTopic => subTopic.type ===
|
|
390
|
+
const subTopicList = chapterIndexList.filter(subTopic => subTopic.type === app_1.CHAPTER_INDEX_TYPE.SUB_TOPIC && subTopic.parentId === topic.id);
|
|
391
391
|
if (!subTopicList)
|
|
392
|
-
throw new Error(
|
|
392
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
|
|
393
393
|
const topicIndex = chapterIndexList.findIndex(c => c.id === topic.id);
|
|
394
394
|
if (!subTopicList.length && topic.teachingTime) {
|
|
395
395
|
chapterIndexList[topicIndex].teachingTime = topic.teachingTime;
|
|
@@ -416,23 +416,23 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
416
416
|
];
|
|
417
417
|
let userIdList = subjectIndex.assignedUsers.map(assignedUser => assignedUser.userId);
|
|
418
418
|
userIdList = [...new Set(userIdList)];
|
|
419
|
-
const assignedUsersIdCount = await
|
|
419
|
+
const assignedUsersIdCount = await userModel_1.default.count({
|
|
420
420
|
where: {
|
|
421
421
|
id: {
|
|
422
422
|
[sequelize_1.Op.in]: userIdList,
|
|
423
423
|
},
|
|
424
|
-
type:
|
|
424
|
+
type: app_1.USER_TYPES.TEACHER,
|
|
425
425
|
},
|
|
426
426
|
});
|
|
427
427
|
if (assignedUsersIdCount !== userIdList.length) {
|
|
428
|
-
throw new Error(
|
|
428
|
+
throw new Error(errorMessages_1.USER_ERROR_MESSAGES.NOT_FOUND);
|
|
429
429
|
}
|
|
430
430
|
const where = {
|
|
431
|
-
userType:
|
|
432
|
-
status:
|
|
431
|
+
userType: app_1.USER_TYPES.TEACHER,
|
|
432
|
+
status: app_1.USER_INSTITUTE_META_STATUS.ACCEPTED,
|
|
433
433
|
entities: { $in: [subjectIndex.subject] },
|
|
434
434
|
};
|
|
435
|
-
if (subjectIndex.type ===
|
|
435
|
+
if (subjectIndex.type === app_1.SUBJECT_INDEX_TYPE.PRIVATE) {
|
|
436
436
|
where.instituteId = {
|
|
437
437
|
$in: [...subjectIndex.sharedInstituteId, subjectIndex.instituteId || ''],
|
|
438
438
|
};
|
|
@@ -440,15 +440,15 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
440
440
|
else {
|
|
441
441
|
where.instituteId = subjectIndex.instituteId;
|
|
442
442
|
}
|
|
443
|
-
const userIntituteMetaList = await
|
|
443
|
+
const userIntituteMetaList = await userInstituteMetaModel_1.default.find({ ...where }, { userId: 1 });
|
|
444
444
|
let allowUserIds = userIntituteMetaList.map(userIntituteMeta => userIntituteMeta.userId);
|
|
445
|
-
if (subjectIndex.type ===
|
|
445
|
+
if (subjectIndex.type === app_1.SUBJECT_INDEX_TYPE.PRIVATE) {
|
|
446
446
|
allowUserIds.push(subjectIndex.userId);
|
|
447
447
|
}
|
|
448
448
|
allowUserIds = [...new Set(allowUserIds)];
|
|
449
449
|
const notAllowUserIds = subjectIndex.assignedUsers?.filter(assignedUsers => !allowUserIds.includes(assignedUsers.userId));
|
|
450
450
|
if (notAllowUserIds?.length)
|
|
451
|
-
throw new Error(
|
|
451
|
+
throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.CAN_NOT_ASSIGN_TO_USER);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
catch (error) {
|
|
@@ -456,50 +456,50 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
458
|
const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) => {
|
|
459
|
-
const batchList = await
|
|
459
|
+
const batchList = await batchModel_1.default.findAll({
|
|
460
460
|
where: {
|
|
461
461
|
id: {
|
|
462
462
|
[sequelize_1.Op.in]: subjectIndexList.map(subject => subject.batch),
|
|
463
463
|
},
|
|
464
464
|
},
|
|
465
465
|
});
|
|
466
|
-
const batchListById = (0,
|
|
467
|
-
const subjectList = await
|
|
466
|
+
const batchListById = (0, utils_1.keyByFieldOrFields)(batchList, 'id');
|
|
467
|
+
const subjectList = await instituteEntityModel_1.default.findAll({
|
|
468
468
|
where: {
|
|
469
469
|
id: {
|
|
470
470
|
[sequelize_1.Op.in]: subjectIndexList.map(subject => subject.subject),
|
|
471
471
|
},
|
|
472
472
|
},
|
|
473
473
|
});
|
|
474
|
-
const subjectListById = (0,
|
|
474
|
+
const subjectListById = (0, utils_1.keyByFieldOrFields)(subjectList, 'id');
|
|
475
475
|
const userIdSet = new Set(subjectIndexList.flatMap(subject => [subject.userId, subject.createdBy]));
|
|
476
476
|
subjectIndexList.forEach(subject => subject.assignedUsers?.forEach(assign => userIdSet.add(assign.userId)));
|
|
477
|
-
const userList = await
|
|
477
|
+
const userList = await userModel_1.default.findAll({
|
|
478
478
|
where: { id: { [sequelize_1.Op.in]: [...userIdSet] } },
|
|
479
|
-
attributes:
|
|
479
|
+
attributes: defaultModelAttributes_1.USER_BASIC_DETAIL,
|
|
480
480
|
});
|
|
481
|
-
const userListById = (0,
|
|
481
|
+
const userListById = (0, utils_1.keyByFieldOrFields)(userList, 'id');
|
|
482
482
|
const instituteIdSet = new Set(subjectIndexList.flatMap(subject => [subject.instituteId, ...(subject.sharedInstituteId || [])]));
|
|
483
|
-
const instituteList = await
|
|
483
|
+
const instituteList = await instituteModel_1.default.findAll({
|
|
484
484
|
where: { id: { [sequelize_1.Op.in]: [...instituteIdSet] } },
|
|
485
|
-
attributes:
|
|
485
|
+
attributes: defaultModelAttributes_1.INSTITUTE_BASIC_DETAIL,
|
|
486
486
|
});
|
|
487
|
-
const instituteListById = (0,
|
|
487
|
+
const instituteListById = (0, utils_1.keyByFieldOrFields)(instituteList, 'id');
|
|
488
488
|
const fileStorageIdList = subjectIndexList.flatMap(subject => subject.chapterIndex?.flatMap(chapter => chapter.files?.map(file => file.fileStorageId) || []) || []);
|
|
489
|
-
const fileStorageList = await
|
|
489
|
+
const fileStorageList = await fileStorageModel_1.default.findAll({
|
|
490
490
|
where: { id: { [sequelize_1.Op.in]: fileStorageIdList } },
|
|
491
|
-
attributes: { exclude:
|
|
491
|
+
attributes: { exclude: defaultModelAttributes_1.DEFAULT_EXCLUDES_ATTRIBUTES },
|
|
492
492
|
raw: true,
|
|
493
493
|
});
|
|
494
|
-
const fileStorageListById = (0,
|
|
494
|
+
const fileStorageListById = (0, utils_1.keyByFieldOrFields)(fileStorageList, 'id');
|
|
495
495
|
const fileCategoryIdList = subjectIndexList
|
|
496
496
|
.flatMap(subject => subject.chapterIndex?.flatMap(chapter => chapter.files?.map(file => file.categoryId) || []) || [])
|
|
497
|
-
.filter(id => (0,
|
|
498
|
-
const fileCategoryList = await
|
|
497
|
+
.filter(id => (0, utils_1.isValidUUID)(id));
|
|
498
|
+
const fileCategoryList = await typeManagementModel_1.default.findAll({
|
|
499
499
|
where: { id: { [sequelize_1.Op.in]: fileCategoryIdList } },
|
|
500
|
-
attributes: { exclude:
|
|
500
|
+
attributes: { exclude: defaultModelAttributes_1.DEFAULT_EXCLUDES_ATTRIBUTES },
|
|
501
501
|
});
|
|
502
|
-
const fileCategoryListById = (0,
|
|
502
|
+
const fileCategoryListById = (0, utils_1.keyByFieldOrFields)(fileCategoryList, 'id');
|
|
503
503
|
return await Promise.all(
|
|
504
504
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
505
505
|
subjectIndexList.map(async (subject) => {
|
|
@@ -523,20 +523,20 @@ const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) =>
|
|
|
523
523
|
});
|
|
524
524
|
}
|
|
525
525
|
let completedChapterLastLecture = [];
|
|
526
|
-
if (subject.assignedUsers && subject.assignedUsers.length && options?.reqUser?.type ===
|
|
527
|
-
const lectureList = await
|
|
526
|
+
if (subject.assignedUsers && subject.assignedUsers.length && options?.reqUser?.type === app_1.USER_TYPES.STUDENT) {
|
|
527
|
+
const lectureList = await lectureModel_1.default.findAll({
|
|
528
528
|
where: { subject: { [sequelize_1.Op.in]: [subject.subject] } },
|
|
529
529
|
order: [['checkedInAt', 'DESC']],
|
|
530
530
|
limit: 1,
|
|
531
531
|
});
|
|
532
532
|
const lastLecture = lectureList.pop();
|
|
533
533
|
if (lastLecture) {
|
|
534
|
-
const lectureDay = (0,
|
|
534
|
+
const lectureDay = (0, utils_1.startOfDay)(lastLecture.checkedInAt).getTime();
|
|
535
535
|
completedChapterLastLecture = subject.assignedUsers
|
|
536
536
|
.filter((assignedUser) => {
|
|
537
|
-
const statusUpdateDay = (0,
|
|
537
|
+
const statusUpdateDay = (0, utils_1.startOfDay)(assignedUser.statusUpdatedAt).getTime();
|
|
538
538
|
return (assignedUser?.lectureId === lastLecture.id &&
|
|
539
|
-
assignedUser.status ===
|
|
539
|
+
assignedUser.status === app_1.USER_CHAPTER_INDEX_STATUS.COMPLETED &&
|
|
540
540
|
lectureDay === statusUpdateDay);
|
|
541
541
|
})
|
|
542
542
|
.map((assignedUser) => assignedUser.chapterIndexId);
|
|
@@ -547,9 +547,9 @@ const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) =>
|
|
|
547
547
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
548
548
|
subject.chapterIndex.map(async (chapter) => {
|
|
549
549
|
if (chapter.files?.length) {
|
|
550
|
-
if (subject.type ===
|
|
550
|
+
if (subject.type === app_1.SUBJECT_INDEX_TYPE.BATCH &&
|
|
551
551
|
options.reqUser &&
|
|
552
|
-
[
|
|
552
|
+
[app_1.USER_TYPES.STUDENT, app_1.USER_TYPES.PARENTS, app_1.USER_TYPES.TEACHER].includes(options.reqUser.type)) {
|
|
553
553
|
chapter.files = chapter.files.filter(file => subject.selectedCategoryIds.includes(file.categoryId));
|
|
554
554
|
if (!completedChapterLastLecture.includes(chapter.id))
|
|
555
555
|
chapter.files = [];
|
|
@@ -558,14 +558,14 @@ const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) =>
|
|
|
558
558
|
file.fileStorageDetails = fileStorageListById[file.fileStorageId] || {};
|
|
559
559
|
file.fileCategoryDetails = fileCategoryListById[file.categoryId] || {};
|
|
560
560
|
if (file.fileStorageDetails.storageFileName) {
|
|
561
|
-
file.fileStorageDetails.filePath = await (0,
|
|
561
|
+
file.fileStorageDetails.filePath = await (0, s3Uploader_1.getPresignedUrl)(env_1.ENV_VARIABLE.AWS_BUCKET_NAME, file.fileStorageDetails);
|
|
562
562
|
}
|
|
563
563
|
return file;
|
|
564
564
|
}));
|
|
565
565
|
}
|
|
566
566
|
return chapter;
|
|
567
567
|
}));
|
|
568
|
-
subject.nestChapterIndex = (0,
|
|
568
|
+
subject.nestChapterIndex = (0, utils_1.buildNestedStructure)(subject.chapterIndex, 'parentId', 'list');
|
|
569
569
|
}
|
|
570
570
|
if (subject.assignedUsers?.length) {
|
|
571
571
|
subject.assignedUsers = subject.assignedUsers.map((assign) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Model } from 'mongoose';
|
|
2
|
-
import { ISubscriptionPlanModelAttributes } from '../../interfaces/subscriptionPlanInterface
|
|
2
|
+
import { ISubscriptionPlanModelAttributes } from '../../interfaces/subscriptionPlanInterface';
|
|
3
3
|
declare const SubscriptionPlanModel: Model<ISubscriptionPlanModelAttributes>;
|
|
4
4
|
export default SubscriptionPlanModel;
|
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
-
const
|
|
37
|
+
const app_1 = require("../../constants/app");
|
|
38
38
|
const subscriptionPlanFilesSchema = new mongoose_1.Schema({
|
|
39
39
|
type: {
|
|
40
40
|
type: String,
|
|
@@ -46,7 +46,7 @@ const subscriptionPlanFilesSchema = new mongoose_1.Schema({
|
|
|
46
46
|
},
|
|
47
47
|
status: {
|
|
48
48
|
type: String,
|
|
49
|
-
default:
|
|
49
|
+
default: app_1.COMMAN_STATUS.ACTIVE,
|
|
50
50
|
required: true,
|
|
51
51
|
},
|
|
52
52
|
}, { _id: false });
|
|
@@ -74,7 +74,7 @@ const subscriptionPlanModelSchema = new mongoose_1.Schema({
|
|
|
74
74
|
},
|
|
75
75
|
status: {
|
|
76
76
|
type: String,
|
|
77
|
-
default:
|
|
77
|
+
default: app_1.COMMAN_STATUS.ACTIVE,
|
|
78
78
|
required: true,
|
|
79
79
|
},
|
|
80
80
|
perUserCharge: {
|
|
@@ -87,12 +87,12 @@ const subscriptionPlanModelSchema = new mongoose_1.Schema({
|
|
|
87
87
|
},
|
|
88
88
|
chargeInterval: {
|
|
89
89
|
type: String,
|
|
90
|
-
default:
|
|
90
|
+
default: app_1.SUBSCRIPTION_PLAN_CHARGE_INTERVAL.MONTHLY,
|
|
91
91
|
required: true,
|
|
92
92
|
},
|
|
93
93
|
discountType: {
|
|
94
94
|
type: String,
|
|
95
|
-
default:
|
|
95
|
+
default: app_1.DISCOUNT_TYPE.NONE,
|
|
96
96
|
required: true,
|
|
97
97
|
},
|
|
98
98
|
moduleList: {
|
|
@@ -102,7 +102,7 @@ const subscriptionPlanModelSchema = new mongoose_1.Schema({
|
|
|
102
102
|
},
|
|
103
103
|
validCurrency: {
|
|
104
104
|
type: String,
|
|
105
|
-
default:
|
|
105
|
+
default: app_1.VALID_CURRENCY.COIN,
|
|
106
106
|
required: true,
|
|
107
107
|
},
|
|
108
108
|
files: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Model } from 'mongoose';
|
|
2
|
-
import { ITaskManagementModelAttributes } from '../../interfaces/taskManagementInterface
|
|
2
|
+
import { ITaskManagementModelAttributes } from '../../interfaces/taskManagementInterface';
|
|
3
3
|
declare const TaskManagementModel: Model<ITaskManagementModelAttributes>;
|
|
4
4
|
export default TaskManagementModel;
|
|
@@ -37,11 +37,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
40
|
-
const
|
|
40
|
+
const app_1 = require("../../constants/app");
|
|
41
41
|
const sequelize_1 = require("sequelize");
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
42
|
+
const errorMessages_1 = require("../../constants/errorMessages");
|
|
43
|
+
const instituteModel_1 = __importDefault(require("../psql/instituteModel"));
|
|
44
|
+
const userModel_1 = __importDefault(require("../psql/userModel"));
|
|
45
45
|
const TaskConversationsSchema = new mongoose_1.Schema({
|
|
46
46
|
messageId: {
|
|
47
47
|
type: String,
|
|
@@ -96,9 +96,9 @@ const TaskManagementModelSchema = new mongoose_1.Schema({
|
|
|
96
96
|
},
|
|
97
97
|
status: {
|
|
98
98
|
type: String,
|
|
99
|
-
enum: Object.values(
|
|
99
|
+
enum: Object.values(app_1.TASK_MANAGEMENT_STATUS),
|
|
100
100
|
required: true,
|
|
101
|
-
default:
|
|
101
|
+
default: app_1.TASK_MANAGEMENT_STATUS.PENDING,
|
|
102
102
|
},
|
|
103
103
|
instituteId: {
|
|
104
104
|
type: String,
|
|
@@ -117,9 +117,9 @@ const TaskManagementModelSchema = new mongoose_1.Schema({
|
|
|
117
117
|
const creatOrUpdateHook = async (task) => {
|
|
118
118
|
try {
|
|
119
119
|
if (task.instituteId) {
|
|
120
|
-
const institute = await
|
|
120
|
+
const institute = await instituteModel_1.default.findByPk(task.instituteId);
|
|
121
121
|
if (!institute)
|
|
122
|
-
throw new Error(
|
|
122
|
+
throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
123
123
|
}
|
|
124
124
|
let users = [
|
|
125
125
|
...(task.assignedUsers || []),
|
|
@@ -128,13 +128,13 @@ const creatOrUpdateHook = async (task) => {
|
|
|
128
128
|
];
|
|
129
129
|
users = [...new Set(users)];
|
|
130
130
|
if (users.length) {
|
|
131
|
-
const userCount = await
|
|
131
|
+
const userCount = await userModel_1.default.count({
|
|
132
132
|
where: {
|
|
133
133
|
id: { [sequelize_1.Op.in]: users },
|
|
134
134
|
},
|
|
135
135
|
});
|
|
136
136
|
if (userCount !== users.length) {
|
|
137
|
-
throw new Error(
|
|
137
|
+
throw new Error(errorMessages_1.USER_ERROR_MESSAGES.NOT_FOUND);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Model } from 'mongoose';
|
|
2
|
-
import { IUniqueNumberCounterModelAttributes } from '../../interfaces/uniqueNumberCounterInterface
|
|
2
|
+
import { IUniqueNumberCounterModelAttributes } from '../../interfaces/uniqueNumberCounterInterface';
|
|
3
3
|
declare const UniqueNumberCounterModel: Model<IUniqueNumberCounterModelAttributes>;
|
|
4
4
|
export default UniqueNumberCounterModel;
|
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
-
const
|
|
37
|
+
const app_1 = require("../../constants/app");
|
|
38
38
|
const uniqueNumberCounterSchema = new mongoose_1.Schema({
|
|
39
39
|
instituteId: {
|
|
40
40
|
type: String,
|
|
@@ -48,13 +48,13 @@ const uniqueNumberCounterSchema = new mongoose_1.Schema({
|
|
|
48
48
|
},
|
|
49
49
|
userType: {
|
|
50
50
|
type: String,
|
|
51
|
-
enum: Object.values(
|
|
51
|
+
enum: Object.values(app_1.USER_TYPES),
|
|
52
52
|
default: null,
|
|
53
53
|
required: false,
|
|
54
54
|
},
|
|
55
55
|
type: {
|
|
56
56
|
type: String,
|
|
57
|
-
enum: Object.values(
|
|
57
|
+
enum: Object.values(app_1.TYPE_OF_USER),
|
|
58
58
|
default: null,
|
|
59
59
|
required: false,
|
|
60
60
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Model, Schema } from 'mongoose';
|
|
2
|
-
import { IUserDetailsAttributes, IUserSchoolInfo } from '../../interfaces/userDetailsInterface
|
|
2
|
+
import { IUserDetailsAttributes, IUserSchoolInfo } from '../../interfaces/userDetailsInterface';
|
|
3
3
|
export declare const UserSchoolInfoSchema: Schema<IUserSchoolInfo>;
|
|
4
4
|
declare const userDetails: Model<IUserDetailsAttributes>;
|
|
5
5
|
export default userDetails;
|