@driveup/schema 0.2.6 → 0.2.9

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 (220) hide show
  1. package/lib/catalog/addon/addon.entity.d.ts +3 -3
  2. package/lib/catalog/addon/addon.entity.js +7 -7
  3. package/lib/catalog/addon/addon.entity.js.map +1 -1
  4. package/lib/catalog/addon/country.entity.d.ts +4 -4
  5. package/lib/catalog/addon/country.entity.js +5 -6
  6. package/lib/catalog/addon/country.entity.js.map +1 -1
  7. package/lib/catalog/priceplan/priceplan.entity.d.ts +8 -3
  8. package/lib/catalog/priceplan/priceplan.entity.js +14 -7
  9. package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
  10. package/lib/catalog/product/country.entity.d.ts +6 -6
  11. package/lib/catalog/product/country.entity.js +9 -10
  12. package/lib/catalog/product/country.entity.js.map +1 -1
  13. package/lib/catalog/product/priceplan.entity.d.ts +9 -4
  14. package/lib/catalog/product/priceplan.entity.js +19 -9
  15. package/lib/catalog/product/priceplan.entity.js.map +1 -1
  16. package/lib/catalog/product/product.entity.d.ts +3 -3
  17. package/lib/catalog/product/product.entity.js +8 -8
  18. package/lib/catalog/product/product.entity.js.map +1 -1
  19. package/lib/catalog/program/program.entity.d.ts +2 -2
  20. package/lib/catalog/program/program.entity.js +7 -7
  21. package/lib/catalog/program/program.entity.js.map +1 -1
  22. package/lib/catalog/seed/assets/asset.entity.d.ts +2 -2
  23. package/lib/catalog/seed/assets/asset.entity.js +6 -6
  24. package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
  25. package/lib/catalog/seed/courses/course.entity.d.ts +4 -4
  26. package/lib/catalog/seed/courses/course.entity.js +9 -9
  27. package/lib/catalog/seed/courses/course.entity.js.map +1 -1
  28. package/lib/catalog/seed/courses/lesson.entity.d.ts +3 -3
  29. package/lib/catalog/seed/courses/lesson.entity.js +7 -7
  30. package/lib/catalog/seed/courses/lesson.entity.js.map +1 -1
  31. package/lib/catalog/seed/courses/topic.entity.d.ts +3 -3
  32. package/lib/catalog/seed/courses/topic.entity.js +8 -8
  33. package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
  34. package/lib/catalog/seed/expense/category.entity.d.ts +2 -2
  35. package/lib/catalog/seed/expense/category.entity.js +6 -6
  36. package/lib/catalog/seed/expense/category.entity.js.map +1 -1
  37. package/lib/index.d.ts +2 -2
  38. package/lib/index.js +2 -2
  39. package/lib/index.js.map +1 -1
  40. package/lib/profile/agent/agent.entity.d.ts +13 -4
  41. package/lib/profile/agent/agent.entity.js +46 -20
  42. package/lib/profile/agent/agent.entity.js.map +1 -1
  43. package/lib/profile/agent/asset.entity.d.ts +1 -1
  44. package/lib/profile/agent/asset.entity.js +2 -2
  45. package/lib/profile/agent/asset.entity.js.map +1 -1
  46. package/lib/profile/agent/payout.entity.d.ts +3 -3
  47. package/lib/profile/agent/payout.entity.js +6 -6
  48. package/lib/profile/agent/payout.entity.js.map +1 -1
  49. package/lib/profile/agent/promotion.entity.d.ts +3 -3
  50. package/lib/profile/agent/promotion.entity.js +6 -6
  51. package/lib/profile/agent/promotion.entity.js.map +1 -1
  52. package/lib/profile/company/company.entity.d.ts +80 -9
  53. package/lib/profile/company/company.entity.js +246 -36
  54. package/lib/profile/company/company.entity.js.map +1 -1
  55. package/lib/profile/company/course/appointment.entity.d.ts +73 -4
  56. package/lib/profile/company/course/appointment.entity.js +247 -0
  57. package/lib/profile/company/course/appointment.entity.js.map +1 -1
  58. package/lib/profile/company/course/course.entity.d.ts +41 -8
  59. package/lib/profile/company/course/course.entity.js +58 -12
  60. package/lib/profile/company/course/course.entity.js.map +1 -1
  61. package/lib/profile/company/course/lesson.entity.d.ts +30 -7
  62. package/lib/profile/company/course/lesson.entity.js +93 -12
  63. package/lib/profile/company/course/lesson.entity.js.map +1 -1
  64. package/lib/profile/company/course/schedule.entity.d.ts +276 -0
  65. package/lib/profile/company/course/schedule.entity.js +744 -0
  66. package/lib/profile/company/course/schedule.entity.js.map +1 -0
  67. package/lib/profile/company/course/topic.entity.d.ts +9 -4
  68. package/lib/profile/company/course/topic.entity.js +14 -7
  69. package/lib/profile/company/course/topic.entity.js.map +1 -1
  70. package/lib/profile/company/finances/billing/bill.entity.d.ts +9 -2
  71. package/lib/profile/company/finances/billing/bill.entity.js +38 -4
  72. package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
  73. package/lib/profile/company/finances/billing/item.entity.d.ts +8 -3
  74. package/lib/profile/company/finances/billing/item.entity.js +10 -6
  75. package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
  76. package/lib/profile/company/finances/billing/transaction.entity.d.ts +7 -5
  77. package/lib/profile/company/finances/billing/transaction.entity.js +6 -6
  78. package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
  79. package/lib/profile/company/finances/expense/category.entity.d.ts +1 -1
  80. package/lib/profile/company/finances/expense/category.entity.js +4 -4
  81. package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
  82. package/lib/profile/company/finances/expense/expense.entity.d.ts +6 -2
  83. package/lib/profile/company/finances/expense/expense.entity.js +32 -4
  84. package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
  85. package/lib/profile/company/finances/handover/handover.entity.d.ts +3 -3
  86. package/lib/profile/company/finances/handover/handover.entity.js +6 -6
  87. package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
  88. package/lib/profile/company/finances/invoice/invoice.entity.d.ts +8 -7
  89. package/lib/profile/company/finances/invoice/invoice.entity.js +15 -14
  90. package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
  91. package/lib/profile/company/finances/invoice/item.entity.d.ts +2 -2
  92. package/lib/profile/company/finances/invoice/item.entity.js +4 -4
  93. package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
  94. package/lib/profile/company/finances/payment/method.entity.d.ts +24 -4
  95. package/lib/profile/company/finances/payment/method.entity.js +40 -5
  96. package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
  97. package/lib/profile/company/instructor/activity.entity.js.map +1 -1
  98. package/lib/profile/company/instructor/calendar-state.entity.js.map +1 -1
  99. package/lib/profile/company/instructor/instructor.entity.d.ts +34 -17
  100. package/lib/profile/company/instructor/instructor.entity.js +143 -25
  101. package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
  102. package/lib/profile/company/instructor/task.entity.d.ts +2 -1
  103. package/lib/profile/company/instructor/task.entity.js +9 -4
  104. package/lib/profile/company/instructor/task.entity.js.map +1 -1
  105. package/lib/profile/company/medical/examination.entity.d.ts +4 -4
  106. package/lib/profile/company/medical/examination.entity.js +6 -6
  107. package/lib/profile/company/medical/examination.entity.js.map +1 -1
  108. package/lib/profile/company/medical/product.entity.d.ts +4 -5
  109. package/lib/profile/company/medical/product.entity.js +13 -14
  110. package/lib/profile/company/medical/product.entity.js.map +1 -1
  111. package/lib/profile/company/product/addon.entity.d.ts +3 -3
  112. package/lib/profile/company/product/addon.entity.js +6 -7
  113. package/lib/profile/company/product/addon.entity.js.map +1 -1
  114. package/lib/profile/company/product/priceplan.entity.d.ts +15 -13
  115. package/lib/profile/company/product/priceplan.entity.js +20 -16
  116. package/lib/profile/company/product/priceplan.entity.js.map +1 -1
  117. package/lib/profile/company/product/product.entity.d.ts +34 -8
  118. package/lib/profile/company/product/product.entity.js +70 -12
  119. package/lib/profile/company/product/product.entity.js.map +1 -1
  120. package/lib/profile/company/product/vehicle.entity.d.ts +2 -2
  121. package/lib/profile/company/product/vehicle.entity.js +4 -4
  122. package/lib/profile/company/product/vehicle.entity.js.map +1 -1
  123. package/lib/profile/instructor/instructor.entity.d.ts +6 -3
  124. package/lib/profile/instructor/instructor.entity.js +31 -9
  125. package/lib/profile/instructor/instructor.entity.js.map +1 -1
  126. package/lib/profile/student/program/licence/licence.entity.d.ts +13 -5
  127. package/lib/profile/student/program/licence/licence.entity.js +19 -8
  128. package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
  129. package/lib/profile/student/program/medical/certificate.entity.d.ts +3 -3
  130. package/lib/profile/student/program/medical/certificate.entity.js +6 -6
  131. package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
  132. package/lib/profile/student/program/medical/examination.entity.d.ts +4 -4
  133. package/lib/profile/student/program/medical/examination.entity.js +14 -14
  134. package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
  135. package/lib/profile/student/program/program.entity.d.ts +4 -4
  136. package/lib/profile/student/program/program.entity.js +8 -13
  137. package/lib/profile/student/program/program.entity.js.map +1 -1
  138. package/lib/profile/student/program/training/appointment.entity.d.ts +32 -9
  139. package/lib/profile/student/program/training/appointment.entity.js +144 -21
  140. package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
  141. package/lib/profile/student/program/training/exam.entity.d.ts +9 -2
  142. package/lib/profile/student/program/training/exam.entity.js +28 -12
  143. package/lib/profile/student/program/training/exam.entity.js.map +1 -1
  144. package/lib/profile/student/program/training/lesson.entity.d.ts +8 -3
  145. package/lib/profile/student/program/training/lesson.entity.js +28 -6
  146. package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
  147. package/lib/profile/student/program/training/request.entity.d.ts +6 -3
  148. package/lib/profile/student/program/training/request.entity.js +26 -5
  149. package/lib/profile/student/program/training/request.entity.js.map +1 -1
  150. package/lib/profile/student/program/training/topic.entity.d.ts +16 -4
  151. package/lib/profile/student/program/training/topic.entity.js +36 -9
  152. package/lib/profile/student/program/training/topic.entity.js.map +1 -1
  153. package/lib/profile/student/program/training/training.entity.d.ts +50 -6
  154. package/lib/profile/student/program/training/training.entity.js +217 -33
  155. package/lib/profile/student/program/training/training.entity.js.map +1 -1
  156. package/lib/profile/student/program/training/transaction.entity.d.ts +8 -3
  157. package/lib/profile/student/program/training/transaction.entity.js +43 -6
  158. package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
  159. package/lib/profile/student/student.entity.d.ts +11 -6
  160. package/lib/profile/student/student.entity.js +59 -11
  161. package/lib/profile/student/student.entity.js.map +1 -1
  162. package/lib/system/campaign/campaign.entity.d.ts +4 -4
  163. package/lib/system/campaign/campaign.entity.js +10 -10
  164. package/lib/system/campaign/campaign.entity.js.map +1 -1
  165. package/lib/system/campaign/gifcode.entity.d.ts +4 -4
  166. package/lib/system/campaign/gifcode.entity.js +8 -8
  167. package/lib/system/campaign/gifcode.entity.js.map +1 -1
  168. package/lib/system/country/country.entity.d.ts +8 -6
  169. package/lib/system/country/country.entity.js +15 -9
  170. package/lib/system/country/country.entity.js.map +1 -1
  171. package/lib/system/currency/currency.entity.d.ts +1 -1
  172. package/lib/system/currency/currency.entity.js +4 -4
  173. package/lib/system/currency/currency.entity.js.map +1 -1
  174. package/lib/system/driving/category.entity.d.ts +7 -7
  175. package/lib/system/driving/category.entity.js +14 -14
  176. package/lib/system/driving/category.entity.js.map +1 -1
  177. package/lib/system/driving/vehicle.entity.d.ts +2 -2
  178. package/lib/system/driving/vehicle.entity.js +4 -4
  179. package/lib/system/driving/vehicle.entity.js.map +1 -1
  180. package/lib/system/event/event.entity.d.ts +2 -2
  181. package/lib/system/event/event.entity.js +4 -4
  182. package/lib/system/event/event.entity.js.map +1 -1
  183. package/lib/system/event/log.entity.d.ts +2 -2
  184. package/lib/system/event/log.entity.js +3 -3
  185. package/lib/system/event/log.entity.js.map +1 -1
  186. package/lib/system/ical/ical.entity.d.ts +63 -0
  187. package/lib/system/ical/ical.entity.js +70 -0
  188. package/lib/system/ical/ical.entity.js.map +1 -0
  189. package/lib/system/policy/policy.entity.d.ts +2 -2
  190. package/lib/system/policy/policy.entity.js +8 -8
  191. package/lib/system/policy/policy.entity.js.map +1 -1
  192. package/lib/system/staff/staff.entity.d.ts +1 -1
  193. package/lib/system/staff/staff.entity.js +5 -4
  194. package/lib/system/staff/staff.entity.js.map +1 -1
  195. package/lib/tsconfig.tsbuildinfo +1 -1
  196. package/lib/user/alert.entity.d.ts +4 -3
  197. package/lib/user/alert.entity.js +11 -4
  198. package/lib/user/alert.entity.js.map +1 -1
  199. package/lib/user/blocked.entity.js +2 -2
  200. package/lib/user/blocked.entity.js.map +1 -1
  201. package/lib/user/device.entity.d.ts +17 -2
  202. package/lib/user/device.entity.js +29 -3
  203. package/lib/user/device.entity.js.map +1 -1
  204. package/lib/user/notification.entity.d.ts +3 -3
  205. package/lib/user/notification.entity.js +8 -8
  206. package/lib/user/notification.entity.js.map +1 -1
  207. package/lib/user/ticket.entity.d.ts +8 -3
  208. package/lib/user/ticket.entity.js +16 -7
  209. package/lib/user/ticket.entity.js.map +1 -1
  210. package/lib/user/user.entity.d.ts +101 -89
  211. package/lib/user/user.entity.js +272 -270
  212. package/lib/user/user.entity.js.map +1 -1
  213. package/lib/user/verification.entity.js +2 -2
  214. package/lib/user/verification.entity.js.map +1 -1
  215. package/lib/utils/activity.helper.d.ts +2 -2
  216. package/lib/utils/activity.helper.js.map +1 -1
  217. package/lib/utils/trackable.d.ts +13 -2
  218. package/lib/utils/trackable.js +55 -0
  219. package/lib/utils/trackable.js.map +1 -1
  220. package/package.json +3 -3
