@hed-hog/lms 0.0.330 → 0.0.338

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 (128) hide show
  1. package/dist/class-group/class-group.controller.d.ts +3 -3
  2. package/dist/class-group/class-group.service.d.ts +3 -3
  3. package/dist/course/course.service.d.ts.map +1 -1
  4. package/dist/course/course.service.js +12 -20
  5. package/dist/course/course.service.js.map +1 -1
  6. package/dist/enterprise/enterprise.controller.d.ts +72 -0
  7. package/dist/enterprise/enterprise.controller.d.ts.map +1 -1
  8. package/dist/enterprise/enterprise.controller.js +10 -0
  9. package/dist/enterprise/enterprise.controller.js.map +1 -1
  10. package/dist/enterprise/enterprise.service.d.ts +78 -0
  11. package/dist/enterprise/enterprise.service.d.ts.map +1 -1
  12. package/dist/enterprise/enterprise.service.js +413 -40
  13. package/dist/enterprise/enterprise.service.js.map +1 -1
  14. package/dist/enterprise/training/training-admin.controller.d.ts +6 -3
  15. package/dist/enterprise/training/training-admin.controller.d.ts.map +1 -1
  16. package/dist/enterprise/training/training-admin.controller.js +10 -6
  17. package/dist/enterprise/training/training-admin.controller.js.map +1 -1
  18. package/dist/enterprise/training/training-admin.service.d.ts +8 -2
  19. package/dist/enterprise/training/training-admin.service.d.ts.map +1 -1
  20. package/dist/enterprise/training/training-admin.service.js +108 -52
  21. package/dist/enterprise/training/training-admin.service.js.map +1 -1
  22. package/dist/enterprise/training/training-viewer.controller.d.ts +3 -0
  23. package/dist/enterprise/training/training-viewer.controller.d.ts.map +1 -1
  24. package/dist/evaluation/evaluation.controller.d.ts +4 -4
  25. package/dist/evaluation/evaluation.service.d.ts +4 -4
  26. package/dist/instructor/dto/create-instructor-skill.dto.d.ts +0 -4
  27. package/dist/instructor/dto/create-instructor-skill.dto.d.ts.map +1 -1
  28. package/dist/instructor/dto/create-instructor-skill.dto.js +0 -21
  29. package/dist/instructor/dto/create-instructor-skill.dto.js.map +1 -1
  30. package/dist/instructor/dto/update-instructor-skill.dto.d.ts +0 -4
  31. package/dist/instructor/dto/update-instructor-skill.dto.d.ts.map +1 -1
  32. package/dist/instructor/dto/update-instructor-skill.dto.js +0 -22
  33. package/dist/instructor/dto/update-instructor-skill.dto.js.map +1 -1
  34. package/dist/instructor/instructor-skill.controller.d.ts +4 -4
  35. package/dist/instructor/instructor-skill.service.d.ts +4 -7
  36. package/dist/instructor/instructor-skill.service.d.ts.map +1 -1
  37. package/dist/instructor/instructor-skill.service.js +2 -89
  38. package/dist/instructor/instructor-skill.service.js.map +1 -1
  39. package/dist/instructor/instructor.controller.d.ts +20 -0
  40. package/dist/instructor/instructor.controller.d.ts.map +1 -1
  41. package/dist/instructor/instructor.controller.js +19 -0
  42. package/dist/instructor/instructor.controller.js.map +1 -1
  43. package/dist/instructor/instructor.service.d.ts +25 -0
  44. package/dist/instructor/instructor.service.d.ts.map +1 -1
  45. package/dist/instructor/instructor.service.js +70 -18
  46. package/dist/instructor/instructor.service.js.map +1 -1
  47. package/dist/lms.module.d.ts.map +1 -1
  48. package/dist/lms.module.js.map +1 -1
  49. package/hedhog/data/route.yaml +23 -1
  50. package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +42 -24
  51. package/hedhog/frontend/app/_components/create-lms-instructor-sheet.tsx.ejs +591 -0
  52. package/hedhog/frontend/app/certificates/issued/page.tsx.ejs +6 -1
  53. package/hedhog/frontend/app/certificates/models/page.tsx.ejs +7 -2
  54. package/hedhog/frontend/app/classes/[id]/page.tsx.ejs +17 -17
  55. package/hedhog/frontend/app/classes/page.tsx.ejs +6 -1
  56. package/hedhog/frontend/app/courses/[id]/_components/CourseClassificationCard.tsx.ejs +3 -33
  57. package/hedhog/frontend/app/courses/[id]/_components/CourseContentCard.tsx.ejs +9 -9
  58. package/hedhog/frontend/app/courses/[id]/_components/CourseMainInfoCard.tsx.ejs +109 -0
  59. package/hedhog/frontend/app/courses/[id]/_components/CourseMultiEntityPicker.tsx.ejs +42 -15
  60. package/hedhog/frontend/app/courses/[id]/_components/CourseRelationsCard.tsx.ejs +76 -81
  61. package/hedhog/frontend/app/courses/[id]/_components/CourseSummaryCard.tsx.ejs +60 -0
  62. package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +3 -3
  63. package/hedhog/frontend/app/courses/[id]/structure/_components/course-scheduled-classes-tab.tsx.ejs +406 -0
  64. package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree-dnd.tsx.ejs +1 -1
  65. package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree.tsx.ejs +134 -0
  66. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-course.tsx.ejs +113 -0
  67. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-lesson.tsx.ejs +314 -0
  68. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-session.tsx.ejs +174 -0
  69. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +242 -33
  70. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +228 -152
  71. package/hedhog/frontend/app/courses/[id]/structure/_components/mock-data.ts.ejs +185 -0
  72. package/hedhog/frontend/app/courses/[id]/structure/_components/shortcuts-help.tsx.ejs +71 -31
  73. package/hedhog/frontend/app/courses/page.tsx.ejs +6 -1
  74. package/hedhog/frontend/app/enterprise/[id]/page.tsx.ejs +37 -41
  75. package/hedhog/frontend/app/enterprise/_components/enterprise-activity-timeline.tsx.ejs +87 -0
  76. package/hedhog/frontend/app/enterprise/_components/enterprise-admin-create-sheet.tsx.ejs +4 -0
  77. package/hedhog/frontend/app/enterprise/_components/enterprise-administrators-tab.tsx.ejs +31 -5
  78. package/hedhog/frontend/app/enterprise/_components/enterprise-classes-tab.tsx.ejs +79 -20
  79. package/hedhog/frontend/app/enterprise/_components/enterprise-company-identity-card.tsx.ejs +11 -2
  80. package/hedhog/frontend/app/enterprise/_components/enterprise-course-edit-sheet.tsx.ejs +201 -0
  81. package/hedhog/frontend/app/enterprise/_components/enterprise-courses-tab.tsx.ejs +55 -24
  82. package/hedhog/frontend/app/enterprise/_components/enterprise-detail-sheet.tsx.ejs +430 -296
  83. package/hedhog/frontend/app/enterprise/_components/enterprise-mocks.ts.ejs +277 -0
  84. package/hedhog/frontend/app/enterprise/_components/enterprise-overview-analytics.tsx.ejs +205 -0
  85. package/hedhog/frontend/app/enterprise/_components/enterprise-person-edit-sheet.tsx.ejs +97 -0
  86. package/hedhog/frontend/app/enterprise/_components/enterprise-sheet.tsx.ejs +82 -57
  87. package/hedhog/frontend/app/enterprise/_components/enterprise-student-create-sheet.tsx.ejs +4 -0
  88. package/hedhog/frontend/app/enterprise/_components/enterprise-students-tab.tsx.ejs +60 -22
  89. package/hedhog/frontend/app/enterprise/_components/enterprise-types.ts.ejs +54 -0
  90. package/hedhog/frontend/app/enterprise/_components/enterprise-user-create-sheet.tsx.ejs +211 -0
  91. package/hedhog/frontend/app/enterprise/page.tsx.ejs +39 -7
  92. package/hedhog/frontend/app/evaluations/_components/evaluation-topic-form-sheet.tsx.ejs +1 -1
  93. package/hedhog/frontend/app/exams/[id]/questions/page.tsx.ejs +6 -1
  94. package/hedhog/frontend/app/exams/page.tsx.ejs +12 -3
  95. package/hedhog/frontend/app/instructor-skills/page.tsx.ejs +51 -104
  96. package/hedhog/frontend/app/instructors/_components/instructor-form-sheet.tsx.ejs +712 -427
  97. package/hedhog/frontend/app/instructors/page.tsx.ejs +77 -53
  98. package/hedhog/frontend/app/paths/page.tsx.ejs +14 -5
  99. package/hedhog/frontend/app/reports/courses/page.tsx.ejs +5 -5
  100. package/hedhog/frontend/app/reports/dashboard/page.tsx.ejs +8 -8
  101. package/hedhog/frontend/app/reports/evaluations/page.tsx.ejs +6 -1
  102. package/hedhog/frontend/app/reports/page.tsx.ejs +7 -7
  103. package/hedhog/frontend/app/reports/students/page.tsx.ejs +6 -6
  104. package/hedhog/frontend/app/training/page.tsx.ejs +8 -3
  105. package/hedhog/frontend/messages/en.json +394 -55
  106. package/hedhog/frontend/messages/pt.json +389 -48
  107. package/hedhog/frontend/widgets/active-classes-kpi.tsx.ejs +1 -1
  108. package/hedhog/frontend/widgets/active-courses-kpi.tsx.ejs +1 -1
  109. package/hedhog/frontend/widgets/approval-rate-kpi.tsx.ejs +1 -1
  110. package/hedhog/frontend/widgets/class-calendar.tsx.ejs +2 -2
  111. package/hedhog/frontend/widgets/completion-rate-kpi.tsx.ejs +1 -1
  112. package/hedhog/frontend/widgets/issued-certificates-kpi.tsx.ejs +1 -1
  113. package/hedhog/frontend/widgets/total-students-kpi.tsx.ejs +1 -1
  114. package/hedhog/table/enterprise_student_license_event.yaml +30 -0
  115. package/hedhog/table/instructor_qualification.yaml +1 -1
  116. package/hedhog/table/instructor_skill.yaml +0 -11
  117. package/package.json +8 -8
  118. package/src/course/course.service.ts +12 -24
  119. package/src/enterprise/enterprise.controller.ts +5 -0
  120. package/src/enterprise/enterprise.service.ts +507 -29
  121. package/src/enterprise/training/training-admin.controller.ts +4 -0
  122. package/src/enterprise/training/training-admin.service.ts +115 -51
  123. package/src/instructor/dto/create-instructor-skill.dto.ts +0 -17
  124. package/src/instructor/dto/update-instructor-skill.dto.ts +0 -18
  125. package/src/instructor/instructor-skill.service.ts +2 -97
  126. package/src/instructor/instructor.controller.ts +16 -0
  127. package/src/instructor/instructor.service.ts +85 -10
  128. package/src/lms.module.ts +1 -0
