@kipicore/dbcore 1.1.15 → 1.1.17
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/esm/configs/aws.js +9 -6
- package/dist/esm/configs/env.js +96 -57
- package/dist/esm/constants/app.js +336 -330
- package/dist/esm/constants/defaultModelAttributes.js +12 -9
- package/dist/esm/constants/errorMessages.js +219 -214
- package/dist/esm/constants/httpStatusCode.js +5 -2
- package/dist/esm/constants/successMessages.js +223 -217
- package/dist/esm/helpers/s3Uploader.js +25 -17
- package/dist/esm/helpers/utils.js +145 -66
- package/dist/esm/index.js +758 -151
- package/dist/esm/interfaces/academicCalendarInterface.js +2 -1
- package/dist/esm/interfaces/accountHasReceiptDetailsInterface.js +2 -1
- package/dist/esm/interfaces/announcementInterface.js +2 -1
- package/dist/esm/interfaces/approvalRequestInterface.js +2 -1
- package/dist/esm/interfaces/areaInterface.js +2 -1
- package/dist/esm/interfaces/attendanceInterface.js +2 -1
- package/dist/esm/interfaces/bankAccountDetailsInterface.js +2 -1
- package/dist/esm/interfaces/bannerInterface.js +2 -1
- package/dist/esm/interfaces/batchInterface.js +2 -1
- package/dist/esm/interfaces/batchSubjectBookAssessmentInterface.js +2 -1
- package/dist/esm/interfaces/batchSubjectProjectAssessmentInterface.js +2 -1
- package/dist/esm/interfaces/blogInterface.js +2 -1
- package/dist/esm/interfaces/bookAssessmentDateInterface.js +2 -1
- package/dist/esm/interfaces/careerInterface.js +2 -1
- package/dist/esm/interfaces/categoriesInterface.js +2 -1
- package/dist/esm/interfaces/certificatesHistoryInterface.js +2 -1
- package/dist/esm/interfaces/certificatesManagementInterface.js +2 -1
- package/dist/esm/interfaces/cityInterface.js +2 -1
- package/dist/esm/interfaces/classRoomInterface.js +2 -1
- package/dist/esm/interfaces/cloudStorageInterface.js +2 -1
- package/dist/esm/interfaces/coinPurchaseOfferInterface.js +2 -1
- package/dist/esm/interfaces/columnInterface.js +2 -1
- package/dist/esm/interfaces/commanInterface.js +2 -1
- package/dist/esm/interfaces/contactFeedBackInterface.js +2 -1
- package/dist/esm/interfaces/countryInterface.js +2 -1
- package/dist/esm/interfaces/courseHasVisitorsInterface.js +2 -1
- package/dist/esm/interfaces/courseInterface.js +2 -1
- package/dist/esm/interfaces/dailyBookInterface.js +2 -1
- package/dist/esm/interfaces/dashboardManagementInterface.js +2 -1
- package/dist/esm/interfaces/driverInterface.js +2 -1
- package/dist/esm/interfaces/entityGroupInterface.js +2 -1
- package/dist/esm/interfaces/eventInterface.js +2 -1
- package/dist/esm/interfaces/examGroupInterface.js +2 -1
- package/dist/esm/interfaces/examHasAnswerSheetInterface.js +2 -1
- package/dist/esm/interfaces/examInterface.js +2 -1
- package/dist/esm/interfaces/facilityInterface.js +2 -1
- package/dist/esm/interfaces/featureActionInterface.js +2 -1
- package/dist/esm/interfaces/feeHistoryDetailsInterface.js +2 -1
- package/dist/esm/interfaces/feeHistoryInterface.js +2 -1
- package/dist/esm/interfaces/feeReminderInterface.js +2 -1
- package/dist/esm/interfaces/feeReminderSettingInterface.js +2 -1
- package/dist/esm/interfaces/feeReminderTypeInterface.js +2 -1
- package/dist/esm/interfaces/feeTypeHasTermsInterface.js +2 -1
- package/dist/esm/interfaces/feeTypeInterface.js +2 -1
- package/dist/esm/interfaces/feedBackInterface.js +2 -1
- package/dist/esm/interfaces/feesCollectionInterface.js +2 -1
- package/dist/esm/interfaces/fileStorageInterface.js +2 -1
- package/dist/esm/interfaces/floorManagementInterface.js +2 -1
- package/dist/esm/interfaces/generateIdCardInterface.js +2 -1
- package/dist/esm/interfaces/greetingsInterface.js +2 -1
- package/dist/esm/interfaces/holidayInterface.js +2 -1
- package/dist/esm/interfaces/homeworkInterface.js +2 -1
- package/dist/esm/interfaces/informationSupportInterface.js +2 -1
- package/dist/esm/interfaces/inquiryInterface.js +2 -1
- package/dist/esm/interfaces/instituteEntityInterface.js +2 -1
- package/dist/esm/interfaces/instituteEntityTypeInterface.js +2 -1
- package/dist/esm/interfaces/instituteInterface.js +2 -1
- package/dist/esm/interfaces/instituteSubscriptionPlanInterface.js +2 -1
- package/dist/esm/interfaces/inventoryHistoryInterface.js +2 -1
- package/dist/esm/interfaces/inventoryInterface.js +2 -1
- package/dist/esm/interfaces/invoiceInterface.js +2 -1
- package/dist/esm/interfaces/jobApplyInterface.js +2 -1
- package/dist/esm/interfaces/lectureHistoryInterface.js +2 -1
- package/dist/esm/interfaces/lectureInterface.js +2 -1
- package/dist/esm/interfaces/masterLeaveInterface.js +2 -1
- package/dist/esm/interfaces/moduleFeatureInterface.js +2 -1
- package/dist/esm/interfaces/moduleInterface.js +2 -1
- package/dist/esm/interfaces/offersInterface.js +2 -1
- package/dist/esm/interfaces/paymentTermsInterface.js +2 -1
- package/dist/esm/interfaces/pdcChequeInterface.js +2 -1
- package/dist/esm/interfaces/pdcHistoryInterface.js +2 -1
- package/dist/esm/interfaces/photosGalleryInterface.js +2 -1
- package/dist/esm/interfaces/pincodeInterface.js +2 -1
- package/dist/esm/interfaces/plannerInterface.js +2 -1
- package/dist/esm/interfaces/productInterface.js +2 -1
- package/dist/esm/interfaces/projectAssessmentOptionInterface.js +2 -1
- package/dist/esm/interfaces/replaceTeacherInterface.js +2 -1
- package/dist/esm/interfaces/roleInterface.js +2 -1
- package/dist/esm/interfaces/rulesRegulationInterface.js +2 -1
- package/dist/esm/interfaces/schoolFeeCollectionInterface.js +2 -1
- package/dist/esm/interfaces/schoolFeeInterface.js +2 -1
- package/dist/esm/interfaces/schoolOfferInterface.js +2 -1
- package/dist/esm/interfaces/sendNotificationInerface.js +2 -1
- package/dist/esm/interfaces/slotInterface.js +2 -1
- package/dist/esm/interfaces/stateInterface.js +2 -1
- package/dist/esm/interfaces/subCategoriesInterface.js +2 -1
- package/dist/esm/interfaces/subjectHasFeeInterface.js +2 -1
- package/dist/esm/interfaces/subjectHasPayFeeHistoryInterface.js +2 -1
- package/dist/esm/interfaces/subjectIndexInterface.js +2 -1
- package/dist/esm/interfaces/subscriptionPlanInterface.js +2 -1
- package/dist/esm/interfaces/syllabusInterface.js +2 -1
- package/dist/esm/interfaces/taskManagementInterface.js +2 -1
- package/dist/esm/interfaces/testimonialInterface.js +2 -1
- package/dist/esm/interfaces/toDoInterface.js +2 -1
- package/dist/esm/interfaces/tokenInterface.js +2 -1
- package/dist/esm/interfaces/tripInterface.js +2 -1
- package/dist/esm/interfaces/typeManagementInterface.js +2 -1
- package/dist/esm/interfaces/uniqueNumberCounterInterface.js +2 -1
- package/dist/esm/interfaces/userBookAssessmentInterface.js +2 -1
- package/dist/esm/interfaces/userDetailsInterface.js +2 -1
- package/dist/esm/interfaces/userFeeTypeByAccountInterface.js +2 -1
- package/dist/esm/interfaces/userFeeTypeInterface.js +2 -1
- package/dist/esm/interfaces/userHasAnnouncementInterface.js +2 -1
- package/dist/esm/interfaces/userHasBatchInterface.js +2 -1
- package/dist/esm/interfaces/userHasCourseInterface.js +2 -1
- package/dist/esm/interfaces/userHasDeviceInterface.js +2 -1
- package/dist/esm/interfaces/userHasFeeTermsInterface.js +2 -1
- package/dist/esm/interfaces/userHasFileInterface.js +2 -1
- package/dist/esm/interfaces/userHasHomeWorkInterface.js +2 -1
- package/dist/esm/interfaces/userHasInventoryHistoryInterface.js +2 -1
- package/dist/esm/interfaces/userHasInventoryInterface.js +2 -1
- package/dist/esm/interfaces/userHasLeaveHistoryInterface.js +2 -1
- package/dist/esm/interfaces/userHasLeaveInterface.js +2 -1
- package/dist/esm/interfaces/userHasOfferInterface.js +2 -1
- package/dist/esm/interfaces/userHasParentInterface.js +2 -1
- package/dist/esm/interfaces/userHasRoleInterface.js +2 -1
- package/dist/esm/interfaces/userHasRollNumberInterface.js +2 -1
- package/dist/esm/interfaces/userHasStorageInterface.js +2 -1
- package/dist/esm/interfaces/userHasSubjectFeeInterface.js +2 -1
- package/dist/esm/interfaces/userInstituteMetaInterface.js +2 -1
- package/dist/esm/interfaces/userInterface.js +2 -1
- package/dist/esm/interfaces/userLeaveRequestInterface.js +2 -1
- package/dist/esm/interfaces/userMetaInterface.js +2 -1
- package/dist/esm/interfaces/userPayoutDetailsInterface.js +2 -1
- package/dist/esm/interfaces/userPayoutHistoryInterface.js +2 -1
- package/dist/esm/interfaces/userPayoutInterface.js +2 -1
- package/dist/esm/interfaces/userProjectAssessmentOptionInterface.js +2 -1
- package/dist/esm/interfaces/userRequiredStepsInterface.js +2 -1
- package/dist/esm/interfaces/userSchoolMetaInterface.js +2 -1
- package/dist/esm/interfaces/vehicleInterface.js +2 -1
- package/dist/esm/interfaces/vendorManagementInterface.js +2 -1
- package/dist/esm/interfaces/videoAnalystInterface.js +2 -1
- package/dist/esm/interfaces/walletHistoryInterface.js +2 -1
- package/dist/esm/interfaces/walletInterface.js +2 -1
- package/dist/esm/interfaces/walletTransactionInterface.js +2 -1
- package/dist/esm/interfaces/workingDayInterface.js +2 -1
- package/dist/esm/interfaces/workingShiftInterface.js +2 -1
- package/dist/esm/models/mongodb/approvalRequestModel.js +43 -8
- package/dist/esm/models/mongodb/attendanceModel.js +68 -30
- package/dist/esm/models/mongodb/blogModel.js +46 -11
- package/dist/esm/models/mongodb/careerModel.js +42 -7
- package/dist/esm/models/mongodb/certificatesHistoryModel.js +39 -4
- package/dist/esm/models/mongodb/certificatesManagementModel.js +42 -7
- package/dist/esm/models/mongodb/columnModel.js +45 -10
- package/dist/esm/models/mongodb/dailyBookModel.js +39 -4
- package/dist/esm/models/mongodb/dashboardManagementModel.js +46 -11
- package/dist/esm/models/mongodb/eventModel.js +58 -20
- package/dist/esm/models/mongodb/examGroupModel.js +69 -31
- package/dist/esm/models/mongodb/examHasAnswerSheetModel.js +56 -18
- package/dist/esm/models/mongodb/examModel.js +76 -38
- package/dist/esm/models/mongodb/feeReminderTypeModel.js +42 -7
- package/dist/esm/models/mongodb/feedBackModel.js +43 -8
- package/dist/esm/models/mongodb/generateIdCardModel.js +39 -4
- package/dist/esm/models/mongodb/holidayModel.js +58 -20
- package/dist/esm/models/mongodb/index.js +16 -11
- package/dist/esm/models/mongodb/informationSupportModel.js +42 -7
- package/dist/esm/models/mongodb/inquiryModel.js +67 -29
- package/dist/esm/models/mongodb/invoiceModel.js +48 -13
- package/dist/esm/models/mongodb/jobApplyModel.js +49 -14
- package/dist/esm/models/mongodb/photosGalleryModel.js +46 -11
- package/dist/esm/models/mongodb/plannerModel.js +45 -10
- package/dist/esm/models/mongodb/plugin/addDefaultAttributesPlugin.js +4 -1
- package/dist/esm/models/mongodb/plugin/transformIdInQueryPlugin.js +3 -1
- package/dist/esm/models/mongodb/plugin/transformIdInResponsePlugin.js +8 -3
- package/dist/esm/models/mongodb/replaceTeacherModel.js +46 -11
- package/dist/esm/models/mongodb/schoolFeeModel.js +56 -18
- package/dist/esm/models/mongodb/subjectIndexModel.js +145 -107
- package/dist/esm/models/mongodb/subscriptionPlanModel.js +47 -12
- package/dist/esm/models/mongodb/taskManagementModel.js +56 -18
- package/dist/esm/models/mongodb/uniqueNumberCounterModel.js +42 -7
- package/dist/esm/models/mongodb/userDetailsModel.js +68 -32
- package/dist/esm/models/mongodb/userDoc.js +6 -3
- package/dist/esm/models/mongodb/userInstituteMetaModel.js +54 -19
- package/dist/esm/models/mongodb/userSchoolMetaModel.js +46 -41
- package/dist/esm/models/mongodb/videoAnalystModel.js +40 -5
- package/dist/esm/models/mongodb/walletTransactionModel.js +56 -21
- package/dist/esm/models/psql/SubCategoriesModel.js +28 -23
- package/dist/esm/models/psql/academicCalendarModel.js +26 -21
- package/dist/esm/models/psql/accountHasReceiptDetailsModel.js +38 -33
- package/dist/esm/models/psql/announcementModel.js +58 -53
- package/dist/esm/models/psql/areaModel.js +17 -12
- package/dist/esm/models/psql/bankAccountDetailsModel.js +35 -30
- package/dist/esm/models/psql/bannerModel.js +40 -35
- package/dist/esm/models/psql/batchModel.js +53 -48
- package/dist/esm/models/psql/batchSubjectBookAssessmentModel.js +35 -30
- package/dist/esm/models/psql/batchSubjectProjectAssessmentModel.js +35 -30
- package/dist/esm/models/psql/bookAssessmentDateModel.js +25 -20
- package/dist/esm/models/psql/categoriesModel.js +24 -19
- package/dist/esm/models/psql/cityModel.js +21 -16
- package/dist/esm/models/psql/classRoomModel.js +36 -31
- package/dist/esm/models/psql/cloudStorageModel.js +30 -25
- package/dist/esm/models/psql/coinPurchaseOfferModel.js +31 -26
- package/dist/esm/models/psql/contactFeedBackModel.js +34 -29
- package/dist/esm/models/psql/countryModel.js +13 -11
- package/dist/esm/models/psql/courseHasVisitorsModel.js +22 -17
- package/dist/esm/models/psql/courseModel.js +41 -36
- package/dist/esm/models/psql/driverModel.js +51 -46
- package/dist/esm/models/psql/entityGroupModel.js +29 -24
- package/dist/esm/models/psql/facilityModel.js +34 -29
- package/dist/esm/models/psql/featureActionModel.js +28 -23
- package/dist/esm/models/psql/feeHistoryDetailsModel.js +45 -40
- package/dist/esm/models/psql/feeHistoryModel.js +78 -73
- package/dist/esm/models/psql/feeReminderModel.js +63 -58
- package/dist/esm/models/psql/feeReminderSettingModel.js +27 -22
- package/dist/esm/models/psql/feeTypeHasTermsModel.js +31 -26
- package/dist/esm/models/psql/feeTypeModel.js +42 -37
- package/dist/esm/models/psql/feesCollectionModel.js +55 -50
- package/dist/esm/models/psql/fileStorageModel.js +26 -21
- package/dist/esm/models/psql/floorManagementModel.js +25 -20
- package/dist/esm/models/psql/greetingsModel.js +34 -29
- package/dist/esm/models/psql/homeWorkModel.js +36 -31
- package/dist/esm/models/psql/index.js +15 -7
- package/dist/esm/models/psql/instituteEntityModel.js +34 -29
- package/dist/esm/models/psql/instituteEntityTypeModel.js +25 -20
- package/dist/esm/models/psql/instituteModel.js +70 -65
- package/dist/esm/models/psql/instituteSubscriptionPlanModel.js +42 -37
- package/dist/esm/models/psql/inventoryHistoryModel.js +42 -37
- package/dist/esm/models/psql/inventoryModel.js +36 -31
- package/dist/esm/models/psql/lectureHistoryModel.js +62 -57
- package/dist/esm/models/psql/lectureModel.js +111 -106
- package/dist/esm/models/psql/masterLeaveModel.js +41 -36
- package/dist/esm/models/psql/moduleFeatureModel.js +29 -24
- package/dist/esm/models/psql/moduleModel.js +30 -25
- package/dist/esm/models/psql/offerModel.js +39 -34
- package/dist/esm/models/psql/paymentTermsModel.js +35 -30
- package/dist/esm/models/psql/pdcChequeModel.js +40 -35
- package/dist/esm/models/psql/pdcHistoryModel.js +44 -39
- package/dist/esm/models/psql/pincodeModel.js +28 -23
- package/dist/esm/models/psql/productModel.js +32 -27
- package/dist/esm/models/psql/projectAssessmentOptionModel.js +23 -18
- package/dist/esm/models/psql/roleModel.js +26 -21
- package/dist/esm/models/psql/rulesRegulationModel.js +23 -18
- package/dist/esm/models/psql/schoolFeeCollectionModel.js +34 -29
- package/dist/esm/models/psql/schoolOfferModel.js +43 -38
- package/dist/esm/models/psql/sendNotificationModel.js +32 -27
- package/dist/esm/models/psql/slotModel.js +27 -22
- package/dist/esm/models/psql/stateModel.js +18 -13
- package/dist/esm/models/psql/subjectHasFeeModel.js +25 -20
- package/dist/esm/models/psql/subjectHasPayFeeHistoryModel.js +32 -27
- package/dist/esm/models/psql/syllabusModel.js +31 -26
- package/dist/esm/models/psql/testimonialModel.js +52 -47
- package/dist/esm/models/psql/toDoModel.js +35 -30
- package/dist/esm/models/psql/tokenModel.js +12 -10
- package/dist/esm/models/psql/tripModel.js +34 -29
- package/dist/esm/models/psql/typeManagementModel.js +32 -27
- package/dist/esm/models/psql/userBookAssessmentModel.js +34 -29
- package/dist/esm/models/psql/userFeeTypeByAccountModel.js +41 -36
- package/dist/esm/models/psql/userFeeTypeModel.js +44 -39
- package/dist/esm/models/psql/userHasAnnouncementModel.js +31 -26
- package/dist/esm/models/psql/userHasBatchModel.js +24 -19
- package/dist/esm/models/psql/userHasCourseModel.js +35 -30
- package/dist/esm/models/psql/userHasDeviceModel.js +26 -21
- package/dist/esm/models/psql/userHasFeeTermsModel.js +45 -40
- package/dist/esm/models/psql/userHasFileModel.js +29 -24
- package/dist/esm/models/psql/userHasHomeWorkModel.js +36 -31
- package/dist/esm/models/psql/userHasInventoryHistoryModel.js +41 -36
- package/dist/esm/models/psql/userHasInventoryModel.js +45 -40
- package/dist/esm/models/psql/userHasLeaveHistoryModel.js +41 -36
- package/dist/esm/models/psql/userHasLeaveModel.js +34 -29
- package/dist/esm/models/psql/userHasOfferModel.js +36 -31
- package/dist/esm/models/psql/userHasParentModel.js +31 -26
- package/dist/esm/models/psql/userHasRoleModel.js +27 -22
- package/dist/esm/models/psql/userHasRollNumberModel.js +28 -23
- package/dist/esm/models/psql/userHasStorageModel.js +27 -22
- package/dist/esm/models/psql/userHasSubjectFeeModel.js +27 -22
- package/dist/esm/models/psql/userLeaveRequestModel.js +43 -38
- package/dist/esm/models/psql/userModel.js +92 -87
- package/dist/esm/models/psql/userPayoutDetailsModel.js +41 -36
- package/dist/esm/models/psql/userPayoutHistoryModel.js +40 -35
- package/dist/esm/models/psql/userPayoutModel.js +63 -58
- package/dist/esm/models/psql/userProjectAssessmentOptionModel.js +31 -26
- package/dist/esm/models/psql/userRequiredStepsModel.js +22 -17
- package/dist/esm/models/psql/vehicleModel.js +30 -25
- package/dist/esm/models/psql/vendorManagementModel.js +44 -39
- package/dist/esm/models/psql/walletHistoryModel.js +34 -28
- package/dist/esm/models/psql/walletModel.js +25 -20
- package/dist/esm/models/psql/workingDayModel.js +24 -19
- package/dist/esm/models/psql/workingShiftModel.js +34 -29
- package/dist/esm/services/Concrete/mongooseCommonService.js +9 -5
- package/dist/esm/services/Concrete/sequelizeCommonService.js +9 -6
- package/dist/esm/services/Contracts/IMongooseCommonService.js +2 -1
- package/dist/esm/services/Contracts/ISequelizeCommonService.js +2 -1
- package/dist/esm/types/academicCalendarType.js +2 -1
- package/dist/esm/types/accountHasReceiptDetailsType.js +2 -1
- package/dist/esm/types/announcementType.js +2 -1
- package/dist/esm/types/approveRequestType.js +2 -1
- package/dist/esm/types/areaType.js +2 -1
- package/dist/esm/types/attendanceType.js +2 -1
- package/dist/esm/types/bankAccountDetailsType.js +2 -1
- package/dist/esm/types/bannerType.js +2 -1
- package/dist/esm/types/batchSubjectBookAssessmentType.js +2 -1
- package/dist/esm/types/batchSubjectProjectAssessmentType.js +2 -1
- package/dist/esm/types/batchType.js +2 -1
- package/dist/esm/types/blogType.js +2 -1
- package/dist/esm/types/bookAssessmentDateType.js +2 -1
- package/dist/esm/types/careerType.js +2 -1
- package/dist/esm/types/categoriesType.js +2 -1
- package/dist/esm/types/certificatesHistoryType.js +2 -1
- package/dist/esm/types/certificatesManagementType.js +2 -1
- package/dist/esm/types/classRoomType.js +2 -1
- package/dist/esm/types/cloudStorageType.js +2 -1
- package/dist/esm/types/coinPurchaseOfferType.js +2 -1
- package/dist/esm/types/commonType.js +2 -1
- package/dist/esm/types/contactFeedBackType.js +2 -1
- package/dist/esm/types/courseHasVisitorsType.js +2 -1
- package/dist/esm/types/courseType.js +2 -1
- package/dist/esm/types/dailyBookType.js +2 -1
- package/dist/esm/types/dashboardManagementType.js +2 -1
- package/dist/esm/types/driverType.js +2 -1
- package/dist/esm/types/entityGroupType.js +2 -1
- package/dist/esm/types/eventType.js +2 -1
- package/dist/esm/types/examGroupType.js +2 -1
- package/dist/esm/types/examHasAnswerSheetType.js +2 -1
- package/dist/esm/types/examType.js +2 -1
- package/dist/esm/types/facilityType.js +2 -1
- package/dist/esm/types/featureActionType.js +2 -1
- package/dist/esm/types/feeHistoryDetailsType.js +2 -1
- package/dist/esm/types/feeHistoryType.js +2 -1
- package/dist/esm/types/feeReminderSettingType.js +2 -1
- package/dist/esm/types/feeReminderType.js +2 -1
- package/dist/esm/types/feeReminderTypeType.js +2 -1
- package/dist/esm/types/feeTypeHasTermsType.js +2 -1
- package/dist/esm/types/feeTypeType.js +2 -1
- package/dist/esm/types/feedBackType.js +2 -1
- package/dist/esm/types/feesCollectionType.js +2 -1
- package/dist/esm/types/fileStorageType.js +2 -1
- package/dist/esm/types/floormanagementType.js +2 -1
- package/dist/esm/types/generateIdCardType.js +2 -1
- package/dist/esm/types/greetingsType.js +2 -1
- package/dist/esm/types/holidayType.js +2 -1
- package/dist/esm/types/homeWorkType.js +2 -1
- package/dist/esm/types/informationSupportType.js +2 -1
- package/dist/esm/types/inquiryType.js +2 -1
- package/dist/esm/types/instituteEntityType.js +2 -1
- package/dist/esm/types/instituteEntityTypeType.js +2 -1
- package/dist/esm/types/instituteSubscriptionPlanType.js +2 -1
- package/dist/esm/types/instituteType.js +2 -1
- package/dist/esm/types/inventoryHistoryType.js +2 -1
- package/dist/esm/types/inventoryType.js +2 -1
- package/dist/esm/types/jobApply.js +2 -1
- package/dist/esm/types/lectureHistoryType.js +2 -1
- package/dist/esm/types/lectureType.js +2 -1
- package/dist/esm/types/masterLeaveType.js +2 -1
- package/dist/esm/types/moduleFeatureType.js +2 -1
- package/dist/esm/types/moduleType.js +2 -1
- package/dist/esm/types/offerType.js +2 -1
- package/dist/esm/types/paymentTermsType.js +2 -1
- package/dist/esm/types/pdcChequeType.js +2 -1
- package/dist/esm/types/pdcHistoryType.js +2 -1
- package/dist/esm/types/photosGalleryType.js +2 -1
- package/dist/esm/types/plannerType.js +2 -1
- package/dist/esm/types/productType.js +2 -1
- package/dist/esm/types/projectAssessmentOptionType.js +2 -1
- package/dist/esm/types/roleType.js +2 -1
- package/dist/esm/types/rulesRegulationType.js +2 -1
- package/dist/esm/types/schoolFeeCollectionType.js +2 -1
- package/dist/esm/types/schoolFeeType.js +2 -1
- package/dist/esm/types/schoolOfferType.js +2 -1
- package/dist/esm/types/sendNotificationType.js +2 -1
- package/dist/esm/types/slotType.js +2 -1
- package/dist/esm/types/subCategoryType.js +2 -1
- package/dist/esm/types/subjectHasFeeType.js +2 -1
- package/dist/esm/types/subjectHasPayFeeHistoryType.js +2 -1
- package/dist/esm/types/subjectIndexType.js +2 -1
- package/dist/esm/types/subscriptionPlanType.js +2 -1
- package/dist/esm/types/syllabusType.js +2 -1
- package/dist/esm/types/taskManagementType.js +2 -1
- package/dist/esm/types/testimonialType.js +2 -1
- package/dist/esm/types/toDoType.js +2 -1
- package/dist/esm/types/tripType.js +2 -1
- package/dist/esm/types/typeManagementType.js +2 -1
- package/dist/esm/types/uniqueNumberCounterType.js +2 -1
- package/dist/esm/types/userBookAssessmentType.js +2 -1
- package/dist/esm/types/userDetailsType.js +2 -1
- package/dist/esm/types/userFeeTypeByAccountType.js +2 -1
- package/dist/esm/types/userFeeTypeType.js +2 -1
- package/dist/esm/types/userHasAnnouncementType.js +2 -1
- package/dist/esm/types/userHasBatchType.js +2 -1
- package/dist/esm/types/userHasCourseType.js +2 -1
- package/dist/esm/types/userHasDeviceType.js +2 -1
- package/dist/esm/types/userHasFeeTermsType.js +2 -1
- package/dist/esm/types/userHasFileType.js +2 -1
- package/dist/esm/types/userHasHomeWorkType.js +2 -1
- package/dist/esm/types/userHasInventoryHistoryType.js +2 -1
- package/dist/esm/types/userHasInventoryType.js +2 -1
- package/dist/esm/types/userHasLeaveHistoryType.js +2 -1
- package/dist/esm/types/userHasLeaveType.js +2 -1
- package/dist/esm/types/userHasOffer.js +2 -1
- package/dist/esm/types/userHasParentType.js +2 -1
- package/dist/esm/types/userHasRoleType.js +2 -1
- package/dist/esm/types/userHasRollNumberType.js +2 -1
- package/dist/esm/types/userHasStorageType.js +2 -1
- package/dist/esm/types/userHasSubjectFeeType.js +2 -1
- package/dist/esm/types/userInstituteMetaType.js +2 -1
- package/dist/esm/types/userLeaveRequestType.js +2 -1
- package/dist/esm/types/userMetaType.js +2 -1
- package/dist/esm/types/userPayoutDetailsType.js +2 -1
- package/dist/esm/types/userPayoutHistoryType.js +2 -1
- package/dist/esm/types/userPayoutType.js +2 -1
- package/dist/esm/types/userProjectAssessmentOptionType.js +2 -1
- package/dist/esm/types/userRequiredStepsType.js +2 -1
- package/dist/esm/types/userSchoolMetaType.js +2 -1
- package/dist/esm/types/userType.js +2 -1
- package/dist/esm/types/vehicleType.js +2 -1
- package/dist/esm/types/vendorType.js +2 -1
- package/dist/esm/types/videoAnalystType.js +2 -1
- package/dist/esm/types/walletHistoryType.js +2 -1
- package/dist/esm/types/walletTransactionType.js +2 -1
- package/dist/esm/types/walletType.js +2 -1
- package/dist/esm/types/workingDayType.js +2 -1
- package/dist/esm/types/workingShiftType.js +2 -1
- package/package.json +7 -5
|
@@ -1,29 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
39
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
40
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
41
|
+
const app_js_1 = require("../../constants/app.js");
|
|
42
|
+
const utils_js_1 = require("../../helpers/utils.js");
|
|
43
|
+
const sequelize_1 = require("sequelize");
|
|
44
|
+
const env_js_1 = require("../../configs/env.js");
|
|
45
|
+
const errorMessages_js_1 = require("../../constants/errorMessages.js");
|
|
46
|
+
const batchModel_js_1 = __importDefault(require("../psql/batchModel.js"));
|
|
47
|
+
const instituteModel_js_1 = __importDefault(require("../psql/instituteModel.js"));
|
|
48
|
+
const userModel_js_1 = __importDefault(require("../psql/userModel.js"));
|
|
49
|
+
const defaultModelAttributes_js_1 = require("../../constants/defaultModelAttributes.js");
|
|
50
|
+
const instituteEntityModel_js_1 = __importDefault(require("../psql/instituteEntityModel.js"));
|
|
51
|
+
const fileStorageModel_js_1 = __importDefault(require("../psql/fileStorageModel.js"));
|
|
52
|
+
const typeManagementModel_js_1 = __importDefault(require("../psql/typeManagementModel.js"));
|
|
53
|
+
const lectureModel_js_1 = __importDefault(require("../psql/lectureModel.js"));
|
|
54
|
+
const s3Uploader_js_1 = require("../../helpers/s3Uploader.js");
|
|
55
|
+
const userInstituteMetaModel_js_1 = __importDefault(require("./userInstituteMetaModel.js"));
|
|
18
56
|
// Define the schema for IChapterFileAttributes
|
|
19
|
-
const ChapterFileSchema = new Schema({
|
|
57
|
+
const ChapterFileSchema = new mongoose_1.Schema({
|
|
20
58
|
id: {
|
|
21
59
|
type: String,
|
|
22
60
|
required: true,
|
|
23
61
|
},
|
|
24
62
|
type: {
|
|
25
63
|
type: String,
|
|
26
|
-
enum: Object.values(CHAPTER_INDEX_FILE_TYPE),
|
|
64
|
+
enum: Object.values(app_js_1.CHAPTER_INDEX_FILE_TYPE),
|
|
27
65
|
required: true,
|
|
28
66
|
},
|
|
29
67
|
fileStorageId: {
|
|
@@ -51,7 +89,7 @@ const ChapterFileSchema = new Schema({
|
|
|
51
89
|
default: false,
|
|
52
90
|
},
|
|
53
91
|
}, { _id: false });
|
|
54
|
-
const assignedUsersSchema = new Schema({
|
|
92
|
+
const assignedUsersSchema = new mongoose_1.Schema({
|
|
55
93
|
userId: {
|
|
56
94
|
type: String,
|
|
57
95
|
required: true,
|
|
@@ -62,8 +100,8 @@ const assignedUsersSchema = new Schema({
|
|
|
62
100
|
},
|
|
63
101
|
status: {
|
|
64
102
|
type: String,
|
|
65
|
-
enum: Object.values(USER_CHAPTER_INDEX_STATUS),
|
|
66
|
-
default: USER_CHAPTER_INDEX_STATUS.NOT_COMPLETED,
|
|
103
|
+
enum: Object.values(app_js_1.USER_CHAPTER_INDEX_STATUS),
|
|
104
|
+
default: app_js_1.USER_CHAPTER_INDEX_STATUS.NOT_COMPLETED,
|
|
67
105
|
required: false,
|
|
68
106
|
},
|
|
69
107
|
statusUpdatedAt: {
|
|
@@ -86,7 +124,7 @@ const assignedUsersSchema = new Schema({
|
|
|
86
124
|
},
|
|
87
125
|
}, { _id: false });
|
|
88
126
|
// Define the schema for IChapterIndexAttributes
|
|
89
|
-
const ChapterIndexSchema = new Schema({
|
|
127
|
+
const ChapterIndexSchema = new mongoose_1.Schema({
|
|
90
128
|
id: {
|
|
91
129
|
type: String,
|
|
92
130
|
required: true,
|
|
@@ -105,7 +143,7 @@ const ChapterIndexSchema = new Schema({
|
|
|
105
143
|
},
|
|
106
144
|
type: {
|
|
107
145
|
type: String,
|
|
108
|
-
enum: Object.values(CHAPTER_INDEX_TYPE),
|
|
146
|
+
enum: Object.values(app_js_1.CHAPTER_INDEX_TYPE),
|
|
109
147
|
required: true,
|
|
110
148
|
},
|
|
111
149
|
parentId: {
|
|
@@ -126,7 +164,7 @@ const ChapterIndexSchema = new Schema({
|
|
|
126
164
|
},
|
|
127
165
|
}, { _id: false });
|
|
128
166
|
// Define the schema for ISubjectIndexModelAttributes
|
|
129
|
-
const SubjectIndexSchema = new Schema({
|
|
167
|
+
const SubjectIndexSchema = new mongoose_1.Schema({
|
|
130
168
|
title: {
|
|
131
169
|
type: String,
|
|
132
170
|
required: false,
|
|
@@ -141,7 +179,7 @@ const SubjectIndexSchema = new Schema({
|
|
|
141
179
|
},
|
|
142
180
|
type: {
|
|
143
181
|
type: String,
|
|
144
|
-
enum: Object.values(SUBJECT_INDEX_TYPE),
|
|
182
|
+
enum: Object.values(app_js_1.SUBJECT_INDEX_TYPE),
|
|
145
183
|
required: true,
|
|
146
184
|
},
|
|
147
185
|
chapterIndex: {
|
|
@@ -150,8 +188,8 @@ const SubjectIndexSchema = new Schema({
|
|
|
150
188
|
},
|
|
151
189
|
status: {
|
|
152
190
|
type: String,
|
|
153
|
-
enum: Object.values(COMMAN_STATUS),
|
|
154
|
-
default: COMMAN_STATUS.ACTIVE,
|
|
191
|
+
enum: Object.values(app_js_1.COMMAN_STATUS),
|
|
192
|
+
default: app_js_1.COMMAN_STATUS.ACTIVE,
|
|
155
193
|
required: false,
|
|
156
194
|
},
|
|
157
195
|
instituteId: {
|
|
@@ -189,61 +227,61 @@ const SubjectIndexSchema = new Schema({
|
|
|
189
227
|
const creatOrUpdateHook = async (subjectIndex) => {
|
|
190
228
|
try {
|
|
191
229
|
if (subjectIndex.instituteId) {
|
|
192
|
-
const institute = await
|
|
230
|
+
const institute = await instituteModel_js_1.default.findByPk(subjectIndex.instituteId);
|
|
193
231
|
if (!institute)
|
|
194
|
-
throw new Error(INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
232
|
+
throw new Error(errorMessages_js_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
195
233
|
}
|
|
196
234
|
if (subjectIndex.sharedInstituteId?.length) {
|
|
197
235
|
subjectIndex.sharedInstituteId = [...new Set(subjectIndex.sharedInstituteId)];
|
|
198
|
-
const count = await
|
|
236
|
+
const count = await instituteModel_js_1.default.count({
|
|
199
237
|
where: {
|
|
200
|
-
id: { [Op.in]: subjectIndex.sharedInstituteId },
|
|
238
|
+
id: { [sequelize_1.Op.in]: subjectIndex.sharedInstituteId },
|
|
201
239
|
},
|
|
202
240
|
});
|
|
203
241
|
if (count !== subjectIndex.sharedInstituteId.length)
|
|
204
|
-
throw new Error(INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
242
|
+
throw new Error(errorMessages_js_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
205
243
|
}
|
|
206
244
|
if (subjectIndex.sharedUnverifiedInstituteId?.length) {
|
|
207
245
|
subjectIndex.sharedUnverifiedInstituteId = [...new Set(subjectIndex.sharedUnverifiedInstituteId)].filter(instituteId => !subjectIndex?.sharedInstituteId?.includes(instituteId));
|
|
208
|
-
const count = await
|
|
246
|
+
const count = await instituteModel_js_1.default.count({
|
|
209
247
|
where: {
|
|
210
|
-
id: { [Op.in]: subjectIndex.sharedUnverifiedInstituteId },
|
|
248
|
+
id: { [sequelize_1.Op.in]: subjectIndex.sharedUnverifiedInstituteId },
|
|
211
249
|
},
|
|
212
250
|
});
|
|
213
251
|
if (count !== subjectIndex.sharedUnverifiedInstituteId.length)
|
|
214
|
-
throw new Error(INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
252
|
+
throw new Error(errorMessages_js_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
215
253
|
}
|
|
216
254
|
if (subjectIndex.subject) {
|
|
217
|
-
const subject = await
|
|
255
|
+
const subject = await instituteEntityModel_js_1.default.findOne({
|
|
218
256
|
where: { id: subjectIndex.subject },
|
|
219
257
|
include: [
|
|
220
258
|
{
|
|
221
259
|
association: 'entityType',
|
|
222
|
-
where: { sequence: INSTITUTE_ENTITY_TYPE_SEQUENCE.LAST },
|
|
260
|
+
where: { sequence: app_js_1.INSTITUTE_ENTITY_TYPE_SEQUENCE.LAST },
|
|
223
261
|
},
|
|
224
262
|
],
|
|
225
263
|
});
|
|
226
264
|
if (!subject)
|
|
227
|
-
throw new Error(INSTITUTE_ENTITY_ERROR_MESSAGES.NOT_FOUND);
|
|
265
|
+
throw new Error(errorMessages_js_1.INSTITUTE_ENTITY_ERROR_MESSAGES.NOT_FOUND);
|
|
228
266
|
}
|
|
229
267
|
if (subjectIndex.batch) {
|
|
230
|
-
const batch = await
|
|
268
|
+
const batch = await batchModel_js_1.default.findOne({
|
|
231
269
|
where: {
|
|
232
270
|
id: subjectIndex.batch,
|
|
233
|
-
subjects: { [Op.overlap]: [subjectIndex.subject] },
|
|
271
|
+
subjects: { [sequelize_1.Op.overlap]: [subjectIndex.subject] },
|
|
234
272
|
},
|
|
235
273
|
});
|
|
236
274
|
if (!batch)
|
|
237
|
-
throw new Error(BATCH_ERROR_MESSAGES.NOT_FOUND);
|
|
275
|
+
throw new Error(errorMessages_js_1.BATCH_ERROR_MESSAGES.NOT_FOUND);
|
|
238
276
|
}
|
|
239
277
|
if (subjectIndex.userId) {
|
|
240
|
-
const userId = await
|
|
278
|
+
const userId = await userModel_js_1.default.findOne({
|
|
241
279
|
where: {
|
|
242
280
|
id: subjectIndex.userId,
|
|
243
281
|
},
|
|
244
282
|
});
|
|
245
283
|
if (!userId) {
|
|
246
|
-
throw new Error(USER_ERROR_MESSAGES.NOT_FOUND);
|
|
284
|
+
throw new Error(errorMessages_js_1.USER_ERROR_MESSAGES.NOT_FOUND);
|
|
247
285
|
}
|
|
248
286
|
}
|
|
249
287
|
if (subjectIndex.chapterIndex && subjectIndex.chapterIndex.length) {
|
|
@@ -269,17 +307,17 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
269
307
|
}
|
|
270
308
|
return true;
|
|
271
309
|
};
|
|
272
|
-
const chapterList = subjectIndex.chapterIndex.filter(chapter => chapter.type === CHAPTER_INDEX_TYPE.CHAPTER);
|
|
310
|
+
const chapterList = subjectIndex.chapterIndex.filter(chapter => chapter.type === app_js_1.CHAPTER_INDEX_TYPE.CHAPTER);
|
|
273
311
|
if (!isValidIndex(chapterList))
|
|
274
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_INDEX);
|
|
312
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_INDEX);
|
|
275
313
|
for (const chapter of chapterList) {
|
|
276
|
-
const topicList = subjectIndex.chapterIndex.filter(topic => topic.type === CHAPTER_INDEX_TYPE.TOPIC && topic.parentId === chapter.id);
|
|
314
|
+
const topicList = subjectIndex.chapterIndex.filter(topic => topic.type === app_js_1.CHAPTER_INDEX_TYPE.TOPIC && topic.parentId === chapter.id);
|
|
277
315
|
if (!isValidIndex(topicList))
|
|
278
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
316
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
279
317
|
for (const topic of topicList) {
|
|
280
|
-
const subTopicList = subjectIndex.chapterIndex.filter(subTopic => subTopic.type === CHAPTER_INDEX_TYPE.SUB_TOPIC && subTopic.parentId === topic.id);
|
|
318
|
+
const subTopicList = subjectIndex.chapterIndex.filter(subTopic => subTopic.type === app_js_1.CHAPTER_INDEX_TYPE.SUB_TOPIC && subTopic.parentId === topic.id);
|
|
281
319
|
if (!isValidIndex(subTopicList))
|
|
282
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
|
|
320
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
|
|
283
321
|
const topicIndex = subjectIndex.chapterIndex.findIndex(c => c.id === topic.id);
|
|
284
322
|
if (!subTopicList.length && topic.teachingTime) {
|
|
285
323
|
subjectIndex.chapterIndex[topicIndex].teachingTime = topic.teachingTime;
|
|
@@ -299,15 +337,15 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
299
337
|
for (const chapterIndex of subjectIndex.chapterIndex) {
|
|
300
338
|
if (!chapterIndex.id)
|
|
301
339
|
chapterIndex.id = crypto.randomUUID();
|
|
302
|
-
if (chapterIndex.type !== CHAPTER_INDEX_TYPE.CHAPTER) {
|
|
340
|
+
if (chapterIndex.type !== app_js_1.CHAPTER_INDEX_TYPE.CHAPTER) {
|
|
303
341
|
const parentChapterIndex = subjectIndex.chapterIndex.find(index => index.id === chapterIndex.parentId);
|
|
304
342
|
if (!parentChapterIndex)
|
|
305
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
306
|
-
if (chapterIndex.type === CHAPTER_INDEX_TYPE.SUB_TOPIC && parentChapterIndex.type !== CHAPTER_INDEX_TYPE.TOPIC) {
|
|
307
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
343
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
344
|
+
if (chapterIndex.type === app_js_1.CHAPTER_INDEX_TYPE.SUB_TOPIC && parentChapterIndex.type !== app_js_1.CHAPTER_INDEX_TYPE.TOPIC) {
|
|
345
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
308
346
|
}
|
|
309
|
-
if (chapterIndex.type === CHAPTER_INDEX_TYPE.TOPIC && parentChapterIndex.type !== CHAPTER_INDEX_TYPE.CHAPTER) {
|
|
310
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
|
|
347
|
+
if (chapterIndex.type === app_js_1.CHAPTER_INDEX_TYPE.TOPIC && parentChapterIndex.type !== app_js_1.CHAPTER_INDEX_TYPE.CHAPTER) {
|
|
348
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
|
|
311
349
|
}
|
|
312
350
|
}
|
|
313
351
|
if (chapterIndex.files && chapterIndex.files.length) {
|
|
@@ -325,7 +363,7 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
325
363
|
}
|
|
326
364
|
}
|
|
327
365
|
if (subjectIndex.assignedUsers && subjectIndex.assignedUsers.length) {
|
|
328
|
-
subjectIndex.assignedUsers = getUniqueArrayByFields(subjectIndex.assignedUsers, ['userId', 'chapterIndexId']);
|
|
366
|
+
subjectIndex.assignedUsers = (0, utils_js_1.getUniqueArrayByFields)(subjectIndex.assignedUsers, ['userId', 'chapterIndexId']);
|
|
329
367
|
const chapterIndex = [...(subjectIndex.chapterIndex || [])];
|
|
330
368
|
const chapterIndexIdList = chapterIndex
|
|
331
369
|
// .filter(chapter => chapter.type === CHAPTER_INDEX_TYPE.CHAPTER)
|
|
@@ -341,17 +379,17 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
341
379
|
chapter.teachingTime = found.teachingTime;
|
|
342
380
|
return chapter;
|
|
343
381
|
});
|
|
344
|
-
const chapterList = chapterIndexList.filter(chapter => chapter.type === CHAPTER_INDEX_TYPE.CHAPTER);
|
|
382
|
+
const chapterList = chapterIndexList.filter(chapter => chapter.type === app_js_1.CHAPTER_INDEX_TYPE.CHAPTER);
|
|
345
383
|
if (!chapterList.length)
|
|
346
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_INDEX);
|
|
384
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_INDEX);
|
|
347
385
|
for (const chapter of chapterList) {
|
|
348
|
-
const topicList = chapterIndexList.filter(topic => topic.type === CHAPTER_INDEX_TYPE.TOPIC && topic.parentId === chapter.id);
|
|
386
|
+
const topicList = chapterIndexList.filter(topic => topic.type === app_js_1.CHAPTER_INDEX_TYPE.TOPIC && topic.parentId === chapter.id);
|
|
349
387
|
if (!topicList)
|
|
350
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
388
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
|
|
351
389
|
for (const topic of topicList) {
|
|
352
|
-
const subTopicList = chapterIndexList.filter(subTopic => subTopic.type === CHAPTER_INDEX_TYPE.SUB_TOPIC && subTopic.parentId === topic.id);
|
|
390
|
+
const subTopicList = chapterIndexList.filter(subTopic => subTopic.type === app_js_1.CHAPTER_INDEX_TYPE.SUB_TOPIC && subTopic.parentId === topic.id);
|
|
353
391
|
if (!subTopicList)
|
|
354
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
|
|
392
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
|
|
355
393
|
const topicIndex = chapterIndexList.findIndex(c => c.id === topic.id);
|
|
356
394
|
if (!subTopicList.length && topic.teachingTime) {
|
|
357
395
|
chapterIndexList[topicIndex].teachingTime = topic.teachingTime;
|
|
@@ -378,23 +416,23 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
378
416
|
];
|
|
379
417
|
let userIdList = subjectIndex.assignedUsers.map(assignedUser => assignedUser.userId);
|
|
380
418
|
userIdList = [...new Set(userIdList)];
|
|
381
|
-
const assignedUsersIdCount = await
|
|
419
|
+
const assignedUsersIdCount = await userModel_js_1.default.count({
|
|
382
420
|
where: {
|
|
383
421
|
id: {
|
|
384
|
-
[Op.in]: userIdList,
|
|
422
|
+
[sequelize_1.Op.in]: userIdList,
|
|
385
423
|
},
|
|
386
|
-
type: USER_TYPES.TEACHER,
|
|
424
|
+
type: app_js_1.USER_TYPES.TEACHER,
|
|
387
425
|
},
|
|
388
426
|
});
|
|
389
427
|
if (assignedUsersIdCount !== userIdList.length) {
|
|
390
|
-
throw new Error(USER_ERROR_MESSAGES.NOT_FOUND);
|
|
428
|
+
throw new Error(errorMessages_js_1.USER_ERROR_MESSAGES.NOT_FOUND);
|
|
391
429
|
}
|
|
392
430
|
const where = {
|
|
393
|
-
userType: USER_TYPES.TEACHER,
|
|
394
|
-
status: USER_INSTITUTE_META_STATUS.ACCEPTED,
|
|
431
|
+
userType: app_js_1.USER_TYPES.TEACHER,
|
|
432
|
+
status: app_js_1.USER_INSTITUTE_META_STATUS.ACCEPTED,
|
|
395
433
|
entities: { $in: [subjectIndex.subject] },
|
|
396
434
|
};
|
|
397
|
-
if (subjectIndex.type === SUBJECT_INDEX_TYPE.PRIVATE) {
|
|
435
|
+
if (subjectIndex.type === app_js_1.SUBJECT_INDEX_TYPE.PRIVATE) {
|
|
398
436
|
where.instituteId = {
|
|
399
437
|
$in: [...subjectIndex.sharedInstituteId, subjectIndex.instituteId || ''],
|
|
400
438
|
};
|
|
@@ -402,15 +440,15 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
402
440
|
else {
|
|
403
441
|
where.instituteId = subjectIndex.instituteId;
|
|
404
442
|
}
|
|
405
|
-
const userIntituteMetaList = await
|
|
443
|
+
const userIntituteMetaList = await userInstituteMetaModel_js_1.default.find({ ...where }, { userId: 1 });
|
|
406
444
|
let allowUserIds = userIntituteMetaList.map(userIntituteMeta => userIntituteMeta.userId);
|
|
407
|
-
if (subjectIndex.type === SUBJECT_INDEX_TYPE.PRIVATE) {
|
|
445
|
+
if (subjectIndex.type === app_js_1.SUBJECT_INDEX_TYPE.PRIVATE) {
|
|
408
446
|
allowUserIds.push(subjectIndex.userId);
|
|
409
447
|
}
|
|
410
448
|
allowUserIds = [...new Set(allowUserIds)];
|
|
411
449
|
const notAllowUserIds = subjectIndex.assignedUsers?.filter(assignedUsers => !allowUserIds.includes(assignedUsers.userId));
|
|
412
450
|
if (notAllowUserIds?.length)
|
|
413
|
-
throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.CAN_NOT_ASSIGN_TO_USER);
|
|
451
|
+
throw new Error(errorMessages_js_1.SUBJECT_INDEX_ERROR_MESSAGES.CAN_NOT_ASSIGN_TO_USER);
|
|
414
452
|
}
|
|
415
453
|
}
|
|
416
454
|
catch (error) {
|
|
@@ -418,50 +456,50 @@ const creatOrUpdateHook = async (subjectIndex) => {
|
|
|
418
456
|
}
|
|
419
457
|
};
|
|
420
458
|
const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) => {
|
|
421
|
-
const batchList = await
|
|
459
|
+
const batchList = await batchModel_js_1.default.findAll({
|
|
422
460
|
where: {
|
|
423
461
|
id: {
|
|
424
|
-
[Op.in]: subjectIndexList.map(subject => subject.batch),
|
|
462
|
+
[sequelize_1.Op.in]: subjectIndexList.map(subject => subject.batch),
|
|
425
463
|
},
|
|
426
464
|
},
|
|
427
465
|
});
|
|
428
|
-
const batchListById = keyByFieldOrFields(batchList, 'id');
|
|
429
|
-
const subjectList = await
|
|
466
|
+
const batchListById = (0, utils_js_1.keyByFieldOrFields)(batchList, 'id');
|
|
467
|
+
const subjectList = await instituteEntityModel_js_1.default.findAll({
|
|
430
468
|
where: {
|
|
431
469
|
id: {
|
|
432
|
-
[Op.in]: subjectIndexList.map(subject => subject.subject),
|
|
470
|
+
[sequelize_1.Op.in]: subjectIndexList.map(subject => subject.subject),
|
|
433
471
|
},
|
|
434
472
|
},
|
|
435
473
|
});
|
|
436
|
-
const subjectListById = keyByFieldOrFields(subjectList, 'id');
|
|
474
|
+
const subjectListById = (0, utils_js_1.keyByFieldOrFields)(subjectList, 'id');
|
|
437
475
|
const userIdSet = new Set(subjectIndexList.flatMap(subject => [subject.userId, subject.createdBy]));
|
|
438
476
|
subjectIndexList.forEach(subject => subject.assignedUsers?.forEach(assign => userIdSet.add(assign.userId)));
|
|
439
|
-
const userList = await
|
|
440
|
-
where: { id: { [Op.in]: [...userIdSet] } },
|
|
441
|
-
attributes: USER_BASIC_DETAIL,
|
|
477
|
+
const userList = await userModel_js_1.default.findAll({
|
|
478
|
+
where: { id: { [sequelize_1.Op.in]: [...userIdSet] } },
|
|
479
|
+
attributes: defaultModelAttributes_js_1.USER_BASIC_DETAIL,
|
|
442
480
|
});
|
|
443
|
-
const userListById = keyByFieldOrFields(userList, 'id');
|
|
481
|
+
const userListById = (0, utils_js_1.keyByFieldOrFields)(userList, 'id');
|
|
444
482
|
const instituteIdSet = new Set(subjectIndexList.flatMap(subject => [subject.instituteId, ...(subject.sharedInstituteId || [])]));
|
|
445
|
-
const instituteList = await
|
|
446
|
-
where: { id: { [Op.in]: [...instituteIdSet] } },
|
|
447
|
-
attributes: INSTITUTE_BASIC_DETAIL,
|
|
483
|
+
const instituteList = await instituteModel_js_1.default.findAll({
|
|
484
|
+
where: { id: { [sequelize_1.Op.in]: [...instituteIdSet] } },
|
|
485
|
+
attributes: defaultModelAttributes_js_1.INSTITUTE_BASIC_DETAIL,
|
|
448
486
|
});
|
|
449
|
-
const instituteListById = keyByFieldOrFields(instituteList, 'id');
|
|
487
|
+
const instituteListById = (0, utils_js_1.keyByFieldOrFields)(instituteList, 'id');
|
|
450
488
|
const fileStorageIdList = subjectIndexList.flatMap(subject => subject.chapterIndex?.flatMap(chapter => chapter.files?.map(file => file.fileStorageId) || []) || []);
|
|
451
|
-
const fileStorageList = await
|
|
452
|
-
where: { id: { [Op.in]: fileStorageIdList } },
|
|
453
|
-
attributes: { exclude: DEFAULT_EXCLUDES_ATTRIBUTES },
|
|
489
|
+
const fileStorageList = await fileStorageModel_js_1.default.findAll({
|
|
490
|
+
where: { id: { [sequelize_1.Op.in]: fileStorageIdList } },
|
|
491
|
+
attributes: { exclude: defaultModelAttributes_js_1.DEFAULT_EXCLUDES_ATTRIBUTES },
|
|
454
492
|
raw: true,
|
|
455
493
|
});
|
|
456
|
-
const fileStorageListById = keyByFieldOrFields(fileStorageList, 'id');
|
|
494
|
+
const fileStorageListById = (0, utils_js_1.keyByFieldOrFields)(fileStorageList, 'id');
|
|
457
495
|
const fileCategoryIdList = subjectIndexList
|
|
458
496
|
.flatMap(subject => subject.chapterIndex?.flatMap(chapter => chapter.files?.map(file => file.categoryId) || []) || [])
|
|
459
|
-
.filter(id => isValidUUID(id));
|
|
460
|
-
const fileCategoryList = await
|
|
461
|
-
where: { id: { [Op.in]: fileCategoryIdList } },
|
|
462
|
-
attributes: { exclude: DEFAULT_EXCLUDES_ATTRIBUTES },
|
|
497
|
+
.filter(id => (0, utils_js_1.isValidUUID)(id));
|
|
498
|
+
const fileCategoryList = await typeManagementModel_js_1.default.findAll({
|
|
499
|
+
where: { id: { [sequelize_1.Op.in]: fileCategoryIdList } },
|
|
500
|
+
attributes: { exclude: defaultModelAttributes_js_1.DEFAULT_EXCLUDES_ATTRIBUTES },
|
|
463
501
|
});
|
|
464
|
-
const fileCategoryListById = keyByFieldOrFields(fileCategoryList, 'id');
|
|
502
|
+
const fileCategoryListById = (0, utils_js_1.keyByFieldOrFields)(fileCategoryList, 'id');
|
|
465
503
|
return await Promise.all(
|
|
466
504
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
467
505
|
subjectIndexList.map(async (subject) => {
|
|
@@ -485,20 +523,20 @@ const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) =>
|
|
|
485
523
|
});
|
|
486
524
|
}
|
|
487
525
|
let completedChapterLastLecture = [];
|
|
488
|
-
if (subject.assignedUsers && subject.assignedUsers.length && options?.reqUser?.type === USER_TYPES.STUDENT) {
|
|
489
|
-
const lectureList = await
|
|
490
|
-
where: { subject: { [Op.in]: [subject.subject] } },
|
|
526
|
+
if (subject.assignedUsers && subject.assignedUsers.length && options?.reqUser?.type === app_js_1.USER_TYPES.STUDENT) {
|
|
527
|
+
const lectureList = await lectureModel_js_1.default.findAll({
|
|
528
|
+
where: { subject: { [sequelize_1.Op.in]: [subject.subject] } },
|
|
491
529
|
order: [['checkedInAt', 'DESC']],
|
|
492
530
|
limit: 1,
|
|
493
531
|
});
|
|
494
532
|
const lastLecture = lectureList.pop();
|
|
495
533
|
if (lastLecture) {
|
|
496
|
-
const lectureDay = startOfDay(lastLecture.checkedInAt).getTime();
|
|
534
|
+
const lectureDay = (0, utils_js_1.startOfDay)(lastLecture.checkedInAt).getTime();
|
|
497
535
|
completedChapterLastLecture = subject.assignedUsers
|
|
498
536
|
.filter((assignedUser) => {
|
|
499
|
-
const statusUpdateDay = startOfDay(assignedUser.statusUpdatedAt).getTime();
|
|
537
|
+
const statusUpdateDay = (0, utils_js_1.startOfDay)(assignedUser.statusUpdatedAt).getTime();
|
|
500
538
|
return (assignedUser?.lectureId === lastLecture.id &&
|
|
501
|
-
assignedUser.status === USER_CHAPTER_INDEX_STATUS.COMPLETED &&
|
|
539
|
+
assignedUser.status === app_js_1.USER_CHAPTER_INDEX_STATUS.COMPLETED &&
|
|
502
540
|
lectureDay === statusUpdateDay);
|
|
503
541
|
})
|
|
504
542
|
.map((assignedUser) => assignedUser.chapterIndexId);
|
|
@@ -509,9 +547,9 @@ const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) =>
|
|
|
509
547
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
510
548
|
subject.chapterIndex.map(async (chapter) => {
|
|
511
549
|
if (chapter.files?.length) {
|
|
512
|
-
if (subject.type === SUBJECT_INDEX_TYPE.BATCH &&
|
|
550
|
+
if (subject.type === app_js_1.SUBJECT_INDEX_TYPE.BATCH &&
|
|
513
551
|
options.reqUser &&
|
|
514
|
-
[USER_TYPES.STUDENT, USER_TYPES.PARENTS, USER_TYPES.TEACHER].includes(options.reqUser.type)) {
|
|
552
|
+
[app_js_1.USER_TYPES.STUDENT, app_js_1.USER_TYPES.PARENTS, app_js_1.USER_TYPES.TEACHER].includes(options.reqUser.type)) {
|
|
515
553
|
chapter.files = chapter.files.filter(file => subject.selectedCategoryIds.includes(file.categoryId));
|
|
516
554
|
if (!completedChapterLastLecture.includes(chapter.id))
|
|
517
555
|
chapter.files = [];
|
|
@@ -520,14 +558,14 @@ const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) =>
|
|
|
520
558
|
file.fileStorageDetails = fileStorageListById[file.fileStorageId] || {};
|
|
521
559
|
file.fileCategoryDetails = fileCategoryListById[file.categoryId] || {};
|
|
522
560
|
if (file.fileStorageDetails.storageFileName) {
|
|
523
|
-
file.fileStorageDetails.filePath = await getPresignedUrl(ENV_VARIABLE.AWS_BUCKET_NAME, file.fileStorageDetails);
|
|
561
|
+
file.fileStorageDetails.filePath = await (0, s3Uploader_js_1.getPresignedUrl)(env_js_1.ENV_VARIABLE.AWS_BUCKET_NAME, file.fileStorageDetails);
|
|
524
562
|
}
|
|
525
563
|
return file;
|
|
526
564
|
}));
|
|
527
565
|
}
|
|
528
566
|
return chapter;
|
|
529
567
|
}));
|
|
530
|
-
subject.nestChapterIndex = buildNestedStructure(subject.chapterIndex, 'parentId', 'list');
|
|
568
|
+
subject.nestChapterIndex = (0, utils_js_1.buildNestedStructure)(subject.chapterIndex, 'parentId', 'list');
|
|
531
569
|
}
|
|
532
570
|
if (subject.assignedUsers?.length) {
|
|
533
571
|
subject.assignedUsers = subject.assignedUsers.map((assign) => {
|
|
@@ -579,8 +617,8 @@ SubjectIndexSchema.index({
|
|
|
579
617
|
type: 1,
|
|
580
618
|
subject: 1,
|
|
581
619
|
});
|
|
582
|
-
const SubjectIndexModel =
|
|
620
|
+
const SubjectIndexModel = mongoose_1.default.model('subject_indexes', SubjectIndexSchema);
|
|
583
621
|
// (async () => {
|
|
584
622
|
// await SubjectIndexModel.syncIndexes();
|
|
585
623
|
// })(); // Rebuilds indexes in DB based on schema
|
|
586
|
-
|
|
624
|
+
exports.default = SubjectIndexModel;
|
|
@@ -1,6 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
const app_js_1 = require("../../constants/app.js");
|
|
38
|
+
const subscriptionPlanFilesSchema = new mongoose_1.Schema({
|
|
4
39
|
type: {
|
|
5
40
|
type: String,
|
|
6
41
|
required: true,
|
|
@@ -11,11 +46,11 @@ const subscriptionPlanFilesSchema = new Schema({
|
|
|
11
46
|
},
|
|
12
47
|
status: {
|
|
13
48
|
type: String,
|
|
14
|
-
default: COMMAN_STATUS.ACTIVE,
|
|
49
|
+
default: app_js_1.COMMAN_STATUS.ACTIVE,
|
|
15
50
|
required: true,
|
|
16
51
|
},
|
|
17
52
|
}, { _id: false });
|
|
18
|
-
const subscriptionPlanModelSchema = new Schema({
|
|
53
|
+
const subscriptionPlanModelSchema = new mongoose_1.Schema({
|
|
19
54
|
uuid: {
|
|
20
55
|
type: String,
|
|
21
56
|
required: true,
|
|
@@ -39,7 +74,7 @@ const subscriptionPlanModelSchema = new Schema({
|
|
|
39
74
|
},
|
|
40
75
|
status: {
|
|
41
76
|
type: String,
|
|
42
|
-
default: COMMAN_STATUS.ACTIVE,
|
|
77
|
+
default: app_js_1.COMMAN_STATUS.ACTIVE,
|
|
43
78
|
required: true,
|
|
44
79
|
},
|
|
45
80
|
perUserCharge: {
|
|
@@ -52,12 +87,12 @@ const subscriptionPlanModelSchema = new Schema({
|
|
|
52
87
|
},
|
|
53
88
|
chargeInterval: {
|
|
54
89
|
type: String,
|
|
55
|
-
default: SUBSCRIPTION_PLAN_CHARGE_INTERVAL.MONTHLY,
|
|
90
|
+
default: app_js_1.SUBSCRIPTION_PLAN_CHARGE_INTERVAL.MONTHLY,
|
|
56
91
|
required: true,
|
|
57
92
|
},
|
|
58
93
|
discountType: {
|
|
59
94
|
type: String,
|
|
60
|
-
default: DISCOUNT_TYPE.NONE,
|
|
95
|
+
default: app_js_1.DISCOUNT_TYPE.NONE,
|
|
61
96
|
required: true,
|
|
62
97
|
},
|
|
63
98
|
moduleList: {
|
|
@@ -67,7 +102,7 @@ const subscriptionPlanModelSchema = new Schema({
|
|
|
67
102
|
},
|
|
68
103
|
validCurrency: {
|
|
69
104
|
type: String,
|
|
70
|
-
default: VALID_CURRENCY.COIN,
|
|
105
|
+
default: app_js_1.VALID_CURRENCY.COIN,
|
|
71
106
|
required: true,
|
|
72
107
|
},
|
|
73
108
|
files: {
|
|
@@ -76,7 +111,7 @@ const subscriptionPlanModelSchema = new Schema({
|
|
|
76
111
|
required: true,
|
|
77
112
|
},
|
|
78
113
|
planHistory: {
|
|
79
|
-
type: Schema.Types.Mixed,
|
|
114
|
+
type: mongoose_1.Schema.Types.Mixed,
|
|
80
115
|
default: [],
|
|
81
116
|
required: false,
|
|
82
117
|
},
|
|
@@ -93,5 +128,5 @@ const subscriptionPlanModelSchema = new Schema({
|
|
|
93
128
|
timestamps: true,
|
|
94
129
|
versionKey: false,
|
|
95
130
|
});
|
|
96
|
-
const SubscriptionPlanModel =
|
|
97
|
-
|
|
131
|
+
const SubscriptionPlanModel = mongoose_1.default.model('subscription_plans', subscriptionPlanModelSchema);
|
|
132
|
+
exports.default = SubscriptionPlanModel;
|