@hed-hog/lms 0.0.355 → 0.0.358

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 (115) hide show
  1. package/dist/course/course-audio-transcription.service.d.ts.map +1 -1
  2. package/dist/course/course-audio-transcription.service.js +15 -7
  3. package/dist/course/course-audio-transcription.service.js.map +1 -1
  4. package/dist/course/course-operations-integration.service.d.ts +31 -0
  5. package/dist/course/course-operations-integration.service.d.ts.map +1 -1
  6. package/dist/course/course-operations-integration.service.js +286 -22
  7. package/dist/course/course-operations-integration.service.js.map +1 -1
  8. package/dist/course/course-operations.controller.d.ts +10 -0
  9. package/dist/course/course-operations.controller.d.ts.map +1 -0
  10. package/dist/course/course-operations.controller.js +67 -0
  11. package/dist/course/course-operations.controller.js.map +1 -0
  12. package/dist/course/course-structure.controller.d.ts +15 -1
  13. package/dist/course/course-structure.controller.d.ts.map +1 -1
  14. package/dist/course/course-structure.service.d.ts +25 -1
  15. package/dist/course/course-structure.service.d.ts.map +1 -1
  16. package/dist/course/course-structure.service.js +160 -24
  17. package/dist/course/course-structure.service.js.map +1 -1
  18. package/dist/course/course.module.d.ts.map +1 -1
  19. package/dist/course/course.module.js +4 -1
  20. package/dist/course/course.module.js.map +1 -1
  21. package/dist/course/course.service.d.ts +4 -2
  22. package/dist/course/course.service.d.ts.map +1 -1
  23. package/dist/course/course.service.js +61 -2
  24. package/dist/course/course.service.js.map +1 -1
  25. package/dist/course/dto/create-course-structure-lesson.dto.d.ts +3 -0
  26. package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -1
  27. package/dist/course/dto/create-course-structure-lesson.dto.js +15 -0
  28. package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -1
  29. package/dist/course/dto/create-course-structure-session.dto.d.ts +1 -0
  30. package/dist/course/dto/create-course-structure-session.dto.d.ts.map +1 -1
  31. package/dist/course/dto/create-course-structure-session.dto.js +5 -0
  32. package/dist/course/dto/create-course-structure-session.dto.js.map +1 -1
  33. package/dist/course/dto/update-course-operations-config.dto.d.ts +6 -0
  34. package/dist/course/dto/update-course-operations-config.dto.d.ts.map +1 -0
  35. package/dist/course/dto/update-course-operations-config.dto.js +33 -0
  36. package/dist/course/dto/update-course-operations-config.dto.js.map +1 -0
  37. package/dist/course/lms-operations-task.subscriber.d.ts +13 -0
  38. package/dist/course/lms-operations-task.subscriber.d.ts.map +1 -0
  39. package/dist/course/lms-operations-task.subscriber.js +57 -0
  40. package/dist/course/lms-operations-task.subscriber.js.map +1 -0
  41. package/dist/enterprise/enterprise.service.js +1 -1
  42. package/dist/enterprise/enterprise.service.js.map +1 -1
  43. package/dist/enterprise/training/training-student.controller.d.ts +0 -95
  44. package/dist/enterprise/training/training-student.controller.d.ts.map +1 -1
  45. package/dist/enterprise/training/training-student.controller.js +1 -34
  46. package/dist/enterprise/training/training-student.controller.js.map +1 -1
  47. package/dist/enterprise/training/training-student.service.d.ts +63 -0
  48. package/dist/enterprise/training/training-student.service.d.ts.map +1 -1
  49. package/dist/enterprise/training/training-student.service.js +320 -4
  50. package/dist/enterprise/training/training-student.service.js.map +1 -1
  51. package/dist/instructor/instructor.service.d.ts.map +1 -1
  52. package/dist/instructor/instructor.service.js +12 -3
  53. package/dist/instructor/instructor.service.js.map +1 -1
  54. package/dist/lms.module.d.ts.map +1 -1
  55. package/dist/lms.module.js +2 -0
  56. package/dist/lms.module.js.map +1 -1
  57. package/dist/platforma/platforma.controller.d.ts +287 -0
  58. package/dist/platforma/platforma.controller.d.ts.map +1 -0
  59. package/dist/platforma/platforma.controller.js +147 -0
  60. package/dist/platforma/platforma.controller.js.map +1 -0
  61. package/hedhog/data/route.yaml +102 -9
  62. package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +2 -2
  63. package/hedhog/frontend/app/_components/course-form-sheet.tsx.ejs +10 -13
  64. package/hedhog/frontend/app/_lib/editor/templateSerializer.ts.ejs +26 -4
  65. package/hedhog/frontend/app/_lib/editor/types.ts.ejs +6 -0
  66. package/hedhog/frontend/app/certificates/models/CanvasStage.tsx.ejs +447 -31
  67. package/hedhog/frontend/app/certificates/models/LeftPanel.tsx.ejs +59 -47
  68. package/hedhog/frontend/app/certificates/models/RightPanel.tsx.ejs +201 -35
  69. package/hedhog/frontend/app/certificates/models/TemplateEditorPage.tsx.ejs +36 -5
  70. package/hedhog/frontend/app/classes/[id]/page.tsx.ejs +2 -2
  71. package/hedhog/frontend/app/courses/[id]/_components/course-edit-types.ts.ejs +1 -1
  72. package/hedhog/frontend/app/courses/[id]/structure/_components/confirm-dialog.tsx.ejs +17 -6
  73. package/hedhog/frontend/app/courses/[id]/structure/_components/course-operations-tab.tsx.ejs +382 -0
  74. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +45 -8
  75. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +177 -67
  76. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-session.tsx.ejs +25 -60
  77. package/hedhog/frontend/app/courses/[id]/structure/_components/mock-data.ts.ejs +1 -0
  78. package/hedhog/frontend/app/courses/[id]/structure/_components/store.ts.ejs +11 -0
  79. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-context-menu.tsx.ejs +22 -0
  80. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-lesson.tsx.ejs +79 -64
  81. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-session.tsx.ejs +31 -14
  82. package/hedhog/frontend/app/courses/[id]/structure/_components/types.ts.ejs +4 -4
  83. package/hedhog/frontend/app/courses/[id]/structure/_data/adapters/course-structure.adapter.ts.ejs +39 -27
  84. package/hedhog/frontend/app/courses/[id]/structure/_data/types/api-course.types.ts.ejs +24 -2
  85. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-mutations.ts.ejs +41 -6
  86. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-query.ts.ejs +2 -2
  87. package/hedhog/frontend/app/courses/page.tsx.ejs +80 -103
  88. package/hedhog/frontend/app/enterprise/_components/enterprise-course-create-sheet.tsx.ejs +1 -1
  89. package/hedhog/frontend/app/enterprise/_components/enterprise-course-edit-sheet.tsx.ejs +2 -2
  90. package/hedhog/frontend/app/enterprise/page.tsx.ejs +18 -6
  91. package/hedhog/frontend/app/exams/[id]/page.tsx.ejs +5 -4
  92. package/hedhog/frontend/app/instructors/_components/instructor-form-sheet.tsx.ejs +16 -10
  93. package/hedhog/frontend/app/paths/page.tsx.ejs +1 -1
  94. package/hedhog/frontend/app/training/page.tsx.ejs +1 -1
  95. package/hedhog/frontend/messages/en.json +7 -2
  96. package/hedhog/frontend/messages/pt.json +7 -2
  97. package/hedhog/table/course_lesson.yaml +2 -2
  98. package/hedhog/table/course_module.yaml +3 -0
  99. package/package.json +8 -8
  100. package/src/course/course-audio-transcription.service.ts +21 -8
  101. package/src/course/course-operations-integration.service.ts +460 -22
  102. package/src/course/course-operations.controller.ts +45 -0
  103. package/src/course/course-structure.service.ts +209 -4
  104. package/src/course/course.module.ts +4 -1
  105. package/src/course/course.service.ts +67 -1
  106. package/src/course/dto/create-course-structure-lesson.dto.ts +17 -0
  107. package/src/course/dto/create-course-structure-session.dto.ts +13 -1
  108. package/src/course/dto/update-course-operations-config.dto.ts +16 -0
  109. package/src/course/lms-operations-task.subscriber.ts +44 -0
  110. package/src/enterprise/enterprise.service.ts +1 -1
  111. package/src/enterprise/training/training-student.controller.ts +3 -27
  112. package/src/enterprise/training/training-student.service.ts +350 -2
  113. package/src/instructor/instructor.service.ts +12 -3
  114. package/src/lms.module.ts +2 -0
  115. package/src/platforma/platforma.controller.ts +92 -0