@@ -20,28 +20,6 @@ __decorate([
20
20
  (0, class_validator_1.MaxLength)(255),
21
21
  __metadata("design:type", String)
22
22
  ], UpdateInstructorSkillDto.prototype, "slug", void 0);
23
- __decorate([
24
- (0, class_validator_1.IsOptional)(),
25
- (0, class_validator_1.IsString)(),
26
- (0, class_validator_1.MaxLength)(255),
27
- __metadata("design:type", String)
28
- ], UpdateInstructorSkillDto.prototype, "namePt", void 0);
29
- __decorate([
30
- (0, class_validator_1.IsOptional)(),
31
- (0, class_validator_1.IsString)(),
32
- (0, class_validator_1.MaxLength)(255),
33
- __metadata("design:type", String)
34
- ], UpdateInstructorSkillDto.prototype, "nameEn", void 0);
35
- __decorate([
36
- (0, class_validator_1.IsOptional)(),
37
- (0, class_validator_1.IsString)(),
38
- __metadata("design:type", String)
39
- ], UpdateInstructorSkillDto.prototype, "descriptionPt", void 0);
40
- __decorate([
41
- (0, class_validator_1.IsOptional)(),
42
- (0, class_validator_1.IsString)(),
43
- __metadata("design:type", String)
44
- ], UpdateInstructorSkillDto.prototype, "descriptionEn", void 0);
45
23
  __decorate([
46
24
  (0, class_validator_1.IsOptional)(),
47
25
  (0, class_validator_1.IsEnum)(['active', 'inactive']),
@@ -1 +1 @@
1
- {"version":3,"file":"update-instructor-skill.dto.js","sourceRoot":"","sources":["../../../src/instructor/dto/update-instructor-skill.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0E;AAE1E,MAAa,wBAAwB;CA2BpC;AA3BD,4DA2BC;AAvBC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;sDACD;AAKd;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;wDACC;AAKhB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;wDACC;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+DACY;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+DACY;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;;wDACA"}
1
+ {"version":3,"file":"update-instructor-skill.dto.js","sourceRoot":"","sources":["../../../src/instructor/dto/update-instructor-skill.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0E;AAE1E,MAAa,wBAAwB;CASpC;AATD,4DASC;AALC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;sDACD;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;;wDACA"}
@@ -9,7 +9,7 @@ export declare class InstructorSkillController {
9
9
  id: any;
10
10
  slug: any;
11
11
  status: any;
12
- locales: any;
12
+ name: any;
13
13
  }[];
14
14
  total: any;
15
15
  page: number;
@@ -19,19 +19,19 @@ export declare class InstructorSkillController {
19
19
  id: any;
20
20
  slug: any;
21
21
  status: any;
22
- locales: any;
22
+ name: any;
23
23
  }[]>;
24
24
  create(dto: CreateInstructorSkillDto): Promise<{
25
25
  id: any;
26
26
  slug: any;
27
27
  status: any;
28
- locales: any;
28
+ name: any;
29
29
  }>;
30
30
  update(id: number, dto: UpdateInstructorSkillDto): Promise<{
31
31
  id: any;
32
32
  slug: any;
33
33
  status: any;
34
- locales: any;
34
+ name: any;
35
35
  }>;
36
36
  remove(id: number): Promise<void>;
37
37
  }
@@ -5,7 +5,6 @@ export declare class InstructorSkillService {
5
5
  private readonly prisma;
6
6
  constructor(prisma: PrismaService);
7
7
  private get skillClient();
8
- private get localeClient();
9
8
  list(params: {
10
9
  page?: number;
11
10
  pageSize?: number;
@@ -15,7 +14,7 @@ export declare class InstructorSkillService {
15
14
  id: any;
16
15
  slug: any;
17
16
  status: any;
18
- locales: any;
17
+ name: any;
19
18
  }[];
20
19
  total: any;
21
20
  page: number;
@@ -25,24 +24,22 @@ export declare class InstructorSkillService {
25
24
  id: any;
26
25
  slug: any;
27
26
  status: any;
28
- locales: any;
27
+ name: any;
29
28
  }[]>;
30
29
  create(dto: CreateInstructorSkillDto): Promise<{
31
30
  id: any;
32
31
  slug: any;
33
32
  status: any;
34
- locales: any;
33
+ name: any;
35
34
  }>;
36
35
  update(id: number, dto: UpdateInstructorSkillDto): Promise<{
37
36
  id: any;
38
37
  slug: any;
39
38
  status: any;
40
- locales: any;
39
+ name: any;
41
40
  }>;
42
41
  delete(id: number): Promise<void>;
43
42
  private getSkillById;
44
43
  private mapRow;
45
- private syncLocales;
46
- private resolveLocaleIds;
47
44
  }
48
45
  //# sourceMappingURL=instructor-skill.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instructor-skill.service.d.ts","sourceRoot":"","sources":["../../src/instructor/instructor-skill.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,qBACa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,KAAK,YAAY,GAEvB;IAEK,IAAI,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;IA0ClE,MAAM;;;;;;IAcN,MAAM,CAAC,GAAG,EAAE,wBAAwB;;;;;;IAapC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,wBAAwB;;;;;;IAwBhD,MAAM,CAAC,EAAE,EAAE,MAAM;YAaT,YAAY;IAiB1B,OAAO,CAAC,MAAM;YASA,WAAW;YAqDX,gBAAgB;CAW/B"}
1
+ {"version":3,"file":"instructor-skill.service.d.ts","sourceRoot":"","sources":["../../src/instructor/instructor-skill.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,qBACa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD,OAAO,KAAK,WAAW,GAEtB;IAEK,IAAI,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;IA8BlE,MAAM;;;;;;IASN,MAAM,CAAC,GAAG,EAAE,wBAAwB;;;;;;IAWpC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,wBAAwB;;;;;;IAsBhD,MAAM,CAAC,EAAE,EAAE,MAAM;YAaT,YAAY;IAY1B,OAAO,CAAC,MAAM;CAQf"}
@@ -19,9 +19,6 @@ let InstructorSkillService = class InstructorSkillService {
19
19
  get skillClient() {
20
20
  return this.prisma.instructor_skill;
21
21
  }
22
- get localeClient() {
23
- return this.prisma.instructor_skill_locale;
24
- }
25
22
  async list(params) {
26
23
  var _a;
27
24
  const page = Math.max(Number(params.page) || 1, 1);
@@ -30,25 +27,13 @@ let InstructorSkillService = class InstructorSkillService {
30
27
  const search = (_a = params.search) === null || _a === void 0 ? void 0 : _a.trim();
31
28
  const where = {};
32
29
  if (search) {
33
- where.OR = [
34
- { slug: { contains: search, mode: 'insensitive' } },
35
- {
36
- instructor_skill_locale: {
37
- some: { name: { contains: search, mode: 'insensitive' } },
38
- },
39
- },
40
- ];
30
+ where.slug = { contains: search, mode: 'insensitive' };
41
31
  }
42
32
  const [rows, total] = await Promise.all([
43
33
  this.skillClient.findMany({
44
34
  where,
45
35
  skip,
46
36
  take: pageSize,
47
- include: {
48
- instructor_skill_locale: {
49
- select: { locale_id: true, name: true, description: true },
50
- },
51
- },
52
37
  orderBy: { slug: 'asc' },
53
38
  }),
54
39
  this.skillClient.count({ where }),
@@ -63,11 +48,6 @@ let InstructorSkillService = class InstructorSkillService {
63
48
  async getAll() {
64
49
  const rows = await this.skillClient.findMany({
65
50
  where: { status: 'active' },
66
- include: {
67
- instructor_skill_locale: {
68
- select: { locale_id: true, name: true },
69
- },
70
- },
71
51
  orderBy: { slug: 'asc' },
72
52
  });
73
53
  return rows.map((row) => this.mapRow(row));
@@ -80,7 +60,6 @@ let InstructorSkillService = class InstructorSkillService {
80
60
  status: (_a = dto.status) !== null && _a !== void 0 ? _a : 'active',
81
61
  },
82
62
  });
83
- await this.syncLocales(skill.id, dto);
84
63
  return this.getSkillById(skill.id);
85
64
  }
86
65
  async update(id, dto) {
@@ -99,7 +78,6 @@ let InstructorSkillService = class InstructorSkillService {
99
78
  if (Object.keys(data).length > 0) {
100
79
  await this.skillClient.update({ where: { id }, data });
101
80
  }
102
- await this.syncLocales(id, dto);
103
81
  return this.getSkillById(id);
104
82
  }
105
83
  async delete(id) {
@@ -115,11 +93,6 @@ let InstructorSkillService = class InstructorSkillService {
115
93
  async getSkillById(id) {
116
94
  const row = await this.skillClient.findUnique({
117
95
  where: { id },
118
- include: {
119
- instructor_skill_locale: {
120
- select: { locale_id: true, name: true, description: true },
121
- },
122
- },
123
96
  });
124
97
  if (!row) {
125
98
  throw new common_1.NotFoundException('Instructor skill not found');
@@ -127,71 +100,11 @@ let InstructorSkillService = class InstructorSkillService {
127
100
  return this.mapRow(row);
128
101
  }
129
102
  mapRow(row) {
130
- var _a;
131
103
  return {
132
104
  id: row.id,
133
105
  slug: row.slug,
134
106
  status: row.status,
135
- locales: (_a = row.instructor_skill_locale) !== null && _a !== void 0 ? _a : [],
136
- };
137
- }
138
- async syncLocales(skillId, dto) {
139
- var _a, _b, _c, _d;
140
- const localeIds = await this.resolveLocaleIds();
141
- if (dto.namePt !== undefined && localeIds.pt !== null) {
142
- const existing = await this.localeClient.findFirst({
143
- where: { instructor_skill_id: skillId, locale_id: localeIds.pt },
144
- select: { id: true },
145
- });
146
- if (existing) {
147
- await this.localeClient.update({
148
- where: { id: existing.id },
149
- data: { name: dto.namePt, description: (_a = dto.descriptionPt) !== null && _a !== void 0 ? _a : null },
150
- });
151
- }
152
- else {
153
- await this.localeClient.create({
154
- data: {
155
- instructor_skill_id: skillId,
156
- locale_id: localeIds.pt,
157
- name: dto.namePt,
158
- description: (_b = dto.descriptionPt) !== null && _b !== void 0 ? _b : null,
159
- },
160
- });
161
- }
162
- }
163
- if (dto.nameEn !== undefined && localeIds.en !== null) {
164
- const existing = await this.localeClient.findFirst({
165
- where: { instructor_skill_id: skillId, locale_id: localeIds.en },
166
- select: { id: true },
167
- });
168
- if (existing) {
169
- await this.localeClient.update({
170
- where: { id: existing.id },
171
- data: { name: dto.nameEn, description: (_c = dto.descriptionEn) !== null && _c !== void 0 ? _c : null },
172
- });
173
- }
174
- else {
175
- await this.localeClient.create({
176
- data: {
177
- instructor_skill_id: skillId,
178
- locale_id: localeIds.en,
179
- name: dto.nameEn,
180
- description: (_d = dto.descriptionEn) !== null && _d !== void 0 ? _d : null,
181
- },
182
- });
183
- }
184
- }
185
- }
186
- async resolveLocaleIds() {
187
- var _a, _b, _c, _d;
188
- const locales = await this.prisma.locale.findMany({
189
- where: { code: { in: ['pt', 'en'] } },
190
- select: { id: true, code: true },
191
- });
192
- return {
193
- pt: (_b = (_a = locales.find((l) => l.code === 'pt')) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null,
194
- en: (_d = (_c = locales.find((l) => l.code === 'en')) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : null,
107
+ name: row.slug,
195
108
  };
196
109
  }
197
110
  };
@@ -1 +1 @@
1
- {"version":3,"file":"instructor-skill.service.js","sourceRoot":"","sources":["../../src/instructor/instructor-skill.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,2CAA+D;AAKxD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAA6B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAEtD,IAAY,WAAW;QACrB,OAAQ,IAAI,C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C,EAAE;wBACvB,IAAI,EAAE,GAAG,CAAC,MAAM;wBAChB,WAAW,EAAE,MAAA,GAAG,CAAC,aAAa,mCAAI,IAAI;qBACvC;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,gBAAgB;;QAC5B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;YAChD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;YACrC,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;QAEH,OAAO;YACL,EAAE,EAAE,MAAA,MAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,0CAAE,EAAE,mCAAI,IAAI;YACpD,EAAE,EAAE,MAAA,MAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,0CAAE,EAAE,mCAAI,IAAI;SACrD,CAAC;IACJ,CAAC;CACF,CAAA;AA/MY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;qCAE0B,0BAAa;GADvC,sBAAsB,CA+MlC"}
1
+ {"version":3,"file":"instructor-skill.service.js","sourceRoot":"","sources":["../../src/instructor/instructor-skill.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,2CAA+D;AAKxD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAA6B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAEtD,IAAY,WAAW;QACrB,OAAQ,IAAI,CAAC,MAAc,CAAC,gBAAgB,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,IAAI,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: number, pageSize?: number, search?: string, status?: string): Promise<{
59
+ data: {
60
+ id: number;
61
+ name: string;
62
+ code: string;
63
+ courseId: number;
64
+ courseName: string;
65
+ courseLogoFileId: number;
66
+ courseLogoUrl: string;
67
+ startDate: Date;
68
+ endDate: Date;
69
+ slots: number;
70
+ totalSlots: number;
71
+ status: import("@prisma/client").$Enums.course_class_group_status_d840783477_enum;
72
+ }[];
73
+ total: number;
74
+ page: number;
75
+ pageSize: number;
76
+ lastPage: number;
77
+ }>;
58
78
  getById(id: number): Promise<{
59
79
  id: number;
60
80
  personId: number;
@@ -1 +1 @@
1
- {"version":3,"file":"instructor.controller.d.ts","sourceRoot":"","sources":["../../src/instructor/instructor.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,qBAEa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,iBAAiB;IAGjE,IAAI,CACa,IAAI,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;IAYrE,QAAQ;;;;;IAKR,KAAK,CAAa,MAAM,EAAE,MAAM;;;;;IAKhC,MAAM,CAAS,GAAG,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;IAKvC,OAAO,CAA4B,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;IAK7C,iBAAiB,CACY,EAAE,EAAE,MAAM,EACpB,OAAO,EAAE,OAAO;;;;IAMnC,MAAM,CACuB,EAAE,EAAE,MAAM,EAC7B,GAAG,EAAE,mBAAmB;;;;;;;;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@ let InstructorController = class InstructorController {
40
40
  create(dto) {
41
41
  return this.instructorService.create(dto);
42
42
  }
43
+ getInstructorClassGroups(id, page, pageSize, search, status) {
44
+ return this.instructorService.getInstructorClassGroups(id, {
45
+ page,
46
+ pageSize,
47
+ search,
48
+ status,
49
+ });
50
+ }
43
51
  getById(id) {
44
52
  return this.instructorService.getById(id);
45
53
  }
@@ -100,6 +108,17 @@ __decorate([
100
108
  __metadata("design:paramtypes", [create_instructor_dto_1.CreateInstructorDto]),
101
109
  __metadata("design:returntype", void 0)
102
110
  ], InstructorController.prototype, "create", null);
111
+ __decorate([
112
+ (0, common_1.Get)(':id/class-groups'),
113
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
114
+ __param(1, (0, common_1.Query)('page', new common_1.ParseIntPipe({ optional: true }))),
115
+ __param(2, (0, common_1.Query)('pageSize', new common_1.ParseIntPipe({ optional: true }))),
116
+ __param(3, (0, common_1.Query)('search')),
117
+ __param(4, (0, common_1.Query)('status')),
118
+ __metadata("design:type", Function),
119
+ __metadata("design:paramtypes", [Number, Number, Number, String, String]),
120
+ __metadata("design:returntype", void 0)
121
+ ], InstructorController.prototype, "getInstructorClassGroups", null);
103
122
  __decorate([
104
123
  (0, common_1.Get)(':id'),
105
124
  __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
@@ -1 +1 @@
1
- {"version":3,"file":"instructor.controller.js","sourceRoot":"","sources":["../../src/instructor/instructor.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA0C;AAC1C,2CAYwB;AACxB,uEAAkE;AAClE,uEAAkE;AAClE,6DAAyD;AAIlD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAGrE,IAAI,CACa,IAAa,EACT,QAAiB,EACnB,MAAe,EACf,MAAe,EACH,kBAAsC;QAEnE,OAAO,IAAI,CAAC,iBAAiB,CAA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AA;IACzB,WAAA,IAAA,aAAI,EAAC,SAAS,CAAC,CAAA;;;;6DAGjB;AAGD;IADC,IAAA,cAAK,EAAC,KAAK,CAAC;IAEV,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,2CAAmB;;kDAGjC;AAID;IAFC,IAAA,eAAM,EAAC,KAAK,CAAC;IACb,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IACxB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;;;;kDAEhC;+BA5DU,oBAAoB;IAFhC,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEoB,sCAAiB;GADtD,oBAAoB,CA+EhC"}
1
+ {"version":3,"file":"instructor.controller.js","sourceRoot":"","sources":["../../src/instructor/instructor.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA0C;AAC1C,2CAYwB;AACxB,uEAAkE;AAClE,uEAAkE;AAClE,6DAAyD;AAIlD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAGrE,IAAI,CACa,IAAa,EACT,QAAiB,EACnB,MAAe,EACf,MAAe,EACH,kBAAsC;QAEnE,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;YACjC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7B,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;YAC1C,MAAM;YACN,MAAM;YACN,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;SACrD,CAAC,CAAC;IACL,CAAC;IAGD,QAAQ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A;IACvD,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;IACf,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;oEAQjB;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;IACF,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;;;;mDAEjC;AAGD;IADC,IAAA,cAAK,EAAC,qBAAqB,CAAC;IAE1B,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,EAAC,SAAS,CAAC,CAAA;;;;6DAGjB;AAGD;IADC,IAAA,cAAK,EAAC,KAAK,CAAC;IAEV,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,2CAAmB;;kDAGjC;AAID;IAFC,IAAA,eAAM,EAAC,KAAK,CAAC;IACb,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IACxB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;;;;kDAEhC;+BA5EU,oBAAoB;IAFhC,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEoB,sCAAiB;GADtD,oBAAoB,CA+FhC"}
@@ -134,6 +134,31 @@ export declare class InstructorService {
134
134
  private resolveContactTypeIds;
135
135
  private upsertPrimaryContact;
136
136
  private syncInstructorSkills;
137
+ getInstructorClassGroups(instructorId: number, options?: {
138
+ page?: number;
139
+ pageSize?: number;
140
+ search?: string;
141
+ status?: string;
142
+ }): Promise<{
143
+ data: {
144
+ id: number;
145
+ name: string;
146
+ code: string;
147
+ courseId: number;
148
+ courseName: string;
149
+ courseLogoFileId: number;
150
+ courseLogoUrl: string;
151
+ startDate: Date;
152
+ endDate: Date;
153
+ slots: number;
154
+ totalSlots: number;
155
+ status: import("@prisma/client").$Enums.course_class_group_status_d840783477_enum;
156
+ }[];
157
+ total: number;
158
+ page: number;
159
+ pageSize: number;
160
+ lastPage: number;
161
+ }>;
137
162
  }
138
163
  export {};
139
164
  //# sourceMappingURL=instructor.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instructor.service.d.ts","sourceRoot":"","sources":["../../src/instructor/instructor.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,KAAK,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAIzD,qBACa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,IAAI,CAAC,MAAM,EAAE;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC/B;;;;;;;;;;;;;;oBAkH6C,MAAM;sBAAQ,MAAM;sBAAQ,MAAM;;;;;;;IA+E1E,MAAM,CAAC,GAAG,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;IAqF/B,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;IA2E3C,KAAK,CAAC,MAAM,EAAE,MAAM;;;;;IA+BpB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,GAAE,QAAsB;;;;;;;;;;;;;;;;;;IAuH9C,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;;;;IAwCxD,QAAQ;;;;;IASR,MAAM,CAAC,EAAE,E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E,MAAM,EAAE,GAAG,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;IA2E3C,KAAK,CAAC,MAAM,EAAE,MAAM;;;;;IA+BpB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,GAAE,QAAsB;;;;;;;;;;;;;;;;;;IAmH9C,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;;;;IAwCxD,QAAQ;;;;;IASR,MAAM,CAAC,EAAE,EAAE,MAAM;IAajB,8BAA8B,CAAC,kBAAkB,EAAE,MAAM,EAAE;;;;;;;;;;;;;gBA3bnB,MAAM;kBAAQ,MAAM;kBAAQ,MAAM;;;IAsc1E,4BAA4B,CAChC,aAAa,EAAE,MAAM,EAAE,EACvB,kBAAkB,EAAE,MAAM,EAAE;IAgC9B,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,sBAAsB;YA8BhB,0BAA0B;YAe1B,wCAAwC;YAsCxC,4BAA4B;YAkD5B,mBAAmB;YAsBnB,kBAAkB;YA2BlB,qBAAqB;YAqBrB,oBAAoB;YAmDpB,oBAAoB;IA8B5B,wBAAwB,CAC5B,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ;;;;;;;;;;;;;;;;;;;;CA2ET"}
@@ -18,7 +18,7 @@ let InstructorService = class InstructorService {
18
18
  this.prisma = prisma;
19
19
  }
20
20
  async list(params) {
21
- var _a, _b, _c, _d, _e, _f;
21
+ var _a, _b, _c;
22
22
  await this.ensureQualificationCatalog();
23
23
  await this.backfillLegacyCourseLessonQualifications();
24
24
  const page = Math.max(Number(params.page) || 1, 1);
@@ -135,10 +135,6 @@ let InstructorService = class InstructorService {
135
135
  select: {
136
136
  id: true,
137
137
  slug: true,
138
- instructor_skill_locale: {
139
- take: 1,
140
- select: { name: true },
141
- },
142
138
  },
143
139
  },
144
140
  },
@@ -158,7 +154,7 @@ let InstructorService = class InstructorService {
158
154
  existing.push({
159
155
  id: a.instructor_skill.id,
160
156
  slug: a.instructor_skill.slug,
161
- name: (_f = (_e = (_d = a.instructor_skill.instructor_skill_locale) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : a.instructor_skill.slug,
157
+ name: a.instructor_skill.slug,
162
158
  });
163
159
  skillsMap.set(a.instructor_id, existing);
164
160
  }
@@ -406,10 +402,6 @@ let InstructorService = class InstructorService {
406
402
  select: {
407
403
  id: true,
408
404
  slug: true,
409
- instructor_skill_locale: {
410
- take: 1,
411
- select: { name: true },
412
- },
413
405
  },
414
406
  },
415
407
  },
@@ -426,14 +418,11 @@ let InstructorService = class InstructorService {
426
418
  seenSlugs.add(a.instructor_skill.slug);
427
419
  return true;
428
420
  })
429
- .map((a) => {
430
- var _a, _b, _c;
431
- return ({
432
- id: a.instructor_skill.id,
433
- slug: a.instructor_skill.slug,
434
- name: (_c = (_b = (_a = a.instructor_skill.instructor_skill_locale) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : a.instructor_skill.slug,
435
- });
436
- });
421
+ .map((a) => ({
422
+ id: a.instructor_skill.id,
423
+ slug: a.instructor_skill.slug,
424
+ name: a.instructor_skill.slug,
425
+ }));
437
426
  return {
438
427
  id: instructor.id,
439
428
  personId: instructor.person.id,
@@ -764,6 +753,69 @@ let InstructorService = class InstructorService {
764
753
  });
765
754
  }
766
755
  }
756
+ async getInstructorClassGroups(instructorId, options = {}) {
757
+ const { page = 1, pageSize = 6, search, status } = options;
758
+ const where = Object.assign(Object.assign({ instructor_id: instructorId }, (status ? { status: status } : {})), (search
759
+ ? {
760
+ OR: [
761
+ { title: { contains: search, mode: 'insensitive' } },
762
+ { code: { contains: search, mode: 'insensitive' } },
763
+ { course: { title: { contains: search, mode: 'insensitive' } } },
764
+ ],
765
+ }
766
+ : {}));
767
+ const [classGroups, total] = await this.prisma.$transaction([
768
+ this.prisma.course_class_group.findMany({
769
+ where,
770
+ orderBy: { start_date: 'desc' },
771
+ include: {
772
+ course: {
773
+ select: {
774
+ id: true,
775
+ title: true,
776
+ course_image: {
777
+ where: {
778
+ image_type: { slug: { in: ['course-logo', 'course-banner'] } },
779
+ },
780
+ orderBy: { is_primary: 'desc' },
781
+ select: {
782
+ file: { select: { id: true, location: true } },
783
+ image_type: { select: { slug: true } },
784
+ },
785
+ },
786
+ },
787
+ },
788
+ _count: {
789
+ select: {
790
+ course_enrollment: { where: { status: { not: 'cancelled' } } },
791
+ },
792
+ },
793
+ },
794
+ skip: (page - 1) * pageSize,
795
+ take: pageSize,
796
+ }),
797
+ this.prisma.course_class_group.count({ where }),
798
+ ]);
799
+ const data = classGroups.map((cg) => {
800
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
801
+ const preferredImage = (_b = (_a = cg.course) === null || _a === void 0 ? void 0 : _a.course_image.find((ci) => { var _a; return ((_a = ci.image_type) === null || _a === void 0 ? void 0 : _a.slug) === 'course-logo'; })) !== null && _b !== void 0 ? _b : (_c = cg.course) === null || _c === void 0 ? void 0 : _c.course_image[0];
802
+ return {
803
+ id: cg.id,
804
+ name: cg.title,
805
+ code: (_d = cg.code) !== null && _d !== void 0 ? _d : '',
806
+ courseId: (_f = (_e = cg.course) === null || _e === void 0 ? void 0 : _e.id) !== null && _f !== void 0 ? _f : null,
807
+ courseName: (_h = (_g = cg.course) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : null,
808
+ courseLogoFileId: (_k = (_j = preferredImage === null || preferredImage === void 0 ? void 0 : preferredImage.file) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : null,
809
+ courseLogoUrl: (_m = (_l = preferredImage === null || preferredImage === void 0 ? void 0 : preferredImage.file) === null || _l === void 0 ? void 0 : _l.location) !== null && _m !== void 0 ? _m : null,
810
+ startDate: cg.start_date,
811
+ endDate: (_o = cg.end_date) !== null && _o !== void 0 ? _o : null,
812
+ slots: cg._count.course_enrollment,
813
+ totalSlots: (_p = cg.capacity) !== null && _p !== void 0 ? _p : null,
814
+ status: cg.status,
815
+ };
816
+ });
817
+ return { data, total, page, pageSize, lastPage: Math.ceil(total / pageSize) };
818
+ }
767
819
  };
768
820
  exports.InstructorService = InstructorService;
769
821
  exports.InstructorService = InstructorService = __decorate([