@kipicore/dbcore 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (850) hide show
  1. package/README.md +1 -0
  2. package/dist/configs/aws.d.ts +2 -0
  3. package/dist/configs/aws.js +12 -0
  4. package/dist/configs/env.d.ts +15 -0
  5. package/dist/configs/env.js +83 -0
  6. package/dist/constants/app.d.ts +848 -0
  7. package/dist/constants/app.js +1073 -0
  8. package/dist/constants/defaultModelAttributes.d.ts +17 -0
  9. package/dist/constants/defaultModelAttributes.js +21 -0
  10. package/dist/constants/errorMessages.d.ts +1055 -0
  11. package/dist/constants/errorMessages.js +1166 -0
  12. package/dist/constants/httpStatusCode.d.ts +26 -0
  13. package/dist/constants/httpStatusCode.js +30 -0
  14. package/dist/constants/successMessages.d.ts +699 -0
  15. package/dist/constants/successMessages.js +813 -0
  16. package/dist/db/mongodb.d.ts +1 -0
  17. package/dist/db/mongodb.js +24 -0
  18. package/dist/db/postgres.d.ts +2 -0
  19. package/dist/db/postgres.js +17 -0
  20. package/dist/helpers/s3Uploader.d.ts +3 -0
  21. package/dist/helpers/s3Uploader.js +61 -0
  22. package/dist/helpers/utils.d.ts +173 -0
  23. package/dist/helpers/utils.js +682 -0
  24. package/dist/index.d.ts +0 -0
  25. package/dist/index.js +12 -0
  26. package/dist/interfaces/PaymentProcessorInterface.d.ts +0 -0
  27. package/dist/interfaces/PaymentProcessorInterface.js +1 -0
  28. package/dist/interfaces/academicCalendarInterface.d.ts +9 -0
  29. package/dist/interfaces/academicCalendarInterface.js +2 -0
  30. package/dist/interfaces/accountHasReceiptDetailsInterface.d.ts +17 -0
  31. package/dist/interfaces/accountHasReceiptDetailsInterface.js +2 -0
  32. package/dist/interfaces/announcementInterface.d.ts +19 -0
  33. package/dist/interfaces/announcementInterface.js +2 -0
  34. package/dist/interfaces/approvalRequestInterface.d.ts +14 -0
  35. package/dist/interfaces/approvalRequestInterface.js +2 -0
  36. package/dist/interfaces/areaInterface.d.ts +5 -0
  37. package/dist/interfaces/areaInterface.js +2 -0
  38. package/dist/interfaces/attendanceInterface.d.ts +21 -0
  39. package/dist/interfaces/attendanceInterface.js +2 -0
  40. package/dist/interfaces/bankAccountDetailsInterface.d.ts +14 -0
  41. package/dist/interfaces/bankAccountDetailsInterface.js +2 -0
  42. package/dist/interfaces/bannerInterface.d.ts +15 -0
  43. package/dist/interfaces/bannerInterface.js +2 -0
  44. package/dist/interfaces/batchInterface.d.ts +18 -0
  45. package/dist/interfaces/batchInterface.js +2 -0
  46. package/dist/interfaces/batchSubjectBookAssessmentInterface.d.ts +9 -0
  47. package/dist/interfaces/batchSubjectBookAssessmentInterface.js +2 -0
  48. package/dist/interfaces/batchSubjectProjectAssessmentInterface.d.ts +12 -0
  49. package/dist/interfaces/batchSubjectProjectAssessmentInterface.js +2 -0
  50. package/dist/interfaces/blogInterface.d.ts +46 -0
  51. package/dist/interfaces/blogInterface.js +2 -0
  52. package/dist/interfaces/bookAssessmentDateInterface.d.ts +8 -0
  53. package/dist/interfaces/bookAssessmentDateInterface.js +2 -0
  54. package/dist/interfaces/careerInterface.d.ts +12 -0
  55. package/dist/interfaces/careerInterface.js +2 -0
  56. package/dist/interfaces/categoriesInterface.d.ts +8 -0
  57. package/dist/interfaces/categoriesInterface.js +2 -0
  58. package/dist/interfaces/certificatesHistoryInterface.d.ts +9 -0
  59. package/dist/interfaces/certificatesHistoryInterface.js +2 -0
  60. package/dist/interfaces/certificatesManagementInterface.d.ts +11 -0
  61. package/dist/interfaces/certificatesManagementInterface.js +2 -0
  62. package/dist/interfaces/cityInterface.d.ts +12 -0
  63. package/dist/interfaces/cityInterface.js +2 -0
  64. package/dist/interfaces/classRoomInterface.d.ts +13 -0
  65. package/dist/interfaces/classRoomInterface.js +2 -0
  66. package/dist/interfaces/cloudStorageInterface.d.ts +15 -0
  67. package/dist/interfaces/cloudStorageInterface.js +2 -0
  68. package/dist/interfaces/coinPurchaseOfferInterface.d.ts +16 -0
  69. package/dist/interfaces/coinPurchaseOfferInterface.js +2 -0
  70. package/dist/interfaces/columnInterface.d.ts +15 -0
  71. package/dist/interfaces/columnInterface.js +2 -0
  72. package/dist/interfaces/commanInterface.d.ts +52 -0
  73. package/dist/interfaces/commanInterface.js +2 -0
  74. package/dist/interfaces/contactFeedBackInterface.d.ts +13 -0
  75. package/dist/interfaces/contactFeedBackInterface.js +2 -0
  76. package/dist/interfaces/countryInterface.d.ts +11 -0
  77. package/dist/interfaces/countryInterface.js +2 -0
  78. package/dist/interfaces/courseHasVisitorsInterface.d.ts +7 -0
  79. package/dist/interfaces/courseHasVisitorsInterface.js +2 -0
  80. package/dist/interfaces/courseInterface.d.ts +18 -0
  81. package/dist/interfaces/courseInterface.js +2 -0
  82. package/dist/interfaces/dailyBookInterface.d.ts +14 -0
  83. package/dist/interfaces/dailyBookInterface.js +2 -0
  84. package/dist/interfaces/dashboardManagementInterface.d.ts +19 -0
  85. package/dist/interfaces/dashboardManagementInterface.js +2 -0
  86. package/dist/interfaces/driverInterface.d.ts +21 -0
  87. package/dist/interfaces/driverInterface.js +2 -0
  88. package/dist/interfaces/entityGroupInterface.d.ts +12 -0
  89. package/dist/interfaces/entityGroupInterface.js +2 -0
  90. package/dist/interfaces/eventInterface.d.ts +21 -0
  91. package/dist/interfaces/eventInterface.js +2 -0
  92. package/dist/interfaces/examGroupInterface.d.ts +30 -0
  93. package/dist/interfaces/examGroupInterface.js +2 -0
  94. package/dist/interfaces/examHasAnswerSheetInterface.d.ts +23 -0
  95. package/dist/interfaces/examHasAnswerSheetInterface.js +2 -0
  96. package/dist/interfaces/examInterface.d.ts +38 -0
  97. package/dist/interfaces/examInterface.js +2 -0
  98. package/dist/interfaces/facilityInterface.d.ts +9 -0
  99. package/dist/interfaces/facilityInterface.js +2 -0
  100. package/dist/interfaces/featureActionInterface.d.ts +17 -0
  101. package/dist/interfaces/featureActionInterface.js +2 -0
  102. package/dist/interfaces/feeHistoryDetailsInterface.d.ts +17 -0
  103. package/dist/interfaces/feeHistoryDetailsInterface.js +2 -0
  104. package/dist/interfaces/feeHistoryInterface.d.ts +21 -0
  105. package/dist/interfaces/feeHistoryInterface.js +2 -0
  106. package/dist/interfaces/feeReminderInterface.d.ts +13 -0
  107. package/dist/interfaces/feeReminderInterface.js +2 -0
  108. package/dist/interfaces/feeReminderSettingInterface.d.ts +10 -0
  109. package/dist/interfaces/feeReminderSettingInterface.js +2 -0
  110. package/dist/interfaces/feeReminderTypeInterface.d.ts +10 -0
  111. package/dist/interfaces/feeReminderTypeInterface.js +2 -0
  112. package/dist/interfaces/feeTypeHasTermsInterface.d.ts +12 -0
  113. package/dist/interfaces/feeTypeHasTermsInterface.js +2 -0
  114. package/dist/interfaces/feeTypeInterface.d.ts +13 -0
  115. package/dist/interfaces/feeTypeInterface.js +2 -0
  116. package/dist/interfaces/feedBackInterface.d.ts +19 -0
  117. package/dist/interfaces/feedBackInterface.js +2 -0
  118. package/dist/interfaces/feesCollectionInterface.d.ts +19 -0
  119. package/dist/interfaces/feesCollectionInterface.js +2 -0
  120. package/dist/interfaces/fileStorageInterface.d.ts +14 -0
  121. package/dist/interfaces/fileStorageInterface.js +2 -0
  122. package/dist/interfaces/floorManagementInterface.d.ts +9 -0
  123. package/dist/interfaces/floorManagementInterface.js +2 -0
  124. package/dist/interfaces/generateIdCardInterface.d.ts +8 -0
  125. package/dist/interfaces/generateIdCardInterface.js +2 -0
  126. package/dist/interfaces/greetingsInterface.d.ts +12 -0
  127. package/dist/interfaces/greetingsInterface.js +2 -0
  128. package/dist/interfaces/holidayInterface.d.ts +22 -0
  129. package/dist/interfaces/holidayInterface.js +2 -0
  130. package/dist/interfaces/homeworkInterface.d.ts +13 -0
  131. package/dist/interfaces/homeworkInterface.js +2 -0
  132. package/dist/interfaces/informationSupportInterface.d.ts +15 -0
  133. package/dist/interfaces/informationSupportInterface.js +2 -0
  134. package/dist/interfaces/inquiryInterface.d.ts +54 -0
  135. package/dist/interfaces/inquiryInterface.js +2 -0
  136. package/dist/interfaces/instituteEntityInterface.d.ts +16 -0
  137. package/dist/interfaces/instituteEntityInterface.js +2 -0
  138. package/dist/interfaces/instituteEntityTypeInterface.d.ts +10 -0
  139. package/dist/interfaces/instituteEntityTypeInterface.js +2 -0
  140. package/dist/interfaces/instituteInterface.d.ts +35 -0
  141. package/dist/interfaces/instituteInterface.js +2 -0
  142. package/dist/interfaces/instituteSubscriptionPlanInterface.d.ts +21 -0
  143. package/dist/interfaces/instituteSubscriptionPlanInterface.js +2 -0
  144. package/dist/interfaces/inventoryHistoryInterface.d.ts +17 -0
  145. package/dist/interfaces/inventoryHistoryInterface.js +2 -0
  146. package/dist/interfaces/inventoryInterface.d.ts +15 -0
  147. package/dist/interfaces/inventoryInterface.js +2 -0
  148. package/dist/interfaces/invoiceInterface.d.ts +31 -0
  149. package/dist/interfaces/invoiceInterface.js +2 -0
  150. package/dist/interfaces/jobApplyInterface.d.ts +35 -0
  151. package/dist/interfaces/jobApplyInterface.js +2 -0
  152. package/dist/interfaces/lectureHistoryInterface.d.ts +24 -0
  153. package/dist/interfaces/lectureHistoryInterface.js +2 -0
  154. package/dist/interfaces/lectureInterface.d.ts +26 -0
  155. package/dist/interfaces/lectureInterface.js +2 -0
  156. package/dist/interfaces/masterLeaveInterface.d.ts +13 -0
  157. package/dist/interfaces/masterLeaveInterface.js +2 -0
  158. package/dist/interfaces/moduleFeatureInterface.d.ts +16 -0
  159. package/dist/interfaces/moduleFeatureInterface.js +2 -0
  160. package/dist/interfaces/moduleInterface.d.ts +15 -0
  161. package/dist/interfaces/moduleInterface.js +2 -0
  162. package/dist/interfaces/offersInterface.d.ts +18 -0
  163. package/dist/interfaces/offersInterface.js +2 -0
  164. package/dist/interfaces/paymentTermsInterface.d.ts +15 -0
  165. package/dist/interfaces/paymentTermsInterface.js +2 -0
  166. package/dist/interfaces/pdcChequeInterface.d.ts +16 -0
  167. package/dist/interfaces/pdcChequeInterface.js +2 -0
  168. package/dist/interfaces/pdcHistoryInterface.d.ts +17 -0
  169. package/dist/interfaces/pdcHistoryInterface.js +2 -0
  170. package/dist/interfaces/photosGalleryInterface.d.ts +17 -0
  171. package/dist/interfaces/photosGalleryInterface.js +2 -0
  172. package/dist/interfaces/pincodeInterface.d.ts +15 -0
  173. package/dist/interfaces/pincodeInterface.js +2 -0
  174. package/dist/interfaces/plannerInterface.d.ts +32 -0
  175. package/dist/interfaces/plannerInterface.js +2 -0
  176. package/dist/interfaces/productInterface.d.ts +10 -0
  177. package/dist/interfaces/productInterface.js +2 -0
  178. package/dist/interfaces/projectAssessmentOptionInterface.d.ts +8 -0
  179. package/dist/interfaces/projectAssessmentOptionInterface.js +2 -0
  180. package/dist/interfaces/replaceTeacherInterface.d.ts +22 -0
  181. package/dist/interfaces/replaceTeacherInterface.js +2 -0
  182. package/dist/interfaces/roleInterface.d.ts +26 -0
  183. package/dist/interfaces/roleInterface.js +2 -0
  184. package/dist/interfaces/rulesRegulationInterface.d.ts +10 -0
  185. package/dist/interfaces/rulesRegulationInterface.js +2 -0
  186. package/dist/interfaces/schoolFeeCollectionInterface.d.ts +13 -0
  187. package/dist/interfaces/schoolFeeCollectionInterface.js +2 -0
  188. package/dist/interfaces/schoolFeeInterface.d.ts +21 -0
  189. package/dist/interfaces/schoolFeeInterface.js +2 -0
  190. package/dist/interfaces/schoolOfferInterface.d.ts +20 -0
  191. package/dist/interfaces/schoolOfferInterface.js +2 -0
  192. package/dist/interfaces/sendNotificationInerface.d.ts +20 -0
  193. package/dist/interfaces/sendNotificationInerface.js +2 -0
  194. package/dist/interfaces/slotInterface.d.ts +8 -0
  195. package/dist/interfaces/slotInterface.js +2 -0
  196. package/dist/interfaces/stateInterface.d.ts +11 -0
  197. package/dist/interfaces/stateInterface.js +2 -0
  198. package/dist/interfaces/subCategoriesInterface.d.ts +9 -0
  199. package/dist/interfaces/subCategoriesInterface.js +2 -0
  200. package/dist/interfaces/subjectHasFeeInterface.d.ts +7 -0
  201. package/dist/interfaces/subjectHasFeeInterface.js +2 -0
  202. package/dist/interfaces/subjectHasPayFeeHistoryInterface.d.ts +9 -0
  203. package/dist/interfaces/subjectHasPayFeeHistoryInterface.js +2 -0
  204. package/dist/interfaces/subjectIndexInterface.d.ts +48 -0
  205. package/dist/interfaces/subjectIndexInterface.js +2 -0
  206. package/dist/interfaces/subscriptionPlanInterface.d.ts +29 -0
  207. package/dist/interfaces/subscriptionPlanInterface.js +2 -0
  208. package/dist/interfaces/syllabusInterface.d.ts +9 -0
  209. package/dist/interfaces/syllabusInterface.js +2 -0
  210. package/dist/interfaces/taskManagementInterface.d.ts +24 -0
  211. package/dist/interfaces/taskManagementInterface.js +2 -0
  212. package/dist/interfaces/testimonialInterface.d.ts +12 -0
  213. package/dist/interfaces/testimonialInterface.js +2 -0
  214. package/dist/interfaces/toDoInterface.d.ts +11 -0
  215. package/dist/interfaces/toDoInterface.js +2 -0
  216. package/dist/interfaces/tokenInterface.d.ts +27 -0
  217. package/dist/interfaces/tokenInterface.js +2 -0
  218. package/dist/interfaces/tripInterface.d.ts +13 -0
  219. package/dist/interfaces/tripInterface.js +2 -0
  220. package/dist/interfaces/typeManagementInterface.d.ts +11 -0
  221. package/dist/interfaces/typeManagementInterface.js +2 -0
  222. package/dist/interfaces/uniqueNumberCounterInterface.d.ts +11 -0
  223. package/dist/interfaces/uniqueNumberCounterInterface.js +2 -0
  224. package/dist/interfaces/userBookAssessmentInterface.d.ts +10 -0
  225. package/dist/interfaces/userBookAssessmentInterface.js +2 -0
  226. package/dist/interfaces/userDetailsInterface.d.ts +122 -0
  227. package/dist/interfaces/userDetailsInterface.js +2 -0
  228. package/dist/interfaces/userFeeTypeByAccountInterface.d.ts +19 -0
  229. package/dist/interfaces/userFeeTypeByAccountInterface.js +2 -0
  230. package/dist/interfaces/userFeeTypeInterface.d.ts +16 -0
  231. package/dist/interfaces/userFeeTypeInterface.js +2 -0
  232. package/dist/interfaces/userHasAnnouncementInterface.d.ts +9 -0
  233. package/dist/interfaces/userHasAnnouncementInterface.js +2 -0
  234. package/dist/interfaces/userHasBatchInterface.d.ts +7 -0
  235. package/dist/interfaces/userHasBatchInterface.js +2 -0
  236. package/dist/interfaces/userHasCourseInterface.d.ts +13 -0
  237. package/dist/interfaces/userHasCourseInterface.js +2 -0
  238. package/dist/interfaces/userHasDeviceInterface.d.ts +10 -0
  239. package/dist/interfaces/userHasDeviceInterface.js +2 -0
  240. package/dist/interfaces/userHasFeeTermsInterface.d.ts +37 -0
  241. package/dist/interfaces/userHasFeeTermsInterface.js +2 -0
  242. package/dist/interfaces/userHasFileInterface.d.ts +11 -0
  243. package/dist/interfaces/userHasFileInterface.js +2 -0
  244. package/dist/interfaces/userHasHomeWorkInterface.d.ts +11 -0
  245. package/dist/interfaces/userHasHomeWorkInterface.js +2 -0
  246. package/dist/interfaces/userHasInventoryHistoryInterface.d.ts +20 -0
  247. package/dist/interfaces/userHasInventoryHistoryInterface.js +2 -0
  248. package/dist/interfaces/userHasInventoryInterface.d.ts +21 -0
  249. package/dist/interfaces/userHasInventoryInterface.js +2 -0
  250. package/dist/interfaces/userHasLeaveHistoryInterface.d.ts +16 -0
  251. package/dist/interfaces/userHasLeaveHistoryInterface.js +2 -0
  252. package/dist/interfaces/userHasLeaveInterface.d.ts +12 -0
  253. package/dist/interfaces/userHasLeaveInterface.js +2 -0
  254. package/dist/interfaces/userHasOffer.d.ts +10 -0
  255. package/dist/interfaces/userHasOffer.js +2 -0
  256. package/dist/interfaces/userHasParentInterface.d.ts +14 -0
  257. package/dist/interfaces/userHasParentInterface.js +2 -0
  258. package/dist/interfaces/userHasRoleInterface.d.ts +13 -0
  259. package/dist/interfaces/userHasRoleInterface.js +2 -0
  260. package/dist/interfaces/userHasRollNumberInterface.d.ts +8 -0
  261. package/dist/interfaces/userHasRollNumberInterface.js +2 -0
  262. package/dist/interfaces/userHasStorageInterface.d.ts +11 -0
  263. package/dist/interfaces/userHasStorageInterface.js +2 -0
  264. package/dist/interfaces/userHasSubjectFeeInterface.d.ts +9 -0
  265. package/dist/interfaces/userHasSubjectFeeInterface.js +2 -0
  266. package/dist/interfaces/userInstituteMetaInterface.d.ts +39 -0
  267. package/dist/interfaces/userInstituteMetaInterface.js +2 -0
  268. package/dist/interfaces/userInterface.d.ts +44 -0
  269. package/dist/interfaces/userInterface.js +2 -0
  270. package/dist/interfaces/userLeaveRequestInterface.d.ts +15 -0
  271. package/dist/interfaces/userLeaveRequestInterface.js +2 -0
  272. package/dist/interfaces/userMetaInterface.d.ts +13 -0
  273. package/dist/interfaces/userMetaInterface.js +2 -0
  274. package/dist/interfaces/userPayoutDetailsInterface.d.ts +14 -0
  275. package/dist/interfaces/userPayoutDetailsInterface.js +2 -0
  276. package/dist/interfaces/userPayoutHistoryInterface.d.ts +18 -0
  277. package/dist/interfaces/userPayoutHistoryInterface.js +2 -0
  278. package/dist/interfaces/userPayoutInterface.d.ts +12 -0
  279. package/dist/interfaces/userPayoutInterface.js +2 -0
  280. package/dist/interfaces/userProjectAssessmentOptionInterface.d.ts +10 -0
  281. package/dist/interfaces/userProjectAssessmentOptionInterface.js +2 -0
  282. package/dist/interfaces/userRequiredStepsInterface.d.ts +9 -0
  283. package/dist/interfaces/userRequiredStepsInterface.js +2 -0
  284. package/dist/interfaces/userSchoolMetaInterface.d.ts +115 -0
  285. package/dist/interfaces/userSchoolMetaInterface.js +2 -0
  286. package/dist/interfaces/vehicleInterface.d.ts +11 -0
  287. package/dist/interfaces/vehicleInterface.js +2 -0
  288. package/dist/interfaces/vendorManagementInterface.d.ts +19 -0
  289. package/dist/interfaces/vendorManagementInterface.js +2 -0
  290. package/dist/interfaces/videoAnalystInterface.d.ts +37 -0
  291. package/dist/interfaces/videoAnalystInterface.js +2 -0
  292. package/dist/interfaces/walletHistoryInterface.d.ts +15 -0
  293. package/dist/interfaces/walletHistoryInterface.js +2 -0
  294. package/dist/interfaces/walletInterface.d.ts +10 -0
  295. package/dist/interfaces/walletInterface.js +2 -0
  296. package/dist/interfaces/walletTransactionInterface.d.ts +34 -0
  297. package/dist/interfaces/walletTransactionInterface.js +2 -0
  298. package/dist/interfaces/workingDayInterface.d.ts +11 -0
  299. package/dist/interfaces/workingDayInterface.js +2 -0
  300. package/dist/interfaces/workingShiftInterface.d.ts +12 -0
  301. package/dist/interfaces/workingShiftInterface.js +2 -0
  302. package/dist/models/mongodb/approvalRequestModel.d.ts +4 -0
  303. package/dist/models/mongodb/approvalRequestModel.js +96 -0
  304. package/dist/models/mongodb/attendanceModel.d.ts +4 -0
  305. package/dist/models/mongodb/attendanceModel.js +178 -0
  306. package/dist/models/mongodb/blogModel.d.ts +4 -0
  307. package/dist/models/mongodb/blogModel.js +91 -0
  308. package/dist/models/mongodb/careerModel.d.ts +4 -0
  309. package/dist/models/mongodb/careerModel.js +83 -0
  310. package/dist/models/mongodb/certificatesHistoryModel.d.ts +4 -0
  311. package/dist/models/mongodb/certificatesHistoryModel.js +58 -0
  312. package/dist/models/mongodb/certificatesManagementModel.d.ts +4 -0
  313. package/dist/models/mongodb/certificatesManagementModel.js +67 -0
  314. package/dist/models/mongodb/columnModel.d.ts +4 -0
  315. package/dist/models/mongodb/columnModel.js +75 -0
  316. package/dist/models/mongodb/dailyBookModel.d.ts +4 -0
  317. package/dist/models/mongodb/dailyBookModel.js +88 -0
  318. package/dist/models/mongodb/dashboardManagementModel.d.ts +4 -0
  319. package/dist/models/mongodb/dashboardManagementModel.js +111 -0
  320. package/dist/models/mongodb/eventModel.d.ts +4 -0
  321. package/dist/models/mongodb/eventModel.js +164 -0
  322. package/dist/models/mongodb/examGroupModel.d.ts +4 -0
  323. package/dist/models/mongodb/examGroupModel.js +293 -0
  324. package/dist/models/mongodb/examHasAnswerSheetModel.d.ts +4 -0
  325. package/dist/models/mongodb/examHasAnswerSheetModel.js +133 -0
  326. package/dist/models/mongodb/examModel.d.ts +4 -0
  327. package/dist/models/mongodb/examModel.js +267 -0
  328. package/dist/models/mongodb/feeReminderTypeModel.d.ts +4 -0
  329. package/dist/models/mongodb/feeReminderTypeModel.js +73 -0
  330. package/dist/models/mongodb/feedBackModel.d.ts +4 -0
  331. package/dist/models/mongodb/feedBackModel.js +111 -0
  332. package/dist/models/mongodb/generateIdCardModel.d.ts +4 -0
  333. package/dist/models/mongodb/generateIdCardModel.js +55 -0
  334. package/dist/models/mongodb/holidayModel.d.ts +4 -0
  335. package/dist/models/mongodb/holidayModel.js +172 -0
  336. package/dist/models/mongodb/index.d.ts +2 -0
  337. package/dist/models/mongodb/index.js +24 -0
  338. package/dist/models/mongodb/informationSupportModel.d.ts +4 -0
  339. package/dist/models/mongodb/informationSupportModel.js +96 -0
  340. package/dist/models/mongodb/inquiryModel.d.ts +4 -0
  341. package/dist/models/mongodb/inquiryModel.js +186 -0
  342. package/dist/models/mongodb/invoiceModel.d.ts +4 -0
  343. package/dist/models/mongodb/invoiceModel.js +134 -0
  344. package/dist/models/mongodb/jobApplyModel.d.ts +4 -0
  345. package/dist/models/mongodb/jobApplyModel.js +151 -0
  346. package/dist/models/mongodb/photosGalleryModel.d.ts +4 -0
  347. package/dist/models/mongodb/photosGalleryModel.js +86 -0
  348. package/dist/models/mongodb/plannerModel.d.ts +4 -0
  349. package/dist/models/mongodb/plannerModel.js +174 -0
  350. package/dist/models/mongodb/plugin/addDefaultAttributesPlugin.d.ts +2 -0
  351. package/dist/models/mongodb/plugin/addDefaultAttributesPlugin.js +63 -0
  352. package/dist/models/mongodb/plugin/transformIdInQueryPlugin.d.ts +3 -0
  353. package/dist/models/mongodb/plugin/transformIdInQueryPlugin.js +61 -0
  354. package/dist/models/mongodb/plugin/transformIdInResponsePlugin.d.ts +3 -0
  355. package/dist/models/mongodb/plugin/transformIdInResponsePlugin.js +65 -0
  356. package/dist/models/mongodb/replaceTeacherModel.d.ts +4 -0
  357. package/dist/models/mongodb/replaceTeacherModel.js +110 -0
  358. package/dist/models/mongodb/schoolFeeModel.d.ts +4 -0
  359. package/dist/models/mongodb/schoolFeeModel.js +178 -0
  360. package/dist/models/mongodb/subjectIndexModel.d.ts +4 -0
  361. package/dist/models/mongodb/subjectIndexModel.js +667 -0
  362. package/dist/models/mongodb/subscriptionPlanModel.d.ts +4 -0
  363. package/dist/models/mongodb/subscriptionPlanModel.js +133 -0
  364. package/dist/models/mongodb/taskManagementModel.d.ts +4 -0
  365. package/dist/models/mongodb/taskManagementModel.js +167 -0
  366. package/dist/models/mongodb/uniqueNumberCounterModel.d.ts +4 -0
  367. package/dist/models/mongodb/uniqueNumberCounterModel.js +83 -0
  368. package/dist/models/mongodb/userDetailsModel.d.ts +5 -0
  369. package/dist/models/mongodb/userDetailsModel.js +509 -0
  370. package/dist/models/mongodb/userDoc.d.ts +10 -0
  371. package/dist/models/mongodb/userDoc.js +9 -0
  372. package/dist/models/mongodb/userInstituteMetaModel.d.ts +4 -0
  373. package/dist/models/mongodb/userInstituteMetaModel.js +212 -0
  374. package/dist/models/mongodb/userSchoolMetaModel.d.ts +7 -0
  375. package/dist/models/mongodb/userSchoolMetaModel.js +552 -0
  376. package/dist/models/mongodb/videoAnalystModel.d.ts +4 -0
  377. package/dist/models/mongodb/videoAnalystModel.js +80 -0
  378. package/dist/models/mongodb/walletTransactionModel.d.ts +4 -0
  379. package/dist/models/mongodb/walletTransactionModel.js +163 -0
  380. package/dist/models/psql/SubCategoriesModel.d.ts +17 -0
  381. package/dist/models/psql/SubCategoriesModel.js +102 -0
  382. package/dist/models/psql/academicCalendarModel.d.ts +18 -0
  383. package/dist/models/psql/academicCalendarModel.js +94 -0
  384. package/dist/models/psql/accountHasReceiptDetailsModel.d.ts +26 -0
  385. package/dist/models/psql/accountHasReceiptDetailsModel.js +145 -0
  386. package/dist/models/psql/announcementModel.d.ts +28 -0
  387. package/dist/models/psql/announcementModel.js +198 -0
  388. package/dist/models/psql/areaModel.d.ts +9 -0
  389. package/dist/models/psql/areaModel.js +40 -0
  390. package/dist/models/psql/bankAccountDetailsModel.d.ts +23 -0
  391. package/dist/models/psql/bankAccountDetailsModel.js +100 -0
  392. package/dist/models/psql/bannerModel.d.ts +24 -0
  393. package/dist/models/psql/bannerModel.js +116 -0
  394. package/dist/models/psql/batchModel.d.ts +27 -0
  395. package/dist/models/psql/batchModel.js +222 -0
  396. package/dist/models/psql/batchSubjectBookAssessmentModel.d.ts +18 -0
  397. package/dist/models/psql/batchSubjectBookAssessmentModel.js +156 -0
  398. package/dist/models/psql/batchSubjectProjectAssessmentModel.d.ts +21 -0
  399. package/dist/models/psql/batchSubjectProjectAssessmentModel.js +154 -0
  400. package/dist/models/psql/bookAssessmentDateModel.d.ts +17 -0
  401. package/dist/models/psql/bookAssessmentDateModel.js +87 -0
  402. package/dist/models/psql/categoriesModel.d.ts +17 -0
  403. package/dist/models/psql/categoriesModel.js +80 -0
  404. package/dist/models/psql/cityModel.d.ts +13 -0
  405. package/dist/models/psql/cityModel.js +72 -0
  406. package/dist/models/psql/classRoomModel.d.ts +22 -0
  407. package/dist/models/psql/classRoomModel.js +126 -0
  408. package/dist/models/psql/cloudStorageModel.d.ts +24 -0
  409. package/dist/models/psql/cloudStorageModel.js +97 -0
  410. package/dist/models/psql/coinPurchaseOfferModel.d.ts +25 -0
  411. package/dist/models/psql/coinPurchaseOfferModel.js +103 -0
  412. package/dist/models/psql/contactFeedBackModel.d.ts +22 -0
  413. package/dist/models/psql/contactFeedBackModel.js +120 -0
  414. package/dist/models/psql/countryModel.d.ts +14 -0
  415. package/dist/models/psql/countryModel.js +43 -0
  416. package/dist/models/psql/courseHasVisitorsModel.d.ts +16 -0
  417. package/dist/models/psql/courseHasVisitorsModel.js +71 -0
  418. package/dist/models/psql/courseModel.d.ts +27 -0
  419. package/dist/models/psql/courseModel.js +136 -0
  420. package/dist/models/psql/driverModel.d.ts +30 -0
  421. package/dist/models/psql/driverModel.js +163 -0
  422. package/dist/models/psql/entityGroupModel.d.ts +21 -0
  423. package/dist/models/psql/entityGroupModel.js +100 -0
  424. package/dist/models/psql/facilityModel.d.ts +18 -0
  425. package/dist/models/psql/facilityModel.js +120 -0
  426. package/dist/models/psql/featureActionModel.d.ts +22 -0
  427. package/dist/models/psql/featureActionModel.js +95 -0
  428. package/dist/models/psql/feeHistoryDetailsModel.d.ts +26 -0
  429. package/dist/models/psql/feeHistoryDetailsModel.js +186 -0
  430. package/dist/models/psql/feeHistoryModel.d.ts +30 -0
  431. package/dist/models/psql/feeHistoryModel.js +334 -0
  432. package/dist/models/psql/feeReminderModel.d.ts +22 -0
  433. package/dist/models/psql/feeReminderModel.js +239 -0
  434. package/dist/models/psql/feeReminderSettingModel.d.ts +19 -0
  435. package/dist/models/psql/feeReminderSettingModel.js +90 -0
  436. package/dist/models/psql/feeTypeHasTermsModel.d.ts +21 -0
  437. package/dist/models/psql/feeTypeHasTermsModel.js +102 -0
  438. package/dist/models/psql/feeTypeModel.d.ts +22 -0
  439. package/dist/models/psql/feeTypeModel.js +125 -0
  440. package/dist/models/psql/feesCollectionModel.d.ts +28 -0
  441. package/dist/models/psql/feesCollectionModel.js +232 -0
  442. package/dist/models/psql/fileStorageModel.d.ts +6 -0
  443. package/dist/models/psql/fileStorageModel.js +86 -0
  444. package/dist/models/psql/floorManagementModel.d.ts +18 -0
  445. package/dist/models/psql/floorManagementModel.js +90 -0
  446. package/dist/models/psql/greetingsModel.d.ts +21 -0
  447. package/dist/models/psql/greetingsModel.js +118 -0
  448. package/dist/models/psql/homeWorkModel.d.ts +22 -0
  449. package/dist/models/psql/homeWorkModel.js +128 -0
  450. package/dist/models/psql/index.d.ts +4 -0
  451. package/dist/models/psql/index.js +121 -0
  452. package/dist/models/psql/instituteEntityModel.d.ts +25 -0
  453. package/dist/models/psql/instituteEntityModel.js +131 -0
  454. package/dist/models/psql/instituteEntityTypeModel.d.ts +19 -0
  455. package/dist/models/psql/instituteEntityTypeModel.js +74 -0
  456. package/dist/models/psql/instituteModel.d.ts +44 -0
  457. package/dist/models/psql/instituteModel.js +240 -0
  458. package/dist/models/psql/instituteSubscriptionPlanModel.d.ts +33 -0
  459. package/dist/models/psql/instituteSubscriptionPlanModel.js +186 -0
  460. package/dist/models/psql/inventoryHistoryModel.d.ts +26 -0
  461. package/dist/models/psql/inventoryHistoryModel.js +159 -0
  462. package/dist/models/psql/inventoryModel.d.ts +24 -0
  463. package/dist/models/psql/inventoryModel.js +132 -0
  464. package/dist/models/psql/lectureHistoryModel.d.ts +32 -0
  465. package/dist/models/psql/lectureHistoryModel.js +223 -0
  466. package/dist/models/psql/lectureModel.d.ts +34 -0
  467. package/dist/models/psql/lectureModel.js +485 -0
  468. package/dist/models/psql/masterLeaveModel.d.ts +22 -0
  469. package/dist/models/psql/masterLeaveModel.js +132 -0
  470. package/dist/models/psql/moduleFeatureModel.d.ts +21 -0
  471. package/dist/models/psql/moduleFeatureModel.js +98 -0
  472. package/dist/models/psql/moduleModel.d.ts +20 -0
  473. package/dist/models/psql/moduleModel.js +101 -0
  474. package/dist/models/psql/offerModel.d.ts +27 -0
  475. package/dist/models/psql/offerModel.js +144 -0
  476. package/dist/models/psql/paymentTermsModel.d.ts +17 -0
  477. package/dist/models/psql/paymentTermsModel.js +114 -0
  478. package/dist/models/psql/pdcChequeModel.d.ts +25 -0
  479. package/dist/models/psql/pdcChequeModel.js +138 -0
  480. package/dist/models/psql/pdcHistoryModel.d.ts +26 -0
  481. package/dist/models/psql/pdcHistoryModel.js +152 -0
  482. package/dist/models/psql/pincodeModel.d.ts +23 -0
  483. package/dist/models/psql/pincodeModel.js +79 -0
  484. package/dist/models/psql/productModel.d.ts +19 -0
  485. package/dist/models/psql/productModel.js +124 -0
  486. package/dist/models/psql/projectAssessmentOptionModel.d.ts +17 -0
  487. package/dist/models/psql/projectAssessmentOptionModel.js +90 -0
  488. package/dist/models/psql/roleModel.d.ts +22 -0
  489. package/dist/models/psql/roleModel.js +97 -0
  490. package/dist/models/psql/rulesRegulationModel.d.ts +19 -0
  491. package/dist/models/psql/rulesRegulationModel.js +72 -0
  492. package/dist/models/psql/schoolFeeCollectionModel.d.ts +22 -0
  493. package/dist/models/psql/schoolFeeCollectionModel.js +156 -0
  494. package/dist/models/psql/schoolOfferModel.d.ts +29 -0
  495. package/dist/models/psql/schoolOfferModel.js +167 -0
  496. package/dist/models/psql/sendNotificationModel.d.ts +22 -0
  497. package/dist/models/psql/sendNotificationModel.js +117 -0
  498. package/dist/models/psql/slotModel.d.ts +17 -0
  499. package/dist/models/psql/slotModel.js +99 -0
  500. package/dist/models/psql/stateModel.d.ts +13 -0
  501. package/dist/models/psql/stateModel.js +58 -0
  502. package/dist/models/psql/subjectHasFeeModel.d.ts +16 -0
  503. package/dist/models/psql/subjectHasFeeModel.js +78 -0
  504. package/dist/models/psql/subjectHasPayFeeHistoryModel.d.ts +18 -0
  505. package/dist/models/psql/subjectHasPayFeeHistoryModel.js +109 -0
  506. package/dist/models/psql/syllabusModel.d.ts +18 -0
  507. package/dist/models/psql/syllabusModel.js +125 -0
  508. package/dist/models/psql/testimonialModel.d.ts +21 -0
  509. package/dist/models/psql/testimonialModel.js +162 -0
  510. package/dist/models/psql/toDoModel.d.ts +20 -0
  511. package/dist/models/psql/toDoModel.js +116 -0
  512. package/dist/models/psql/tokenModel.d.ts +15 -0
  513. package/dist/models/psql/tokenModel.js +37 -0
  514. package/dist/models/psql/tripModel.d.ts +22 -0
  515. package/dist/models/psql/tripModel.js +114 -0
  516. package/dist/models/psql/typeManagementModel.d.ts +20 -0
  517. package/dist/models/psql/typeManagementModel.js +122 -0
  518. package/dist/models/psql/userBookAssessmentModel.d.ts +19 -0
  519. package/dist/models/psql/userBookAssessmentModel.js +141 -0
  520. package/dist/models/psql/userFeeTypeByAccountModel.d.ts +22 -0
  521. package/dist/models/psql/userFeeTypeByAccountModel.js +184 -0
  522. package/dist/models/psql/userFeeTypeModel.d.ts +25 -0
  523. package/dist/models/psql/userFeeTypeModel.js +172 -0
  524. package/dist/models/psql/userHasAnnouncementModel.d.ts +18 -0
  525. package/dist/models/psql/userHasAnnouncementModel.js +108 -0
  526. package/dist/models/psql/userHasBatchModel.d.ts +16 -0
  527. package/dist/models/psql/userHasBatchModel.js +92 -0
  528. package/dist/models/psql/userHasCourseModel.d.ts +22 -0
  529. package/dist/models/psql/userHasCourseModel.js +116 -0
  530. package/dist/models/psql/userHasDeviceModel.d.ts +19 -0
  531. package/dist/models/psql/userHasDeviceModel.js +91 -0
  532. package/dist/models/psql/userHasFeeTermsModel.d.ts +27 -0
  533. package/dist/models/psql/userHasFeeTermsModel.js +202 -0
  534. package/dist/models/psql/userHasFileModel.d.ts +16 -0
  535. package/dist/models/psql/userHasFileModel.js +107 -0
  536. package/dist/models/psql/userHasHomeWorkModel.d.ts +19 -0
  537. package/dist/models/psql/userHasHomeWorkModel.js +119 -0
  538. package/dist/models/psql/userHasInventoryHistoryModel.d.ts +29 -0
  539. package/dist/models/psql/userHasInventoryHistoryModel.js +146 -0
  540. package/dist/models/psql/userHasInventoryModel.d.ts +30 -0
  541. package/dist/models/psql/userHasInventoryModel.js +148 -0
  542. package/dist/models/psql/userHasLeaveHistoryModel.d.ts +25 -0
  543. package/dist/models/psql/userHasLeaveHistoryModel.js +106 -0
  544. package/dist/models/psql/userHasLeaveModel.d.ts +21 -0
  545. package/dist/models/psql/userHasLeaveModel.js +121 -0
  546. package/dist/models/psql/userHasOfferModel.d.ts +19 -0
  547. package/dist/models/psql/userHasOfferModel.js +154 -0
  548. package/dist/models/psql/userHasParentModel.d.ts +23 -0
  549. package/dist/models/psql/userHasParentModel.js +135 -0
  550. package/dist/models/psql/userHasRoleModel.d.ts +18 -0
  551. package/dist/models/psql/userHasRoleModel.js +97 -0
  552. package/dist/models/psql/userHasRollNumberModel.d.ts +17 -0
  553. package/dist/models/psql/userHasRollNumberModel.js +90 -0
  554. package/dist/models/psql/userHasStorageModel.d.ts +20 -0
  555. package/dist/models/psql/userHasStorageModel.js +86 -0
  556. package/dist/models/psql/userHasSubjectFeeModel.d.ts +18 -0
  557. package/dist/models/psql/userHasSubjectFeeModel.js +86 -0
  558. package/dist/models/psql/userLeaveRequestModel.d.ts +24 -0
  559. package/dist/models/psql/userLeaveRequestModel.js +104 -0
  560. package/dist/models/psql/userModel.d.ts +55 -0
  561. package/dist/models/psql/userModel.js +392 -0
  562. package/dist/models/psql/userPayoutDetailsModel.d.ts +21 -0
  563. package/dist/models/psql/userPayoutDetailsModel.js +162 -0
  564. package/dist/models/psql/userPayoutHistoryModel.d.ts +27 -0
  565. package/dist/models/psql/userPayoutHistoryModel.js +155 -0
  566. package/dist/models/psql/userPayoutModel.d.ts +20 -0
  567. package/dist/models/psql/userPayoutModel.js +316 -0
  568. package/dist/models/psql/userProjectAssessmentOptionModel.d.ts +19 -0
  569. package/dist/models/psql/userProjectAssessmentOptionModel.js +126 -0
  570. package/dist/models/psql/userRequiredStepsModel.d.ts +17 -0
  571. package/dist/models/psql/userRequiredStepsModel.js +78 -0
  572. package/dist/models/psql/vehicleModel.d.ts +20 -0
  573. package/dist/models/psql/vehicleModel.js +110 -0
  574. package/dist/models/psql/vendorManagementModel.d.ts +28 -0
  575. package/dist/models/psql/vendorManagementModel.js +179 -0
  576. package/dist/models/psql/walletHistoryModel.d.ts +24 -0
  577. package/dist/models/psql/walletHistoryModel.js +103 -0
  578. package/dist/models/psql/walletModel.d.ts +19 -0
  579. package/dist/models/psql/walletModel.js +93 -0
  580. package/dist/models/psql/workingDayModel.d.ts +20 -0
  581. package/dist/models/psql/workingDayModel.js +79 -0
  582. package/dist/models/psql/workingShiftModel.d.ts +21 -0
  583. package/dist/models/psql/workingShiftModel.js +92 -0
  584. package/dist/services/Concrete/mongooseCommonService.d.ts +36 -0
  585. package/dist/services/Concrete/mongooseCommonService.js +108 -0
  586. package/dist/services/Concrete/sequelizeCommanService.d.ts +17 -0
  587. package/dist/services/Concrete/sequelizeCommanService.js +123 -0
  588. package/dist/services/Contracts/IMongooseCommonService.d.ts +35 -0
  589. package/dist/services/Contracts/IMongooseCommonService.js +2 -0
  590. package/dist/services/Contracts/ISequelizeCommonService.d.ts +20 -0
  591. package/dist/services/Contracts/ISequelizeCommonService.js +2 -0
  592. package/dist/types/academicCalendarType.d.ts +6 -0
  593. package/dist/types/academicCalendarType.js +2 -0
  594. package/dist/types/accountHasReceiptDetailsType.d.ts +7 -0
  595. package/dist/types/accountHasReceiptDetailsType.js +2 -0
  596. package/dist/types/announcementType.d.ts +6 -0
  597. package/dist/types/announcementType.js +2 -0
  598. package/dist/types/approveRequestType.d.ts +2 -0
  599. package/dist/types/approveRequestType.js +2 -0
  600. package/dist/types/areaType.d.ts +3 -0
  601. package/dist/types/areaType.js +2 -0
  602. package/dist/types/attendanceType.d.ts +2 -0
  603. package/dist/types/attendanceType.js +2 -0
  604. package/dist/types/bankAccountDetailsType.d.ts +3 -0
  605. package/dist/types/bankAccountDetailsType.js +2 -0
  606. package/dist/types/bannerType.d.ts +7 -0
  607. package/dist/types/bannerType.js +2 -0
  608. package/dist/types/batchSubjectBookAssessmentType.d.ts +7 -0
  609. package/dist/types/batchSubjectBookAssessmentType.js +2 -0
  610. package/dist/types/batchSubjectProjectAssessmentType.d.ts +7 -0
  611. package/dist/types/batchSubjectProjectAssessmentType.js +2 -0
  612. package/dist/types/batchType.d.ts +7 -0
  613. package/dist/types/batchType.js +2 -0
  614. package/dist/types/blogType.d.ts +2 -0
  615. package/dist/types/blogType.js +2 -0
  616. package/dist/types/bookAssessmentDateType.d.ts +7 -0
  617. package/dist/types/bookAssessmentDateType.js +2 -0
  618. package/dist/types/careerType.d.ts +2 -0
  619. package/dist/types/careerType.js +2 -0
  620. package/dist/types/categoriesType.d.ts +3 -0
  621. package/dist/types/categoriesType.js +2 -0
  622. package/dist/types/certificatesHistoryType.d.ts +2 -0
  623. package/dist/types/certificatesHistoryType.js +2 -0
  624. package/dist/types/certificatesManagementType.d.ts +2 -0
  625. package/dist/types/certificatesManagementType.js +2 -0
  626. package/dist/types/classRoomType.d.ts +3 -0
  627. package/dist/types/classRoomType.js +2 -0
  628. package/dist/types/cloudStorageType.d.ts +3 -0
  629. package/dist/types/cloudStorageType.js +2 -0
  630. package/dist/types/coinPurchaseOfferType.d.ts +3 -0
  631. package/dist/types/coinPurchaseOfferType.js +2 -0
  632. package/dist/types/commonType.d.ts +9 -0
  633. package/dist/types/commonType.js +2 -0
  634. package/dist/types/contactFeedBackType.d.ts +3 -0
  635. package/dist/types/contactFeedBackType.js +2 -0
  636. package/dist/types/courseHasVisitorsType.d.ts +2 -0
  637. package/dist/types/courseHasVisitorsType.js +2 -0
  638. package/dist/types/courseType.d.ts +2 -0
  639. package/dist/types/courseType.js +2 -0
  640. package/dist/types/dailyBookType.d.ts +2 -0
  641. package/dist/types/dailyBookType.js +2 -0
  642. package/dist/types/dashboardManagementType.d.ts +2 -0
  643. package/dist/types/dashboardManagementType.js +2 -0
  644. package/dist/types/driverType.d.ts +6 -0
  645. package/dist/types/driverType.js +2 -0
  646. package/dist/types/entityGroupType.d.ts +3 -0
  647. package/dist/types/entityGroupType.js +2 -0
  648. package/dist/types/eventType.d.ts +2 -0
  649. package/dist/types/eventType.js +2 -0
  650. package/dist/types/examGroupType.d.ts +6 -0
  651. package/dist/types/examGroupType.js +2 -0
  652. package/dist/types/examHasAnswerSheetType.d.ts +2 -0
  653. package/dist/types/examHasAnswerSheetType.js +2 -0
  654. package/dist/types/examType.d.ts +6 -0
  655. package/dist/types/examType.js +2 -0
  656. package/dist/types/facilityType.d.ts +3 -0
  657. package/dist/types/facilityType.js +2 -0
  658. package/dist/types/featureActionType.d.ts +3 -0
  659. package/dist/types/featureActionType.js +2 -0
  660. package/dist/types/feeHistoryDetailsType.d.ts +6 -0
  661. package/dist/types/feeHistoryDetailsType.js +2 -0
  662. package/dist/types/feeHistoryType.d.ts +18 -0
  663. package/dist/types/feeHistoryType.js +2 -0
  664. package/dist/types/feeReminderSettingType.d.ts +3 -0
  665. package/dist/types/feeReminderSettingType.js +2 -0
  666. package/dist/types/feeReminderType.d.ts +3 -0
  667. package/dist/types/feeReminderType.js +2 -0
  668. package/dist/types/feeReminderTypeType.d.ts +2 -0
  669. package/dist/types/feeReminderTypeType.js +2 -0
  670. package/dist/types/feeTypeHasTermsType.d.ts +3 -0
  671. package/dist/types/feeTypeHasTermsType.js +2 -0
  672. package/dist/types/feeTypeType.d.ts +3 -0
  673. package/dist/types/feeTypeType.js +2 -0
  674. package/dist/types/feedBackType.d.ts +2 -0
  675. package/dist/types/feedBackType.js +2 -0
  676. package/dist/types/feesCollectionType.d.ts +3 -0
  677. package/dist/types/feesCollectionType.js +2 -0
  678. package/dist/types/fileStorageType.d.ts +3 -0
  679. package/dist/types/fileStorageType.js +2 -0
  680. package/dist/types/floormanagementType.d.ts +3 -0
  681. package/dist/types/floormanagementType.js +2 -0
  682. package/dist/types/generateIdCardType.d.ts +2 -0
  683. package/dist/types/generateIdCardType.js +2 -0
  684. package/dist/types/greetingsType.d.ts +6 -0
  685. package/dist/types/greetingsType.js +2 -0
  686. package/dist/types/holidayType.d.ts +2 -0
  687. package/dist/types/holidayType.js +3 -0
  688. package/dist/types/homeWorkType.d.ts +3 -0
  689. package/dist/types/homeWorkType.js +2 -0
  690. package/dist/types/informationSupportType.d.ts +2 -0
  691. package/dist/types/informationSupportType.js +2 -0
  692. package/dist/types/inquiryType.d.ts +2 -0
  693. package/dist/types/inquiryType.js +2 -0
  694. package/dist/types/instituteEntityType.d.ts +6 -0
  695. package/dist/types/instituteEntityType.js +2 -0
  696. package/dist/types/instituteEntityTypeType.d.ts +3 -0
  697. package/dist/types/instituteEntityTypeType.js +2 -0
  698. package/dist/types/instituteSubscriptionPlanType.d.ts +3 -0
  699. package/dist/types/instituteSubscriptionPlanType.js +2 -0
  700. package/dist/types/instituteType.d.ts +3 -0
  701. package/dist/types/instituteType.js +2 -0
  702. package/dist/types/inventoryHistoryType.d.ts +3 -0
  703. package/dist/types/inventoryHistoryType.js +2 -0
  704. package/dist/types/inventoryType.d.ts +3 -0
  705. package/dist/types/inventoryType.js +2 -0
  706. package/dist/types/jobApply.d.ts +2 -0
  707. package/dist/types/jobApply.js +2 -0
  708. package/dist/types/lectureHistoryType.d.ts +6 -0
  709. package/dist/types/lectureHistoryType.js +2 -0
  710. package/dist/types/lectureType.d.ts +6 -0
  711. package/dist/types/lectureType.js +2 -0
  712. package/dist/types/masterLeaveType.d.ts +3 -0
  713. package/dist/types/masterLeaveType.js +2 -0
  714. package/dist/types/moduleFeatureType.d.ts +3 -0
  715. package/dist/types/moduleFeatureType.js +2 -0
  716. package/dist/types/moduleType.d.ts +3 -0
  717. package/dist/types/moduleType.js +2 -0
  718. package/dist/types/offerType.d.ts +3 -0
  719. package/dist/types/offerType.js +2 -0
  720. package/dist/types/paymentTermsType.d.ts +3 -0
  721. package/dist/types/paymentTermsType.js +3 -0
  722. package/dist/types/pdcChequeType.d.ts +6 -0
  723. package/dist/types/pdcChequeType.js +2 -0
  724. package/dist/types/pdcHistoryType.d.ts +2 -0
  725. package/dist/types/pdcHistoryType.js +2 -0
  726. package/dist/types/photosGalleryType.d.ts +2 -0
  727. package/dist/types/photosGalleryType.js +2 -0
  728. package/dist/types/plannerType.d.ts +7 -0
  729. package/dist/types/plannerType.js +2 -0
  730. package/dist/types/productType.d.ts +3 -0
  731. package/dist/types/productType.js +2 -0
  732. package/dist/types/projectAssessmentOptionType.d.ts +7 -0
  733. package/dist/types/projectAssessmentOptionType.js +2 -0
  734. package/dist/types/roleType.d.ts +11 -0
  735. package/dist/types/roleType.js +2 -0
  736. package/dist/types/rulesRegulationType.d.ts +3 -0
  737. package/dist/types/rulesRegulationType.js +2 -0
  738. package/dist/types/schoolFeeCollectionType.d.ts +3 -0
  739. package/dist/types/schoolFeeCollectionType.js +2 -0
  740. package/dist/types/schoolFeeType.d.ts +3 -0
  741. package/dist/types/schoolFeeType.js +2 -0
  742. package/dist/types/schoolOfferType.d.ts +3 -0
  743. package/dist/types/schoolOfferType.js +2 -0
  744. package/dist/types/sendNotificationType.d.ts +3 -0
  745. package/dist/types/sendNotificationType.js +2 -0
  746. package/dist/types/slotType.d.ts +2 -0
  747. package/dist/types/slotType.js +2 -0
  748. package/dist/types/subCategoryType.d.ts +3 -0
  749. package/dist/types/subCategoryType.js +2 -0
  750. package/dist/types/subjectHasFeeType.d.ts +3 -0
  751. package/dist/types/subjectHasFeeType.js +2 -0
  752. package/dist/types/subjectHasPayFeeHistoryType.d.ts +3 -0
  753. package/dist/types/subjectHasPayFeeHistoryType.js +2 -0
  754. package/dist/types/subjectIndexType.d.ts +7 -0
  755. package/dist/types/subjectIndexType.js +2 -0
  756. package/dist/types/subscriptionPlanType.d.ts +2 -0
  757. package/dist/types/subscriptionPlanType.js +2 -0
  758. package/dist/types/syllabusType.d.ts +7 -0
  759. package/dist/types/syllabusType.js +2 -0
  760. package/dist/types/taskManagementType.d.ts +2 -0
  761. package/dist/types/taskManagementType.js +2 -0
  762. package/dist/types/testimonialType.d.ts +13 -0
  763. package/dist/types/testimonialType.js +2 -0
  764. package/dist/types/toDoType.d.ts +6 -0
  765. package/dist/types/toDoType.js +2 -0
  766. package/dist/types/tripType.d.ts +2 -0
  767. package/dist/types/tripType.js +2 -0
  768. package/dist/types/typeManagementType.d.ts +3 -0
  769. package/dist/types/typeManagementType.js +2 -0
  770. package/dist/types/uniqueNumberCounterType.d.ts +2 -0
  771. package/dist/types/uniqueNumberCounterType.js +2 -0
  772. package/dist/types/userBookAssessmentType.d.ts +7 -0
  773. package/dist/types/userBookAssessmentType.js +2 -0
  774. package/dist/types/userDetailsType.d.ts +2 -0
  775. package/dist/types/userDetailsType.js +2 -0
  776. package/dist/types/userFeeTypeByAccountType.d.ts +3 -0
  777. package/dist/types/userFeeTypeByAccountType.js +2 -0
  778. package/dist/types/userFeeTypeType.d.ts +6 -0
  779. package/dist/types/userFeeTypeType.js +2 -0
  780. package/dist/types/userHasAnnouncementType.d.ts +3 -0
  781. package/dist/types/userHasAnnouncementType.js +2 -0
  782. package/dist/types/userHasBatchType.d.ts +9 -0
  783. package/dist/types/userHasBatchType.js +2 -0
  784. package/dist/types/userHasCourseType.d.ts +3 -0
  785. package/dist/types/userHasCourseType.js +2 -0
  786. package/dist/types/userHasDeviceType.d.ts +3 -0
  787. package/dist/types/userHasDeviceType.js +2 -0
  788. package/dist/types/userHasFeeTermsType.d.ts +3 -0
  789. package/dist/types/userHasFeeTermsType.js +2 -0
  790. package/dist/types/userHasFileType.d.ts +3 -0
  791. package/dist/types/userHasFileType.js +2 -0
  792. package/dist/types/userHasHomeWorkType.d.ts +3 -0
  793. package/dist/types/userHasHomeWorkType.js +2 -0
  794. package/dist/types/userHasInventoryHistoryType.d.ts +3 -0
  795. package/dist/types/userHasInventoryHistoryType.js +2 -0
  796. package/dist/types/userHasInventoryType.d.ts +3 -0
  797. package/dist/types/userHasInventoryType.js +2 -0
  798. package/dist/types/userHasLeaveHistoryType.d.ts +3 -0
  799. package/dist/types/userHasLeaveHistoryType.js +2 -0
  800. package/dist/types/userHasLeaveType.d.ts +3 -0
  801. package/dist/types/userHasLeaveType.js +2 -0
  802. package/dist/types/userHasOffer.d.ts +3 -0
  803. package/dist/types/userHasOffer.js +2 -0
  804. package/dist/types/userHasParentType.d.ts +10 -0
  805. package/dist/types/userHasParentType.js +2 -0
  806. package/dist/types/userHasRoleType.d.ts +3 -0
  807. package/dist/types/userHasRoleType.js +2 -0
  808. package/dist/types/userHasRollNumberType.d.ts +3 -0
  809. package/dist/types/userHasRollNumberType.js +2 -0
  810. package/dist/types/userHasStorageType.d.ts +3 -0
  811. package/dist/types/userHasStorageType.js +2 -0
  812. package/dist/types/userHasSubjectFeeType.d.ts +3 -0
  813. package/dist/types/userHasSubjectFeeType.js +2 -0
  814. package/dist/types/userInstituteMetaType.d.ts +2 -0
  815. package/dist/types/userInstituteMetaType.js +2 -0
  816. package/dist/types/userLeaveRequestType.d.ts +3 -0
  817. package/dist/types/userLeaveRequestType.js +2 -0
  818. package/dist/types/userMetaType.d.ts +13 -0
  819. package/dist/types/userMetaType.js +2 -0
  820. package/dist/types/userPayoutDetailsType.d.ts +3 -0
  821. package/dist/types/userPayoutDetailsType.js +2 -0
  822. package/dist/types/userPayoutHistoryType.d.ts +3 -0
  823. package/dist/types/userPayoutHistoryType.js +2 -0
  824. package/dist/types/userPayoutType.d.ts +7 -0
  825. package/dist/types/userPayoutType.js +2 -0
  826. package/dist/types/userProjectAssessmentOptionType.d.ts +7 -0
  827. package/dist/types/userProjectAssessmentOptionType.js +2 -0
  828. package/dist/types/userRequiredStepsType.d.ts +3 -0
  829. package/dist/types/userRequiredStepsType.js +2 -0
  830. package/dist/types/userSchoolMetaType.d.ts +3 -0
  831. package/dist/types/userSchoolMetaType.js +2 -0
  832. package/dist/types/userType.d.ts +12 -0
  833. package/dist/types/userType.js +2 -0
  834. package/dist/types/vehicleType.d.ts +3 -0
  835. package/dist/types/vehicleType.js +2 -0
  836. package/dist/types/vendorType.d.ts +3 -0
  837. package/dist/types/vendorType.js +2 -0
  838. package/dist/types/videoAnalystType.d.ts +2 -0
  839. package/dist/types/videoAnalystType.js +2 -0
  840. package/dist/types/walletHistoryType.d.ts +3 -0
  841. package/dist/types/walletHistoryType.js +2 -0
  842. package/dist/types/walletTransactionType.d.ts +3 -0
  843. package/dist/types/walletTransactionType.js +2 -0
  844. package/dist/types/walletType.d.ts +3 -0
  845. package/dist/types/walletType.js +2 -0
  846. package/dist/types/workingDayType.d.ts +3 -0
  847. package/dist/types/workingDayType.js +2 -0
  848. package/dist/types/workingShiftType.d.ts +3 -0
  849. package/dist/types/workingShiftType.js +2 -0
  850. package/package.json +48 -0