@@ -11,20 +11,21 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  var CompanyCourseLessonEntity_1;
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.CompanyCourseLessonEntity = void 0;
14
+ const common_1 = require("@driveup/common");
15
+ const shared_1 = require("@driveup/shared");
14
16
  const typeorm_1 = require("typeorm");
15
17
  const luxon_1 = require("luxon");
16
- const shared_1 = require("@driveup/shared");
17
- const common_1 = require("@driveup/common");
18
- const company_entity_1 = require("../company.entity");
19
- const product_entity_1 = require("../product/product.entity");
18
+ const appointment_entity_1 = require("../../student/program/training/appointment.entity");
19
+ const lesson_entity_1 = require("../../student/program/training/lesson.entity");
20
+ const instructor_entity_1 = require("../instructor/instructor.entity");
21
+ const activity_helper_1 = require("../../../utils/activity.helper");
20
22
  const student_entity_1 = require("../../student/student.entity");
23
+ const product_entity_1 = require("../product/product.entity");
24
+ const trackable_1 = require("../../../utils/trackable");
25
+ const company_entity_1 = require("../company.entity");
26
+ const schedule_entity_1 = require("./schedule.entity");
21
27
  const course_entity_1 = require("./course.entity");
22
28
  const topic_entity_1 = require("./topic.entity");