@@ -0,0 +1,67 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.CourseOperationsController = void 0;
16
+ const api_1 = require("@hed-hog/api");
17
+ const common_1 = require("@nestjs/common");
18
+ const course_operations_integration_service_1 = require("./course-operations-integration.service");
19
+ const update_course_operations_config_dto_1 = require("./dto/update-course-operations-config.dto");
20
+ let CourseOperationsController = class CourseOperationsController {
21
+ constructor(operationsIntegration) {
22
+ this.operationsIntegration = operationsIntegration;
23
+ }
24
+ getConfig(courseId) {
25
+ return this.operationsIntegration.getOperationsConfig(courseId);
26
+ }
27
+ updateConfig(courseId, dto) {
28
+ return this.operationsIntegration.updateOperationsConfig(courseId, {
29
+ projectId: dto.projectId,
30
+ taskMode: dto.taskMode,
31
+ completionStatus: dto.completionStatus,
32
+ });
33
+ }
34
+ recreateTasks(courseId) {
35
+ return this.operationsIntegration.createMissingTasksForCourseLessons(courseId);
36
+ }
37
+ };
38
+ exports.CourseOperationsController = CourseOperationsController;
39
+ __decorate([
40
+ (0, common_1.Get)(),
41
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
42
+ __metadata("design:type", Function),
43
+ __metadata("design:paramtypes", [Number]),
44
+ __metadata("design:returntype", void 0)
45
+ ], CourseOperationsController.prototype, "getConfig", null);
46
+ __decorate([
47
+ (0, common_1.Patch)(),
48
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
49
+ __param(1, (0, common_1.Body)()),
50
+ __metadata("design:type", Function),
51
+ __metadata("design:paramtypes", [Number, update_course_operations_config_dto_1.UpdateCourseOperationsConfigDto]),
52
+ __metadata("design:returntype", void 0)
53
+ ], CourseOperationsController.prototype, "updateConfig", null);
54
+ __decorate([
55
+ (0, common_1.Post)('recreate-tasks'),
56
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
57
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
58
+ __metadata("design:type", Function),
59
+ __metadata("design:paramtypes", [Number]),
60
+ __metadata("design:returntype", void 0)
61
+ ], CourseOperationsController.prototype, "recreateTasks", null);
62
+ exports.CourseOperationsController = CourseOperationsController = __decorate([
63
+ (0, api_1.Role)(),
64
+ (0, common_1.Controller)('lms/courses/:id/operations'),
65
+ __metadata("design:paramtypes", [course_operations_integration_service_1.CourseOperationsIntegrationService])
66
+ ], CourseOperationsController);
67
+ //# sourceMappingURL=course-operations.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-operations.controller.js","sourceRoot":"","sources":["../../src/course/course-operations.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAoC;AACpC,2CAUwB;AACxB,mGAA6F;AAC7F,mGAA4F;AAIrF,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YACmB,qBAAyD;QAAzD,0BAAqB,GAArB,qBAAqB,CAAoC;IACzE,CAAC;IAGJ,SAAS,CAA4B,QAAgB;QACnD,OAAO,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAGD,YAAY,CACiB,QAAgB,EACnC,GAAoC;QAE5C,OAAO,IAAI,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,QAAQ,EAAE;YACjE,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;SACvC,CAAC,CAAC;IACL,CAAC;IAID,aAAa,CAA4B,QAAgB;QACvD,OAAO,IAAI,CAAC,qBAAqB,CAAC,kCAAkC,CAAC,QAAQ,CAAC,CAAC;IACjF,CAAC;CACF,CAAA;AA3BY,gEAA0B;AAMrC;IADC,IAAA,YAAG,GAAE;IACK,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;;;;2DAEnC;AAGD;IADC,IAAA,cAAK,GAAE;IAEL,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,qEAA+B;;8DAO7C;AAID;IAFC,IAAA,aAAI,EAAC,gBAAgB,CAAC;IACtB,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IACT,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;;;;+DAEvC;qCA1BU,0BAA0B;IAFtC,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,4BAA4B,CAAC;qCAGG,0EAAkC;GAFjE,0BAA0B,CA2BtC"}
@@ -21,6 +21,7 @@ export declare class CourseStructureController {
21
21
  codigo: string;
22
22
  titulo: string;
23
23
  duracao: number;
24
+ published: boolean;
24
25
  collapsed: boolean;
25
26
  }[];