@@ -0,0 +1,667 @@
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 });
39
+ /* eslint-disable @typescript-eslint/no-explicit-any */
40
+ const mongoose_1 = __importStar(require("mongoose"));
41
+ const app_1 = require("../../constants/app");
42
+ const uuid_1 = require("uuid");
43
+ const utils_1 = require("../../helpers/utils");
44
+ const sequelize_1 = require("sequelize");
45
+ const env_1 = require("../../configs/env");
46
+ const errorMessages_1 = require("../../constants/errorMessages");
47
+ const batchModel_1 = __importDefault(require("../psql/batchModel"));
48
+ const instituteModel_1 = __importDefault(require("../psql/instituteModel"));
49
+ const userModel_1 = __importDefault(require("../psql/userModel"));
50
+ const defaultModelAttributes_1 = require("../../constants/defaultModelAttributes");
51
+ const instituteEntityModel_1 = __importDefault(require("../psql/instituteEntityModel"));
52
+ const fileStorageModel_1 = __importDefault(require("../psql/fileStorageModel"));
53
+ const typeManagementModel_1 = __importDefault(require("../psql/typeManagementModel"));
54
+ const lectureModel_1 = __importDefault(require("../psql/lectureModel"));
55
+ const s3Uploader_1 = require("../../helpers/s3Uploader");
56
+ const userInstituteMetaModel_1 = __importDefault(require("./userInstituteMetaModel"));
57
+ // Define the schema for IChapterFileAttributes
58
+ const ChapterFileSchema = new mongoose_1.Schema({
59
+ id: {
60
+ type: String,
61
+ required: true,
62
+ },
63
+ type: {
64
+ type: String,
65
+ enum: Object.values(app_1.CHAPTER_INDEX_FILE_TYPE),
66
+ required: true,
67
+ },
68
+ fileStorageId: {
69
+ type: String,
70
+ required: false,
71
+ },
72
+ fileLink: {
73
+ type: String,
74
+ required: false,
75
+ },
76
+ categoryId: {
77
+ type: String,
78
+ required: false,
79
+ },
80
+ title: {
81
+ type: String,
82
+ required: false,
83
+ },
84
+ descriptions: {
85
+ type: String,
86
+ required: false,
87
+ },
88
+ isDefault: {
89
+ type: Boolean,
90
+ default: false,
91
+ },
92
+ }, { _id: false } // Prevents automatic _id generation for subdocuments
93
+ );
94
+ const assignedUsersSchema = new mongoose_1.Schema({
95
+ userId: {
96
+ type: String,
97
+ required: true,
98
+ },
99
+ chapterIndexId: {
100
+ type: String,
101
+ required: true,
102
+ },
103
+ status: {
104
+ type: String,
105
+ enum: Object.values(app_1.USER_CHAPTER_INDEX_STATUS),
106
+ default: app_1.USER_CHAPTER_INDEX_STATUS.NOT_COMPLETED,
107
+ required: false,
108
+ },
109
+ statusUpdatedAt: {
110
+ type: Date,
111
+ default: () => new Date(),
112
+ required: false,
113
+ },
114
+ /*******pass lecture id when checkout lecture ******/
115
+ lectureId: {
116
+ type: String,
117
+ required: false,
118
+ },
119
+ teachingTime: {
120
+ type: Number,
121
+ required: false,
122
+ },
123
+ teachingAid: {
124
+ type: String,
125
+ require: false,
126
+ },
127
+ }, { _id: false } // Prevents automatic _id generation for sub documents
128
+ );
129
+ // Define the schema for IChapterIndexAttributes
130
+ const ChapterIndexSchema = new mongoose_1.Schema({
131
+ id: {
132
+ type: String,
133
+ required: true,
134
+ },
135
+ index: {
136
+ type: Number,
137
+ required: true,
138
+ },
139
+ title: {
140
+ type: String,
141
+ required: true,
142
+ },
143
+ subTitle: {
144
+ type: String,
145
+ required: false,
146
+ },
147
+ type: {
148
+ type: String,
149
+ enum: Object.values(app_1.CHAPTER_INDEX_TYPE),
150
+ required: true,
151
+ },
152
+ parentId: {
153
+ type: String,
154
+ },
155
+ files: {
156
+ type: [ChapterFileSchema],
157
+ default: [],
158
+ required: false,
159
+ },
160
+ teachingTime: {
161
+ type: Number,
162
+ required: false,
163
+ },
164
+ isDefault: {
165
+ type: Boolean,
166
+ default: false,
167
+ },
168
+ }, { _id: false } // Prevents automatic _id generation for subdocuments
169
+ );
170
+ // Define the schema for ISubjectIndexModelAttributes
171
+ const SubjectIndexSchema = new mongoose_1.Schema({
172
+ title: {
173
+ type: String,
174
+ required: false,
175
+ },
176
+ subject: {
177
+ type: String,
178
+ required: true,
179
+ },
180
+ batch: {
181
+ type: String,
182
+ required: false,
183
+ },
184
+ type: {
185
+ type: String,
186
+ enum: Object.values(app_1.SUBJECT_INDEX_TYPE),
187
+ required: true,
188
+ },
189
+ chapterIndex: {
190
+ type: [ChapterIndexSchema],
191
+ required: false,
192
+ },
193
+ status: {
194
+ type: String,
195
+ enum: Object.values(app_1.COMMAN_STATUS),
196
+ default: app_1.COMMAN_STATUS.ACTIVE,
197
+ required: false,
198
+ },
199
+ instituteId: {
200
+ type: String,
201
+ required: false,
202
+ },
203
+ sharedInstituteId: {
204
+ type: [String],
205
+ default: [],
206
+ required: false,
207
+ },
208
+ sharedUnverifiedInstituteId: {
209
+ type: [String],
210
+ default: [],
211
+ required: false,
212
+ },
213
+ userId: {
214
+ type: String,
215
+ required: false,
216
+ },
217
+ assignedUsers: {
218
+ type: [assignedUsersSchema],
219
+ required: false,
220
+ default: [],
221
+ },
222
+ selectedCategoryIds: {
223
+ type: [String],
224
+ required: false,
225
+ default: [],
226
+ },
227
+ }, {
228
+ timestamps: true, // Adds createdAt and updatedAt fields
229
+ versionKey: false, // Disables the __v field
230
+ });
231
+ const creatOrUpdateHook = async (subjectIndex) => {
232
+ try {
233
+ if (subjectIndex.instituteId) {
234
+ const institute = await instituteModel_1.default.findByPk(subjectIndex.instituteId);
235
+ if (!institute)
236
+ throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
237
+ }
238
+ if (subjectIndex.sharedInstituteId?.length) {
239
+ subjectIndex.sharedInstituteId = [
240
+ ...new Set(subjectIndex.sharedInstituteId),
241
+ ];
242
+ const count = await instituteModel_1.default.count({
243
+ where: {
244
+ id: { [sequelize_1.Op.in]: subjectIndex.sharedInstituteId },
245
+ },
246
+ });
247
+ if (count !== subjectIndex.sharedInstituteId.length)
248
+ throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
249
+ }
250
+ if (subjectIndex.sharedUnverifiedInstituteId?.length) {
251
+ subjectIndex.sharedUnverifiedInstituteId = [
252
+ ...new Set(subjectIndex.sharedUnverifiedInstituteId),
253
+ ].filter((instituteId) => !subjectIndex?.sharedInstituteId?.includes(instituteId));
254
+ const count = await instituteModel_1.default.count({
255
+ where: {
256
+ id: { [sequelize_1.Op.in]: subjectIndex.sharedUnverifiedInstituteId },
257
+ },
258
+ });
259
+ if (count !== subjectIndex.sharedUnverifiedInstituteId.length)
260
+ throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
261
+ }
262
+ if (subjectIndex.subject) {
263
+ const subject = await instituteEntityModel_1.default.findOne({
264
+ where: { id: subjectIndex.subject },
265
+ include: [
266
+ {
267
+ association: "entityType",
268
+ where: { sequence: app_1.INSTITUTE_ENTITY_TYPE_SEQUENCE.LAST },
269
+ },
270
+ ],
271
+ });
272
+ if (!subject)
273
+ throw new Error(errorMessages_1.INSTITUTE_ENTITY_ERROR_MESSAGES.NOT_FOUND);
274
+ }
275
+ if (subjectIndex.batch) {
276
+ const batch = await batchModel_1.default.findOne({
277
+ where: {
278
+ id: subjectIndex.batch,
279
+ subjects: { [sequelize_1.Op.overlap]: [subjectIndex.subject] },
280
+ },
281
+ });
282
+ if (!batch)
283
+ throw new Error(errorMessages_1.BATCH_ERROR_MESSAGES.NOT_FOUND);
284
+ }
285
+ if (subjectIndex.userId) {
286
+ const userId = await userModel_1.default.findOne({
287
+ where: {
288
+ id: subjectIndex.userId,
289
+ },
290
+ });
291
+ if (!userId) {
292
+ throw new Error(errorMessages_1.USER_ERROR_MESSAGES.NOT_FOUND);
293
+ }
294
+ }
295
+ if (subjectIndex.chapterIndex && subjectIndex.chapterIndex.length) {
296
+ const isValidIndex = (list) => {
297
+ if (!list.length)
298
+ return true;
299
+ //make unique index aray
300
+ const indexList = list.map((one) => one.index);
301
+ const tmpArr = [...new Set(indexList)];
302
+ if (tmpArr.length !== indexList.length)
303
+ return false;
304
+ //check index start from 1 and last should be nth;
305
+ if (indexList[0] !== 1 ||
306
+ indexList[indexList.length - 1] !== indexList.length)
307
+ return false;
308
+ // Sort the array
309
+ indexList.sort((a, b) => a - b);
310
+ for (let i = 1; i < indexList.length; i++) {
311
+ if (!indexList[i])
312
+ return false;
313
+ if (indexList[i] - indexList[i - 1] !== 1) {
314
+ return false; // Condition fails
315
+ }
316
+ }
317
+ return true;
318
+ };
319
+ const chapterList = subjectIndex.chapterIndex.filter((chapter) => chapter.type === app_1.CHAPTER_INDEX_TYPE.CHAPTER);
320
+ if (!isValidIndex(chapterList))
321
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_INDEX);
322
+ for (const chapter of chapterList) {
323
+ const topicList = subjectIndex.chapterIndex.filter((topic) => topic.type === app_1.CHAPTER_INDEX_TYPE.TOPIC &&
324
+ topic.parentId === chapter.id);
325
+ if (!isValidIndex(topicList))
326
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
327
+ for (const topic of topicList) {
328
+ const subTopicList = subjectIndex.chapterIndex.filter((subTopic) => subTopic.type === app_1.CHAPTER_INDEX_TYPE.SUB_TOPIC &&
329
+ subTopic.parentId === topic.id);
330
+ if (!isValidIndex(subTopicList))
331
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
332
+ const topicIndex = subjectIndex.chapterIndex.findIndex((c) => c.id === topic.id);
333
+ if (!subTopicList.length && topic.teachingTime) {
334
+ subjectIndex.chapterIndex[topicIndex].teachingTime =
335
+ topic.teachingTime;
336
+ }
337
+ else {
338
+ subjectIndex.chapterIndex[topicIndex].teachingTime =
339
+ subTopicList.reduce((sum, subTopic) => sum + (subTopic.teachingTime || 0), 0);
340
+ }
341
+ }
342
+ const chapterIndex = subjectIndex.chapterIndex.findIndex((c) => c.id === chapter.id);
343
+ if (!topicList.length && chapter.teachingTime) {
344
+ subjectIndex.chapterIndex[chapterIndex].teachingTime =
345
+ chapter.teachingTime;
346
+ }
347
+ else {
348
+ subjectIndex.chapterIndex[chapterIndex].teachingTime =
349
+ topicList.reduce((sum, topic) => sum + (topic.teachingTime || 0), 0);
350
+ }
351
+ }
352
+ for (const chapterIndex of subjectIndex.chapterIndex) {
353
+ if (!chapterIndex.id)
354
+ chapterIndex.id = (0, uuid_1.v4)();
355
+ if (chapterIndex.type !== app_1.CHAPTER_INDEX_TYPE.CHAPTER) {
356
+ const parentChapterIndex = subjectIndex.chapterIndex.find((index) => index.id === chapterIndex.parentId);
357
+ if (!parentChapterIndex)
358
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
359
+ if (chapterIndex.type === app_1.CHAPTER_INDEX_TYPE.SUB_TOPIC &&
360
+ parentChapterIndex.type !== app_1.CHAPTER_INDEX_TYPE.TOPIC) {
361
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
362
+ }
363
+ if (chapterIndex.type === app_1.CHAPTER_INDEX_TYPE.TOPIC &&
364
+ parentChapterIndex.type !== app_1.CHAPTER_INDEX_TYPE.CHAPTER) {
365
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
366
+ }
367
+ }
368
+ if (chapterIndex.files && chapterIndex.files.length) {
369
+ // if (subjectIndex.selectedCategoryIds && subjectIndex.selectedCategoryIds.length) {
370
+ // chapterIndex.files = chapterIndex.files.filter(file =>
371
+ // subjectIndex.selectedCategoryIds?.includes(file.categoryId as string),
372
+ // );
373
+ // }
374
+ chapterIndex.files = chapterIndex.files.map((file) => {
375
+ if (!file.id)
376
+ file.id = (0, uuid_1.v4)();
377
+ return file;
378
+ });
379
+ }
380
+ }
381
+ }
382
+ if (subjectIndex.assignedUsers && subjectIndex.assignedUsers.length) {
383
+ subjectIndex.assignedUsers = (0, utils_1.getUniqueArrayByFields)(subjectIndex.assignedUsers, ["userId", "chapterIndexId"]);
384
+ const chapterIndex = [...(subjectIndex.chapterIndex || [])];
385
+ const chapterIndexIdList = chapterIndex
386
+ // .filter(chapter => chapter.type === CHAPTER_INDEX_TYPE.CHAPTER)
387
+ .map((chapter) => chapter.id);
388
+ // const isValidIndex = subjectIndex.assignedUsers.every(assignedUser => chapterIndexIdList.includes(assignedUser.chapterIndexId));
389
+ // if (!isValidIndex) throw new Error(SUBJECT_INDEX_ERROR_MESSAGES.CAN_NOT_ASSIGN_TO_USER);
390
+ subjectIndex.assignedUsers = subjectIndex.assignedUsers.filter((assignedUser) => chapterIndexIdList.includes(assignedUser.chapterIndexId));
391
+ const chapterIndexList = chapterIndex
392
+ .filter((chapter) => subjectIndex.assignedUsers
393
+ ?.map((assigned) => assigned.chapterIndexId)
394
+ .includes(chapter.id))
395
+ .map((chapter) => {
396
+ const found = subjectIndex?.assignedUsers?.find((assignedUser) => chapter.id === assignedUser.chapterIndexId);
397
+ if (found && found.teachingTime)
398
+ chapter.teachingTime = found.teachingTime;
399
+ return chapter;
400
+ });
401
+ const chapterList = chapterIndexList.filter((chapter) => chapter.type === app_1.CHAPTER_INDEX_TYPE.CHAPTER);
402
+ if (!chapterList.length)
403
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_INDEX);
404
+ for (const chapter of chapterList) {
405
+ const topicList = chapterIndexList.filter((topic) => topic.type === app_1.CHAPTER_INDEX_TYPE.TOPIC &&
406
+ topic.parentId === chapter.id);
407
+ if (!topicList)
408
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_TOPIC_INDEX);
409
+ for (const topic of topicList) {
410
+ const subTopicList = chapterIndexList.filter((subTopic) => subTopic.type === app_1.CHAPTER_INDEX_TYPE.SUB_TOPIC &&
411
+ subTopic.parentId === topic.id);
412
+ if (!subTopicList)
413
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.INVALID_CHAPTER_SUB_TOPIC_INDEX);
414
+ const topicIndex = chapterIndexList.findIndex((c) => c.id === topic.id);
415
+ if (!subTopicList.length && topic.teachingTime) {
416
+ chapterIndexList[topicIndex].teachingTime = topic.teachingTime;
417
+ }
418
+ else {
419
+ chapterIndexList[topicIndex].teachingTime = subTopicList.reduce((sum, subTopic) => sum + (subTopic.teachingTime || 0), 0);
420
+ }
421
+ }
422
+ const chapterIndex = chapterIndexList.findIndex((c) => c.id === chapter.id);
423
+ if (!topicList.length && chapter.teachingTime) {
424
+ chapterIndexList[chapterIndex].teachingTime = chapter.teachingTime;
425
+ }
426
+ else {
427
+ chapterIndexList[chapterIndex].teachingTime = topicList.reduce((sum, topic) => sum + (topic.teachingTime || 0), 0);
428
+ }
429
+ }
430
+ subjectIndex.assignedUsers = [
431
+ ...subjectIndex.assignedUsers.map((assignedUser) => {
432
+ const found = chapterIndexList.find((chapter) => chapter.id === assignedUser.chapterIndexId);
433
+ if (found && found.teachingTime)
434
+ assignedUser.teachingTime = found.teachingTime;
435
+ return assignedUser;
436
+ }),
437
+ ];
438
+ let userIdList = subjectIndex.assignedUsers.map((assignedUser) => assignedUser.userId);
439
+ userIdList = [...new Set(userIdList)];
440
+ const assignedUsersIdCount = await userModel_1.default.count({
441
+ where: {
442
+ id: {
443
+ [sequelize_1.Op.in]: userIdList,
444
+ },
445
+ type: app_1.USER_TYPES.TEACHER,
446
+ },
447
+ });
448
+ if (assignedUsersIdCount !== userIdList.length) {
449
+ throw new Error(errorMessages_1.USER_ERROR_MESSAGES.NOT_FOUND);
450
+ }
451
+ const where = {
452
+ userType: app_1.USER_TYPES.TEACHER,
453
+ status: app_1.USER_INSTITUTE_META_STATUS.ACCEPTED,
454
+ entities: { $in: [subjectIndex.subject] },
455
+ };
456
+ if (subjectIndex.type === app_1.SUBJECT_INDEX_TYPE.PRIVATE) {
457
+ where.instituteId = {
458
+ $in: [
459
+ ...subjectIndex.sharedInstituteId,
460
+ subjectIndex.instituteId || "",
461
+ ],
462
+ };
463
+ }
464
+ else {
465
+ where.instituteId = subjectIndex.instituteId;
466
+ }
467
+ const userIntituteMetaList = await userInstituteMetaModel_1.default.find({ ...where }, { userId: 1 });
468
+ let allowUserIds = userIntituteMetaList.map((userIntituteMeta) => userIntituteMeta.userId);
469
+ if (subjectIndex.type === app_1.SUBJECT_INDEX_TYPE.PRIVATE) {
470
+ allowUserIds.push(subjectIndex.userId);
471
+ }
472
+ allowUserIds = [...new Set(allowUserIds)];
473
+ const notAllowUserIds = subjectIndex.assignedUsers?.filter((assignedUsers) => !allowUserIds.includes(assignedUsers.userId));
474
+ if (notAllowUserIds?.length)
475
+ throw new Error(errorMessages_1.SUBJECT_INDEX_ERROR_MESSAGES.CAN_NOT_ASSIGN_TO_USER);
476
+ }
477
+ }
478
+ catch (error) {
479
+ throw error;
480
+ }
481
+ };
482
+ const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) => {
483
+ const batchList = await batchModel_1.default.findAll({
484
+ where: {
485
+ id: {
486
+ [sequelize_1.Op.in]: subjectIndexList.map((subject) => subject.batch),
487
+ },
488
+ },
489
+ });
490
+ const batchListById = (0, utils_1.keyByFieldOrFields)(batchList, "id");
491
+ const subjectList = await instituteEntityModel_1.default.findAll({
492
+ where: {
493
+ id: {
494
+ [sequelize_1.Op.in]: subjectIndexList.map((subject) => subject.subject),
495
+ },
496
+ },
497
+ });
498
+ const subjectListById = (0, utils_1.keyByFieldOrFields)(subjectList, "id");
499
+ const userIdSet = new Set(subjectIndexList.flatMap((subject) => [
500
+ subject.userId,
501
+ subject.createdBy,
502
+ ]));
503
+ subjectIndexList.forEach((subject) => subject.assignedUsers?.forEach((assign) => userIdSet.add(assign.userId)));
504
+ const userList = await userModel_1.default.findAll({
505
+ where: { id: { [sequelize_1.Op.in]: [...userIdSet] } },
506
+ attributes: defaultModelAttributes_1.USER_BASIC_DETAIL,
507
+ });
508
+ const userListById = (0, utils_1.keyByFieldOrFields)(userList, "id");
509
+ const instituteIdSet = new Set(subjectIndexList.flatMap((subject) => [
510
+ subject.instituteId,
511
+ ...(subject.sharedInstituteId || []),
512
+ ]));
513
+ const instituteList = await instituteModel_1.default.findAll({
514
+ where: { id: { [sequelize_1.Op.in]: [...instituteIdSet] } },
515
+ attributes: defaultModelAttributes_1.INSTITUTE_BASIC_DETAIL,
516
+ });
517
+ const instituteListById = (0, utils_1.keyByFieldOrFields)(instituteList, "id");
518
+ const fileStorageIdList = subjectIndexList.flatMap((subject) => subject.chapterIndex?.flatMap((chapter) => chapter.files?.map((file) => file.fileStorageId) || []) || []);
519
+ const fileStorageList = await fileStorageModel_1.default.findAll({
520
+ where: { id: { [sequelize_1.Op.in]: fileStorageIdList } },
521
+ attributes: { exclude: defaultModelAttributes_1.DEFAULT_EXCLUDES_ATTRIBUTES },
522
+ raw: true,
523
+ });
524
+ const fileStorageListById = (0, utils_1.keyByFieldOrFields)(fileStorageList, "id");
525
+ const fileCategoryIdList = subjectIndexList
526
+ .flatMap((subject) => subject.chapterIndex?.flatMap((chapter) => chapter.files?.map((file) => file.categoryId) || []) || [])
527
+ .filter((id) => (0, utils_1.isValidUUID)(id));
528
+ const fileCategoryList = await typeManagementModel_1.default.findAll({
529
+ where: { id: { [sequelize_1.Op.in]: fileCategoryIdList } },
530
+ attributes: { exclude: defaultModelAttributes_1.DEFAULT_EXCLUDES_ATTRIBUTES },
531
+ });
532
+ const fileCategoryListById = (0, utils_1.keyByFieldOrFields)(fileCategoryList, "id");
533
+ return await Promise.all(
534
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
535
+ subjectIndexList.map(async (subject) => {
536
+ subject.batchDetails = batchListById[subject.batch] || {};
537
+ subject.userDetails = userListById[subject.userId] || {};
538
+ subject.createdByUser = userListById[subject.createdBy] || {};
539
+ subject.subjectDetails = subjectListById[subject.subject] || {};
540
+ subject.instituteDetails = instituteListById[subject.instituteId] || {};
541
+ if (subject.sharedInstituteId?.length) {
542
+ subject.sharedInstituteDetails = subject.sharedInstituteId
543
+ .map((id) => instituteListById[id])
544
+ .filter(Boolean);
545
+ }
546
+ if (where.assignedUsers) {
547
+ subject.assignedUsers =
548
+ subject.assignedUsers?.filter((assignedUser) => where.assignedUsers.$elemMatch.userId.$in.includes(assignedUser.userId)) || [];
549
+ const assignedUsersMap = new Map(subject.assignedUsers?.map((assign) => [
550
+ assign.chapterIndexId,
551
+ assign,
552
+ ]) || []);
553
+ subject.chapterIndex = subject.chapterIndex
554
+ ?.filter((chapter) => assignedUsersMap.has(chapter.id))
555
+ .map((chapter) => {
556
+ const assignedUser = assignedUsersMap.get(chapter.id);
557
+ return assignedUser ? { ...chapter, ...assignedUser } : chapter;
558
+ });
559
+ }
560
+ let completedChapterLastLecture = [];
561
+ if (subject.assignedUsers &&
562
+ subject.assignedUsers.length &&
563
+ options?.reqUser?.type === app_1.USER_TYPES.STUDENT) {
564
+ const lectureList = await lectureModel_1.default.findAll({
565
+ where: { subject: { [sequelize_1.Op.in]: [subject.subject] } },
566
+ order: [["checkedInAt", "DESC"]],
567
+ limit: 1,
568
+ });
569
+ const lastLecture = lectureList.pop();
570
+ if (lastLecture) {
571
+ const lectureDay = (0, utils_1.startOfDay)(lastLecture.checkedInAt).getTime();
572
+ completedChapterLastLecture = subject.assignedUsers
573
+ .filter((assignedUser) => {
574
+ const statusUpdateDay = (0, utils_1.startOfDay)(assignedUser.statusUpdatedAt).getTime();
575
+ return (assignedUser?.lectureId === lastLecture.id &&
576
+ assignedUser.status === app_1.USER_CHAPTER_INDEX_STATUS.COMPLETED &&
577
+ lectureDay === statusUpdateDay);
578
+ })
579
+ .map((assignedUser) => assignedUser.chapterIndexId);
580
+ }
581
+ }
582
+ if (subject.chapterIndex?.length) {
583
+ subject.chapterIndex = await Promise.all(
584
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
585
+ subject.chapterIndex.map(async (chapter) => {
586
+ if (chapter.files?.length) {
587
+ if (subject.type === app_1.SUBJECT_INDEX_TYPE.BATCH &&
588
+ options.reqUser &&
589
+ [
590
+ app_1.USER_TYPES.STUDENT,
591
+ app_1.USER_TYPES.PARENTS,
592
+ app_1.USER_TYPES.TEACHER,
593
+ ].includes(options.reqUser.type)) {
594
+ chapter.files = chapter.files.filter((file) => subject.selectedCategoryIds.includes(file.categoryId));
595
+ if (!completedChapterLastLecture.includes(chapter.id))
596
+ chapter.files = [];
597
+ }
598
+ chapter.files = await Promise.all(chapter.files.map(async (file) => {
599
+ file.fileStorageDetails =
600
+ fileStorageListById[file.fileStorageId] || {};
601
+ file.fileCategoryDetails =
602
+ fileCategoryListById[file.categoryId] || {};
603
+ if (file.fileStorageDetails.storageFileName) {
604
+ file.fileStorageDetails.filePath = await (0, s3Uploader_1.getPresignedUrl)(env_1.ENV_VARIABLE.AWS_BUCKET_NAME, file.fileStorageDetails);
605
+ }
606
+ return file;
607
+ }));
608
+ }
609
+ return chapter;
610
+ }));
611
+ subject.nestChapterIndex = (0, utils_1.buildNestedStructure)(subject.chapterIndex, "parentId", "list");
612
+ }
613
+ if (subject.assignedUsers?.length) {
614
+ subject.assignedUsers = subject.assignedUsers.map((assign) => {
615
+ assign.userDetails = userListById[assign.userId] || {};
616
+ return assign;
617
+ });
618
+ }
619
+ return subject;
620
+ }));
621
+ };
622
+ const queryHooks = ["find", "findOne", "findById"];
623
+ queryHooks.forEach((hook) => {
624
+ SubjectIndexSchema.post(hook, async function (docs) {
625
+ const queryFilter = this.getFilter(); // Get the query filter
626
+ const queryOptions = this.getOptions(); // Get the query filter
627
+ if (!queryOptions.skipAddDocDetails) {
628
+ if (Array.isArray(docs)) {
629
+ docs = await addDocsDetailsHook(docs, queryFilter, queryOptions);
630
+ }
631
+ else if (docs) {
632
+ docs = await addDocsDetailsHook([docs], queryFilter, queryOptions);
633
+ docs = docs.pop();
634
+ }
635
+ }
636
+ });
637
+ });
638
+ SubjectIndexSchema.pre("save", async function (next) {
639
+ const subjectIndex = this;
640
+ try {
641
+ await creatOrUpdateHook(subjectIndex);
642
+ next();
643
+ }
644
+ catch (error) {
645
+ throw error;
646
+ }
647
+ });
648
+ SubjectIndexSchema.pre("updateMany", async function (next) {
649
+ const subjectIndex = this.getUpdate();
650
+ try {
651
+ await creatOrUpdateHook(subjectIndex);
652
+ next();
653
+ }
654
+ catch (error) {
655
+ throw error;
656
+ }
657
+ });
658
+ SubjectIndexSchema.index({
659
+ instituteId: 1,
660
+ type: 1,
661
+ subject: 1,
662
+ });
663
+ const SubjectIndexModel = mongoose_1.default.model("subject_indexes", SubjectIndexSchema);
664
+ // (async () => {
665
+ // await SubjectIndexModel.syncIndexes();
666
+ // })(); // Rebuilds indexes in DB based on schema
667
+ exports.default = SubjectIndexModel;
@@ -0,0 +1,4 @@
1
+ import { Model } from 'mongoose';
2
+ import { ISubscriptionPlanModelAttributes } from '../../interfaces/subscriptionPlanInterface';
3
+ declare const SubscriptionPlanModel: Model<ISubscriptionPlanModelAttributes>;
4
+ export default SubscriptionPlanModel;