23
- const appointment_entity_1 = require("./appointment.entity");
24
- const instructor_entity_1 = require("../instructor/instructor.entity");
25
- const lesson_entity_1 = require("../../student/program/training/lesson.entity");
26
- const trackable_1 = require("../../../utils/trackable");
27
- const activity_helper_1 = require("../../../utils/activity.helper");
28
29
  /**
29
30
  * Company Course Lesson Entity
30
31
  *
@@ -62,7 +63,7 @@ let CompanyCourseLessonEntity = CompanyCourseLessonEntity_1 = class CompanyCours
62
63
  startDate: this.startDate,
63
64
  endDate: this.endDate,
64
65
  duration: this.duration,
65
- location: this.location ? common_1.Address.toInstance(this.location) : null
66
+ location: this.location ? shared_1.Address.toInstance(this.location) : null
66
67
  });
67
68
  }
68
69
  /**
@@ -112,6 +113,23 @@ let CompanyCourseLessonEntity = CompanyCourseLessonEntity_1 = class CompanyCours
112
113
  async getInstructor() {
113
114
  return await this.instructor;
114
115
  }
116
+ /**
117
+ * For flexible courses only. data is sorted based on appointment date ascending
118
+ */
119
+ async getAppointments(period, filteredInstructorIds) {
120
+ const course = await this.course;
121
+ if (course.isFixed)
122
+ return [];
123
+ period.startDate = new Date(period.startDate);
124
+ period.endDate = new Date(period.endDate);
125
+ const schedule = await this.schedule;
126
+ const appointments = [];
127
+ for (const def of schedule) {
128
+ appointments.push(...(await def.getAppointments(period, filteredInstructorIds)));
129
+ }
130
+ appointments.sort((a, b) => (a.startDate > b.startDate ? 1 : -1));
131
+ return appointments;
132
+ }
115
133
  async getActiveStudentsByAppointments() {
116
134
  return student_entity_1.StudentEntity.createQueryBuilder('student')
117
135
  .innerJoin('student.courseAppointments', 'appointment', 'appointment.studentId = student.id')
@@ -120,6 +138,55 @@ let CompanyCourseLessonEntity = CompanyCourseLessonEntity_1 = class CompanyCours
120
138
  .andWhere('appointment.startDate > : today', { today: luxon_1.DateTime.now().toJSDate() })
121
139
  .getMany();
122
140
  }