26
27
  aulas: {
@@ -39,6 +40,8 @@ export declare class CourseStructureController {
39
40
  videoConversionJobId: any;
40
41
  exameVinculado: string;
41
42
  conteudoPost: any;
43
+ statusProducao: "preparada" | "gravada" | "editada" | "finalizada" | "publicada";
44
+ published: boolean;
42
45
  recursos: {
43
46
  id: string;
44
47
  nome: string;
@@ -57,7 +60,8 @@ export declare class CourseStructureController {
57
60
  instrutores: {
58
61
  id: string;
59
62
  role: import("@prisma/client").$Enums.course_lesson_instructor_role_300ba1a5e9_enum;
60
- nome: string;
63
+ name: string;
64
+ avatarId: number;
61
65
  }[];
62
66
  operationsTaskId: number;
63
67
  operationsTaskName: string;
@@ -66,6 +70,7 @@ export declare class CourseStructureController {
66
70
  instructors: {
67
71
  id: number;
68
72
  name: string;
73
+ avatarId: number;
69
74
  }[];
70
75
  curso: {
71
76
  id: string;
@@ -105,6 +110,7 @@ export declare class CourseStructureController {
105
110
  codigo: string;
106
111
  titulo: string;
107
112
  duracao: number;
113
+ published: boolean;
108
114
  collapsed: boolean;
109
115
  }>;
110
116
  reorderSessions(courseId: number, dto: ReorderSessionsDto): Promise<{
@@ -115,6 +121,7 @@ export declare class CourseStructureController {
115
121
  codigo: string;
116
122
  titulo: string;
117
123
  duracao: number;
124
+ published: boolean;
118
125
  collapsed: boolean;
119
126
  }>;
120
127
  deleteSession(courseId: number, sessionId: number): Promise<{
@@ -126,6 +133,7 @@ export declare class CourseStructureController {
126
133
  codigo: string;
127
134
  titulo: string;
128
135
  duracao: number;
136
+ published: boolean;
129
137
  collapsed: boolean;
130
138
  };
131
139
  lessons: any[];
@@ -145,6 +153,8 @@ export declare class CourseStructureController {
145
153
  transcricao: any;
146
154
  videoConversionJobId: any;
147
155
  exameVinculado: string;
156
+ statusProducao: "preparada" | "gravada" | "editada" | "finalizada" | "publicada";
157
+ published: boolean;
148
158
  conteudoPost: any;
149
159
  recursos: {
150
160
  id: string;
@@ -184,6 +194,8 @@ export declare class CourseStructureController {
184
194
  transcricao: any;
185
195
  videoConversionJobId: any;
186
196
  exameVinculado: string;
197
+ statusProducao: "preparada" | "gravada" | "editada" | "finalizada" | "publicada";
198
+ published: boolean;
187
199
  conteudoPost: any;
188
200
  recursos: {
189
201
  id: string;
@@ -244,6 +256,8 @@ export declare class CourseStructureController {
244
256
  transcricao: any;
245
257
  videoConversionJobId: any;
246
258
  exameVinculado: string;
259
+ statusProducao: "preparada" | "gravada" | "editada" | "finalizada" | "publicada";
260
+ published: boolean;
247
261
  conteudoPost: any;
248
262
  recursos: {
249
263
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"course-structure.controller.d.ts","sourceRoot":"","sources":["../../src/course/course-structure.controller.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAC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AG,EAAE,0BAA0B;;;;;;IAWzC,iBAAiB,CACY,QAAQ,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACvC,GAAG,EAAE,0BAA0B;;;;;;IAYzC,eAAe,CACc,QAAQ,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpD"}
1
+ {"version":3,"file":"course-structure.controller.d.ts","sourceRoot":"","sources":["../../src/course/course-structure.controller.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EACH,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAE5F,qBAEa,yBAAyB;IAElC,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,4BAA4B;gBAD5B,sBAAsB,EAAE,sBAAsB,EAC9C,4B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,2BAA2B,CACjB,EAAE,EAAE,EAAE,MAAM,EAAE;;KAAA,EACK,QAAQ,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EACzC,GAAG,EAAE,8BAA8B;;;;IAY7C,YAAY,CACiB,QAAQ,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM;;;IAMnD,iBAAiB,CACY,QAAQ,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM;;;IAMjD,iBAAiB,CACY,QAAQ,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EACzC,GAAG,EAAE,0BAA0B;;;;;;IAWzC,iBAAiB,CACY,QAAQ,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACvC,GAAG,EAAE,0BAA0B;;;;;;IAYzC,eAAe,CACc,QAAQ,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpD"}
@@ -15,6 +15,7 @@ import { UpdateCourseStructureLessonDto } from './dto/update-course-structure-le
15
15
  import { UpdateCourseStructureSessionDto } from './dto/update-course-structure-session.dto';
16
16
  import { UpdateTranscriptionSegmentsDTO } from './dto/update-transcription-segments.dto';
17
17
  type LessonUiType = 'video' | 'questao' | 'post' | 'exercicio';
18
+ type LessonProductionStatus = 'preparada' | 'gravada' | 'editada' | 'finalizada' | 'publicada';
18
19
  type LessonFileType = 'video_original' | `video_profile:${number}` | 'lesson_audio' | 'student_download' | 'supplementary_material';
19
20
  export declare class CourseStructureService {
20
21
  private readonly prisma;
@@ -28,6 +29,7 @@ export declare class CourseStructureService {
28
29
  codigo: string;
29
30
  titulo: string;
30
31
  duracao: number;
32
+ published: boolean;
31
33
  collapsed: boolean;
32
34
  }[];
33
35
  aulas: {
@@ -46,6 +48,8 @@ export declare class CourseStructureService {
46
48
  videoConversionJobId: any;
47
49
  exameVinculado: string;
48
50
  conteudoPost: any;
51
+ statusProducao: LessonProductionStatus;
52
+ published: boolean;
49
53
  recursos: {
50
54
  id: string;
51
55
  nome: string;
@@ -64,7 +68,8 @@ export declare class CourseStructureService {
64
68
  instrutores: {
65
69
  id: string;
66
70
  role: import("@prisma/client").$Enums.course_lesson_instructor_role_300ba1a5e9_enum;
67
- nome: string;
71
+ name: string;
72
+ avatarId: number;
68
73
  }[];
69
74
  operationsTaskId: number;
70
75
  operationsTaskName: string;
@@ -73,6 +78,7 @@ export declare class CourseStructureService {
73
78
  instructors: {
74
79
  id: number;
75
80
  name: string;
81
+ avatarId: number;
76
82
  }[];
77
83
  curso: {
78
84
  id: string;
@@ -112,6 +118,7 @@ export declare class CourseStructureService {
112
118
  codigo: string;
113
119
  titulo: string;
114
120
  duracao: number;
121
+ published: boolean;
115
122
  collapsed: boolean;
116
123
  }>;
117
124
  updateSession(courseId: number, sessionId: number, dto: UpdateCourseStructureSessionDto): Promise<{
@@ -119,6 +126,7 @@ export declare class CourseStructureService {
119
126
  codigo: string;
120
127
  titulo: string;
121
128
  duracao: number;
129
+ published: boolean;
122
130
  collapsed: boolean;
123
131
  }>;
124
132
  deleteSession(courseId: number, sessionId: number): Promise<{
@@ -139,6 +147,8 @@ export declare class CourseStructureService {
139
147
  transcricao: any;
140
148
  videoConversionJobId: any;
141
149
  exameVinculado: string;
150
+ statusProducao: LessonProductionStatus;
151
+ published: boolean;
142
152
  conteudoPost: any;
143
153
  recursos: {
144
154
  id: string;
@@ -172,6 +182,8 @@ export declare class CourseStructureService {
172
182
  transcricao: any;
173
183
  videoConversionJobId: any;
174
184
  exameVinculado: string;
185
+ statusProducao: LessonProductionStatus;
186
+ published: boolean;
175
187
  conteudoPost: any;
176
188
  recursos: {
177
189
  id: string;
@@ -223,6 +235,7 @@ export declare class CourseStructureService {
223
235
  codigo: string;
224
236
  titulo: string;
225
237
  duracao: number;
238
+ published: boolean;
226
239
  collapsed: boolean;
227
240
  };
228
241
  lessons: any[];
@@ -242,6 +255,8 @@ export declare class CourseStructureService {
242
255
  transcricao: any;
243
256
  videoConversionJobId: any;
244
257
  exameVinculado: string;
258
+ statusProducao: LessonProductionStatus;
259
+ published: boolean;
245
260
  conteudoPost: any;
246
261
  recursos: {
247
262
  id: string;
@@ -274,6 +289,15 @@ export declare class CourseStructureService {
274
289
  private mapUiTypeToDbType;
275
290
  private mapDbTypeToUiType;
276
291
  private serializeContent;
292
+ private normalizeProductionStatus;
293
+ private normalizeIdList;
294
+ private buildIdCsv;
295
+ private getSessionPublishedByIds;
296
+ private getSessionPublished;
297
+ private setSessionPublished;
298
+ private getLessonPublishedByIds;
299
+ private getLessonPublished;
300
+ private setLessonPublished;
277
301
  private parseLessonContent;
278
302
  private normalizeLessonFileType;
279
303
  private readLessonFileType;
@@ -1 +1 @@
1
- {"version":3,"file":"course-structure.service.d.ts","sourceRoot":"","sources":["../../src/course/course-structure.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kB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;;;;;;;;IAsHpD,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6FrE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe;;;IA8F5E,wBAAwB,CAAC,QAAQ,EAAE,MAAM;IAazC,2BAA2B,CAC/B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,8BAA8B;IAiB/B,aAAa,CAAC,QAAQ,EAAE,MAAM;YActB,mBAAmB;YAiFnB,aAAa;YAyFb,kBAAkB;YAWlB,eAAe;YAUf,eAAe;IAU7B,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,gBAAgB;IAuCxB,OAAO,CAAC,yBAAyB;IAejC,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,UAAU;YAIJ,wBAAwB;YAuBxB,mBAAmB;YAUnB,mBAAmB;YAMnB,uBAAuB;YAuBvB,kBAAkB;YAUlB,kBAAkB;IAUhC,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,uBAAuB;IAuB/B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,0BAA0B;IAalC,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,UAAU;CAGnB"}
@@ -56,6 +56,7 @@ let CourseStructureService = class CourseStructureService {
56
56
  person: {
57
57
  select: {
58
58
  name: true,
59
+ avatar_id: true,
59
60
  },
60
61
  },
61
62
  },
@@ -81,20 +82,26 @@ let CourseStructureService = class CourseStructureService {
81
82
  }),
82
83
  this.operationsIntegration.getCourseProjectLinks([courseId]),
83
84
  ]);
84
- const lessonTaskLinks = await this.operationsIntegration.getLessonTaskLinks(modules.flatMap((module) => module.course_lesson.map((lesson) => lesson.id)));
85
+ const lessonIds = modules.flatMap((module) => module.course_lesson.map((lesson) => lesson.id));
86
+ const [lessonTaskLinks, sessionPublishedById, lessonPublishedById] = await Promise.all([
87
+ this.operationsIntegration.getLessonTaskLinks(lessonIds),
88
+ this.getSessionPublishedByIds(modules.map((module) => module.id)),
89
+ this.getLessonPublishedByIds(lessonIds),
90
+ ]);
85
91
  const courseProject = courseProjectLinks.get(courseId);
86
92
  const sessoes = modules.map((module, index) => {
87
- var _a, _b;
93
+ var _a, _b, _c;
88
94
  return ({
89
95
  id: String(module.id),
90
96
  codigo: this.formatCode('S', (_a = module.order) !== null && _a !== void 0 ? _a : index + 1),
91
97
  titulo: module.title,
92
98
  duracao: (_b = module.duration_minutes) !== null && _b !== void 0 ? _b : 0,
99
+ published: (_c = sessionPublishedById.get(module.id)) !== null && _c !== void 0 ? _c : false,
93
100
  collapsed: false,
94
101
  });
95
102
  });
96
103
  const aulas = modules.flatMap((module) => module.course_lesson.map((lesson, index) => {
97
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
104
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
98
105
  const parsedContent = this.parseLessonContent(lesson.content);
99
106
  const tipo = this.mapDbTypeToUiType(lesson.type, parsedContent === null || parsedContent === void 0 ? void 0 : parsedContent.sourceType);
100
107
  return {
@@ -117,6 +124,8 @@ let CourseStructureService = class CourseStructureService {
117
124
  ? String(lesson.course_lesson_question[0].question_id)
118
125
  : undefined,
119
126
  conteudoPost: parsedContent === null || parsedContent === void 0 ? void 0 : parsedContent.conteudoPost,
127
+ statusProducao: this.normalizeProductionStatus(parsedContent === null || parsedContent === void 0 ? void 0 : parsedContent.statusProducao),
128
+ published: (_f = lessonPublishedById.get(lesson.id)) !== null && _f !== void 0 ? _f : false,
120
129
  recursos: lesson.course_lesson_file.map((fileLink) => ({
121
130
  id: String(fileLink.id),
122
131
  nome: fileLink.title,
@@ -136,25 +145,30 @@ let CourseStructureService = class CourseStructureService {
136
145
  });
137
146
  }),
138
147
  instrutores: lesson.course_lesson_instructor.map((item) => {
139
- var _a;
148
+ var _a, _b, _c, _d;
140
149
  return ({
141
150
  id: String(item.instructor_id),
142
151
  role: item.role,
143
- nome: this.personName((_a = item.instructor) === null || _a === void 0 ? void 0 : _a.person),
152
+ name: this.personName((_a = item.instructor) === null || _a === void 0 ? void 0 : _a.person),
153
+ avatarId: (_d = (_c = (_b = item.instructor) === null || _b === void 0 ? void 0 : _b.person) === null || _c === void 0 ? void 0 : _c.avatar_id) !== null && _d !== void 0 ? _d : null,
144
154
  });
145
155
  }),
146
- operationsTaskId: (_g = (_f = lessonTaskLinks.get(lesson.id)) === null || _f === void 0 ? void 0 : _f.taskId) !== null && _g !== void 0 ? _g : null,
147
- operationsTaskName: (_j = (_h = lessonTaskLinks.get(lesson.id)) === null || _h === void 0 ? void 0 : _h.taskName) !== null && _j !== void 0 ? _j : null,
148
- operationsTaskStatus: (_l = (_k = lessonTaskLinks.get(lesson.id)) === null || _k === void 0 ? void 0 : _k.taskStatus) !== null && _l !== void 0 ? _l : null,
156
+ operationsTaskId: (_h = (_g = lessonTaskLinks.get(lesson.id)) === null || _g === void 0 ? void 0 : _g.taskId) !== null && _h !== void 0 ? _h : null,
157
+ operationsTaskName: (_k = (_j = lessonTaskLinks.get(lesson.id)) === null || _j === void 0 ? void 0 : _j.taskName) !== null && _k !== void 0 ? _k : null,
158
+ operationsTaskStatus: (_m = (_l = lessonTaskLinks.get(lesson.id)) === null || _l === void 0 ? void 0 : _l.taskStatus) !== null && _m !== void 0 ? _m : null,
149
159
  };
150
160
  }));
151
161
  return {
152
162
  sessoes,
153
163
  aulas,
154
- instructors: instructors.map((instructor) => ({
155
- id: instructor.id,
156
- name: instructor.name,
157
- })),
164
+ instructors: instructors.map((instructor) => {
165
+ var _a;
166
+ return ({
167
+ id: instructor.id,
168
+ name: instructor.name,
169
+ avatarId: (_a = instructor.avatarId) !== null && _a !== void 0 ? _a : null,
170
+ });
171
+ }),
158
172
  curso: courseRecord
159
173
  ? {
160
174
  id: String(courseRecord.id),
@@ -207,7 +221,7 @@ let CourseStructureService = class CourseStructureService {
207
221
  return this.getCourseResources(courseId);
208
222
  }
209
223
  async createSession(courseId, dto) {
210
- var _a, _b, _c;
224
+ var _a, _b, _c, _d;
211
225
  await this.ensureCourseExists(courseId);
212
226
  const nextOrder = await this.nextModuleOrder(courseId);
213
227
  const created = await this.prisma.course_module.create({
@@ -219,16 +233,19 @@ let CourseStructureService = class CourseStructureService {
219
233
  order: nextOrder,
220
234
  },
221
235
  });
236
+ const published = (_b = dto.published) !== null && _b !== void 0 ? _b : false;
237
+ await this.setSessionPublished(created.id, published);
222
238
  return {
223
239
  id: String(created.id),
224
- codigo: this.formatCode('S', (_b = created.order) !== null && _b !== void 0 ? _b : nextOrder),
240
+ codigo: this.formatCode('S', (_c = created.order) !== null && _c !== void 0 ? _c : nextOrder),
225
241
  titulo: created.title,
226
- duracao: (_c = created.duration_minutes) !== null && _c !== void 0 ? _c : 0,
242
+ duracao: (_d = created.duration_minutes) !== null && _d !== void 0 ? _d : 0,
243
+ published,
227
244
  collapsed: false,
228
245
  };
229
246
  }
230
247
  async updateSession(courseId, sessionId, dto) {
231
- var _a, _b;
248
+ var _a, _b, _c;
232
249
  const module = await this.prisma.course_module.findFirst({
233
250
  where: { id: sessionId, course_id: courseId },
234
251
  include: {
@@ -246,11 +263,16 @@ let CourseStructureService = class CourseStructureService {
246
263
  where: { id: sessionId },
247
264
  data: Object.assign(Object.assign(Object.assign({}, (dto.titulo !== undefined && { title: dto.titulo })), (dto.descricao !== undefined && { description: dto.descricao })), (dto.duracao !== undefined && { duration_minutes: dto.duracao })),
248
265
  });
266
+ const published = (_a = dto.published) !== null && _a !== void 0 ? _a : (await this.getSessionPublished(sessionId));
267
+ if (dto.published !== undefined) {
268
+ await this.setSessionPublished(sessionId, dto.published);
269
+ }
249
270
  return {
250
271
  id: String(updated.id),
251
- codigo: this.formatCode('S', (_a = updated.order) !== null && _a !== void 0 ? _a : 0),
272
+ codigo: this.formatCode('S', (_b = updated.order) !== null && _b !== void 0 ? _b : 0),
252
273
  titulo: updated.title,
253
- duracao: (_b = updated.duration_minutes) !== null && _b !== void 0 ? _b : 0,
274
+ duracao: (_c = updated.duration_minutes) !== null && _c !== void 0 ? _c : 0,
275
+ published,
254
276
  collapsed: false,
255
277
  };
256
278
  }
@@ -286,30 +308,41 @@ let CourseStructureService = class CourseStructureService {
286
308
  throw new common_1.NotFoundException('Session not found for this course');
287
309
  }
288
310
  const created = await this.prisma.$transaction(async (tx) => {
289
- var _a, _b, _c, _d, _e, _f;
311
+ var _a, _b, _c, _d, _e, _f, _g;
290
312
  const nextOrder = await this.nextLessonOrder(sessionId, tx);
291
313
  const mappedType = this.mapUiTypeToDbType(dto.tipo);
314
+ const normalizedStatus = this.normalizeProductionStatus(dto.statusProducao);
315
+ const shouldPublish = (_a = dto.published) !== null && _a !== void 0 ? _a : false;
316
+ if (shouldPublish &&
317
+ normalizedStatus !== 'publicada' &&
318
+ !dto.confirmarPublicacaoComStatus) {
319
+ throw new common_1.BadRequestException('LESSON_PUBLISH_REQUIRES_STATUS_CONFIRMATION');
320
+ }
321
+ const statusProducao = shouldPublish && dto.confirmarPublicacaoComStatus
322
+ ? 'publicada'
323
+ : normalizedStatus;
292
324
  const lesson = await tx.course_lesson.create({
293
325
  data: {
294
326
  course_module_id: sessionId,
295
327
  title: dto.titulo,
296
- description: (_a = dto.descricaoPublica) !== null && _a !== void 0 ? _a : null,
328
+ description: (_b = dto.descricaoPublica) !== null && _b !== void 0 ? _b : null,
297
329
  type: mappedType,
298
330
  duration_seconds: dto.duracao * 60,
299
331
  order: nextOrder,
300
- content: this.serializeContent(dto),
332
+ content: this.serializeContent(Object.assign(Object.assign({}, dto), { statusProducao })),
301
333
  },
302
334
  });
335
+ await this.setLessonPublished(lesson.id, shouldPublish, tx);
303
336
  await this.syncLessonRelations(lesson.id, dto, tx);
304
337
  const projectLinks = await this.operationsIntegration.getCourseProjectLinks([courseId], tx);
305
338
  await this.operationsIntegration.createTaskForLesson(tx, {
306
339
  courseId,
307
340
  lessonId: lesson.id,
308
- projectId: (_c = (_b = projectLinks.get(courseId)) === null || _b === void 0 ? void 0 : _b.projectId) !== null && _c !== void 0 ? _c : null,
309
- courseTitle: (_e = (_d = module.course) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : null,
341
+ projectId: (_d = (_c = projectLinks.get(courseId)) === null || _c === void 0 ? void 0 : _c.projectId) !== null && _d !== void 0 ? _d : null,
342
+ courseTitle: (_f = (_e = module.course) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : null,
310
343
  sessionTitle: module.title,
311
344
  lessonTitle: dto.titulo,
312
- lessonDescription: (_f = dto.descricaoPublica) !== null && _f !== void 0 ? _f : null,
345
+ lessonDescription: (_g = dto.descricaoPublica) !== null && _g !== void 0 ? _g : null,
313
346
  });
314
347
  return lesson;
315
348
  });
@@ -343,8 +376,25 @@ let CourseStructureService = class CourseStructureService {
343
376
  conteudoPost: dto.conteudoPost,
344
377
  exameVinculado: dto.exameVinculado,
345
378
  descricaoPrivada: dto.descricaoPrivada,
379
+ statusProducao: (() => {
380
+ var _a;
381
+ const parsed = this.parseLessonContent(lesson.content);
382
+ const currentStatus = this.normalizeProductionStatus(parsed === null || parsed === void 0 ? void 0 : parsed.statusProducao);
383
+ const nextStatus = this.normalizeProductionStatus((_a = dto.statusProducao) !== null && _a !== void 0 ? _a : currentStatus);
384
+ const shouldPublish = dto.published;
385
+ if (shouldPublish === true && nextStatus !== 'publicada') {
386
+ if (!dto.confirmarPublicacaoComStatus) {
387
+ throw new common_1.BadRequestException('LESSON_PUBLISH_REQUIRES_STATUS_CONFIRMATION');
388
+ }
389
+ return 'publicada';
390
+ }
391
+ return nextStatus;
392
+ })(),
346
393
  }) }),
347
394
  });
395
+ if (dto.published !== undefined) {
396
+ await this.setLessonPublished(lessonId, dto.published);
397
+ }
348
398
  await this.syncLessonRelations(lessonId, dto);
349
399
  await this.operationsIntegration.syncTaskForLesson(lessonId);
350
400
  return this.getLessonById(updated.id);
@@ -360,6 +410,7 @@ let CourseStructureService = class CourseStructureService {
360
410
  if (!lesson) {
361
411
  throw new common_1.NotFoundException('Lesson not found for this session');
362
412
  }
413
+ await this.operationsIntegration.deleteTasksForLesson(lessonId, this.prisma);
363
414
  await this.prisma.course_lesson.delete({ where: { id: lessonId } });
364
415
  return { success: true };
365
416
  }
@@ -603,6 +654,8 @@ let CourseStructureService = class CourseStructureService {
603
654
  order: nextOrder,
604
655
  },
605
656
  });
657
+ const sourcePublished = await this.getSessionPublished(sourceModule.id);
658
+ await this.setSessionPublished(newModule.id, sourcePublished);
606
659
  const newLessons = [];
607
660
  const projectLinks = await this.operationsIntegration.getCourseProjectLinks([
608
661
  courseId,
@@ -621,6 +674,8 @@ let CourseStructureService = class CourseStructureService {
621
674
  order: lessonOrder,
622
675
  },
623
676
  });
677
+ const lessonPublished = await this.getLessonPublished(lesson.id);
678
+ await this.setLessonPublished(newLesson.id, lessonPublished);
624
679
  if (lesson.course_lesson_file.length > 0) {
625
680
  await this.prisma.course_lesson_file.createMany({
626
681
  data: lesson.course_lesson_file.map((f) => (Object.assign({ course_lesson_id: newLesson.id, title: f.title, file_id: f.file_id }, this.buildLessonFilePersistence(f.type, f.is_public)))),
@@ -661,6 +716,7 @@ let CourseStructureService = class CourseStructureService {
661
716
  codigo: this.formatCode('S', (_e = newModule.order) !== null && _e !== void 0 ? _e : nextOrder),
662
717
  titulo: newModule.title,
663
718
  duracao: (_f = newModule.duration_minutes) !== null && _f !== void 0 ? _f : 0,
719
+ published: sourcePublished,
664
720
  collapsed: false,
665
721
  },
666
722
  lessons: newLessons,
@@ -709,6 +765,8 @@ let CourseStructureService = class CourseStructureService {
709
765
  order: nextOrder,
710
766
  },
711
767
  });
768
+ const sourcePublished = await this.getLessonPublished(sourceLesson.id);
769
+ await this.setLessonPublished(newLesson.id, sourcePublished);
712
770
  if (sourceLesson.course_lesson_file.length > 0) {
713
771
  await this.prisma.course_lesson_file.createMany({
714
772
  data: sourceLesson.course_lesson_file.map((f) => (Object.assign({ course_lesson_id: newLesson.id, title: f.title, file_id: f.file_id }, this.buildLessonFilePersistence(f.type, f.is_public)))),
@@ -784,6 +842,8 @@ let CourseStructureService = class CourseStructureService {
784
842
  order: lessonOrder,
785
843
  },
786
844
  });
845
+ const sourcePublished = await this.getLessonPublished(lesson.id);
846
+ await this.setLessonPublished(newLesson.id, sourcePublished);
787
847
  if (lesson.course_lesson_file.length > 0) {
788
848
  await this.prisma.course_lesson_file.createMany({
789
849
  data: lesson.course_lesson_file.map((f) => (Object.assign({ course_lesson_id: newLesson.id, title: f.title, file_id: f.file_id }, this.buildLessonFilePersistence(f.type, f.is_public)))),
@@ -958,6 +1018,7 @@ let CourseStructureService = class CourseStructureService {
958
1018
  const taskLinks = await this.operationsIntegration.getLessonTaskLinks([
959
1019
  lessonId,
960
1020
  ]);
1021
+ const lessonPublished = await this.getLessonPublished(lessonId);
961
1022
  const parsedContent = this.parseLessonContent(lesson.content);
962
1023
  const tipo = this.mapDbTypeToUiType(lesson.type, parsedContent === null || parsedContent === void 0 ? void 0 : parsedContent.sourceType);
963
1024
  return {
@@ -979,6 +1040,8 @@ let CourseStructureService = class CourseStructureService {
979
1040
  : ((_e = lesson.course_lesson_question[0]) === null || _e === void 0 ? void 0 : _e.question_id) != null
980
1041
  ? String(lesson.course_lesson_question[0].question_id)
981
1042
  : undefined,
1043
+ statusProducao: this.normalizeProductionStatus(parsedContent === null || parsedContent === void 0 ? void 0 : parsedContent.statusProducao),
1044
+ published: lessonPublished,
982
1045
  conteudoPost: parsedContent === null || parsedContent === void 0 ? void 0 : parsedContent.conteudoPost,
983
1046
  recursos: lesson.course_lesson_file.map((fileLink) => ({
984
1047
  id: String(fileLink.id),
@@ -1053,6 +1116,7 @@ let CourseStructureService = class CourseStructureService {
1053
1116
  const payload = {
1054
1117
  sourceType: data.tipo,
1055
1118
  descricaoPrivada: (_a = data.descricaoPrivada) !== null && _a !== void 0 ? _a : '',
1119
+ statusProducao: this.normalizeProductionStatus(data.statusProducao),
1056
1120
  };
1057
1121
  if (data.tipo === 'video') {
1058
1122
  payload.videoProvedor = (_b = data.videoProvedor) !== null && _b !== void 0 ? _b : 'file_storage';
@@ -1071,6 +1135,78 @@ let CourseStructureService = class CourseStructureService {
1071
1135
  }
1072
1136
  return JSON.stringify(payload);
1073
1137
  }
1138
+ normalizeProductionStatus(value) {
1139
+ if (!value)
1140
+ return 'preparada';
1141
+ const normalized = String(value).trim().toLowerCase();
1142
+ if (normalized === 'preparada')
1143
+ return 'preparada';
1144
+ if (normalized === 'gravada')
1145
+ return 'gravada';
1146
+ if (normalized === 'editada')
1147
+ return 'editada';
1148
+ if (normalized === 'finalizada')
1149
+ return 'finalizada';
1150
+ if (normalized === 'publicada')
1151
+ return 'publicada';
1152
+ return 'preparada';
1153
+ }
1154
+ normalizeIdList(ids) {
1155
+ return ids
1156
+ .map((id) => Number(id))
1157
+ .filter((id) => Number.isInteger(id) && id > 0);
1158
+ }
1159
+ buildIdCsv(ids) {
1160
+ return this.normalizeIdList(ids).join(',');
1161
+ }
1162
+ async getSessionPublishedByIds(sessionIds) {
1163
+ const publishedById = new Map();
1164
+ const csv = this.buildIdCsv(sessionIds);
1165
+ if (!csv)
1166
+ return publishedById;
1167
+ try {
1168
+ const rows = await this.prisma.$queryRawUnsafe(`SELECT id, published FROM course_module WHERE id IN (${csv})`);
1169
+ for (const row of rows) {
1170
+ publishedById.set(row.id, Boolean(row.published));
1171
+ }
1172
+ }
1173
+ catch (_a) {
1174
+ return publishedById;
1175
+ }
1176
+ return publishedById;
1177
+ }
1178
+ async getSessionPublished(sessionId) {
1179
+ var _a;
1180
+ const rows = await this.prisma.$queryRawUnsafe(`SELECT published FROM course_module WHERE id = ${Number(sessionId)} LIMIT 1`);
1181
+ return Boolean((_a = rows[0]) === null || _a === void 0 ? void 0 : _a.published);
1182
+ }
1183
+ async setSessionPublished(sessionId, published) {
1184
+ await this.prisma.$executeRawUnsafe(`UPDATE course_module SET published = ${published ? 'true' : 'false'} WHERE id = ${Number(sessionId)}`);
1185
+ }
1186
+ async getLessonPublishedByIds(lessonIds) {
1187
+ const publishedById = new Map();
1188
+ const csv = this.buildIdCsv(lessonIds);
1189
+ if (!csv)
1190
+ return publishedById;
1191
+ try {
1192
+ const rows = await this.prisma.$queryRawUnsafe(`SELECT id, published FROM course_lesson WHERE id IN (${csv})`);
1193
+ for (const row of rows) {
1194
+ publishedById.set(row.id, Boolean(row.published));
1195
+ }
1196
+ }
1197
+ catch (_a) {
1198
+ return publishedById;
1199
+ }
1200
+ return publishedById;
1201
+ }
1202
+ async getLessonPublished(lessonId) {
1203
+ var _a;
1204
+ const rows = await this.prisma.$queryRawUnsafe(`SELECT published FROM course_lesson WHERE id = ${Number(lessonId)} LIMIT 1`);
1205
+ return Boolean((_a = rows[0]) === null || _a === void 0 ? void 0 : _a.published);
1206
+ }
1207
+ async setLessonPublished(lessonId, published, client = this.prisma) {
1208
+ await client.$executeRawUnsafe(`UPDATE course_lesson SET published = ${published ? 'true' : 'false'} WHERE id = ${Number(lessonId)}`);
1209
+ }
1074
1210
  parseLessonContent(content) {
1075
1211
  if (!content)
1076
1212
  return null;