@hed-hog/lms 0.0.303 → 0.0.305

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 (462) hide show
  1. package/README.md +413 -401
  2. package/dist/certificate/certificate.controller.d.ts +90 -0
  3. package/dist/certificate/certificate.controller.d.ts.map +1 -0
  4. package/dist/certificate/certificate.controller.js +121 -0
  5. package/dist/certificate/certificate.controller.js.map +1 -0
  6. package/dist/certificate/certificate.module.d.ts +3 -0
  7. package/dist/certificate/certificate.module.d.ts.map +1 -0
  8. package/dist/certificate/certificate.module.js +26 -0
  9. package/dist/certificate/certificate.module.js.map +1 -0
  10. package/dist/certificate/certificate.service.d.ts +115 -0
  11. package/dist/certificate/certificate.service.d.ts.map +1 -0
  12. package/dist/certificate/certificate.service.js +343 -0
  13. package/dist/certificate/certificate.service.js.map +1 -0
  14. package/dist/certificate/dto/create-certificate-template.dto.d.ts +8 -0
  15. package/dist/certificate/dto/create-certificate-template.dto.d.ts.map +1 -0
  16. package/dist/certificate/dto/create-certificate-template.dto.js +44 -0
  17. package/dist/certificate/dto/create-certificate-template.dto.js.map +1 -0
  18. package/dist/certificate/dto/update-certificate-template.dto.d.ts +6 -0
  19. package/dist/certificate/dto/update-certificate-template.dto.d.ts.map +1 -0
  20. package/dist/certificate/dto/update-certificate-template.dto.js +9 -0
  21. package/dist/certificate/dto/update-certificate-template.dto.js.map +1 -0
  22. package/dist/class-group/class-group.controller.d.ts +305 -0
  23. package/dist/class-group/class-group.controller.d.ts.map +1 -0
  24. package/dist/class-group/class-group.controller.js +257 -0
  25. package/dist/class-group/class-group.controller.js.map +1 -0
  26. package/dist/class-group/class-group.module.d.ts +3 -0
  27. package/dist/class-group/class-group.module.d.ts.map +1 -0
  28. package/dist/class-group/class-group.module.js +25 -0
  29. package/dist/class-group/class-group.module.js.map +1 -0
  30. package/dist/class-group/class-group.service.d.ts +354 -0
  31. package/dist/class-group/class-group.service.d.ts.map +1 -0
  32. package/dist/class-group/class-group.service.js +1356 -0
  33. package/dist/class-group/class-group.service.js.map +1 -0
  34. package/dist/class-group/dto/create-class-group.dto.d.ts +33 -0
  35. package/dist/class-group/dto/create-class-group.dto.d.ts.map +1 -0
  36. package/dist/class-group/dto/create-class-group.dto.js +165 -0
  37. package/dist/class-group/dto/create-class-group.dto.js.map +1 -0
  38. package/dist/class-group/dto/create-session.dto.d.ts +22 -0
  39. package/dist/class-group/dto/create-session.dto.d.ts.map +1 -0
  40. package/dist/class-group/dto/create-session.dto.js +117 -0
  41. package/dist/class-group/dto/create-session.dto.js.map +1 -0
  42. package/dist/class-group/dto/enrollment.dto.d.ts +22 -0
  43. package/dist/class-group/dto/enrollment.dto.d.ts.map +1 -0
  44. package/dist/class-group/dto/enrollment.dto.js +89 -0
  45. package/dist/class-group/dto/enrollment.dto.js.map +1 -0
  46. package/dist/class-group/dto/update-class-group.dto.d.ts +6 -0
  47. package/dist/class-group/dto/update-class-group.dto.d.ts.map +1 -0
  48. package/dist/class-group/dto/update-class-group.dto.js +9 -0
  49. package/dist/class-group/dto/update-class-group.dto.js.map +1 -0
  50. package/dist/class-group/dto/update-session.dto.d.ts +7 -0
  51. package/dist/class-group/dto/update-session.dto.d.ts.map +1 -0
  52. package/dist/class-group/dto/update-session.dto.js +24 -0
  53. package/dist/class-group/dto/update-session.dto.js.map +1 -0
  54. package/dist/course/course-structure.controller.d.ts +127 -0
  55. package/dist/course/course-structure.controller.d.ts.map +1 -0
  56. package/dist/course/course-structure.controller.js +115 -0
  57. package/dist/course/course-structure.controller.js.map +1 -0
  58. package/dist/course/course-structure.service.d.ts +142 -0
  59. package/dist/course/course-structure.service.d.ts.map +1 -0
  60. package/dist/course/course-structure.service.js +445 -0
  61. package/dist/course/course-structure.service.js.map +1 -0
  62. package/dist/course/course.controller.d.ts +195 -0
  63. package/dist/course/course.controller.d.ts.map +1 -0
  64. package/dist/course/course.controller.js +104 -0
  65. package/dist/course/course.controller.js.map +1 -0
  66. package/dist/course/course.module.d.ts +3 -0
  67. package/dist/course/course.module.d.ts.map +1 -0
  68. package/dist/course/course.module.js +28 -0
  69. package/dist/course/course.module.js.map +1 -0
  70. package/dist/course/course.service.d.ts +215 -0
  71. package/dist/course/course.service.d.ts.map +1 -0
  72. package/dist/course/course.service.js +743 -0
  73. package/dist/course/course.service.js.map +1 -0
  74. package/dist/course/dto/create-course-structure-lesson.dto.d.ts +24 -0
  75. package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -0
  76. package/dist/course/dto/create-course-structure-lesson.dto.js +118 -0
  77. package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -0
  78. package/dist/course/dto/create-course-structure-session.dto.d.ts +7 -0
  79. package/dist/course/dto/create-course-structure-session.dto.d.ts.map +1 -0
  80. package/dist/course/dto/create-course-structure-session.dto.js +40 -0
  81. package/dist/course/dto/create-course-structure-session.dto.js.map +1 -0
  82. package/dist/course/dto/create-course.dto.d.ts +26 -0
  83. package/dist/course/dto/create-course.dto.d.ts.map +1 -0
  84. package/dist/course/dto/create-course.dto.js +138 -0
  85. package/dist/course/dto/create-course.dto.js.map +1 -0
  86. package/dist/course/dto/update-course-structure-lesson.dto.d.ts +6 -0
  87. package/dist/course/dto/update-course-structure-lesson.dto.d.ts.map +1 -0
  88. package/dist/course/dto/update-course-structure-lesson.dto.js +9 -0
  89. package/dist/course/dto/update-course-structure-lesson.dto.js.map +1 -0
  90. package/dist/course/dto/update-course-structure-session.dto.d.ts +6 -0
  91. package/dist/course/dto/update-course-structure-session.dto.d.ts.map +1 -0
  92. package/dist/course/dto/update-course-structure-session.dto.js +9 -0
  93. package/dist/course/dto/update-course-structure-session.dto.js.map +1 -0
  94. package/dist/course/dto/update-course.dto.d.ts +6 -0
  95. package/dist/course/dto/update-course.dto.d.ts.map +1 -0
  96. package/dist/course/dto/update-course.dto.js +9 -0
  97. package/dist/course/dto/update-course.dto.js.map +1 -0
  98. package/dist/dashboard/dashboard.controller.d.ts +101 -0
  99. package/dist/dashboard/dashboard.controller.d.ts.map +1 -0
  100. package/dist/dashboard/dashboard.controller.js +40 -0
  101. package/dist/dashboard/dashboard.controller.js.map +1 -0
  102. package/dist/dashboard/dashboard.module.d.ts +3 -0
  103. package/dist/dashboard/dashboard.module.d.ts.map +1 -0
  104. package/dist/dashboard/dashboard.module.js +25 -0
  105. package/dist/dashboard/dashboard.module.js.map +1 -0
  106. package/dist/dashboard/dashboard.service.d.ts +130 -0
  107. package/dist/dashboard/dashboard.service.d.ts.map +1 -0
  108. package/dist/dashboard/dashboard.service.js +626 -0
  109. package/dist/dashboard/dashboard.service.js.map +1 -0
  110. package/dist/enterprise/dto/add-enterprise-class-group.dto.d.ts +4 -0
  111. package/dist/enterprise/dto/add-enterprise-class-group.dto.d.ts.map +1 -0
  112. package/dist/enterprise/dto/add-enterprise-class-group.dto.js +22 -0
  113. package/dist/enterprise/dto/add-enterprise-class-group.dto.js.map +1 -0
  114. package/dist/enterprise/dto/add-enterprise-course.dto.d.ts +5 -0
  115. package/dist/enterprise/dto/add-enterprise-course.dto.d.ts.map +1 -0
  116. package/dist/enterprise/dto/add-enterprise-course.dto.js +27 -0
  117. package/dist/enterprise/dto/add-enterprise-course.dto.js.map +1 -0
  118. package/dist/enterprise/dto/add-enterprise-lead.dto.d.ts +4 -0
  119. package/dist/enterprise/dto/add-enterprise-lead.dto.d.ts.map +1 -0
  120. package/dist/enterprise/dto/add-enterprise-lead.dto.js +22 -0
  121. package/dist/enterprise/dto/add-enterprise-lead.dto.js.map +1 -0
  122. package/dist/enterprise/dto/add-enterprise-student.dto.d.ts +5 -0
  123. package/dist/enterprise/dto/add-enterprise-student.dto.d.ts.map +1 -0
  124. package/dist/enterprise/dto/add-enterprise-student.dto.js +27 -0
  125. package/dist/enterprise/dto/add-enterprise-student.dto.js.map +1 -0
  126. package/dist/enterprise/dto/add-enterprise-user.dto.d.ts +7 -0
  127. package/dist/enterprise/dto/add-enterprise-user.dto.d.ts.map +1 -0
  128. package/dist/enterprise/dto/add-enterprise-user.dto.js +36 -0
  129. package/dist/enterprise/dto/add-enterprise-user.dto.js.map +1 -0
  130. package/dist/enterprise/dto/create-enterprise.dto.d.ts +10 -0
  131. package/dist/enterprise/dto/create-enterprise.dto.d.ts.map +1 -0
  132. package/dist/enterprise/dto/create-enterprise.dto.js +54 -0
  133. package/dist/enterprise/dto/create-enterprise.dto.js.map +1 -0
  134. package/dist/enterprise/dto/update-enterprise-student.dto.d.ts +4 -0
  135. package/dist/enterprise/dto/update-enterprise-student.dto.d.ts.map +1 -0
  136. package/dist/enterprise/dto/update-enterprise-student.dto.js +22 -0
  137. package/dist/enterprise/dto/update-enterprise-student.dto.js.map +1 -0
  138. package/dist/enterprise/dto/update-enterprise-user.dto.d.ts +5 -0
  139. package/dist/enterprise/dto/update-enterprise-user.dto.d.ts.map +1 -0
  140. package/dist/enterprise/dto/update-enterprise-user.dto.js +27 -0
  141. package/dist/enterprise/dto/update-enterprise-user.dto.js.map +1 -0
  142. package/dist/enterprise/dto/update-enterprise.dto.d.ts +6 -0
  143. package/dist/enterprise/dto/update-enterprise.dto.d.ts.map +1 -0
  144. package/dist/enterprise/dto/update-enterprise.dto.js +9 -0
  145. package/dist/enterprise/dto/update-enterprise.dto.js.map +1 -0
  146. package/dist/enterprise/enterprise.controller.d.ts +269 -0
  147. package/dist/enterprise/enterprise.controller.d.ts.map +1 -0
  148. package/dist/enterprise/enterprise.controller.js +311 -0
  149. package/dist/enterprise/enterprise.controller.js.map +1 -0
  150. package/dist/enterprise/enterprise.module.d.ts +3 -0
  151. package/dist/enterprise/enterprise.module.d.ts.map +1 -0
  152. package/dist/enterprise/enterprise.module.js +25 -0
  153. package/dist/enterprise/enterprise.module.js.map +1 -0
  154. package/dist/enterprise/enterprise.service.d.ts +282 -0
  155. package/dist/enterprise/enterprise.service.d.ts.map +1 -0
  156. package/dist/enterprise/enterprise.service.js +627 -0
  157. package/dist/enterprise/enterprise.service.js.map +1 -0
  158. package/dist/evaluation/evaluation.controller.d.ts +56 -0
  159. package/dist/evaluation/evaluation.controller.d.ts.map +1 -0
  160. package/dist/evaluation/evaluation.controller.js +76 -0
  161. package/dist/evaluation/evaluation.controller.js.map +1 -0
  162. package/dist/evaluation/evaluation.module.d.ts +3 -0
  163. package/dist/evaluation/evaluation.module.d.ts.map +1 -0
  164. package/dist/evaluation/evaluation.module.js +25 -0
  165. package/dist/evaluation/evaluation.module.js.map +1 -0
  166. package/dist/evaluation/evaluation.service.d.ts +67 -0
  167. package/dist/evaluation/evaluation.service.d.ts.map +1 -0
  168. package/dist/evaluation/evaluation.service.js +378 -0
  169. package/dist/evaluation/evaluation.service.js.map +1 -0
  170. package/dist/exam/dto/create-exam-question.dto.d.ts +25 -0
  171. package/dist/exam/dto/create-exam-question.dto.d.ts.map +1 -0
  172. package/dist/exam/dto/create-exam-question.dto.js +117 -0
  173. package/dist/exam/dto/create-exam-question.dto.js.map +1 -0
  174. package/dist/exam/dto/create-exam.dto.d.ts +11 -0
  175. package/dist/exam/dto/create-exam.dto.d.ts.map +1 -0
  176. package/dist/exam/dto/create-exam.dto.js +63 -0
  177. package/dist/exam/dto/create-exam.dto.js.map +1 -0
  178. package/dist/exam/dto/reorder-exam-questions.dto.d.ts +4 -0
  179. package/dist/exam/dto/reorder-exam-questions.dto.d.ts.map +1 -0
  180. package/dist/exam/dto/reorder-exam-questions.dto.js +23 -0
  181. package/dist/exam/dto/reorder-exam-questions.dto.js.map +1 -0
  182. package/dist/exam/dto/save-exam-attempt-answers.dto.d.ts +14 -0
  183. package/dist/exam/dto/save-exam-attempt-answers.dto.d.ts.map +1 -0
  184. package/dist/exam/dto/save-exam-attempt-answers.dto.js +68 -0
  185. package/dist/exam/dto/save-exam-attempt-answers.dto.js.map +1 -0
  186. package/dist/exam/dto/start-exam-attempt.dto.d.ts +4 -0
  187. package/dist/exam/dto/start-exam-attempt.dto.d.ts.map +1 -0
  188. package/dist/exam/dto/start-exam-attempt.dto.js +23 -0
  189. package/dist/exam/dto/start-exam-attempt.dto.js.map +1 -0
  190. package/dist/exam/dto/submit-exam-attempt.dto.d.ts +5 -0
  191. package/dist/exam/dto/submit-exam-attempt.dto.d.ts.map +1 -0
  192. package/dist/exam/dto/submit-exam-attempt.dto.js +23 -0
  193. package/dist/exam/dto/submit-exam-attempt.dto.js.map +1 -0
  194. package/dist/exam/dto/update-exam-question.dto.d.ts +6 -0
  195. package/dist/exam/dto/update-exam-question.dto.d.ts.map +1 -0
  196. package/dist/exam/dto/update-exam-question.dto.js +9 -0
  197. package/dist/exam/dto/update-exam-question.dto.js.map +1 -0
  198. package/dist/exam/dto/update-exam.dto.d.ts +6 -0
  199. package/dist/exam/dto/update-exam.dto.d.ts.map +1 -0
  200. package/dist/exam/dto/update-exam.dto.js +9 -0
  201. package/dist/exam/dto/update-exam.dto.js.map +1 -0
  202. package/dist/exam/exam-attempt.controller.d.ts +273 -0
  203. package/dist/exam/exam-attempt.controller.d.ts.map +1 -0
  204. package/dist/exam/exam-attempt.controller.js +84 -0
  205. package/dist/exam/exam-attempt.controller.js.map +1 -0
  206. package/dist/exam/exam-attempt.service.d.ts +302 -0
  207. package/dist/exam/exam-attempt.service.d.ts.map +1 -0
  208. package/dist/exam/exam-attempt.service.js +776 -0
  209. package/dist/exam/exam-attempt.service.js.map +1 -0
  210. package/dist/exam/exam.controller.d.ts +162 -0
  211. package/dist/exam/exam.controller.d.ts.map +1 -0
  212. package/dist/exam/exam.controller.js +158 -0
  213. package/dist/exam/exam.controller.js.map +1 -0
  214. package/dist/exam/exam.module.d.ts +3 -0
  215. package/dist/exam/exam.module.d.ts.map +1 -0
  216. package/dist/exam/exam.module.js +27 -0
  217. package/dist/exam/exam.module.js.map +1 -0
  218. package/dist/exam/exam.service.d.ts +179 -0
  219. package/dist/exam/exam.service.d.ts.map +1 -0
  220. package/dist/exam/exam.service.js +597 -0
  221. package/dist/exam/exam.service.js.map +1 -0
  222. package/dist/index.d.ts +28 -0
  223. package/dist/index.d.ts.map +1 -1
  224. package/dist/index.js +28 -0
  225. package/dist/index.js.map +1 -1
  226. package/dist/instructor/dto/create-instructor.dto.d.ts +10 -0
  227. package/dist/instructor/dto/create-instructor.dto.d.ts.map +1 -0
  228. package/dist/instructor/dto/create-instructor.dto.js +55 -0
  229. package/dist/instructor/dto/create-instructor.dto.js.map +1 -0
  230. package/dist/instructor/dto/update-instructor.dto.d.ts +9 -0
  231. package/dist/instructor/dto/update-instructor.dto.d.ts.map +1 -0
  232. package/dist/instructor/dto/update-instructor.dto.js +51 -0
  233. package/dist/instructor/dto/update-instructor.dto.js.map +1 -0
  234. package/dist/instructor/instructor.controller.d.ts +52 -0
  235. package/dist/instructor/instructor.controller.d.ts.map +1 -0
  236. package/dist/instructor/instructor.controller.js +98 -0
  237. package/dist/instructor/instructor.controller.js.map +1 -0
  238. package/dist/instructor/instructor.module.d.ts +3 -0
  239. package/dist/instructor/instructor.module.d.ts.map +1 -0
  240. package/dist/instructor/instructor.module.js +25 -0
  241. package/dist/instructor/instructor.module.js.map +1 -0
  242. package/dist/instructor/instructor.service.d.ts +79 -0
  243. package/dist/instructor/instructor.service.d.ts.map +1 -0
  244. package/dist/instructor/instructor.service.js +528 -0
  245. package/dist/instructor/instructor.service.js.map +1 -0
  246. package/dist/lms.module.d.ts.map +1 -1
  247. package/dist/lms.module.js +36 -4
  248. package/dist/lms.module.js.map +1 -1
  249. package/dist/reports/reports.controller.d.ts +69 -0
  250. package/dist/reports/reports.controller.d.ts.map +1 -0
  251. package/dist/reports/reports.controller.js +40 -0
  252. package/dist/reports/reports.controller.js.map +1 -0
  253. package/dist/reports/reports.module.d.ts +3 -0
  254. package/dist/reports/reports.module.d.ts.map +1 -0
  255. package/dist/reports/reports.module.js +25 -0
  256. package/dist/reports/reports.module.js.map +1 -0
  257. package/dist/reports/reports.service.d.ts +80 -0
  258. package/dist/reports/reports.service.d.ts.map +1 -0
  259. package/dist/reports/reports.service.js +366 -0
  260. package/dist/reports/reports.service.js.map +1 -0
  261. package/dist/training/dto/create-training.dto.d.ts +19 -0
  262. package/dist/training/dto/create-training.dto.d.ts.map +1 -0
  263. package/dist/training/dto/create-training.dto.js +98 -0
  264. package/dist/training/dto/create-training.dto.js.map +1 -0
  265. package/dist/training/dto/update-training.dto.d.ts +6 -0
  266. package/dist/training/dto/update-training.dto.d.ts.map +1 -0
  267. package/dist/training/dto/update-training.dto.js +9 -0
  268. package/dist/training/dto/update-training.dto.js.map +1 -0
  269. package/dist/training/training.controller.d.ts +195 -0
  270. package/dist/training/training.controller.d.ts.map +1 -0
  271. package/dist/training/training.controller.js +104 -0
  272. package/dist/training/training.controller.js.map +1 -0
  273. package/dist/training/training.module.d.ts +3 -0
  274. package/dist/training/training.module.d.ts.map +1 -0
  275. package/dist/training/training.module.js +25 -0
  276. package/dist/training/training.module.js.map +1 -0
  277. package/dist/training/training.service.d.ts +213 -0
  278. package/dist/training/training.service.d.ts.map +1 -0
  279. package/dist/training/training.service.js +497 -0
  280. package/dist/training/training.service.js.map +1 -0
  281. package/hedhog/data/dashboard.yaml +6 -0
  282. package/hedhog/data/dashboard_component.yaml +153 -0
  283. package/hedhog/data/dashboard_component_role.yaml +97 -0
  284. package/hedhog/data/dashboard_item.yaml +167 -0
  285. package/hedhog/data/dashboard_role.yaml +6 -0
  286. package/hedhog/data/instructor_qualification.yaml +16 -0
  287. package/hedhog/data/menu.yaml +129 -19
  288. package/hedhog/data/role.yaml +25 -1
  289. package/hedhog/data/route.yaml +867 -0
  290. package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +1992 -0
  291. package/hedhog/frontend/app/_components/course-form-sheet.tsx.ejs +480 -0
  292. package/hedhog/frontend/app/_components/create-lms-instructor-sheet.tsx.ejs +591 -0
  293. package/hedhog/frontend/app/_components/create-lms-person-sheet.tsx.ejs +164 -0
  294. package/hedhog/frontend/app/_components/create-lms-student-person-sheet.tsx.ejs +120 -0
  295. package/hedhog/frontend/app/_components/lms-class-calendar.tsx.ejs +272 -0
  296. package/hedhog/frontend/app/_components/mobile-calendar.tsx.ejs +277 -0
  297. package/hedhog/frontend/app/_lib/editor/canvasInstance.ts.ejs +48 -0
  298. package/hedhog/frontend/app/_lib/editor/pctHelpers.ts.ejs +50 -0
  299. package/hedhog/frontend/app/_lib/editor/templateSerializer.ts.ejs +268 -0
  300. package/hedhog/frontend/app/_lib/editor/types.ts.ejs +94 -0
  301. package/hedhog/frontend/app/_lib/store/useTemplateStore.ts.ejs +284 -0
  302. package/hedhog/frontend/app/certificates/issued/page.tsx.ejs +638 -0
  303. package/hedhog/frontend/app/certificates/models/CanvasStage.tsx.ejs +916 -0
  304. package/hedhog/frontend/app/certificates/models/LeftPanel.tsx.ejs +200 -0
  305. package/hedhog/frontend/app/certificates/models/RightPanel.tsx.ejs +769 -0
  306. package/hedhog/frontend/app/certificates/models/TemplateEditorPage.tsx.ejs +104 -0
  307. package/hedhog/frontend/app/certificates/models/TopBar.tsx.ejs +354 -0
  308. package/hedhog/frontend/app/certificates/models/editor/page.tsx.ejs +5 -0
  309. package/hedhog/frontend/app/certificates/models/page.tsx.ejs +883 -0
  310. package/hedhog/frontend/app/classes/[id]/_components/event-summary-popover.tsx.ejs +279 -0
  311. package/hedhog/frontend/app/classes/[id]/_components/quick-create-session-popover.tsx.ejs +1027 -0
  312. package/hedhog/frontend/app/classes/[id]/page.tsx.ejs +3130 -993
  313. package/hedhog/frontend/app/classes/page.tsx.ejs +2731 -759
  314. package/hedhog/frontend/app/courses/[id]/_components/CourseCertificateCard.tsx.ejs +80 -0
  315. package/hedhog/frontend/app/courses/[id]/_components/CourseClassificationCard.tsx.ejs +226 -0
  316. package/hedhog/frontend/app/courses/[id]/_components/CourseContentCard.tsx.ejs +71 -0
  317. package/hedhog/frontend/app/courses/[id]/_components/CourseDangerZoneCard.tsx.ejs +42 -0
  318. package/hedhog/frontend/app/courses/[id]/_components/CourseFlagsCard.tsx.ejs +111 -0
  319. package/hedhog/frontend/app/courses/[id]/_components/CourseMainInfoCard.tsx.ejs +113 -0
  320. package/hedhog/frontend/app/courses/[id]/_components/CourseMediaCard.tsx.ejs +215 -0
  321. package/hedhog/frontend/app/courses/[id]/_components/CourseMultiEntityPicker.tsx.ejs +236 -0
  322. package/hedhog/frontend/app/courses/[id]/_components/CourseRelationsCard.tsx.ejs +141 -0
  323. package/hedhog/frontend/app/courses/[id]/_components/CourseSectionCard.tsx.ejs +57 -0
  324. package/hedhog/frontend/app/courses/[id]/_components/CourseSummaryCard.tsx.ejs +60 -0
  325. package/hedhog/frontend/app/courses/[id]/_components/course-edit-types.ts.ejs +33 -0
  326. package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +933 -1103
  327. package/hedhog/frontend/app/courses/[id]/structure/page.tsx.ejs +699 -117
  328. package/hedhog/frontend/app/courses/page.tsx.ejs +1018 -1042
  329. package/hedhog/frontend/app/enterprise/[id]/page.tsx.ejs +317 -0
  330. package/hedhog/frontend/app/enterprise/_components/enterprise-activity-panel.tsx.ejs +88 -0
  331. package/hedhog/frontend/app/enterprise/_components/enterprise-admin-create-sheet.tsx.ejs +318 -0
  332. package/hedhog/frontend/app/enterprise/_components/enterprise-administrators-tab.tsx.ejs +332 -0
  333. package/hedhog/frontend/app/enterprise/_components/enterprise-class-create-sheet.tsx.ejs +57 -0
  334. package/hedhog/frontend/app/enterprise/_components/enterprise-classes-tab.tsx.ejs +390 -0
  335. package/hedhog/frontend/app/enterprise/_components/enterprise-company-identity-card.tsx.ejs +112 -0
  336. package/hedhog/frontend/app/enterprise/_components/enterprise-course-create-sheet.tsx.ejs +183 -0
  337. package/hedhog/frontend/app/enterprise/_components/enterprise-courses-tab.tsx.ejs +363 -0
  338. package/hedhog/frontend/app/enterprise/_components/enterprise-detail-constants.ts.ejs +88 -0
  339. package/hedhog/frontend/app/enterprise/_components/enterprise-detail-sheet.tsx.ejs +548 -0
  340. package/hedhog/frontend/app/enterprise/_components/enterprise-detail-utils.ts.ejs +33 -0
  341. package/hedhog/frontend/app/enterprise/_components/enterprise-mocks.ts.ejs +266 -0
  342. package/hedhog/frontend/app/enterprise/_components/enterprise-person-picker.ts.ejs +31 -0
  343. package/hedhog/frontend/app/enterprise/_components/enterprise-progress-bar.tsx.ejs +21 -0
  344. package/hedhog/frontend/app/enterprise/_components/enterprise-related-tab.tsx.ejs +187 -0
  345. package/hedhog/frontend/app/enterprise/_components/enterprise-sheet.tsx.ejs +397 -0
  346. package/hedhog/frontend/app/enterprise/_components/enterprise-student-create-sheet.tsx.ejs +167 -0
  347. package/hedhog/frontend/app/enterprise/_components/enterprise-students-tab.tsx.ejs +267 -0
  348. package/hedhog/frontend/app/enterprise/_components/enterprise-system-user-picker.ts.ejs +42 -0
  349. package/hedhog/frontend/app/enterprise/_components/enterprise-types.ts.ejs +96 -0
  350. package/hedhog/frontend/app/enterprise/_components/enterprise-user-create-sheet.tsx.ejs +207 -0
  351. package/hedhog/frontend/app/enterprise/_components/enterprise-user-distribution-chart.tsx.ejs +149 -0
  352. package/hedhog/frontend/app/enterprise/page.tsx.ejs +596 -0
  353. package/hedhog/frontend/app/evaluations/page.tsx.ejs +1250 -0
  354. package/hedhog/frontend/app/exams/[id]/attempt/page.tsx.ejs +642 -196
  355. package/hedhog/frontend/app/exams/[id]/page.tsx.ejs +11 -0
  356. package/hedhog/frontend/app/exams/[id]/questions/page.tsx.ejs +1316 -436
  357. package/hedhog/frontend/app/exams/page.tsx.ejs +799 -546
  358. package/hedhog/frontend/app/layout.tsx.ejs +5 -0
  359. package/hedhog/frontend/app/page.tsx.ejs +5 -1222
  360. package/hedhog/frontend/app/reports/courses/page.tsx.ejs +843 -0
  361. package/hedhog/frontend/app/reports/dashboard/page.tsx.ejs +890 -0
  362. package/hedhog/frontend/app/reports/page.tsx.ejs +802 -808
  363. package/hedhog/frontend/app/reports/students/page.tsx.ejs +772 -0
  364. package/hedhog/frontend/app/training/page.tsx.ejs +1873 -628
  365. package/hedhog/frontend/messages/en.json +1606 -111
  366. package/hedhog/frontend/messages/pt.json +1636 -134
  367. package/hedhog/frontend/widgets/active-classes-kpi.tsx.ejs +74 -0
  368. package/hedhog/frontend/widgets/active-courses-kpi.tsx.ejs +74 -0
  369. package/hedhog/frontend/widgets/approval-rate-kpi.tsx.ejs +81 -0
  370. package/hedhog/frontend/widgets/category-distribution-chart.tsx.ejs +119 -0
  371. package/hedhog/frontend/widgets/class-calendar.tsx.ejs +440 -0
  372. package/hedhog/frontend/widgets/completion-rate-kpi.tsx.ejs +81 -0
  373. package/hedhog/frontend/widgets/engagement-chart.tsx.ejs +120 -0
  374. package/hedhog/frontend/widgets/footer-summary.tsx.ejs +80 -0
  375. package/hedhog/frontend/widgets/issued-certificates-kpi.tsx.ejs +74 -0
  376. package/hedhog/frontend/widgets/latest-enrollments.tsx.ejs +166 -0
  377. package/hedhog/frontend/widgets/student-growth-chart.tsx.ejs +89 -0
  378. package/hedhog/frontend/widgets/top-courses-chart.tsx.ejs +104 -0
  379. package/hedhog/frontend/widgets/total-students-kpi.tsx.ejs +78 -0
  380. package/hedhog/frontend/widgets/upcoming-classes.tsx.ejs +152 -0
  381. package/hedhog/table/course.yaml +28 -10
  382. package/hedhog/table/course_class_group.yaml +8 -0
  383. package/hedhog/table/course_class_session.yaml +33 -0
  384. package/hedhog/table/course_instructor.yaml +27 -0
  385. package/hedhog/table/enterprise.yaml +29 -0
  386. package/hedhog/table/enterprise_class_group.yaml +20 -0
  387. package/hedhog/table/enterprise_course.yaml +23 -0
  388. package/hedhog/table/enterprise_student.yaml +24 -0
  389. package/hedhog/table/enterprise_user.yaml +35 -0
  390. package/hedhog/table/instructor_qualification.yaml +26 -0
  391. package/hedhog/table/instructor_qualification_assignment.yaml +22 -0
  392. package/hedhog/table/question.yaml +6 -0
  393. package/package.json +6 -6
  394. package/src/certificate/certificate.controller.ts +83 -0
  395. package/src/certificate/certificate.module.ts +13 -0
  396. package/src/certificate/certificate.service.ts +413 -0
  397. package/src/certificate/dto/create-certificate-template.dto.ts +25 -0
  398. package/src/certificate/dto/update-certificate-template.dto.ts +6 -0
  399. package/src/class-group/class-group.controller.ts +189 -0
  400. package/src/class-group/class-group.module.ts +12 -0
  401. package/src/class-group/class-group.service.ts +1802 -0
  402. package/src/class-group/dto/create-class-group.dto.ts +139 -0
  403. package/src/class-group/dto/create-session.dto.ts +102 -0
  404. package/src/class-group/dto/enrollment.dto.ts +70 -0
  405. package/src/class-group/dto/update-class-group.dto.ts +4 -0
  406. package/src/class-group/dto/update-session.dto.ts +9 -0
  407. package/src/course/course-structure.controller.ts +85 -0
  408. package/src/course/course-structure.service.ts +525 -0
  409. package/src/course/course.controller.ts +69 -0
  410. package/src/course/course.module.ts +15 -0
  411. package/src/course/course.service.ts +920 -0
  412. package/src/course/dto/create-course-structure-lesson.dto.ts +97 -0
  413. package/src/course/dto/create-course-structure-session.dto.ts +22 -0
  414. package/src/course/dto/create-course.dto.ts +111 -0
  415. package/src/course/dto/update-course-structure-lesson.dto.ts +6 -0
  416. package/src/course/dto/update-course-structure-session.dto.ts +6 -0
  417. package/src/course/dto/update-course.dto.ts +4 -0
  418. package/src/dashboard/dashboard.controller.ts +14 -0
  419. package/src/dashboard/dashboard.module.ts +12 -0
  420. package/src/dashboard/dashboard.service.ts +726 -0
  421. package/src/enterprise/dto/add-enterprise-class-group.dto.ts +7 -0
  422. package/src/enterprise/dto/add-enterprise-course.dto.ts +11 -0
  423. package/src/enterprise/dto/add-enterprise-student.dto.ts +16 -0
  424. package/src/enterprise/dto/add-enterprise-user.dto.ts +23 -0
  425. package/src/enterprise/dto/create-enterprise.dto.ts +41 -0
  426. package/src/enterprise/dto/update-enterprise-student.dto.ts +7 -0
  427. package/src/enterprise/dto/update-enterprise-user.dto.ts +11 -0
  428. package/src/enterprise/dto/update-enterprise.dto.ts +4 -0
  429. package/src/enterprise/enterprise.controller.ts +233 -0
  430. package/src/enterprise/enterprise.module.ts +12 -0
  431. package/src/enterprise/enterprise.service.ts +712 -0
  432. package/src/evaluation/evaluation.controller.ts +44 -0
  433. package/src/evaluation/evaluation.module.ts +12 -0
  434. package/src/evaluation/evaluation.service.ts +394 -0
  435. package/src/exam/dto/create-exam-question.dto.ts +103 -0
  436. package/src/exam/dto/create-exam.dto.ts +41 -0
  437. package/src/exam/dto/reorder-exam-questions.dto.ts +8 -0
  438. package/src/exam/dto/save-exam-attempt-answers.dto.ts +55 -0
  439. package/src/exam/dto/start-exam-attempt.dto.ts +8 -0
  440. package/src/exam/dto/submit-exam-attempt.dto.ts +8 -0
  441. package/src/exam/dto/update-exam-question.dto.ts +4 -0
  442. package/src/exam/dto/update-exam.dto.ts +4 -0
  443. package/src/exam/exam-attempt.controller.ts +65 -0
  444. package/src/exam/exam-attempt.service.ts +1008 -0
  445. package/src/exam/exam.controller.ts +102 -0
  446. package/src/exam/exam.module.ts +14 -0
  447. package/src/exam/exam.service.ts +784 -0
  448. package/src/index.ts +29 -0
  449. package/src/instructor/dto/create-instructor.dto.ts +43 -0
  450. package/src/instructor/dto/update-instructor.dto.ts +38 -0
  451. package/src/instructor/instructor.controller.ts +73 -0
  452. package/src/instructor/instructor.module.ts +12 -0
  453. package/src/instructor/instructor.service.ts +646 -0
  454. package/src/lms.module.ts +36 -4
  455. package/src/reports/reports.controller.ts +14 -0
  456. package/src/reports/reports.module.ts +12 -0
  457. package/src/reports/reports.service.ts +485 -0
  458. package/src/training/dto/create-training.dto.ts +81 -0
  459. package/src/training/dto/update-training.dto.ts +4 -0
  460. package/src/training/training.controller.ts +68 -0
  461. package/src/training/training.module.ts +12 -0
  462. package/src/training/training.service.ts +574 -0