141
+ /**
142
+ * For both fixed and flexible courses
143
+ * @param appointment - mandatory for flexible courses. for fixed courses, don't send this argument
144
+ */
145
+ async getTakenSeats(appointment) {
146
+ const course = await this.course;
147
+ if (!course.isFixed && !appointment)
148
+ return;
149
+ if (appointment) {
150
+ return await appointment_entity_1.StudentTrainingAppointmentEntity.createQueryBuilder('ta') // training appointment
151
+ .innerJoin('ta.training', 't') // training
152
+ .innerJoin('ta.lesson', 'tal') // training appointment lesson
153
+ .innerJoin('t.course', 'cc') // company course
154
+ .innerJoin('cc.product', 'cp') // company product
155
+ .where('cc.id = :courseId', { courseId: this.courseId })
156
+ .andWhere('cp.catalogType = :preparationCatalog', { preparationCatalog: shared_1.CatalogType.Preparation })
157
+ .andWhere('tal.lessonId = :lessonId', { lessonId: this.id })
158
+ .andWhere('ta.scheduleId = :scheduleId', { scheduleId: appointment.id })
159
+ .andWhere('t.status != :terminatedStatus', { terminatedStatus: shared_1.StatusType.Terminated })
160
+ .andWhere('ta.startDate = :startDate', { startDate: appointment.startDate })
161
+ .getCount();
162
+ }
163
+ else {
164
+ return await appointment_entity_1.StudentTrainingAppointmentEntity.createQueryBuilder('ta') // training appointment
165
+ .innerJoin('ta.training', 't') // training
166
+ .innerJoin('ta.lesson', 'tal') // training appointment lesson
167
+ .innerJoin('t.course', 'cc') // company course
168
+ .innerJoin('cc.product', 'cp') // company product
169
+ .where('cc.id = :courseId', { courseId: this.courseId })
170
+ .andWhere('cp.catalogType = :preparationCatalog', { preparationCatalog: shared_1.CatalogType.Preparation })
171
+ .andWhere('tal.lessonId = :lessonId', { lessonId: this.id })
172
+ .andWhere('t.status != :terminatedStatus', { terminatedStatus: shared_1.StatusType.Terminated })
173
+ .andWhere('ta.startDate = :startDate', { startDate: this.startDate })
174
+ .getCount();
175
+ }
176
+ }
177
+ /**
178
+ * For both fixed and flexible courses
179
+ * * @param appointment - mandatory for flexible courses. for fixed courses, don't send this argument
180
+ */
181
+ async getRemainingSeats(appointment) {
182
+ const course = await this.course;
183
+ if (!course.isFixed && !appointment)
184
+ return;
185
+ if (!course.maxStudents)
186
+ return;
187
+ const takenSeats = await this.getTakenSeats(appointment);
188
+ return +course.maxStudents - (takenSeats || 0);
189
+ }
123
190
  };
