@hed-hog/lms 0.0.304 → 0.0.306
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +413 -401
- package/dist/certificate/certificate.controller.d.ts +90 -0
- package/dist/certificate/certificate.controller.d.ts.map +1 -0
- package/dist/certificate/certificate.controller.js +121 -0
- package/dist/certificate/certificate.controller.js.map +1 -0
- package/dist/certificate/certificate.module.d.ts +3 -0
- package/dist/certificate/certificate.module.d.ts.map +1 -0
- package/dist/certificate/certificate.module.js +26 -0
- package/dist/certificate/certificate.module.js.map +1 -0
- package/dist/certificate/certificate.service.d.ts +115 -0
- package/dist/certificate/certificate.service.d.ts.map +1 -0
- package/dist/certificate/certificate.service.js +343 -0
- package/dist/certificate/certificate.service.js.map +1 -0
- package/dist/certificate/dto/create-certificate-template.dto.d.ts +8 -0
- package/dist/certificate/dto/create-certificate-template.dto.d.ts.map +1 -0
- package/dist/certificate/dto/create-certificate-template.dto.js +44 -0
- package/dist/certificate/dto/create-certificate-template.dto.js.map +1 -0
- package/dist/certificate/dto/update-certificate-template.dto.d.ts +6 -0
- package/dist/certificate/dto/update-certificate-template.dto.d.ts.map +1 -0
- package/dist/certificate/dto/update-certificate-template.dto.js +9 -0
- package/dist/certificate/dto/update-certificate-template.dto.js.map +1 -0
- package/dist/class-group/class-group.controller.d.ts +305 -0
- package/dist/class-group/class-group.controller.d.ts.map +1 -0
- package/dist/class-group/class-group.controller.js +257 -0
- package/dist/class-group/class-group.controller.js.map +1 -0
- package/dist/class-group/class-group.module.d.ts +3 -0
- package/dist/class-group/class-group.module.d.ts.map +1 -0
- package/dist/class-group/class-group.module.js +25 -0
- package/dist/class-group/class-group.module.js.map +1 -0
- package/dist/class-group/class-group.service.d.ts +354 -0
- package/dist/class-group/class-group.service.d.ts.map +1 -0
- package/dist/class-group/class-group.service.js +1356 -0
- package/dist/class-group/class-group.service.js.map +1 -0
- package/dist/class-group/dto/create-class-group.dto.d.ts +33 -0
- package/dist/class-group/dto/create-class-group.dto.d.ts.map +1 -0
- package/dist/class-group/dto/create-class-group.dto.js +165 -0
- package/dist/class-group/dto/create-class-group.dto.js.map +1 -0
- package/dist/class-group/dto/create-session.dto.d.ts +22 -0
- package/dist/class-group/dto/create-session.dto.d.ts.map +1 -0
- package/dist/class-group/dto/create-session.dto.js +117 -0
- package/dist/class-group/dto/create-session.dto.js.map +1 -0
- package/dist/class-group/dto/enrollment.dto.d.ts +22 -0
- package/dist/class-group/dto/enrollment.dto.d.ts.map +1 -0
- package/dist/class-group/dto/enrollment.dto.js +89 -0
- package/dist/class-group/dto/enrollment.dto.js.map +1 -0
- package/dist/class-group/dto/update-class-group.dto.d.ts +6 -0
- package/dist/class-group/dto/update-class-group.dto.d.ts.map +1 -0
- package/dist/class-group/dto/update-class-group.dto.js +9 -0
- package/dist/class-group/dto/update-class-group.dto.js.map +1 -0
- package/dist/class-group/dto/update-session.dto.d.ts +7 -0
- package/dist/class-group/dto/update-session.dto.d.ts.map +1 -0
- package/dist/class-group/dto/update-session.dto.js +24 -0
- package/dist/class-group/dto/update-session.dto.js.map +1 -0
- package/dist/course/course-structure.controller.d.ts +127 -0
- package/dist/course/course-structure.controller.d.ts.map +1 -0
- package/dist/course/course-structure.controller.js +115 -0
- package/dist/course/course-structure.controller.js.map +1 -0
- package/dist/course/course-structure.service.d.ts +142 -0
- package/dist/course/course-structure.service.d.ts.map +1 -0
- package/dist/course/course-structure.service.js +445 -0
- package/dist/course/course-structure.service.js.map +1 -0
- package/dist/course/course.controller.d.ts +195 -0
- package/dist/course/course.controller.d.ts.map +1 -0
- package/dist/course/course.controller.js +104 -0
- package/dist/course/course.controller.js.map +1 -0
- package/dist/course/course.module.d.ts +3 -0
- package/dist/course/course.module.d.ts.map +1 -0
- package/dist/course/course.module.js +28 -0
- package/dist/course/course.module.js.map +1 -0
- package/dist/course/course.service.d.ts +215 -0
- package/dist/course/course.service.d.ts.map +1 -0
- package/dist/course/course.service.js +743 -0
- package/dist/course/course.service.js.map +1 -0
- package/dist/course/dto/create-course-structure-lesson.dto.d.ts +24 -0
- package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course-structure-lesson.dto.js +118 -0
- package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -0
- package/dist/course/dto/create-course-structure-session.dto.d.ts +7 -0
- package/dist/course/dto/create-course-structure-session.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course-structure-session.dto.js +40 -0
- package/dist/course/dto/create-course-structure-session.dto.js.map +1 -0
- package/dist/course/dto/create-course.dto.d.ts +26 -0
- package/dist/course/dto/create-course.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course.dto.js +138 -0
- package/dist/course/dto/create-course.dto.js.map +1 -0
- package/dist/course/dto/update-course-structure-lesson.dto.d.ts +6 -0
- package/dist/course/dto/update-course-structure-lesson.dto.d.ts.map +1 -0
- package/dist/course/dto/update-course-structure-lesson.dto.js +9 -0
- package/dist/course/dto/update-course-structure-lesson.dto.js.map +1 -0
- package/dist/course/dto/update-course-structure-session.dto.d.ts +6 -0
- package/dist/course/dto/update-course-structure-session.dto.d.ts.map +1 -0
- package/dist/course/dto/update-course-structure-session.dto.js +9 -0
- package/dist/course/dto/update-course-structure-session.dto.js.map +1 -0
- package/dist/course/dto/update-course.dto.d.ts +6 -0
- package/dist/course/dto/update-course.dto.d.ts.map +1 -0
- package/dist/course/dto/update-course.dto.js +9 -0
- package/dist/course/dto/update-course.dto.js.map +1 -0
- package/dist/dashboard/dashboard.controller.d.ts +101 -0
- package/dist/dashboard/dashboard.controller.d.ts.map +1 -0
- package/dist/dashboard/dashboard.controller.js +40 -0
- package/dist/dashboard/dashboard.controller.js.map +1 -0
- package/dist/dashboard/dashboard.module.d.ts +3 -0
- package/dist/dashboard/dashboard.module.d.ts.map +1 -0
- package/dist/dashboard/dashboard.module.js +25 -0
- package/dist/dashboard/dashboard.module.js.map +1 -0
- package/dist/dashboard/dashboard.service.d.ts +130 -0
- package/dist/dashboard/dashboard.service.d.ts.map +1 -0
- package/dist/dashboard/dashboard.service.js +626 -0
- package/dist/dashboard/dashboard.service.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.d.ts +4 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.js +22 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.d.ts +5 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.js +27 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.d.ts +5 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.js +27 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.d.ts +7 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.js +36 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.js.map +1 -0
- package/dist/enterprise/dto/create-enterprise.dto.d.ts +10 -0
- package/dist/enterprise/dto/create-enterprise.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/create-enterprise.dto.js +54 -0
- package/dist/enterprise/dto/create-enterprise.dto.js.map +1 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.d.ts +4 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.js +22 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.js.map +1 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.d.ts +5 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.js +27 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.js.map +1 -0
- package/dist/enterprise/dto/update-enterprise.dto.d.ts +6 -0
- package/dist/enterprise/dto/update-enterprise.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/update-enterprise.dto.js +9 -0
- package/dist/enterprise/dto/update-enterprise.dto.js.map +1 -0
- package/dist/enterprise/enterprise.controller.d.ts +269 -0
- package/dist/enterprise/enterprise.controller.d.ts.map +1 -0
- package/dist/enterprise/enterprise.controller.js +311 -0
- package/dist/enterprise/enterprise.controller.js.map +1 -0
- package/dist/enterprise/enterprise.module.d.ts +3 -0
- package/dist/enterprise/enterprise.module.d.ts.map +1 -0
- package/dist/enterprise/enterprise.module.js +25 -0
- package/dist/enterprise/enterprise.module.js.map +1 -0
- package/dist/enterprise/enterprise.service.d.ts +282 -0
- package/dist/enterprise/enterprise.service.d.ts.map +1 -0
- package/dist/enterprise/enterprise.service.js +627 -0
- package/dist/enterprise/enterprise.service.js.map +1 -0
- package/dist/evaluation/evaluation.controller.d.ts +56 -0
- package/dist/evaluation/evaluation.controller.d.ts.map +1 -0
- package/dist/evaluation/evaluation.controller.js +76 -0
- package/dist/evaluation/evaluation.controller.js.map +1 -0
- package/dist/evaluation/evaluation.module.d.ts +3 -0
- package/dist/evaluation/evaluation.module.d.ts.map +1 -0
- package/dist/evaluation/evaluation.module.js +25 -0
- package/dist/evaluation/evaluation.module.js.map +1 -0
- package/dist/evaluation/evaluation.service.d.ts +67 -0
- package/dist/evaluation/evaluation.service.d.ts.map +1 -0
- package/dist/evaluation/evaluation.service.js +378 -0
- package/dist/evaluation/evaluation.service.js.map +1 -0
- package/dist/exam/dto/create-exam-question.dto.d.ts +25 -0
- package/dist/exam/dto/create-exam-question.dto.d.ts.map +1 -0
- package/dist/exam/dto/create-exam-question.dto.js +117 -0
- package/dist/exam/dto/create-exam-question.dto.js.map +1 -0
- package/dist/exam/dto/create-exam.dto.d.ts +11 -0
- package/dist/exam/dto/create-exam.dto.d.ts.map +1 -0
- package/dist/exam/dto/create-exam.dto.js +63 -0
- package/dist/exam/dto/create-exam.dto.js.map +1 -0
- package/dist/exam/dto/reorder-exam-questions.dto.d.ts +4 -0
- package/dist/exam/dto/reorder-exam-questions.dto.d.ts.map +1 -0
- package/dist/exam/dto/reorder-exam-questions.dto.js +23 -0
- package/dist/exam/dto/reorder-exam-questions.dto.js.map +1 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.d.ts +14 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.d.ts.map +1 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.js +68 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.js.map +1 -0
- package/dist/exam/dto/start-exam-attempt.dto.d.ts +4 -0
- package/dist/exam/dto/start-exam-attempt.dto.d.ts.map +1 -0
- package/dist/exam/dto/start-exam-attempt.dto.js +23 -0
- package/dist/exam/dto/start-exam-attempt.dto.js.map +1 -0
- package/dist/exam/dto/submit-exam-attempt.dto.d.ts +5 -0
- package/dist/exam/dto/submit-exam-attempt.dto.d.ts.map +1 -0
- package/dist/exam/dto/submit-exam-attempt.dto.js +23 -0
- package/dist/exam/dto/submit-exam-attempt.dto.js.map +1 -0
- package/dist/exam/dto/update-exam-question.dto.d.ts +6 -0
- package/dist/exam/dto/update-exam-question.dto.d.ts.map +1 -0
- package/dist/exam/dto/update-exam-question.dto.js +9 -0
- package/dist/exam/dto/update-exam-question.dto.js.map +1 -0
- package/dist/exam/dto/update-exam.dto.d.ts +6 -0
- package/dist/exam/dto/update-exam.dto.d.ts.map +1 -0
- package/dist/exam/dto/update-exam.dto.js +9 -0
- package/dist/exam/dto/update-exam.dto.js.map +1 -0
- package/dist/exam/exam-attempt.controller.d.ts +273 -0
- package/dist/exam/exam-attempt.controller.d.ts.map +1 -0
- package/dist/exam/exam-attempt.controller.js +84 -0
- package/dist/exam/exam-attempt.controller.js.map +1 -0
- package/dist/exam/exam-attempt.service.d.ts +302 -0
- package/dist/exam/exam-attempt.service.d.ts.map +1 -0
- package/dist/exam/exam-attempt.service.js +776 -0
- package/dist/exam/exam-attempt.service.js.map +1 -0
- package/dist/exam/exam.controller.d.ts +162 -0
- package/dist/exam/exam.controller.d.ts.map +1 -0
- package/dist/exam/exam.controller.js +158 -0
- package/dist/exam/exam.controller.js.map +1 -0
- package/dist/exam/exam.module.d.ts +3 -0
- package/dist/exam/exam.module.d.ts.map +1 -0
- package/dist/exam/exam.module.js +27 -0
- package/dist/exam/exam.module.js.map +1 -0
- package/dist/exam/exam.service.d.ts +179 -0
- package/dist/exam/exam.service.d.ts.map +1 -0
- package/dist/exam/exam.service.js +597 -0
- package/dist/exam/exam.service.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/instructor/dto/create-instructor.dto.d.ts +10 -0
- package/dist/instructor/dto/create-instructor.dto.d.ts.map +1 -0
- package/dist/instructor/dto/create-instructor.dto.js +55 -0
- package/dist/instructor/dto/create-instructor.dto.js.map +1 -0
- package/dist/instructor/dto/update-instructor.dto.d.ts +9 -0
- package/dist/instructor/dto/update-instructor.dto.d.ts.map +1 -0
- package/dist/instructor/dto/update-instructor.dto.js +51 -0
- package/dist/instructor/dto/update-instructor.dto.js.map +1 -0
- package/dist/instructor/instructor.controller.d.ts +52 -0
- package/dist/instructor/instructor.controller.d.ts.map +1 -0
- package/dist/instructor/instructor.controller.js +98 -0
- package/dist/instructor/instructor.controller.js.map +1 -0
- package/dist/instructor/instructor.module.d.ts +3 -0
- package/dist/instructor/instructor.module.d.ts.map +1 -0
- package/dist/instructor/instructor.module.js +25 -0
- package/dist/instructor/instructor.module.js.map +1 -0
- package/dist/instructor/instructor.service.d.ts +79 -0
- package/dist/instructor/instructor.service.d.ts.map +1 -0
- package/dist/instructor/instructor.service.js +528 -0
- package/dist/instructor/instructor.service.js.map +1 -0
- package/dist/lms.module.d.ts.map +1 -1
- package/dist/lms.module.js +36 -4
- package/dist/lms.module.js.map +1 -1
- package/dist/reports/reports.controller.d.ts +69 -0
- package/dist/reports/reports.controller.d.ts.map +1 -0
- package/dist/reports/reports.controller.js +40 -0
- package/dist/reports/reports.controller.js.map +1 -0
- package/dist/reports/reports.module.d.ts +3 -0
- package/dist/reports/reports.module.d.ts.map +1 -0
- package/dist/reports/reports.module.js +25 -0
- package/dist/reports/reports.module.js.map +1 -0
- package/dist/reports/reports.service.d.ts +80 -0
- package/dist/reports/reports.service.d.ts.map +1 -0
- package/dist/reports/reports.service.js +366 -0
- package/dist/reports/reports.service.js.map +1 -0
- package/dist/training/dto/create-training.dto.d.ts +19 -0
- package/dist/training/dto/create-training.dto.d.ts.map +1 -0
- package/dist/training/dto/create-training.dto.js +98 -0
- package/dist/training/dto/create-training.dto.js.map +1 -0
- package/dist/training/dto/update-training.dto.d.ts +6 -0
- package/dist/training/dto/update-training.dto.d.ts.map +1 -0
- package/dist/training/dto/update-training.dto.js +9 -0
- package/dist/training/dto/update-training.dto.js.map +1 -0
- package/dist/training/training.controller.d.ts +195 -0
- package/dist/training/training.controller.d.ts.map +1 -0
- package/dist/training/training.controller.js +104 -0
- package/dist/training/training.controller.js.map +1 -0
- package/dist/training/training.module.d.ts +3 -0
- package/dist/training/training.module.d.ts.map +1 -0
- package/dist/training/training.module.js +25 -0
- package/dist/training/training.module.js.map +1 -0
- package/dist/training/training.service.d.ts +213 -0
- package/dist/training/training.service.d.ts.map +1 -0
- package/dist/training/training.service.js +497 -0
- package/dist/training/training.service.js.map +1 -0
- package/hedhog/data/dashboard.yaml +6 -0
- package/hedhog/data/dashboard_component.yaml +153 -0
- package/hedhog/data/dashboard_component_role.yaml +97 -0
- package/hedhog/data/dashboard_item.yaml +167 -0
- package/hedhog/data/dashboard_role.yaml +6 -0
- package/hedhog/data/instructor_qualification.yaml +16 -0
- package/hedhog/data/menu.yaml +129 -19
- package/hedhog/data/role.yaml +25 -1
- package/hedhog/data/route.yaml +867 -0
- package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +1992 -0
- package/hedhog/frontend/app/_components/course-form-sheet.tsx.ejs +480 -0
- package/hedhog/frontend/app/_components/create-lms-instructor-sheet.tsx.ejs +591 -0
- package/hedhog/frontend/app/_components/create-lms-person-sheet.tsx.ejs +164 -0
- package/hedhog/frontend/app/_components/create-lms-student-person-sheet.tsx.ejs +120 -0
- package/hedhog/frontend/app/_components/lms-class-calendar.tsx.ejs +272 -0
- package/hedhog/frontend/app/_components/mobile-calendar.tsx.ejs +277 -0
- package/hedhog/frontend/app/_lib/editor/canvasInstance.ts.ejs +48 -0
- package/hedhog/frontend/app/_lib/editor/pctHelpers.ts.ejs +50 -0
- package/hedhog/frontend/app/_lib/editor/templateSerializer.ts.ejs +268 -0
- package/hedhog/frontend/app/_lib/editor/types.ts.ejs +94 -0
- package/hedhog/frontend/app/_lib/store/useTemplateStore.ts.ejs +284 -0
- package/hedhog/frontend/app/certificates/issued/page.tsx.ejs +638 -0
- package/hedhog/frontend/app/certificates/models/CanvasStage.tsx.ejs +916 -0
- package/hedhog/frontend/app/certificates/models/LeftPanel.tsx.ejs +200 -0
- package/hedhog/frontend/app/certificates/models/RightPanel.tsx.ejs +769 -0
- package/hedhog/frontend/app/certificates/models/TemplateEditorPage.tsx.ejs +104 -0
- package/hedhog/frontend/app/certificates/models/TopBar.tsx.ejs +354 -0
- package/hedhog/frontend/app/certificates/models/editor/page.tsx.ejs +5 -0
- package/hedhog/frontend/app/certificates/models/page.tsx.ejs +883 -0
- package/hedhog/frontend/app/classes/[id]/_components/event-summary-popover.tsx.ejs +279 -0
- package/hedhog/frontend/app/classes/[id]/_components/quick-create-session-popover.tsx.ejs +1027 -0
- package/hedhog/frontend/app/classes/[id]/page.tsx.ejs +3130 -993
- package/hedhog/frontend/app/classes/page.tsx.ejs +2731 -759
- package/hedhog/frontend/app/courses/[id]/_components/CourseCertificateCard.tsx.ejs +80 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseClassificationCard.tsx.ejs +226 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseContentCard.tsx.ejs +71 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseDangerZoneCard.tsx.ejs +42 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseFlagsCard.tsx.ejs +111 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseMainInfoCard.tsx.ejs +113 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseMediaCard.tsx.ejs +215 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseMultiEntityPicker.tsx.ejs +236 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseRelationsCard.tsx.ejs +141 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseSectionCard.tsx.ejs +57 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseSummaryCard.tsx.ejs +60 -0
- package/hedhog/frontend/app/courses/[id]/_components/course-edit-types.ts.ejs +33 -0
- package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +933 -1103
- package/hedhog/frontend/app/courses/[id]/structure/page.tsx.ejs +699 -117
- package/hedhog/frontend/app/courses/page.tsx.ejs +1018 -1042
- package/hedhog/frontend/app/enterprise/[id]/page.tsx.ejs +317 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-activity-panel.tsx.ejs +88 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-admin-create-sheet.tsx.ejs +318 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-administrators-tab.tsx.ejs +332 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-class-create-sheet.tsx.ejs +58 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-classes-tab.tsx.ejs +390 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-company-identity-card.tsx.ejs +112 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-course-create-sheet.tsx.ejs +183 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-courses-tab.tsx.ejs +363 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-detail-constants.ts.ejs +88 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-detail-sheet.tsx.ejs +548 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-detail-utils.ts.ejs +33 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-mocks.ts.ejs +277 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-person-picker.ts.ejs +31 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-progress-bar.tsx.ejs +21 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-related-tab.tsx.ejs +224 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-sheet.tsx.ejs +397 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-student-create-sheet.tsx.ejs +167 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-students-tab.tsx.ejs +267 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-system-user-picker.ts.ejs +42 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-types.ts.ejs +96 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-user-create-sheet.tsx.ejs +207 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-user-distribution-chart.tsx.ejs +149 -0
- package/hedhog/frontend/app/enterprise/page.tsx.ejs +596 -0
- package/hedhog/frontend/app/evaluations/page.tsx.ejs +1250 -0
- package/hedhog/frontend/app/exams/[id]/attempt/page.tsx.ejs +642 -196
- package/hedhog/frontend/app/exams/[id]/page.tsx.ejs +11 -0
- package/hedhog/frontend/app/exams/[id]/questions/page.tsx.ejs +1316 -436
- package/hedhog/frontend/app/exams/page.tsx.ejs +799 -546
- package/hedhog/frontend/app/layout.tsx.ejs +5 -0
- package/hedhog/frontend/app/page.tsx.ejs +3 -1220
- package/hedhog/frontend/app/reports/courses/page.tsx.ejs +843 -0
- package/hedhog/frontend/app/reports/dashboard/page.tsx.ejs +890 -0
- package/hedhog/frontend/app/reports/page.tsx.ejs +802 -808
- package/hedhog/frontend/app/reports/students/page.tsx.ejs +772 -0
- package/hedhog/frontend/app/training/page.tsx.ejs +1873 -628
- package/hedhog/frontend/messages/en.json +1606 -111
- package/hedhog/frontend/messages/pt.json +1636 -134
- package/hedhog/frontend/widgets/active-classes-kpi.tsx.ejs +74 -0
- package/hedhog/frontend/widgets/active-courses-kpi.tsx.ejs +74 -0
- package/hedhog/frontend/widgets/approval-rate-kpi.tsx.ejs +81 -0
- package/hedhog/frontend/widgets/category-distribution-chart.tsx.ejs +119 -0
- package/hedhog/frontend/widgets/class-calendar.tsx.ejs +440 -0
- package/hedhog/frontend/widgets/completion-rate-kpi.tsx.ejs +81 -0
- package/hedhog/frontend/widgets/engagement-chart.tsx.ejs +120 -0
- package/hedhog/frontend/widgets/footer-summary.tsx.ejs +80 -0
- package/hedhog/frontend/widgets/issued-certificates-kpi.tsx.ejs +74 -0
- package/hedhog/frontend/widgets/latest-enrollments.tsx.ejs +166 -0
- package/hedhog/frontend/widgets/student-growth-chart.tsx.ejs +89 -0
- package/hedhog/frontend/widgets/top-courses-chart.tsx.ejs +104 -0
- package/hedhog/frontend/widgets/total-students-kpi.tsx.ejs +78 -0
- package/hedhog/frontend/widgets/upcoming-classes.tsx.ejs +152 -0
- package/hedhog/table/course.yaml +19 -1
- package/hedhog/table/course_class_group.yaml +8 -0
- package/hedhog/table/course_class_session.yaml +33 -0
- package/hedhog/table/course_instructor.yaml +27 -0
- package/hedhog/table/enterprise.yaml +29 -0
- package/hedhog/table/enterprise_class_group.yaml +20 -0
- package/hedhog/table/enterprise_course.yaml +23 -0
- package/hedhog/table/enterprise_student.yaml +24 -0
- package/hedhog/table/enterprise_user.yaml +35 -0
- package/hedhog/table/instructor_qualification.yaml +26 -0
- package/hedhog/table/instructor_qualification_assignment.yaml +22 -0
- package/hedhog/table/question.yaml +6 -0
- package/package.json +6 -6
- package/src/certificate/certificate.controller.ts +83 -0
- package/src/certificate/certificate.module.ts +13 -0
- package/src/certificate/certificate.service.ts +413 -0
- package/src/certificate/dto/create-certificate-template.dto.ts +25 -0
- package/src/certificate/dto/update-certificate-template.dto.ts +6 -0
- package/src/class-group/class-group.controller.ts +189 -0
- package/src/class-group/class-group.module.ts +12 -0
- package/src/class-group/class-group.service.ts +1802 -0
- package/src/class-group/dto/create-class-group.dto.ts +139 -0
- package/src/class-group/dto/create-session.dto.ts +102 -0
- package/src/class-group/dto/enrollment.dto.ts +70 -0
- package/src/class-group/dto/update-class-group.dto.ts +4 -0
- package/src/class-group/dto/update-session.dto.ts +9 -0
- package/src/course/course-structure.controller.ts +85 -0
- package/src/course/course-structure.service.ts +525 -0
- package/src/course/course.controller.ts +69 -0
- package/src/course/course.module.ts +15 -0
- package/src/course/course.service.ts +920 -0
- package/src/course/dto/create-course-structure-lesson.dto.ts +97 -0
- package/src/course/dto/create-course-structure-session.dto.ts +22 -0
- package/src/course/dto/create-course.dto.ts +111 -0
- package/src/course/dto/update-course-structure-lesson.dto.ts +6 -0
- package/src/course/dto/update-course-structure-session.dto.ts +6 -0
- package/src/course/dto/update-course.dto.ts +4 -0
- package/src/dashboard/dashboard.controller.ts +14 -0
- package/src/dashboard/dashboard.module.ts +12 -0
- package/src/dashboard/dashboard.service.ts +726 -0
- package/src/enterprise/dto/add-enterprise-class-group.dto.ts +7 -0
- package/src/enterprise/dto/add-enterprise-course.dto.ts +11 -0
- package/src/enterprise/dto/add-enterprise-student.dto.ts +16 -0
- package/src/enterprise/dto/add-enterprise-user.dto.ts +23 -0
- package/src/enterprise/dto/create-enterprise.dto.ts +41 -0
- package/src/enterprise/dto/update-enterprise-student.dto.ts +7 -0
- package/src/enterprise/dto/update-enterprise-user.dto.ts +11 -0
- package/src/enterprise/dto/update-enterprise.dto.ts +4 -0
- package/src/enterprise/enterprise.controller.ts +233 -0
- package/src/enterprise/enterprise.module.ts +12 -0
- package/src/enterprise/enterprise.service.ts +712 -0
- package/src/evaluation/evaluation.controller.ts +44 -0
- package/src/evaluation/evaluation.module.ts +12 -0
- package/src/evaluation/evaluation.service.ts +394 -0
- package/src/exam/dto/create-exam-question.dto.ts +103 -0
- package/src/exam/dto/create-exam.dto.ts +41 -0
- package/src/exam/dto/reorder-exam-questions.dto.ts +8 -0
- package/src/exam/dto/save-exam-attempt-answers.dto.ts +55 -0
- package/src/exam/dto/start-exam-attempt.dto.ts +8 -0
- package/src/exam/dto/submit-exam-attempt.dto.ts +8 -0
- package/src/exam/dto/update-exam-question.dto.ts +4 -0
- package/src/exam/dto/update-exam.dto.ts +4 -0
- package/src/exam/exam-attempt.controller.ts +65 -0
- package/src/exam/exam-attempt.service.ts +1008 -0
- package/src/exam/exam.controller.ts +102 -0
- package/src/exam/exam.module.ts +14 -0
- package/src/exam/exam.service.ts +784 -0
- package/src/index.ts +29 -0
- package/src/instructor/dto/create-instructor.dto.ts +43 -0
- package/src/instructor/dto/update-instructor.dto.ts +38 -0
- package/src/instructor/instructor.controller.ts +73 -0
- package/src/instructor/instructor.module.ts +12 -0
- package/src/instructor/instructor.service.ts +646 -0
- package/src/lms.module.ts +36 -4
- package/src/reports/reports.controller.ts +14 -0
- package/src/reports/reports.module.ts +12 -0
- package/src/reports/reports.service.ts +485 -0
- package/src/training/dto/create-training.dto.ts +81 -0
- package/src/training/dto/update-training.dto.ts +4 -0
- package/src/training/training.controller.ts +68 -0
- package/src/training/training.module.ts +12 -0
- package/src/training/training.service.ts +574 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { PersonFormSheet } from '@/app/(app)/(libraries)/contact/person/_components/person-form-sheet';
|
|
4
|
+
import type {
|
|
5
|
+
ContactTypeOption,
|
|
6
|
+
DocumentTypeOption,
|
|
7
|
+
Person,
|
|
8
|
+
} from '@/app/(app)/(libraries)/contact/person/_components/person-types';
|
|
9
|
+
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
10
|
+
import { useMemo } from 'react';
|
|
11
|
+
|
|
12
|
+
type CreatedInstructor = {
|
|
13
|
+
id: number;
|
|
14
|
+
personId: number;
|
|
15
|
+
name: string;
|
|
16
|
+
avatarId?: number | null;
|
|
17
|
+
email?: string | null;
|
|
18
|
+
phone?: string | null;
|
|
19
|
+
qualificationSlugs: string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type CreateLmsPersonSheetProps = {
|
|
23
|
+
open: boolean;
|
|
24
|
+
onOpenChange: (open: boolean) => void;
|
|
25
|
+
onCreated?: (instructor: CreatedInstructor) => void | Promise<void>;
|
|
26
|
+
title?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
submitLabel?: string;
|
|
29
|
+
successMessage?: string;
|
|
30
|
+
errorMessage?: string;
|
|
31
|
+
defaultQualificationSlugs?: string[];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
function getPrimaryContactValue(
|
|
35
|
+
person: Person,
|
|
36
|
+
acceptedCodes: string[],
|
|
37
|
+
contactTypesById: Map<number, string>
|
|
38
|
+
) {
|
|
39
|
+
const accepted = new Set(acceptedCodes.map((code) => code.toUpperCase()));
|
|
40
|
+
const contacts = (person.contact ?? []).filter((contact) => {
|
|
41
|
+
const code = (
|
|
42
|
+
contact.contact_type?.code ??
|
|
43
|
+
contactTypesById.get(contact.contact_type_id) ??
|
|
44
|
+
''
|
|
45
|
+
).toUpperCase();
|
|
46
|
+
|
|
47
|
+
return accepted.has(code);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const primaryContact =
|
|
51
|
+
contacts.find((contact) => contact.is_primary) ?? contacts[0];
|
|
52
|
+
|
|
53
|
+
return primaryContact?.value?.trim() || null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function CreateLmsPersonSheet({
|
|
57
|
+
open,
|
|
58
|
+
onOpenChange,
|
|
59
|
+
onCreated,
|
|
60
|
+
title,
|
|
61
|
+
description,
|
|
62
|
+
errorMessage,
|
|
63
|
+
defaultQualificationSlugs,
|
|
64
|
+
}: CreateLmsPersonSheetProps) {
|
|
65
|
+
const { request, currentLocaleCode } = useApp();
|
|
66
|
+
|
|
67
|
+
const qualificationSlugs = useMemo(
|
|
68
|
+
() =>
|
|
69
|
+
defaultQualificationSlugs && defaultQualificationSlugs.length > 0
|
|
70
|
+
? [...new Set(defaultQualificationSlugs)]
|
|
71
|
+
: ['course-lessons'],
|
|
72
|
+
[defaultQualificationSlugs]
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const { data: contactTypes = [] } = useQuery<ContactTypeOption[]>({
|
|
76
|
+
queryKey: ['contact-person-contact-types', currentLocaleCode],
|
|
77
|
+
queryFn: async () => {
|
|
78
|
+
const response = await request<{ data: ContactTypeOption[] }>({
|
|
79
|
+
url: '/person-contact-type?pageSize=100',
|
|
80
|
+
method: 'GET',
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return response.data.data || [];
|
|
84
|
+
},
|
|
85
|
+
placeholderData: (previous) => previous ?? [],
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const { data: documentTypes = [] } = useQuery<DocumentTypeOption[]>({
|
|
89
|
+
queryKey: ['contact-person-document-types', currentLocaleCode],
|
|
90
|
+
queryFn: async () => {
|
|
91
|
+
const response = await request<{ data: DocumentTypeOption[] }>({
|
|
92
|
+
url: '/person-document-type?pageSize=100',
|
|
93
|
+
method: 'GET',
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return response.data.data || [];
|
|
97
|
+
},
|
|
98
|
+
placeholderData: (previous) => previous ?? [],
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const contactTypesById = useMemo(
|
|
102
|
+
() =>
|
|
103
|
+
new Map(
|
|
104
|
+
contactTypes.map((contactType) => [
|
|
105
|
+
contactType.contact_type_id,
|
|
106
|
+
contactType.code,
|
|
107
|
+
])
|
|
108
|
+
),
|
|
109
|
+
[contactTypes]
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const handleSuccess = async (person?: Person) => {
|
|
113
|
+
if (!person?.id) {
|
|
114
|
+
throw new Error(
|
|
115
|
+
errorMessage || 'Nao foi possivel localizar a pessoa cadastrada.'
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const email = getPrimaryContactValue(
|
|
120
|
+
person,
|
|
121
|
+
['EMAIL'],
|
|
122
|
+
contactTypesById
|
|
123
|
+
);
|
|
124
|
+
const phone = getPrimaryContactValue(
|
|
125
|
+
person,
|
|
126
|
+
['PHONE', 'MOBILE', 'WHATSAPP'],
|
|
127
|
+
contactTypesById
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const response = await request<CreatedInstructor>({
|
|
131
|
+
url: '/lms/instructors',
|
|
132
|
+
method: 'POST',
|
|
133
|
+
data: {
|
|
134
|
+
personId: person.id,
|
|
135
|
+
name: person.name.trim(),
|
|
136
|
+
email: email || undefined,
|
|
137
|
+
phone: phone || undefined,
|
|
138
|
+
avatarId: person.avatar_id ?? null,
|
|
139
|
+
qualificationSlugs,
|
|
140
|
+
status: 'active',
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
if (!response.data?.id || !response.data?.name) {
|
|
145
|
+
throw new Error(errorMessage || 'Nao foi possivel vincular o professor.');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
await onCreated?.(response.data);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
return (
|
|
152
|
+
<PersonFormSheet
|
|
153
|
+
open={open}
|
|
154
|
+
person={null}
|
|
155
|
+
contactTypes={contactTypes}
|
|
156
|
+
documentTypes={documentTypes}
|
|
157
|
+
onOpenChange={onOpenChange}
|
|
158
|
+
onSuccess={handleSuccess}
|
|
159
|
+
title={title}
|
|
160
|
+
description={description}
|
|
161
|
+
allowedTypes={['individual']}
|
|
162
|
+
/>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { PersonFormSheet } from '@/app/(app)/(libraries)/contact/person/_components/person-form-sheet';
|
|
4
|
+
import type {
|
|
5
|
+
ContactTypeOption,
|
|
6
|
+
DocumentTypeOption,
|
|
7
|
+
Person,
|
|
8
|
+
} from '@/app/(app)/(libraries)/contact/person/_components/person-types';
|
|
9
|
+
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
10
|
+
|
|
11
|
+
type CreateLmsStudentPersonSheetProps = {
|
|
12
|
+
open: boolean;
|
|
13
|
+
onOpenChange: (open: boolean) => void;
|
|
14
|
+
classGroupId: number | string;
|
|
15
|
+
onEnrolled?: (person: Person) => void | Promise<void>;
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
errorMessage?: string;
|
|
19
|
+
alreadyEnrolledMessage?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function getErrorMessage(error: unknown) {
|
|
23
|
+
if (error instanceof Error && error.message) {
|
|
24
|
+
return error.message;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (typeof error === 'object' && error && 'message' in error) {
|
|
28
|
+
const message = (error as { message?: unknown }).message;
|
|
29
|
+
if (typeof message === 'string' && message.trim()) {
|
|
30
|
+
return message;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function CreateLmsStudentPersonSheet({
|
|
38
|
+
open,
|
|
39
|
+
onOpenChange,
|
|
40
|
+
classGroupId,
|
|
41
|
+
onEnrolled,
|
|
42
|
+
title,
|
|
43
|
+
description,
|
|
44
|
+
errorMessage,
|
|
45
|
+
alreadyEnrolledMessage,
|
|
46
|
+
}: CreateLmsStudentPersonSheetProps) {
|
|
47
|
+
const { request, currentLocaleCode } = useApp();
|
|
48
|
+
|
|
49
|
+
const { data: contactTypes = [] } = useQuery<ContactTypeOption[]>({
|
|
50
|
+
queryKey: ['contact-person-contact-types', currentLocaleCode],
|
|
51
|
+
queryFn: async () => {
|
|
52
|
+
const response = await request<{ data: ContactTypeOption[] }>({
|
|
53
|
+
url: '/person-contact-type?pageSize=100',
|
|
54
|
+
method: 'GET',
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return response.data.data || [];
|
|
58
|
+
},
|
|
59
|
+
placeholderData: (previous) => previous ?? [],
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const { data: documentTypes = [] } = useQuery<DocumentTypeOption[]>({
|
|
63
|
+
queryKey: ['contact-person-document-types', currentLocaleCode],
|
|
64
|
+
queryFn: async () => {
|
|
65
|
+
const response = await request<{ data: DocumentTypeOption[] }>({
|
|
66
|
+
url: '/person-document-type?pageSize=100',
|
|
67
|
+
method: 'GET',
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return response.data.data || [];
|
|
71
|
+
},
|
|
72
|
+
placeholderData: (previous) => previous ?? [],
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const handleSuccess = async (person?: Person) => {
|
|
76
|
+
if (!person?.id) {
|
|
77
|
+
throw new Error(
|
|
78
|
+
errorMessage || 'Nao foi possivel localizar a pessoa cadastrada.'
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
await request({
|
|
84
|
+
url: `/lms/classes/${classGroupId}/students`,
|
|
85
|
+
method: 'POST',
|
|
86
|
+
data: {
|
|
87
|
+
personId: person.id,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
} catch (error: unknown) {
|
|
91
|
+
const message = getErrorMessage(error);
|
|
92
|
+
|
|
93
|
+
if (message?.toLowerCase().includes('already enrolled')) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
alreadyEnrolledMessage || 'Esta pessoa ja esta matriculada na turma.'
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
throw new Error(
|
|
100
|
+
message || errorMessage || 'Nao foi possivel matricular o aluno.'
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
await onEnrolled?.(person);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<PersonFormSheet
|
|
109
|
+
open={open}
|
|
110
|
+
person={null}
|
|
111
|
+
contactTypes={contactTypes}
|
|
112
|
+
documentTypes={documentTypes}
|
|
113
|
+
onOpenChange={onOpenChange}
|
|
114
|
+
onSuccess={handleSuccess}
|
|
115
|
+
title={title}
|
|
116
|
+
description={description}
|
|
117
|
+
allowedTypes={['individual']}
|
|
118
|
+
/>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Button } from '@/components/ui/button';
|
|
4
|
+
import { format } from 'date-fns';
|
|
5
|
+
import { Plus } from 'lucide-react';
|
|
6
|
+
import { useCallback, useState } from 'react';
|
|
7
|
+
import { EventSummaryPopover } from '../classes/[id]/_components/event-summary-popover';
|
|
8
|
+
import { QuickCreateSessionPopover } from '../classes/[id]/_components/quick-create-session-popover';
|
|
9
|
+
import { MobileCalendar, type MobileCalendarEvent } from './mobile-calendar';
|
|
10
|
+
|
|
11
|
+
// ── Minimal types ─────────────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
interface Aula {
|
|
14
|
+
id: number;
|
|
15
|
+
titulo: string;
|
|
16
|
+
data: string;
|
|
17
|
+
horaInicio: string;
|
|
18
|
+
horaFim: string;
|
|
19
|
+
local: string;
|
|
20
|
+
meetingUrl: string;
|
|
21
|
+
tipo: 'presencial' | 'online';
|
|
22
|
+
status: string;
|
|
23
|
+
instructorId?: number | null;
|
|
24
|
+
instructorName?: string;
|
|
25
|
+
recurrence?: {
|
|
26
|
+
frequency: 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
27
|
+
interval: number;
|
|
28
|
+
until: string;
|
|
29
|
+
daysOfWeek?: Array<'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU'>;
|
|
30
|
+
} | null;
|
|
31
|
+
recurrenceId?: string | null;
|
|
32
|
+
occurrenceIndex?: number | null;
|
|
33
|
+
isException?: boolean;
|
|
34
|
+
isRecurring?: boolean;
|
|
35
|
+
cor?: string | null;
|
|
36
|
+
color?: string | null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface PresencaItem {
|
|
40
|
+
alunoId: number;
|
|
41
|
+
selecionado: boolean;
|
|
42
|
+
presente: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type OpenAulaSheetOptions = {
|
|
46
|
+
initialTab?: 'aulas' | 'chamada';
|
|
47
|
+
prefill?: {
|
|
48
|
+
titulo?: string;
|
|
49
|
+
data?: string;
|
|
50
|
+
horaInicio?: string;
|
|
51
|
+
horaFim?: string;
|
|
52
|
+
local?: string;
|
|
53
|
+
tipo?: string;
|
|
54
|
+
instrutorId?: string;
|
|
55
|
+
cor?: string;
|
|
56
|
+
recurrenceFrequency?: 'none' | 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
57
|
+
recurrenceUntil?: string;
|
|
58
|
+
recurrenceDaysOfWeek?: Array<
|
|
59
|
+
'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU'
|
|
60
|
+
>;
|
|
61
|
+
applyScope?: 'single' | 'series';
|
|
62
|
+
};
|
|
63
|
+
attendance?: PresencaItem[];
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type AulaCalendarEvent = {
|
|
67
|
+
id: number;
|
|
68
|
+
title: string;
|
|
69
|
+
start: Date;
|
|
70
|
+
end: Date;
|
|
71
|
+
resource: Aula;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
type CalendarMessages = {
|
|
75
|
+
today: string;
|
|
76
|
+
previous: string;
|
|
77
|
+
next: string;
|
|
78
|
+
month: string;
|
|
79
|
+
week: string;
|
|
80
|
+
day: string;
|
|
81
|
+
agenda: string;
|
|
82
|
+
date: string;
|
|
83
|
+
time: string;
|
|
84
|
+
event: string;
|
|
85
|
+
noEventsInRange: string;
|
|
86
|
+
showMore: (count: number) => string;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
interface LmsClassCalendarProps {
|
|
90
|
+
events: AulaCalendarEvent[];
|
|
91
|
+
classId: string;
|
|
92
|
+
alunos: Array<{ id: number; nome: string }>;
|
|
93
|
+
locale: string;
|
|
94
|
+
defaultStartTime?: string;
|
|
95
|
+
defaultEndTime?: string;
|
|
96
|
+
helperText: string;
|
|
97
|
+
newLessonLabel: string;
|
|
98
|
+
calendarMessages: CalendarMessages;
|
|
99
|
+
mobileCalendarLabels: {
|
|
100
|
+
previousLabel: string;
|
|
101
|
+
nextLabel: string;
|
|
102
|
+
noEventsLabel: string;
|
|
103
|
+
};
|
|
104
|
+
onNewLesson: () => void;
|
|
105
|
+
onOpenAulaSheet: (aula?: Aula, options?: OpenAulaSheetOptions) => void;
|
|
106
|
+
onSessionSaved: (aula: Aula) => void;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ── Component ─────────────────────────────────────────────────────────────────
|
|
110
|
+
|
|
111
|
+
export function LmsClassCalendar({
|
|
112
|
+
events,
|
|
113
|
+
classId,
|
|
114
|
+
alunos,
|
|
115
|
+
locale,
|
|
116
|
+
defaultStartTime = '19:00',
|
|
117
|
+
defaultEndTime = '22:00',
|
|
118
|
+
helperText,
|
|
119
|
+
newLessonLabel,
|
|
120
|
+
calendarMessages,
|
|
121
|
+
mobileCalendarLabels,
|
|
122
|
+
onNewLesson,
|
|
123
|
+
onOpenAulaSheet,
|
|
124
|
+
onSessionSaved,
|
|
125
|
+
}: LmsClassCalendarProps) {
|
|
126
|
+
const [calendarDate, setCalendarDate] = useState(new Date());
|
|
127
|
+
|
|
128
|
+
const [quickCreateOpen, setQuickCreateOpen] = useState(false);
|
|
129
|
+
const [quickCreateSlot, setQuickCreateSlot] = useState<{
|
|
130
|
+
date: string;
|
|
131
|
+
startTime: string;
|
|
132
|
+
endTime: string;
|
|
133
|
+
} | null>(null);
|
|
134
|
+
const [quickCreateAnchor, setQuickCreateAnchor] = useState<{
|
|
135
|
+
x: number;
|
|
136
|
+
y: number;
|
|
137
|
+
} | null>(null);
|
|
138
|
+
|
|
139
|
+
const [eventSummaryOpen, setEventSummaryOpen] = useState(false);
|
|
140
|
+
const [selectedEventSummary, setSelectedEventSummary] = useState<Aula | null>(
|
|
141
|
+
null
|
|
142
|
+
);
|
|
143
|
+
const [eventSummaryAnchor, setEventSummaryAnchor] = useState<{
|
|
144
|
+
x: number;
|
|
145
|
+
y: number;
|
|
146
|
+
} | null>(null);
|
|
147
|
+
|
|
148
|
+
const getEventColor = useCallback((event: MobileCalendarEvent<Aula>) => {
|
|
149
|
+
const persistedColor = event.resource.cor ?? event.resource.color;
|
|
150
|
+
|
|
151
|
+
if (persistedColor) {
|
|
152
|
+
return persistedColor;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return event.resource.tipo === 'presencial' ? '#3b82f6' : '#22c55e';
|
|
156
|
+
}, []);
|
|
157
|
+
|
|
158
|
+
const handleSelectEvent = useCallback(
|
|
159
|
+
(event: { resource?: Aula }, anchor: { x: number; y: number }) => {
|
|
160
|
+
if (!event.resource) return;
|
|
161
|
+
setSelectedEventSummary(event.resource);
|
|
162
|
+
setEventSummaryAnchor(anchor);
|
|
163
|
+
setEventSummaryOpen(true);
|
|
164
|
+
},
|
|
165
|
+
[]
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
const handleOpenSheetFromSummary = useCallback(() => {
|
|
169
|
+
if (!selectedEventSummary) return;
|
|
170
|
+
setEventSummaryOpen(false);
|
|
171
|
+
onOpenAulaSheet(selectedEventSummary);
|
|
172
|
+
}, [onOpenAulaSheet, selectedEventSummary]);
|
|
173
|
+
|
|
174
|
+
const handleOpenAttendanceFromSummary = useCallback(() => {
|
|
175
|
+
if (!selectedEventSummary) return;
|
|
176
|
+
setEventSummaryOpen(false);
|
|
177
|
+
onOpenAulaSheet(selectedEventSummary, { initialTab: 'chamada' });
|
|
178
|
+
}, [onOpenAulaSheet, selectedEventSummary]);
|
|
179
|
+
|
|
180
|
+
const handleSelectDay = useCallback(
|
|
181
|
+
(date: Date, anchor: { x: number; y: number }) => {
|
|
182
|
+
setQuickCreateSlot({
|
|
183
|
+
date: format(date, 'yyyy-MM-dd'),
|
|
184
|
+
startTime: defaultStartTime,
|
|
185
|
+
endTime: defaultEndTime,
|
|
186
|
+
});
|
|
187
|
+
setQuickCreateAnchor(anchor);
|
|
188
|
+
setQuickCreateOpen(true);
|
|
189
|
+
},
|
|
190
|
+
[defaultStartTime, defaultEndTime]
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
const handleQuickCreateMoreOptions = useCallback(
|
|
194
|
+
(values: {
|
|
195
|
+
titulo: string;
|
|
196
|
+
data: string;
|
|
197
|
+
horaInicio: string;
|
|
198
|
+
horaFim: string;
|
|
199
|
+
cor: string;
|
|
200
|
+
recurrenceFrequency?: 'none' | 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
201
|
+
recurrenceUntil?: string;
|
|
202
|
+
recurrenceDaysOfWeek?: Array<
|
|
203
|
+
'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU'
|
|
204
|
+
>;
|
|
205
|
+
attendance: PresencaItem[];
|
|
206
|
+
initialTab: 'aulas' | 'chamada';
|
|
207
|
+
}) => {
|
|
208
|
+
onOpenAulaSheet(undefined, {
|
|
209
|
+
initialTab: values.initialTab,
|
|
210
|
+
prefill: {
|
|
211
|
+
titulo: values.titulo,
|
|
212
|
+
data: values.data,
|
|
213
|
+
horaInicio: values.horaInicio,
|
|
214
|
+
horaFim: values.horaFim,
|
|
215
|
+
cor: values.cor,
|
|
216
|
+
recurrenceFrequency: values.recurrenceFrequency,
|
|
217
|
+
recurrenceUntil: values.recurrenceUntil,
|
|
218
|
+
recurrenceDaysOfWeek: values.recurrenceDaysOfWeek,
|
|
219
|
+
},
|
|
220
|
+
attendance: values.attendance,
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
[onOpenAulaSheet]
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
return (
|
|
227
|
+
<>
|
|
228
|
+
<div className="mb-4 flex items-center justify-between">
|
|
229
|
+
<p className="text-sm text-muted-foreground">{helperText}</p>
|
|
230
|
+
<Button size="sm" className="gap-2" onClick={onNewLesson}>
|
|
231
|
+
<Plus className="size-4" />
|
|
232
|
+
{newLessonLabel}
|
|
233
|
+
</Button>
|
|
234
|
+
</div>
|
|
235
|
+
|
|
236
|
+
{/* Unified custom calendar grid — all viewports */}
|
|
237
|
+
<MobileCalendar
|
|
238
|
+
events={events}
|
|
239
|
+
date={calendarDate}
|
|
240
|
+
locale={locale}
|
|
241
|
+
previousLabel={mobileCalendarLabels.previousLabel}
|
|
242
|
+
nextLabel={mobileCalendarLabels.nextLabel}
|
|
243
|
+
noEventsLabel={mobileCalendarLabels.noEventsLabel}
|
|
244
|
+
onNavigate={setCalendarDate}
|
|
245
|
+
onSelectEvent={handleSelectEvent}
|
|
246
|
+
onSelectDay={handleSelectDay}
|
|
247
|
+
getEventColor={getEventColor}
|
|
248
|
+
/>
|
|
249
|
+
|
|
250
|
+
<QuickCreateSessionPopover
|
|
251
|
+
open={quickCreateOpen}
|
|
252
|
+
onOpenChange={setQuickCreateOpen}
|
|
253
|
+
slot={quickCreateSlot}
|
|
254
|
+
anchor={quickCreateAnchor}
|
|
255
|
+
classId={classId}
|
|
256
|
+
students={alunos}
|
|
257
|
+
onSaved={onSessionSaved}
|
|
258
|
+
onMoreOptions={handleQuickCreateMoreOptions}
|
|
259
|
+
/>
|
|
260
|
+
|
|
261
|
+
<EventSummaryPopover
|
|
262
|
+
open={eventSummaryOpen}
|
|
263
|
+
onOpenChange={setEventSummaryOpen}
|
|
264
|
+
anchor={eventSummaryAnchor}
|
|
265
|
+
classId={classId}
|
|
266
|
+
event={selectedEventSummary}
|
|
267
|
+
onOpenSheet={handleOpenSheetFromSummary}
|
|
268
|
+
onRecordAttendance={handleOpenAttendanceFromSummary}
|
|
269
|
+
/>
|
|
270
|
+
</>
|
|
271
|
+
);
|
|
272
|
+
}
|