@@ -0,0 +1,627 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.EnterpriseService = void 0;
13
+ const api_prisma_1 = require("@hed-hog/api-prisma");
14
+ const common_1 = require("@nestjs/common");
15
+ /** Maps enterprise_user.role to the global role slug that should be granted. */
16
+ const ENTERPRISE_ROLE_TO_GLOBAL_SLUG = {
17
+ enterprise_admin: 'lms-enterprise-admin',
18
+ hr_manager: 'lms-enterprise-admin',
19
+ };
20
+ function paginate(params) {
21
+ const page = Math.max(Number(params.page) || 1, 1);
22
+ const pageSize = Math.max(Number(params.pageSize) || 20, 1);
23
+ const skip = (page - 1) * pageSize;
24
+ return { page, pageSize, skip };
25
+ }
26
+ let EnterpriseService = class EnterpriseService {
27
+ constructor(prisma) {
28
+ this.prisma = prisma;
29
+ }
30
+ async list(params) {
31
+ var _a;
32
+ const { page, pageSize, skip } = paginate(params);
33
+ const where = {};
34
+ if ((_a = params.search) === null || _a === void 0 ? void 0 : _a.trim()) {
35
+ const s = params.search.trim();
36
+ where.OR = [
37
+ { name: { contains: s, mode: 'insensitive' } },
38
+ { slug: { contains: s, mode: 'insensitive' } },
39
+ ];
40
+ }
41
+ if (params.status && params.status !== 'all') {
42
+ where.status = params.status;
43
+ }
44
+ if (params.crmPersonId) {
45
+ where.crm_person_id = params.crmPersonId;
46
+ }
47
+ const [data, total] = await Promise.all([
48
+ this.prisma.enterprise.findMany({
49
+ where,
50
+ skip,
51
+ take: pageSize,
52
+ orderBy: { name: 'asc' },
53
+ include: {
54
+ person: { select: { id: true, name: true } },
55
+ _count: {
56
+ select: {
57
+ enterprise_user: true,
58
+ enterprise_course: true,
59
+ enterprise_class_group: true,
60
+ },
61
+ },
62
+ },
63
+ }),
64
+ this.prisma.enterprise.count({ where }),
65
+ ]);
66
+ return {
67
+ total,
68
+ page,
69
+ pageSize,
70
+ lastPage: Math.max(1, Math.ceil(total / pageSize)),
71
+ data: data.map((e) => this.mapEnterprise(e)),
72
+ };
73
+ }
74
+ async getById(id) {
75
+ var _a;
76
+ const e = await this.prisma.enterprise.findUnique({
77
+ where: { id },
78
+ include: {
79
+ person: {
80
+ select: {
81
+ id: true,
82
+ name: true,
83
+ type: true,
84
+ },
85
+ },
86
+ _count: {
87
+ select: {
88
+ enterprise_user: true,
89
+ enterprise_course: true,
90
+ enterprise_class_group: true,
91
+ },
92
+ },
93
+ },
94
+ });
95
+ if (!e)
96
+ return null;
97
+ // Compute role breakdowns and fetch person_company separately
98
+ // (person_company shares the same PK as person — no Prisma reverse relation)
99
+ const [studentsCount, managersCount, adminsCount, personCompany] = await Promise.all([
100
+ this.prisma.enterprise_student.count({
101
+ where: { enterprise_id: id },
102
+ }),
103
+ this.prisma.enterprise_user.count({
104
+ where: { enterprise_id: id, role: 'hr_manager' },
105
+ }),
106
+ this.prisma.enterprise_user.count({
107
+ where: { enterprise_id: id, role: 'enterprise_admin' },
108
+ }),
109
+ ((_a = e.person) === null || _a === void 0 ? void 0 : _a.id)
110
+ ? this.prisma.person_company.findUnique({
111
+ where: { id: e.person.id },
112
+ select: {
113
+ trade_name: true,
114
+ industry: true,
115
+ website: true,
116
+ account_lifecycle_stage: true,
117
+ },
118
+ })
119
+ : Promise.resolve(null),
120
+ ]);
121
+ return this.mapEnterprise(e, { studentsCount, managersCount, adminsCount, personCompany });
122
+ }
123
+ async create(dto) {
124
+ try {
125
+ return await this.prisma.enterprise.create({ data: dto });
126
+ }
127
+ catch (err) {
128
+ if ((err === null || err === void 0 ? void 0 : err.code) === 'P2002') {
129
+ throw new common_1.ConflictException(`An enterprise with slug "${dto.slug}" already exists.`);
130
+ }
131
+ throw err;
132
+ }
133
+ }
134
+ async update(id, dto) {
135
+ await this.assertEnterpriseExists(id);
136
+ return this.prisma.enterprise.update({ where: { id }, data: dto });
137
+ }
138
+ async delete(id) {
139
+ await this.assertEnterpriseExists(id);
140
+ return this.prisma.enterprise.delete({ where: { id } });
141
+ }
142
+ // ─── Helpers ─────────────────────────────────────────────────────────────────
143
+ async assertEnterpriseExists(id) {
144
+ const exists = await this.prisma.enterprise.findUnique({
145
+ where: { id },
146
+ select: { id: true },
147
+ });
148
+ if (!exists)
149
+ throw new common_1.NotFoundException(`Enterprise #${id} not found`);
150
+ return exists;
151
+ }
152
+ async resolveRoleId(slug) {
153
+ var _a;
154
+ const role = await this.prisma.role.findUnique({
155
+ where: { slug },
156
+ select: { id: true },
157
+ });
158
+ return (_a = role === null || role === void 0 ? void 0 : role.id) !== null && _a !== void 0 ? _a : null;
159
+ }
160
+ async upsertRoleUser(userId, roleSlug) {
161
+ const roleId = await this.resolveRoleId(roleSlug);
162
+ if (!roleId)
163
+ return; // role not seeded yet — skip silently
164
+ const existing = await this.prisma.role_user.findFirst({
165
+ where: { user_id: userId, role_id: roleId },
166
+ select: { id: true },
167
+ });
168
+ if (!existing) {
169
+ await this.prisma.role_user.create({
170
+ data: { user_id: userId, role_id: roleId },
171
+ });
172
+ }
173
+ }
174
+ // ─── Users ───────────────────────────────────────────────────────────────────
175
+ async listUsers(enterpriseId, params) {
176
+ var _a;
177
+ await this.assertEnterpriseExists(enterpriseId);
178
+ const { page, pageSize, skip } = paginate(params);
179
+ const where = { enterprise_id: enterpriseId };
180
+ if ((_a = params.search) === null || _a === void 0 ? void 0 : _a.trim()) {
181
+ const s = params.search.trim();
182
+ where.user = {
183
+ OR: [
184
+ { name: { contains: s, mode: 'insensitive' } },
185
+ {
186
+ user_identifier: {
187
+ some: { type: 'email', value: { contains: s, mode: 'insensitive' } },
188
+ },
189
+ },
190
+ ],
191
+ };
192
+ }
193
+ if (params.status)
194
+ where.status = params.status;
195
+ if (params.role)
196
+ where.role = params.role;
197
+ const [rows, total] = await Promise.all([
198
+ this.prisma.enterprise_user.findMany({
199
+ where,
200
+ skip,
201
+ take: pageSize,
202
+ orderBy: { created_at: 'desc' },
203
+ include: {
204
+ user: {
205
+ select: {
206
+ id: true,
207
+ name: true,
208
+ last_login_at: true,
209
+ user_identifier: {
210
+ where: { type: 'email' },
211
+ select: { value: true },
212
+ take: 1,
213
+ },
214
+ },
215
+ },
216
+ },
217
+ }),
218
+ this.prisma.enterprise_user.count({ where }),
219
+ ]);
220
+ return {
221
+ total,
222
+ page,
223
+ pageSize,
224
+ lastPage: Math.max(1, Math.ceil(total / pageSize)),
225
+ data: rows.map((r) => {
226
+ var _a, _b, _c, _d, _e, _f, _g, _h;
227
+ return ({
228
+ id: r.id,
229
+ userId: r.user_id,
230
+ personId: r.person_id,
231
+ name: (_b = (_a = r.user) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null,
232
+ email: (_f = (_e = (_d = (_c = r.user) === null || _c === void 0 ? void 0 : _c.user_identifier) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : null,
233
+ role: r.role,
234
+ status: r.status,
235
+ lastAccessAt: (_h = (_g = r.user) === null || _g === void 0 ? void 0 : _g.last_login_at) !== null && _h !== void 0 ? _h : null,
236
+ });
237
+ }),
238
+ };
239
+ }
240
+ async addUser(enterpriseId, dto) {
241
+ await this.assertEnterpriseExists(enterpriseId);
242
+ const user = await this.prisma.user.findUnique({
243
+ where: { id: dto.user_id },
244
+ select: { id: true },
245
+ });
246
+ if (!user)
247
+ throw new common_1.NotFoundException(`User #${dto.user_id} not found`);
248
+ const duplicate = await this.prisma.enterprise_user.findFirst({
249
+ where: { enterprise_id: enterpriseId, user_id: dto.user_id },
250
+ select: { id: true },
251
+ });
252
+ if (duplicate)
253
+ throw new common_1.ConflictException(`User #${dto.user_id} is already linked to this enterprise`);
254
+ const record = await this.prisma.enterprise_user.create({
255
+ data: Object.assign({ enterprise_id: enterpriseId }, dto),
256
+ });
257
+ // Apply the corresponding global LMS role
258
+ const globalSlug = ENTERPRISE_ROLE_TO_GLOBAL_SLUG[dto.role];
259
+ if (globalSlug)
260
+ await this.upsertRoleUser(dto.user_id, globalSlug);
261
+ return record;
262
+ }
263
+ async updateUser(enterpriseId, userId, dto) {
264
+ await this.assertEnterpriseExists(enterpriseId);
265
+ const existing = await this.prisma.enterprise_user.findFirst({
266
+ where: { enterprise_id: enterpriseId, user_id: userId },
267
+ select: { id: true, role: true },
268
+ });
269
+ if (!existing)
270
+ throw new common_1.NotFoundException(`User #${userId} is not linked to enterprise #${enterpriseId}`);
271
+ const updated = await this.prisma.enterprise_user.update({
272
+ where: { id: existing.id },
273
+ data: dto,
274
+ });
275
+ // If role changed, upsert the new global role
276
+ if (dto.role && dto.role !== existing.role) {
277
+ const globalSlug = ENTERPRISE_ROLE_TO_GLOBAL_SLUG[dto.role];
278
+ if (globalSlug)
279
+ await this.upsertRoleUser(userId, globalSlug);
280
+ }
281
+ return updated;
282
+ }
283
+ async removeUser(enterpriseId, userId) {
284
+ await this.assertEnterpriseExists(enterpriseId);
285
+ const existing = await this.prisma.enterprise_user.findFirst({
286
+ where: { enterprise_id: enterpriseId, user_id: userId },
287
+ select: { id: true },
288
+ });
289
+ if (!existing)
290
+ throw new common_1.NotFoundException(`User #${userId} is not linked to enterprise #${enterpriseId}`);
291
+ return this.prisma.enterprise_user.delete({
292
+ where: { id: existing.id },
293
+ });
294
+ }
295
+ // ─── Courses ─────────────────────────────────────────────────────────────────
296
+ async listCourses(enterpriseId, params) {
297
+ var _a, _b;
298
+ await this.assertEnterpriseExists(enterpriseId);
299
+ const { page, pageSize, skip } = paginate(params);
300
+ const where = { enterprise_id: enterpriseId };
301
+ if (((_a = params.search) === null || _a === void 0 ? void 0 : _a.trim()) || params.status) {
302
+ where.course = Object.assign(Object.assign({}, (((_b = params.search) === null || _b === void 0 ? void 0 : _b.trim()) ? { title: { contains: params.search.trim(), mode: 'insensitive' } } : {})), (params.status ? { status: params.status } : {}));
303
+ }
304
+ const [rows, total] = await Promise.all([
305
+ this.prisma.enterprise_course.findMany({
306
+ where,
307
+ skip,
308
+ take: pageSize,
309
+ orderBy: { contracted_at: 'desc' },
310
+ include: {
311
+ course: {
312
+ select: {
313
+ id: true,
314
+ title: true,
315
+ slug: true,
316
+ status: true,
317
+ level: true,
318
+ offering_type: true,
319
+ },
320
+ },
321
+ },
322
+ }),
323
+ this.prisma.enterprise_course.count({ where }),
324
+ ]);
325
+ return {
326
+ total,
327
+ page,
328
+ pageSize,
329
+ lastPage: Math.max(1, Math.ceil(total / pageSize)),
330
+ data: rows.map((r) => {
331
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
332
+ return ({
333
+ id: r.id,
334
+ courseId: r.course_id,
335
+ contractedAt: r.contracted_at,
336
+ title: (_b = (_a = r.course) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : null,
337
+ slug: (_d = (_c = r.course) === null || _c === void 0 ? void 0 : _c.slug) !== null && _d !== void 0 ? _d : null,
338
+ status: (_f = (_e = r.course) === null || _e === void 0 ? void 0 : _e.status) !== null && _f !== void 0 ? _f : null,
339
+ level: (_h = (_g = r.course) === null || _g === void 0 ? void 0 : _g.level) !== null && _h !== void 0 ? _h : null,
340
+ modality: (_k = (_j = r.course) === null || _j === void 0 ? void 0 : _j.offering_type) !== null && _k !== void 0 ? _k : null,
341
+ });
342
+ }),
343
+ };
344
+ }
345
+ async addCourse(enterpriseId, dto) {
346
+ await this.assertEnterpriseExists(enterpriseId);
347
+ const course = await this.prisma.course.findUnique({
348
+ where: { id: dto.course_id },
349
+ select: { id: true },
350
+ });
351
+ if (!course)
352
+ throw new common_1.NotFoundException(`Course #${dto.course_id} not found`);
353
+ const duplicate = await this.prisma.enterprise_course.findFirst({
354
+ where: { enterprise_id: enterpriseId, course_id: dto.course_id },
355
+ select: { id: true },
356
+ });
357
+ if (duplicate)
358
+ throw new common_1.ConflictException(`Course #${dto.course_id} is already linked to this enterprise`);
359
+ return this.prisma.enterprise_course.create({
360
+ data: Object.assign({ enterprise_id: enterpriseId }, dto),
361
+ });
362
+ }
363
+ async removeCourse(enterpriseId, courseId) {
364
+ await this.assertEnterpriseExists(enterpriseId);
365
+ const existing = await this.prisma.enterprise_course.findFirst({
366
+ where: { enterprise_id: enterpriseId, course_id: courseId },
367
+ select: { id: true },
368
+ });
369
+ if (!existing)
370
+ throw new common_1.NotFoundException(`Course #${courseId} is not linked to enterprise #${enterpriseId}`);
371
+ return this.prisma.enterprise_course.delete({
372
+ where: { id: existing.id },
373
+ });
374
+ }
375
+ // ─── Class Groups ─────────────────────────────────────────────────────────────
376
+ async listClassGroups(enterpriseId, params) {
377
+ var _a;
378
+ await this.assertEnterpriseExists(enterpriseId);
379
+ const { page, pageSize, skip } = paginate(params);
380
+ const where = { enterprise_id: enterpriseId };
381
+ {
382
+ const s = (_a = params.search) === null || _a === void 0 ? void 0 : _a.trim();
383
+ const hasSearch = Boolean(s);
384
+ const hasStatus = Boolean(params.status);
385
+ if (hasSearch || hasStatus) {
386
+ where.course_class_group = Object.assign(Object.assign({}, (hasSearch
387
+ ? { OR: [{ code: { contains: s, mode: 'insensitive' } }, { title: { contains: s, mode: 'insensitive' } }] }
388
+ : {})), (hasStatus ? { status: params.status } : {}));
389
+ }
390
+ }
391
+ const [rows, total] = await Promise.all([
392
+ this.prisma.enterprise_class_group.findMany({
393
+ where,
394
+ skip,
395
+ take: pageSize,
396
+ orderBy: { created_at: 'desc' },
397
+ include: {
398
+ course_class_group: {
399
+ select: {
400
+ id: true,
401
+ code: true,
402
+ title: true,
403
+ status: true,
404
+ delivery_mode: true,
405
+ start_date: true,
406
+ end_date: true,
407
+ capacity: true,
408
+ course: { select: { id: true, title: true, slug: true } },
409
+ },
410
+ },
411
+ },
412
+ }),
413
+ this.prisma.enterprise_class_group.count({ where }),
414
+ ]);
415
+ return {
416
+ total,
417
+ page,
418
+ pageSize,
419
+ lastPage: Math.max(1, Math.ceil(total / pageSize)),
420
+ data: rows.map((r) => {
421
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
422
+ return ({
423
+ id: r.id,
424
+ courseClassGroupId: r.course_class_group_id,
425
+ code: (_b = (_a = r.course_class_group) === null || _a === void 0 ? void 0 : _a.code) !== null && _b !== void 0 ? _b : null,
426
+ title: (_d = (_c = r.course_class_group) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : null,
427
+ status: (_f = (_e = r.course_class_group) === null || _e === void 0 ? void 0 : _e.status) !== null && _f !== void 0 ? _f : null,
428
+ deliveryMode: (_h = (_g = r.course_class_group) === null || _g === void 0 ? void 0 : _g.delivery_mode) !== null && _h !== void 0 ? _h : null,
429
+ startDate: (_k = (_j = r.course_class_group) === null || _j === void 0 ? void 0 : _j.start_date) !== null && _k !== void 0 ? _k : null,
430
+ endDate: (_m = (_l = r.course_class_group) === null || _l === void 0 ? void 0 : _l.end_date) !== null && _m !== void 0 ? _m : null,
431
+ capacity: (_p = (_o = r.course_class_group) === null || _o === void 0 ? void 0 : _o.capacity) !== null && _p !== void 0 ? _p : null,
432
+ courseTitle: (_s = (_r = (_q = r.course_class_group) === null || _q === void 0 ? void 0 : _q.course) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : null,
433
+ courseSlug: (_v = (_u = (_t = r.course_class_group) === null || _t === void 0 ? void 0 : _t.course) === null || _u === void 0 ? void 0 : _u.slug) !== null && _v !== void 0 ? _v : null,
434
+ });
435
+ }),
436
+ };
437
+ }
438
+ async addClassGroup(enterpriseId, dto) {
439
+ await this.assertEnterpriseExists(enterpriseId);
440
+ const classGroup = await this.prisma.course_class_group.findUnique({
441
+ where: { id: dto.course_class_group_id },
442
+ select: { id: true },
443
+ });
444
+ if (!classGroup)
445
+ throw new common_1.NotFoundException(`Class group #${dto.course_class_group_id} not found`);
446
+ const duplicate = await this.prisma.enterprise_class_group.findFirst({
447
+ where: { enterprise_id: enterpriseId, course_class_group_id: dto.course_class_group_id },
448
+ select: { id: true },
449
+ });
450
+ if (duplicate)
451
+ throw new common_1.ConflictException(`Class group #${dto.course_class_group_id} is already linked to this enterprise`);
452
+ return this.prisma.enterprise_class_group.create({
453
+ data: Object.assign({ enterprise_id: enterpriseId }, dto),
454
+ });
455
+ }
456
+ async removeClassGroup(enterpriseId, classGroupId) {
457
+ await this.assertEnterpriseExists(enterpriseId);
458
+ const existing = await this.prisma.enterprise_class_group.findFirst({
459
+ where: { enterprise_id: enterpriseId, course_class_group_id: classGroupId },
460
+ select: { id: true },
461
+ });
462
+ if (!existing)
463
+ throw new common_1.NotFoundException(`Class group #${classGroupId} is not linked to enterprise #${enterpriseId}`);
464
+ return this.prisma.enterprise_class_group.delete({
465
+ where: { id: existing.id },
466
+ });
467
+ }
468
+ // ─── Students ─────────────────────────────────────────────────────────────────
469
+ async listStudents(enterpriseId, params) {
470
+ var _a;
471
+ await this.assertEnterpriseExists(enterpriseId);
472
+ const { page, pageSize, skip } = paginate(params);
473
+ const where = { enterprise_id: enterpriseId };
474
+ if ((_a = params.search) === null || _a === void 0 ? void 0 : _a.trim()) {
475
+ const s = params.search.trim();
476
+ where.person = {
477
+ name: { contains: s, mode: 'insensitive' },
478
+ };
479
+ }
480
+ if (params.status)
481
+ where.status = params.status;
482
+ const [rows, total] = await Promise.all([
483
+ this.prisma.enterprise_student.findMany({
484
+ where,
485
+ skip,
486
+ take: pageSize,
487
+ orderBy: { created_at: 'desc' },
488
+ include: {
489
+ person: {
490
+ select: {
491
+ id: true,
492
+ name: true,
493
+ contact: {
494
+ where: { contact_type: { code: 'EMAIL' }, is_primary: true },
495
+ select: { value: true },
496
+ take: 1,
497
+ },
498
+ },
499
+ },
500
+ },
501
+ }),
502
+ this.prisma.enterprise_student.count({ where }),
503
+ ]);
504
+ return {
505
+ total,
506
+ page,
507
+ pageSize,
508
+ lastPage: Math.max(1, Math.ceil(total / pageSize)),
509
+ data: rows.map((r) => {
510
+ var _a, _b, _c, _d, _e, _f;
511
+ return ({
512
+ id: r.id,
513
+ personId: r.person_id,
514
+ name: (_b = (_a = r.person) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null,
515
+ email: (_f = (_e = (_d = (_c = r.person) === null || _c === void 0 ? void 0 : _c.contact) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : null,
516
+ status: r.status,
517
+ createdAt: r.created_at,
518
+ });
519
+ }),
520
+ };
521
+ }
522
+ async addStudent(enterpriseId, dto) {
523
+ await this.assertEnterpriseExists(enterpriseId);
524
+ const person = await this.prisma.person.findUnique({
525
+ where: { id: dto.person_id },
526
+ select: { id: true },
527
+ });
528
+ if (!person)
529
+ throw new common_1.NotFoundException(`Person #${dto.person_id} not found`);
530
+ const duplicate = await this.prisma.enterprise_student.findFirst({
531
+ where: { enterprise_id: enterpriseId, person_id: dto.person_id },
532
+ select: { id: true },
533
+ });
534
+ if (duplicate)
535
+ throw new common_1.ConflictException(`Person #${dto.person_id} is already a student of enterprise #${enterpriseId}`);
536
+ return this.prisma.enterprise_student.create({
537
+ data: Object.assign({ enterprise_id: enterpriseId }, dto),
538
+ });
539
+ }
540
+ async updateStudent(enterpriseId, personId, dto) {
541
+ await this.assertEnterpriseExists(enterpriseId);
542
+ const existing = await this.prisma.enterprise_student.findFirst({
543
+ where: { enterprise_id: enterpriseId, person_id: personId },
544
+ select: { id: true },
545
+ });
546
+ if (!existing)
547
+ throw new common_1.NotFoundException(`Person #${personId} is not a student of enterprise #${enterpriseId}`);
548
+ return this.prisma.enterprise_student.update({
549
+ where: { id: existing.id },
550
+ data: dto,
551
+ });
552
+ }
553
+ async removeStudent(enterpriseId, personId) {
554
+ await this.assertEnterpriseExists(enterpriseId);
555
+ const existing = await this.prisma.enterprise_student.findFirst({
556
+ where: { enterprise_id: enterpriseId, person_id: personId },
557
+ select: { id: true },
558
+ });
559
+ if (!existing)
560
+ throw new common_1.NotFoundException(`Person #${personId} is not a student of enterprise #${enterpriseId}`);
561
+ return this.prisma.enterprise_student.delete({
562
+ where: { id: existing.id },
563
+ });
564
+ }
565
+ // ─── Stats / options ──────────────────────────────────────────────────────────
566
+ async getStats() {
567
+ const [total, active, trial, portalEnabled] = await Promise.all([
568
+ this.prisma.enterprise.count(),
569
+ this.prisma.enterprise.count({ where: { status: 'active' } }),
570
+ this.prisma.enterprise.count({ where: { status: 'trial' } }),
571
+ this.prisma.enterprise.count({ where: { portal_enabled: true } }),
572
+ ]);
573
+ return { total, active, trial, portalEnabled };
574
+ }
575
+ async getCrmOptions() {
576
+ const rows = await this.prisma.enterprise.findMany({
577
+ where: { crm_person_id: { not: null } },
578
+ select: { person: { select: { id: true, name: true } } },
579
+ distinct: ['crm_person_id'],
580
+ });
581
+ return rows
582
+ .filter((r) => r.person !== null)
583
+ .map((r) => { var _a; return ({ id: r.person.id, name: (_a = r.person.name) !== null && _a !== void 0 ? _a : '' }); })
584
+ .sort((a, b) => a.name.localeCompare(b.name));
585
+ }
586
+ // ─── Mapper ──────────────────────────────────────────────────────────────────
587
+ mapEnterprise(e, extra) {
588
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
589
+ const { _count, person } = e;
590
+ const pc = (_a = extra === null || extra === void 0 ? void 0 : extra.personCompany) !== null && _a !== void 0 ? _a : null;
591
+ return {
592
+ id: e.id,
593
+ name: e.name,
594
+ slug: e.slug,
595
+ status: e.status,
596
+ portalEnabled: e.portal_enabled,
597
+ licenseLimit: (_b = e.license_limit) !== null && _b !== void 0 ? _b : null,
598
+ notes: (_c = e.notes) !== null && _c !== void 0 ? _c : null,
599
+ createdAt: e.created_at,
600
+ updatedAt: e.updated_at,
601
+ crmAccountId: (_d = person === null || person === void 0 ? void 0 : person.id) !== null && _d !== void 0 ? _d : null,
602
+ crmAccountName: (_e = person === null || person === void 0 ? void 0 : person.name) !== null && _e !== void 0 ? _e : null,
603
+ crmAccount: person
604
+ ? {
605
+ id: person.id,
606
+ name: person.name,
607
+ tradeName: (_f = pc === null || pc === void 0 ? void 0 : pc.trade_name) !== null && _f !== void 0 ? _f : null,
608
+ industry: (_g = pc === null || pc === void 0 ? void 0 : pc.industry) !== null && _g !== void 0 ? _g : null,
609
+ website: (_h = pc === null || pc === void 0 ? void 0 : pc.website) !== null && _h !== void 0 ? _h : null,
610
+ lifecycleStage: (_j = pc === null || pc === void 0 ? void 0 : pc.account_lifecycle_stage) !== null && _j !== void 0 ? _j : null,
611
+ }
612
+ : null,
613
+ usersCount: (_k = _count === null || _count === void 0 ? void 0 : _count.enterprise_user) !== null && _k !== void 0 ? _k : 0,
614
+ studentsCount: (_l = extra === null || extra === void 0 ? void 0 : extra.studentsCount) !== null && _l !== void 0 ? _l : 0,
615
+ managersCount: (_m = extra === null || extra === void 0 ? void 0 : extra.managersCount) !== null && _m !== void 0 ? _m : 0,
616
+ adminsCount: (_o = extra === null || extra === void 0 ? void 0 : extra.adminsCount) !== null && _o !== void 0 ? _o : 0,
617
+ coursesCount: (_p = _count === null || _count === void 0 ? void 0 : _count.enterprise_course) !== null && _p !== void 0 ? _p : 0,
618
+ classesCount: (_q = _count === null || _count === void 0 ? void 0 : _count.enterprise_class_group) !== null && _q !== void 0 ? _q : 0,
619
+ };
620
+ }
621
+ };
622
+ exports.EnterpriseService = EnterpriseService;
623
+ exports.EnterpriseService = EnterpriseService = __decorate([
624
+ (0, common_1.Injectable)(),
625
+ __metadata("design:paramtypes", [api_prisma_1.PrismaService])
626
+ ], EnterpriseService);
627
+ //# sourceMappingURL=enterprise.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enterprise.service.js","sourceRoot":"","sources":["../../src/enterprise/enterprise.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,2CAIwB;AAmBxB,gFAAgF;AAChF,MAAM,8BAA8B,GAAoC;IACtE,gBAAgB,EAAE,sBAAsB;IACxC,UAAU,EAAE,sBAAsB;CACnC,CAAC;AAEF,SAAS,QAAQ,CAAC,MAAwB;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC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