124
191
  exports.CompanyCourseLessonEntity = CompanyCourseLessonEntity;
125
192
  __decorate([
@@ -201,8 +268,22 @@ __decorate([
201
268
  nullable: true,
202
269
  default: null
203
270
  }),
204
- __metadata("design:type", common_1.Address)
271
+ __metadata("design:type", shared_1.Address)
205
272
  ], CompanyCourseLessonEntity.prototype, "location", void 0);
273
+ __decorate([
274
+ (0, typeorm_1.Column)({
275
+ nullable: true,
276
+ default: null
277
+ }),
278
+ __metadata("design:type", Date)
279
+ ], CompanyCourseLessonEntity.prototype, "deactivatedOn", void 0);
280
+ __decorate([
281
+ (0, typeorm_1.Column)({
282
+ nullable: false,
283
+ default: false
284
+ }),
285
+ __metadata("design:type", Boolean)
286
+ ], CompanyCourseLessonEntity.prototype, "canceled", void 0);
206
287
  __decorate([
207
288
  (0, typeorm_1.Column)({ nullable: true, default: null }),
208
289
  __metadata("design:type", Date)
@@ -224,7 +305,7 @@ __decorate([
224
305
  __metadata("design:type", Promise)
225
306
  ], CompanyCourseLessonEntity.prototype, "topics", void 0);
226
307
  __decorate([
227
- (0, typeorm_1.OneToMany)(() => appointment_entity_1.CompanyCourseScheduleEntity, student => student.lesson),
308
+ (0, typeorm_1.OneToMany)(() => schedule_entity_1.CompanyCourseScheduleEntity, student => student.lesson),
228
309
  __metadata("design:type", Promise)
229
310
  ], CompanyCourseLessonEntity.prototype, "schedule", void 0);
230
311
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"lesson.entity.js","sourceRoot":"","sources":["../../../../src/profile/company/course/lesson.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAgE;AAChE,iCAAiC;AACjC,4CAA+C;AAC/C,4CAAqE;AACrE,sDAAkD;AAClD,8DAAiE;AACjE,iEAA6D;AAC7D,mDAAsD;AACtD,iDAA0D;AAC1D,6DAAmE;AACnE,uEAA0E;AAC1E,gF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C;;6DAC3C;AAM7C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAwB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;yDACzB;AAM5C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gDAA2B,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;2DACvB;AAMjD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,2CAA2B,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;iEACjB;oCA/J3C,yBAAyB;IADrC,IAAA,gBAAM,EAAC,sBAAsB,CAAC;;GAClB,yBAAyB,CA6PrC"}
1
+ {"version":3,"file":"lesson.entity.js","sourceRoot":"","sources":["../../../../src/profile/company/course/lesson.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,4CAAiF;AACjF,4CAAiF;AACjF,qCAA+D;AAC/D,iCAAiC;AAEjC,0FAAqG;AACrG,gFAA2F;AAC3F,uEAA0E;AAC1E,oEAA4D;AAC5D,iEAA6D;AAC7D,8DAAiE;AACjE,wDAA2D;AAC3D,sDAAkD;AAClD,uDAAgE;AAChE,mDAAsD;AACtD,iDAA0D;AAE1D;;;;;;;;;GASG;AAEI,IAAM,yBAAyB,iCAA/B,MAAM,yBAA0B,SAAQ,2BAAuB;IAoLrE;;;OAGG;IACH,YAAY,KAA0C;QACrD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACZ,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACtF,OAAO,eAAM,CAAC,UAAU,CAAC;YACxB,EAAE,EAA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,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;6DACvB;AAMnB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAmB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;yDAC5B;AAMrC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,2CAAuB,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,oBAAoB,CAAC;;6DAC3C;AAM7C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAwB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;yDACzB;AAO5C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAA2B,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;2DACvB;AAMjD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,2CAA2B,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;iEACjB;oCAlL3C,yBAAyB;IADrC,IAAA,gBAAM,EAAC,sBAAsB,CAAC;;GAClB,yBAAyB,CA4VrC"}
@@ -0,0 +1,276 @@
1
+ import { Activity, Appointment, RecurringAppointment } from '@driveup/common';
2
+ import { IDateAssignment, IDateDuration, IDateUpdate, Period, WeekDay } from '@driveup/shared';
3
+ import { DateTime } from 'luxon';
4
+ import { TrackableEntity } from '../../../utils/trackable';
5
+ import { StudentTrainingAppointmentEntity } from '../../student/program/training/appointment.entity';
6
+ import { CompanyInstructorEntity } from '../instructor/instructor.entity';
7
+ import { CompanyCourseLessonEntity } from './lesson.entity';
8
+ /**
9
+ * Represents a series of training appointment offers managed by the company.
10
+ *
11
+ * This entity defines appointment templates that serve as available time slots
12
+ * for student training sessions. Companies manage these appointments to organize
13
+ * their course training schedules, which students can then book.
14
+ *
15
+ * Supports both single and recurring appointments with flexible scheduling options
16
+ * including:
17
+ * - Weekly repetitions on specific weekdays
18
+ * - Custom date ranges for recurring appointments
19
+ * - Exception handling for skipped dates
20
+ * - Per-date overrides for time, instructor, and duration
21
+ *
22
+ * @remarks
23
+ * This is a company-managed entity that creates the foundation for student
24
+ * training bookings. Each appointment definition can generate multiple actual
25
+ * student appointments based on its repetition settings.
26
+ *
27
+ * @see {@link CompanyCourseLessonEntity} for the associated course lesson
28
+ * @see {@link StudentTrainingEntity} for student bookings
29
+ */
30
+ export declare class CompanyCourseScheduleEntity extends TrackableEntity<RecurringAppointment> {
31
+ /**
32
+ * Company course lesson
33
+ */
34
+ lessonId: number;
35
+ /**
36
+ * In-charge instructor for the appointment
37
+ * For driving courses, can be empty
38
+ */
39
+ instructorId: number;
40
+ /**
41
+ * Unique identifier
42
+ */
43
+ uid: string;
44
+ /**
45
+ * Represents the lesson start date for single appointments by student trainings.
46
+ * @remarks By recurring appoitmnets this field represents start of sierie
47
+ */
48
+ startDate: Date;
49
+ /**
50
+ * Represents the lesson end date for single appointments by student trainings.
51
+ * @remarks By recurring appoitmnets this field represents end of sierie (repeat until this date)
52
+ */
53
+ endDate: Date;
54
+ /**
55
+ * Duration of the appointment in minutes
56
+ * By fix courses this value is inherited from lesson
57
+ */
58
+ duration: number;
59
+ /**
60
+ * Indicates if the appointment is recurring
61
+ */
62
+ repetition: boolean;
63
+ /**
64
+ * Weekdays on which the appointment recurs
65
+ */
66
+ weekdays: WeekDay[];
67
+ /**
68
+ * Skipped dates for this recurring appointment
69
+ */
70
+ skippedDates: Date[];
71
+ /**
72
+ * Changed dates for this recurring appointment
73
+ */
74
+ updates: IDateUpdate[];
75
+ /**
76
+ * Different instructors for specific dates
77
+ */
78
+ instructors: IDateAssignment[];
79
+ /**
80
+ * Different durations for specific dates
81
+ */
82
+ durations: IDateDuration[];
83
+ /**
84
+ * Course lesson
85
+ */
86
+ lesson: Promise<CompanyCourseLessonEntity>;
87
+ /**
88
+ * Company instructor relation
89
+ */
90
+ instructor: Promise<CompanyInstructorEntity>;
91
+ /**
92
+ * Student training appointments relation
93
+ * - Will not be used for driving courses
94
+ */
95
+ studentSchedule: Promise<StudentTrainingAppointmentEntity[]>;
96
+ /**
97
+ * Creates a new CompanyCourseScheduleEntity instance
98
+ * @param props - Partial properties to initialize the entity with
99
+ */
100
+ constructor(props?: Partial<CompanyCourseScheduleEntity>);
101
+ /**
102
+ * Converts the entity to a RecurringAppointment model instance
103
+ * @returns Promise resolving to RecurringAppointment model with lesson, instructor, and scheduling details
104
+ */
105
+ toModel(): Promise<RecurringAppointment<any>>;
106
+ /**
107
+ * Returns a summary representation of the appointment
108
+ * @returns Promise resolving to RecurringAppointment model (same as toModel())
109
+ */
110
+ toSummary(): Promise<RecurringAppointment<any>>;
111
+ /**
112
+ * Retrieves all tracked activities for this appointment
113
+ * Includes creation and update timestamps and associated users
114
+ * @returns Promise resolving to array of Activity objects filtered to exclude null values
115
+ */
116
+ getActivities(): Promise<Activity[]>;
117
+ getCompany(): Promise<import("../company.entity").CompanyEntity>;
118
+ getCourse(): Promise<import("./course.entity").CompanyCourseEntity>;
119
+ getLesson(): Promise<CompanyCourseLessonEntity>;
120
+ getInstructor(): Promise<CompanyInstructorEntity>;
121
+ getInstructorByDate(date: Date): Promise<CompanyInstructorEntity>;
122
+ /************************* Manage student appointments *************************/
123
+ /**
124
+ * Get list of related student training appointments, which's training is not terminated
125
+ * @param date Date - defaulted to this.startDate - Must be provided for flexible course appointments
126
+ * @returns StudentTrainingAppointmentEntity[]
127
+ */
128
+ getStudentAppointments(date?: Date): Promise<StudentTrainingAppointmentEntity[]>;
129
+ /**
130
+ * Get total number of students who attended the appointment in the given date
131
+ * @param date Date - defaulted to this.startDate - Must be provided for flexible course appointments
132
+ */
133
+ getTotalAttended(date?: Date): Promise<number>;
134
+ /**
135
+ * Get total number of students who where absent in the appointment in the given date
136
+ * @param date Date - defaulted to this.startDate - Must be provided for flexible course appointments
137
+ */
138
+ getTotalAbsent(date?: Date): Promise<number>;
139
+ /**
140
+ * Get the count of taken seats for this appointment
141
+ * - Only applicable for preparation catalog type courses. Returns null for other catalog types.
142
+ * @param startDate Date - Optional - Only send for flexible courses to specify the desired appointment's startDate
143
+ * @returns number - count of registered student appointments for this appointment
144
+ */
145
+ getTakenSeats(startDate?: Date): Promise<number>;
146
+ /**
147
+ * Get the count of present students for this appointment
148
+ * - Only applicable for preparation catalog type courses. Returns null for other catalog types.
149
+ * @param startDate Date - Optional - Only send for flexible courses to specify the desired appointment's startDate
150
+ * @returns number - count of attended student appointments for this appointment
151
+ */
152
+ getTotalPresentStudents(startDate?: Date): Promise<number>;
153
+ /************************* Flexible courses *************************/
154
+ /**
155
+ * Finds if there is an appointment in the given date (checking all of the updates), and returning it if is found
156
+ * @param date Date - the date to check if belongs to an existing appointment
157
+ * @returns Appointment if an appointment is found in the given date, null otherwise
158
+ */
159
+ getAppointment(date: Date): Promise<Appointment>;
160
+ /**
161
+ * Load all appointments of the definition within the given period
162
+ * @description currently only works for flexible course schedules, and will return an empty array if the related course is fixed. but can and must be extended in the future to return the entire appointment list of the schedule, even if the appointment is fixed, or for another product type entirely.
163
+ * @param period Period
164
+ * @param instructorIds number[] - instructorId to filter by (return only appointments related to this instructor id)
165
+ * @param searchPhrase string - optional search phrase to filter appointments by (course title / part title / registered student name)
166
+ * @returns All appointments of the definition within the given period, filtered by instructorId if provided
167
+ */
168
+ getAppointments(period: Period, instructorIds?: number[], searchPhrase?: string): Promise<Appointment[]>;
169
+ /**
170
+ * Check if there is one appointment with empty seats
171
+ *
172
+ * If the definition has no appointments in the given period, returns true.
173
+ * Since the functions is supposed to return wether any of the definition's appointments have empty seats
174
+ */
175
+ hasAppointmentWithEmptySeats(period: Period): Promise<boolean>;
176
+ /**
177
+ *
178
+ * @param period Period
179
+ * @returns DateTime if a first appointment is found, null otherwise
180
+ */
181
+ getFirstAppointmentDateInPeriod(period: Period): DateTime;
182
+ /**
183
+ * @description Get detailed information about an appointment
184
+ * @param date - DateTime - is presumed to be related to an appointment in this definition
185
+ * @param filteredInstructorIds - number - optional - instrucotr id to filter the appointment by
186
+ * @returns Appointment - appointment information (id, start and end date, instructor information)
187
+ */
188
+ getAppointmentInformation(date: DateTime, filteredInstructorIds?: number[]): Promise<Appointment>;
189
+ /**
190
+ * @description Only for repeted definitions (repetition = true)
191
+ * @description Finds the final date of the appointment, considering any date updates (updates in the startDate)
192
+ * @description If no date updates are found, the original date will be returned
193
+ * @param date DateTime - original date of the appointment (default return value, if no date updates are found)
194
+ * @returns DateTime - final date of the appointment
195
+ */
196
+ getUpdatedDate(date: DateTime): DateTime;
197
+ /**
198
+ * @description Only for repeted definitions (repetition = true)
199
+ * @description Checks wether or not the appointment related to the given date has been removed from schedule (pushed in the skippedDates array)
200
+ * @param date DateTime - date of the appointment
201
+ * @returns DateTime - true if the appointment is skipped, false otherwise
202
+ */
203
+ isDateSkipped(date: DateTime): boolean;
204
+ /**
205
+ * @description Only for repeted definitions (repetition = true)
206
+ * @description Finds the final duration of the appointment, considering any duration updates
207
+ * @description If no duration updates are found, this.duration will be returned by default
208
+ * @param date DateTime - date of the appointment
209
+ * @returns number - duration of the appointment (in minutes)
210
+ */
211
+ getAppointmentDuration(date: DateTime): number;
212
+ /**
213
+ * @description Checks weather or not there is a student with a matching name registered in this schedule for the given appointment
214
+ * @description Currently only works for flexible course trainings (MVP logic), and will always return false for fixed course trainings
215
+ * Must be renamed and extended in the future to support fixed course trainings as well, but will remain as is for the sake of MVP Migration
216
+ * @param appointment Appointment - appointment to check for registered students
217
+ * @param studentName string - name of the student to check for registration
218
+ * @returns boolean - Weather or not there a student with the given name registered for the appointment
219
+ */
220
+ isStudentRegistered(appointment: Appointment, studentName: string): Promise<boolean>;
221
+ /**
222
+ * @description Doesn't check for the definition's endDate, or updates and skippedDates
223
+ * @returns the next appointment based on repetition logic and weekdays assigned
224
+ */
225
+ getNextAppointmentDate(date: DateTime): DateTime;
226
+ /**
227
+ * Get the instructor registered for the appointment (works for repeated and single appointments)
228
+ * @param date Date - the date of the appointment
229
+ * @returns Instructor - simple instructor model
230
+ */
231
+ getAppointmentInstructor(date: DateTime): Promise<{
232
+ id: number;
233
+ name: string;
234
+ image: string;
235
+ phone: string;
236
+ role: import("@driveup/shared").Role;
237
+ status: import("@driveup/shared").AccountStatus;
238
+ canReinstate: boolean;
239
+ calendarLinks: import("@driveup/shared").Link[];
240
+ }>;
241
+ /**
242
+ * @param date DateTime - is presumed to belong to an existing appointment
243
+ * @returns number - instructor id for the appointment of the given date
244
+ */
245
+ getAppointmentInstructorId(date: DateTime): number;
246
+ /**
247
+ * Find instructor by id and map with simple information to User model
248
+ * @param id instructor id
249
+ * @returns Object - For the MVP it returns an object mapped like CompanyInstructorMapper.toSimple with the same interface. should be replaced with Person model in the future
250
+ */
251
+ getInstructorById(id: number): Promise<{
252
+ id: number;
253
+ name: string;
254
+ image: string;
255
+ phone: string;
256
+ role: import("@driveup/shared").Role;
257
+ status: import("@driveup/shared").AccountStatus;
258
+ canReinstate: boolean;
259
+ calendarLinks: import("@driveup/shared").Link[];
260
+ }>;
261
+ /**
262
+ * Get total number of appointments that have any update (duration/instructor/date) after the given date
263
+ * @param from Date - if null, from definition start date
264
+ * @returns number - total updated appointments
265
+ */
266
+ getTotalUpdatedAppointments(from: Date): number;
267
+ getRemainingSeats(date: Date): Promise<number>;
268
+ /**
269
+ * This method must be called anytime when definition's endDate is changed to a value other than null/undefined
270
+ *
271
+ * Removes all 'updates', 'skippedDates', 'instructors' and 'durations' after the definition's endDate
272
+ *
273
+ * - Does not save the definition
274
+ */
275
+ removeUpdatesAfterEndDate(): boolean;
276
+ }