@driveup/schema 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +174 -0
- package/lib/catalog/addon/addon.entity.d.ts +109 -0
- package/lib/catalog/addon/addon.entity.js +260 -0
- package/lib/catalog/addon/addon.entity.js.map +1 -0
- package/lib/catalog/addon/country.entity.d.ts +112 -0
- package/lib/catalog/addon/country.entity.js +246 -0
- package/lib/catalog/addon/country.entity.js.map +1 -0
- package/lib/catalog/driving/category.entity.d.ts +122 -0
- package/lib/catalog/driving/category.entity.js +217 -0
- package/lib/catalog/driving/category.entity.js.map +1 -0
- package/lib/catalog/driving/vehicle.entity.d.ts +49 -0
- package/lib/catalog/driving/vehicle.entity.js +97 -0
- package/lib/catalog/driving/vehicle.entity.js.map +1 -0
- package/lib/catalog/priceplan/priceplan.entity.d.ts +123 -0
- package/lib/catalog/priceplan/priceplan.entity.js +288 -0
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -0
- package/lib/catalog/product/country.entity.d.ts +109 -0
- package/lib/catalog/product/country.entity.js +233 -0
- package/lib/catalog/product/country.entity.js.map +1 -0
- package/lib/catalog/product/priceplan.entity.d.ts +113 -0
- package/lib/catalog/product/priceplan.entity.js +251 -0
- package/lib/catalog/product/priceplan.entity.js.map +1 -0
- package/lib/catalog/product/product.entity.d.ts +104 -0
- package/lib/catalog/product/product.entity.js +262 -0
- package/lib/catalog/product/product.entity.js.map +1 -0
- package/lib/catalog/program/program.entity.d.ts +107 -0
- package/lib/catalog/program/program.entity.js +247 -0
- package/lib/catalog/program/program.entity.js.map +1 -0
- package/lib/catalog/seed/assets/asset.entity.d.ts +68 -0
- package/lib/catalog/seed/assets/asset.entity.js +163 -0
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -0
- package/lib/catalog/seed/courses/course.entity.d.ts +98 -0
- package/lib/catalog/seed/courses/course.entity.js +216 -0
- package/lib/catalog/seed/courses/course.entity.js.map +1 -0
- package/lib/catalog/seed/courses/lesson.entity.d.ts +90 -0
- package/lib/catalog/seed/courses/lesson.entity.js +214 -0
- package/lib/catalog/seed/courses/lesson.entity.js.map +1 -0
- package/lib/catalog/seed/courses/topic.entity.d.ts +77 -0
- package/lib/catalog/seed/courses/topic.entity.js +185 -0
- package/lib/catalog/seed/courses/topic.entity.js.map +1 -0
- package/lib/catalog/seed/expense/category.entity.d.ts +61 -0
- package/lib/catalog/seed/expense/category.entity.js +153 -0
- package/lib/catalog/seed/expense/category.entity.js.map +1 -0
- package/lib/index.d.ts +67 -0
- package/lib/index.js +89 -0
- package/lib/index.js.map +1 -0
- package/lib/profile/agent/agent.entity.d.ts +95 -0
- package/lib/profile/agent/agent.entity.js +223 -0
- package/lib/profile/agent/agent.entity.js.map +1 -0
- package/lib/profile/agent/payout.entity.d.ts +70 -0
- package/lib/profile/agent/payout.entity.js +160 -0
- package/lib/profile/agent/payout.entity.js.map +1 -0
- package/lib/profile/agent/promotion.entity.d.ts +82 -0
- package/lib/profile/agent/promotion.entity.js +174 -0
- package/lib/profile/agent/promotion.entity.js.map +1 -0
- package/lib/profile/company/company.entity.d.ts +234 -0
- package/lib/profile/company/company.entity.js +558 -0
- package/lib/profile/company/company.entity.js.map +1 -0
- package/lib/profile/company/course/appointment.entity.d.ts +111 -0
- package/lib/profile/company/course/appointment.entity.js +240 -0
- package/lib/profile/company/course/appointment.entity.js.map +1 -0
- package/lib/profile/company/course/course.entity.d.ts +156 -0
- package/lib/profile/company/course/course.entity.js +365 -0
- package/lib/profile/company/course/course.entity.js.map +1 -0
- package/lib/profile/company/course/lesson.entity.d.ts +123 -0
- package/lib/profile/company/course/lesson.entity.js +288 -0
- package/lib/profile/company/course/lesson.entity.js.map +1 -0
- package/lib/profile/company/course/topic.entity.d.ts +55 -0
- package/lib/profile/company/course/topic.entity.js +147 -0
- package/lib/profile/company/course/topic.entity.js.map +1 -0
- package/lib/profile/company/finances/billing/bill.entity.d.ts +145 -0
- package/lib/profile/company/finances/billing/bill.entity.js +338 -0
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -0
- package/lib/profile/company/finances/billing/item.entity.d.ts +75 -0
- package/lib/profile/company/finances/billing/item.entity.js +219 -0
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -0
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +44 -0
- package/lib/profile/company/finances/billing/transaction.entity.js +158 -0
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -0
- package/lib/profile/company/finances/expense/category.entity.d.ts +55 -0
- package/lib/profile/company/finances/expense/category.entity.js +117 -0
- package/lib/profile/company/finances/expense/category.entity.js.map +1 -0
- package/lib/profile/company/finances/expense/expense.entity.d.ts +48 -0
- package/lib/profile/company/finances/expense/expense.entity.js +171 -0
- package/lib/profile/company/finances/expense/expense.entity.js.map +1 -0
- package/lib/profile/company/finances/handover/handover.entity.d.ts +44 -0
- package/lib/profile/company/finances/handover/handover.entity.js +202 -0
- package/lib/profile/company/finances/handover/handover.entity.js.map +1 -0
- package/lib/profile/company/finances/invoice/invoice.entity.d.ts +65 -0
- package/lib/profile/company/finances/invoice/invoice.entity.js +296 -0
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -0
- package/lib/profile/company/finances/invoice/item.entity.d.ts +25 -0
- package/lib/profile/company/finances/invoice/item.entity.js +148 -0
- package/lib/profile/company/finances/invoice/item.entity.js.map +1 -0
- package/lib/profile/company/finances/payment/method.entity.d.ts +35 -0
- package/lib/profile/company/finances/payment/method.entity.js +143 -0
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -0
- package/lib/profile/company/finances/peyment/method.entity.d.ts +35 -0
- package/lib/profile/company/finances/peyment/method.entity.js +143 -0
- package/lib/profile/company/finances/peyment/method.entity.js.map +1 -0
- package/lib/profile/company/finances/peyment-method/payment-method.d.ts +34 -0
- package/lib/profile/company/finances/peyment-method/payment-method.js +118 -0
- package/lib/profile/company/finances/peyment-method/payment-method.js.map +1 -0
- package/lib/profile/company/instructor/instructor.entity.d.ts +85 -0
- package/lib/profile/company/instructor/instructor.entity.js +254 -0
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -0
- package/lib/profile/company/instructor/task.entity.d.ts +60 -0
- package/lib/profile/company/instructor/task.entity.js +133 -0
- package/lib/profile/company/instructor/task.entity.js.map +1 -0
- package/lib/profile/company/medical/examination.entity.d.ts +59 -0
- package/lib/profile/company/medical/examination.entity.js +175 -0
- package/lib/profile/company/medical/examination.entity.js.map +1 -0
- package/lib/profile/company/medical/product.entity.d.ts +99 -0
- package/lib/profile/company/medical/product.entity.js +270 -0
- package/lib/profile/company/medical/product.entity.js.map +1 -0
- package/lib/profile/company/metrics/company.metric.d.ts +21 -0
- package/lib/profile/company/metrics/company.metric.js +122 -0
- package/lib/profile/company/metrics/company.metric.js.map +1 -0
- package/lib/profile/company/product/addon.entity.d.ts +93 -0
- package/lib/profile/company/product/addon.entity.js +234 -0
- package/lib/profile/company/product/addon.entity.js.map +1 -0
- package/lib/profile/company/product/priceplan.entity.d.ts +57 -0
- package/lib/profile/company/product/priceplan.entity.js +167 -0
- package/lib/profile/company/product/priceplan.entity.js.map +1 -0
- package/lib/profile/company/product/product.entity.d.ts +171 -0
- package/lib/profile/company/product/product.entity.js +383 -0
- package/lib/profile/company/product/product.entity.js.map +1 -0
- package/lib/profile/company/product/vehicle.entity.d.ts +46 -0
- package/lib/profile/company/product/vehicle.entity.js +144 -0
- package/lib/profile/company/product/vehicle.entity.js.map +1 -0
- package/lib/profile/instructor/instructor.entity.d.ts +80 -0
- package/lib/profile/instructor/instructor.entity.js +186 -0
- package/lib/profile/instructor/instructor.entity.js.map +1 -0
- package/lib/profile/student/program/licence/licence.entity.d.ts +66 -0
- package/lib/profile/student/program/licence/licence.entity.js +187 -0
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -0
- package/lib/profile/student/program/medical/certificate.entity.d.ts +84 -0
- package/lib/profile/student/program/medical/certificate.entity.js +244 -0
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -0
- package/lib/profile/student/program/medical/examination.model.d.ts +65 -0
- package/lib/profile/student/program/medical/examination.model.js +209 -0
- package/lib/profile/student/program/medical/examination.model.js.map +1 -0
- package/lib/profile/student/program/program.entity.d.ts +78 -0
- package/lib/profile/student/program/program.entity.js +225 -0
- package/lib/profile/student/program/program.entity.js.map +1 -0
- package/lib/profile/student/program/training/appointment.entity.d.ts +151 -0
- package/lib/profile/student/program/training/appointment.entity.js +441 -0
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -0
- package/lib/profile/student/program/training/exam.entity.d.ts +41 -0
- package/lib/profile/student/program/training/exam.entity.js +141 -0
- package/lib/profile/student/program/training/exam.entity.js.map +1 -0
- package/lib/profile/student/program/training/lesson.entity.d.ts +84 -0
- package/lib/profile/student/program/training/lesson.entity.js +221 -0
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -0
- package/lib/profile/student/program/training/request.entity.d.ts +56 -0
- package/lib/profile/student/program/training/request.entity.js +159 -0
- package/lib/profile/student/program/training/request.entity.js.map +1 -0
- package/lib/profile/student/program/training/topic.entity.d.ts +109 -0
- package/lib/profile/student/program/training/topic.entity.js +255 -0
- package/lib/profile/student/program/training/topic.entity.js.map +1 -0
- package/lib/profile/student/program/training/training.entity.d.ts +167 -0
- package/lib/profile/student/program/training/training.entity.js +501 -0
- package/lib/profile/student/program/training/training.entity.js.map +1 -0
- package/lib/profile/student/program/training/transaction.entity.d.ts +111 -0
- package/lib/profile/student/program/training/transaction.entity.js +266 -0
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -0
- package/lib/profile/student/student.entity.d.ts +89 -0
- package/lib/profile/student/student.entity.js +183 -0
- package/lib/profile/student/student.entity.js.map +1 -0
- package/lib/system/campaign/campaign.entity.d.ts +68 -0
- package/lib/system/campaign/campaign.entity.js +150 -0
- package/lib/system/campaign/campaign.entity.js.map +1 -0
- package/lib/system/campaign/gifcode.entity.d.ts +14 -0
- package/lib/system/campaign/gifcode.entity.js +77 -0
- package/lib/system/campaign/gifcode.entity.js.map +1 -0
- package/lib/system/campaigne/campaign.entity.d.ts +69 -0
- package/lib/system/campaigne/campaign.entity.js +179 -0
- package/lib/system/campaigne/campaign.entity.js.map +1 -0
- package/lib/system/campaigne/gifcode.entity.d.ts +54 -0
- package/lib/system/campaigne/gifcode.entity.js +126 -0
- package/lib/system/campaigne/gifcode.entity.js.map +1 -0
- package/lib/system/country/country.entity.d.ts +121 -0
- package/lib/system/country/country.entity.js +284 -0
- package/lib/system/country/country.entity.js.map +1 -0
- package/lib/system/country/country.metric.d.ts +12 -0
- package/lib/system/country/country.metric.js +68 -0
- package/lib/system/country/country.metric.js.map +1 -0
- package/lib/system/currency/currency.entity.d.ts +46 -0
- package/lib/system/currency/currency.entity.js +112 -0
- package/lib/system/currency/currency.entity.js.map +1 -0
- package/lib/system/driving/category.entity.d.ts +146 -0
- package/lib/system/driving/category.entity.js +321 -0
- package/lib/system/driving/category.entity.js.map +1 -0
- package/lib/system/driving/vehicle.entity.d.ts +54 -0
- package/lib/system/driving/vehicle.entity.js +130 -0
- package/lib/system/driving/vehicle.entity.js.map +1 -0
- package/lib/system/event/business.entity.d.ts +75 -0
- package/lib/system/event/business.entity.js +170 -0
- package/lib/system/event/business.entity.js.map +1 -0
- package/lib/system/event/log.entity.d.ts +103 -0
- package/lib/system/event/log.entity.js +202 -0
- package/lib/system/event/log.entity.js.map +1 -0
- package/lib/system/policy/policy.entity.d.ts +90 -0
- package/lib/system/policy/policy.entity.js +226 -0
- package/lib/system/policy/policy.entity.js.map +1 -0
- package/lib/system/staff/staff.entity.d.ts +72 -0
- package/lib/system/staff/staff.entity.js +186 -0
- package/lib/system/staff/staff.entity.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/user/alert.entity.d.ts +95 -0
- package/lib/user/alert.entity.js +223 -0
- package/lib/user/alert.entity.js.map +1 -0
- package/lib/user/blocked.entity.d.ts +42 -0
- package/lib/user/blocked.entity.js +83 -0
- package/lib/user/blocked.entity.js.map +1 -0
- package/lib/user/device.entity.d.ts +72 -0
- package/lib/user/device.entity.js +182 -0
- package/lib/user/device.entity.js.map +1 -0
- package/lib/user/notification.entity.d.ts +87 -0
- package/lib/user/notification.entity.js +219 -0
- package/lib/user/notification.entity.js.map +1 -0
- package/lib/user/ticket.entity.d.ts +85 -0
- package/lib/user/ticket.entity.js +231 -0
- package/lib/user/ticket.entity.js.map +1 -0
- package/lib/user/user.entity.d.ts +235 -0
- package/lib/user/user.entity.js +573 -0
- package/lib/user/user.entity.js.map +1 -0
- package/lib/user/verification.entity.d.ts +75 -0
- package/lib/user/verification.entity.js +142 -0
- package/lib/user/verification.entity.js.map +1 -0
- package/lib/utils/activity.helper.d.ts +26 -0
- package/lib/utils/activity.helper.js +39 -0
- package/lib/utils/activity.helper.js.map +1 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.js +21 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/json-metrics.transform.d.ts +35 -0
- package/lib/utils/json-metrics.transform.js +83 -0
- package/lib/utils/json-metrics.transform.js.map +1 -0
- package/lib/utils/numeric.transform.d.ts +38 -0
- package/lib/utils/numeric.transform.js +74 -0
- package/lib/utils/numeric.transform.js.map +1 -0
- package/lib/utils/trackable.entity.d.ts +82 -0
- package/lib/utils/trackable.entity.js +100 -0
- package/lib/utils/trackable.entity.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { StudentTrainingEntity } from './training.entity';
|
|
2
|
+
import { StudentTrainingAppointmentEntity } from './appointment.entity';
|
|
3
|
+
import { CompanyInstructorEntity } from '../../../company/instructor/instructor.entity';
|
|
4
|
+
import { CompanyCourseLessonEntity } from '../../../company/course/lesson.entity';
|
|
5
|
+
import { StudentTrainingTopicEntity } from './topic.entity';
|
|
6
|
+
import { TrackableEntity } from '../../../../utils';
|
|
7
|
+
import { Activity, Lesson } from '@driveup/common';
|
|
8
|
+
export declare class StudentTrainingLessonEntity extends TrackableEntity<Lesson> {
|
|
9
|
+
/**
|
|
10
|
+
* Student training
|
|
11
|
+
*/
|
|
12
|
+
trainingId: number;
|
|
13
|
+
/**
|
|
14
|
+
* Company course lesson
|
|
15
|
+
*/
|
|
16
|
+
lessonId: number;
|
|
17
|
+
/**
|
|
18
|
+
* In-charge innstructor for the training lesson
|
|
19
|
+
*/
|
|
20
|
+
instructorId: number;
|
|
21
|
+
/**
|
|
22
|
+
* Title of the lesson
|
|
23
|
+
*/
|
|
24
|
+
title: string;
|
|
25
|
+
/**
|
|
26
|
+
* Detailed description of the lesson content
|
|
27
|
+
*/
|
|
28
|
+
description: string;
|
|
29
|
+
/**
|
|
30
|
+
* URL to the lesson's representative image
|
|
31
|
+
*/
|
|
32
|
+
imageUrl: string;
|
|
33
|
+
/**
|
|
34
|
+
* Lesson start date
|
|
35
|
+
* Only used in fixed trainings
|
|
36
|
+
*/
|
|
37
|
+
startDate: Date;
|
|
38
|
+
/**
|
|
39
|
+
* Lesson end date
|
|
40
|
+
* Only used in fixed trainings
|
|
41
|
+
*/
|
|
42
|
+
endDate: Date;
|
|
43
|
+
/**
|
|
44
|
+
* Duration of the lesson in minutes
|
|
45
|
+
*/
|
|
46
|
+
duration: number;
|
|
47
|
+
/**
|
|
48
|
+
* Sort order for displaying lessons within a training
|
|
49
|
+
*/
|
|
50
|
+
sort: number;
|
|
51
|
+
/**
|
|
52
|
+
* Timestamp when the lesson was canceled
|
|
53
|
+
*/
|
|
54
|
+
canceledOn: Date;
|
|
55
|
+
/**
|
|
56
|
+
* ID of the user who canceled the lesson
|
|
57
|
+
*/
|
|
58
|
+
canceledBy: number;
|
|
59
|
+
/**
|
|
60
|
+
* Student training relation
|
|
61
|
+
*/
|
|
62
|
+
training: Promise<StudentTrainingEntity>;
|
|
63
|
+
/**
|
|
64
|
+
* Company lesson
|
|
65
|
+
* Keep a record of the original lesson details for managing changes in progress status
|
|
66
|
+
*/
|
|
67
|
+
lesson: Promise<CompanyCourseLessonEntity>;
|
|
68
|
+
/**
|
|
69
|
+
* Lesson instructor
|
|
70
|
+
*/
|
|
71
|
+
instructor: Promise<CompanyInstructorEntity>;
|
|
72
|
+
/**
|
|
73
|
+
* Student lesson topics
|
|
74
|
+
*/
|
|
75
|
+
topics: Promise<StudentTrainingTopicEntity[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Lesson appointments relation
|
|
78
|
+
*/
|
|
79
|
+
appointments: Promise<StudentTrainingAppointmentEntity[]>;
|
|
80
|
+
constructor(props?: Partial<StudentTrainingLessonEntity>);
|
|
81
|
+
toModel(): Promise<Lesson>;
|
|
82
|
+
toSummary(): Promise<Lesson>;
|
|
83
|
+
getActivities(): Promise<Activity[]>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StudentTrainingLessonEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const training_entity_1 = require("./training.entity");
|
|
15
|
+
const appointment_entity_1 = require("./appointment.entity");
|
|
16
|
+
const instructor_entity_1 = require("../../../company/instructor/instructor.entity");
|
|
17
|
+
const lesson_entity_1 = require("../../../company/course/lesson.entity");
|
|
18
|
+
const topic_entity_1 = require("./topic.entity");
|
|
19
|
+
const utils_1 = require("../../../../utils");
|
|
20
|
+
const common_1 = require("@driveup/common");
|
|
21
|
+
let StudentTrainingLessonEntity = class StudentTrainingLessonEntity extends utils_1.TrackableEntity {
|
|
22
|
+
/**
|
|
23
|
+
* Student training
|
|
24
|
+
*/
|
|
25
|
+
trainingId;
|
|
26
|
+
/**
|
|
27
|
+
* Company course lesson
|
|
28
|
+
*/
|
|
29
|
+
lessonId;
|
|
30
|
+
/**
|
|
31
|
+
* In-charge innstructor for the training lesson
|
|
32
|
+
*/
|
|
33
|
+
instructorId;
|
|
34
|
+
/**
|
|
35
|
+
* Title of the lesson
|
|
36
|
+
*/
|
|
37
|
+
title;
|
|
38
|
+
/**
|
|
39
|
+
* Detailed description of the lesson content
|
|
40
|
+
*/
|
|
41
|
+
description;
|
|
42
|
+
/**
|
|
43
|
+
* URL to the lesson's representative image
|
|
44
|
+
*/
|
|
45
|
+
imageUrl;
|
|
46
|
+
/**
|
|
47
|
+
* Lesson start date
|
|
48
|
+
* Only used in fixed trainings
|
|
49
|
+
*/
|
|
50
|
+
startDate;
|
|
51
|
+
/**
|
|
52
|
+
* Lesson end date
|
|
53
|
+
* Only used in fixed trainings
|
|
54
|
+
*/
|
|
55
|
+
endDate;
|
|
56
|
+
/**
|
|
57
|
+
* Duration of the lesson in minutes
|
|
58
|
+
*/
|
|
59
|
+
duration;
|
|
60
|
+
/**
|
|
61
|
+
* Sort order for displaying lessons within a training
|
|
62
|
+
*/
|
|
63
|
+
sort;
|
|
64
|
+
/**
|
|
65
|
+
* Timestamp when the lesson was canceled
|
|
66
|
+
*/
|
|
67
|
+
canceledOn;
|
|
68
|
+
/**
|
|
69
|
+
* ID of the user who canceled the lesson
|
|
70
|
+
*/
|
|
71
|
+
canceledBy;
|
|
72
|
+
/**
|
|
73
|
+
* Student training relation
|
|
74
|
+
*/
|
|
75
|
+
training;
|
|
76
|
+
/**
|
|
77
|
+
* Company lesson
|
|
78
|
+
* Keep a record of the original lesson details for managing changes in progress status
|
|
79
|
+
*/
|
|
80
|
+
lesson;
|
|
81
|
+
/**
|
|
82
|
+
* Lesson instructor
|
|
83
|
+
*/
|
|
84
|
+
instructor;
|
|
85
|
+
/**
|
|
86
|
+
* Student lesson topics
|
|
87
|
+
*/
|
|
88
|
+
topics;
|
|
89
|
+
/**
|
|
90
|
+
* Lesson appointments relation
|
|
91
|
+
*/
|
|
92
|
+
appointments;
|
|
93
|
+
constructor(props) {
|
|
94
|
+
super();
|
|
95
|
+
Object.assign(this, props);
|
|
96
|
+
}
|
|
97
|
+
async toModel() {
|
|
98
|
+
const instructor = this.instructorId ? await (await this.instructor).toModel() : null;
|
|
99
|
+
return new common_1.Lesson({
|
|
100
|
+
id: this.id,
|
|
101
|
+
instructor: instructor,
|
|
102
|
+
title: this.title,
|
|
103
|
+
description: this.description,
|
|
104
|
+
imageUrl: this.imageUrl,
|
|
105
|
+
duration: this.duration,
|
|
106
|
+
startDate: this.startDate,
|
|
107
|
+
endDate: this.endDate,
|
|
108
|
+
sort: this.sort
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
toSummary() {
|
|
112
|
+
return this.toModel();
|
|
113
|
+
}
|
|
114
|
+
async getActivities() {
|
|
115
|
+
const activities = [];
|
|
116
|
+
activities.push(await (0, utils_1.toActivity)(this.createdBy, common_1.ActivityType.createdBy));
|
|
117
|
+
activities.push(await (0, utils_1.toActivity)(this.createdOn, common_1.ActivityType.createdOn));
|
|
118
|
+
activities.push(await (0, utils_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy));
|
|
119
|
+
activities.push(await (0, utils_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
120
|
+
return activities.filter(a => a);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
exports.StudentTrainingLessonEntity = StudentTrainingLessonEntity;
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.Column)(),
|
|
126
|
+
__metadata("design:type", Number)
|
|
127
|
+
], StudentTrainingLessonEntity.prototype, "trainingId", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, typeorm_1.Column)({
|
|
130
|
+
nullable: true,
|
|
131
|
+
default: null
|
|
132
|
+
}),
|
|
133
|
+
__metadata("design:type", Number)
|
|
134
|
+
], StudentTrainingLessonEntity.prototype, "lessonId", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.Column)({
|
|
137
|
+
nullable: true,
|
|
138
|
+
default: null
|
|
139
|
+
}),
|
|
140
|
+
__metadata("design:type", Number)
|
|
141
|
+
], StudentTrainingLessonEntity.prototype, "instructorId", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, typeorm_1.Column)(),
|
|
144
|
+
__metadata("design:type", String)
|
|
145
|
+
], StudentTrainingLessonEntity.prototype, "title", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, typeorm_1.Column)({
|
|
148
|
+
nullable: true,
|
|
149
|
+
default: null
|
|
150
|
+
}),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], StudentTrainingLessonEntity.prototype, "description", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, typeorm_1.Column)({
|
|
155
|
+
nullable: true,
|
|
156
|
+
default: null
|
|
157
|
+
}),
|
|
158
|
+
__metadata("design:type", String)
|
|
159
|
+
], StudentTrainingLessonEntity.prototype, "imageUrl", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
(0, typeorm_1.Column)({
|
|
162
|
+
nullable: true,
|
|
163
|
+
default: null
|
|
164
|
+
}),
|
|
165
|
+
__metadata("design:type", Date)
|
|
166
|
+
], StudentTrainingLessonEntity.prototype, "startDate", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, typeorm_1.Column)({
|
|
169
|
+
nullable: true,
|
|
170
|
+
default: null
|
|
171
|
+
}),
|
|
172
|
+
__metadata("design:type", Date)
|
|
173
|
+
], StudentTrainingLessonEntity.prototype, "endDate", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
(0, typeorm_1.Column)({
|
|
176
|
+
nullable: true,
|
|
177
|
+
default: null
|
|
178
|
+
}),
|
|
179
|
+
__metadata("design:type", Number)
|
|
180
|
+
], StudentTrainingLessonEntity.prototype, "duration", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
(0, typeorm_1.Column)({
|
|
183
|
+
type: 'tinyint',
|
|
184
|
+
nullable: true,
|
|
185
|
+
default: null
|
|
186
|
+
}),
|
|
187
|
+
__metadata("design:type", Number)
|
|
188
|
+
], StudentTrainingLessonEntity.prototype, "sort", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, typeorm_1.Column)({ nullable: false, default: false }),
|
|
191
|
+
__metadata("design:type", Date)
|
|
192
|
+
], StudentTrainingLessonEntity.prototype, "canceledOn", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
(0, typeorm_1.Column)({ nullable: false, default: false }),
|
|
195
|
+
__metadata("design:type", Number)
|
|
196
|
+
], StudentTrainingLessonEntity.prototype, "canceledBy", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, typeorm_1.ManyToOne)(() => training_entity_1.StudentTrainingEntity, training => training.lessons),
|
|
199
|
+
__metadata("design:type", Promise)
|
|
200
|
+
], StudentTrainingLessonEntity.prototype, "training", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
(0, typeorm_1.ManyToOne)(() => lesson_entity_1.CompanyCourseLessonEntity, training => training.studentLessons),
|
|
203
|
+
__metadata("design:type", Promise)
|
|
204
|
+
], StudentTrainingLessonEntity.prototype, "lesson", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
(0, typeorm_1.ManyToOne)(() => instructor_entity_1.CompanyInstructorEntity, training => training.studentTrainingLessons),
|
|
207
|
+
__metadata("design:type", Promise)
|
|
208
|
+
], StudentTrainingLessonEntity.prototype, "instructor", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
(0, typeorm_1.OneToMany)(() => topic_entity_1.StudentTrainingTopicEntity, topic => topic.lesson),
|
|
211
|
+
__metadata("design:type", Promise)
|
|
212
|
+
], StudentTrainingLessonEntity.prototype, "topics", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
(0, typeorm_1.OneToMany)(() => appointment_entity_1.StudentTrainingAppointmentEntity, appointment => appointment.lesson),
|
|
215
|
+
__metadata("design:type", Promise)
|
|
216
|
+
], StudentTrainingLessonEntity.prototype, "appointments", void 0);
|
|
217
|
+
exports.StudentTrainingLessonEntity = StudentTrainingLessonEntity = __decorate([
|
|
218
|
+
(0, typeorm_1.Entity)('studentTrainingLessons'),
|
|
219
|
+
__metadata("design:paramtypes", [Object])
|
|
220
|
+
], StudentTrainingLessonEntity);
|
|
221
|
+
//# sourceMappingURL=lesson.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lesson.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/training/lesson.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgE;AAChE,uDAA0D;AAC1D,6DAAwE;AACxE,qFAAwF;AACxF,yEAAkF;AAClF,iDAA4D;AAC5D,6CAAgE;AAChE,4CAA2E;AAGpE,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,uBAAuB;IAEvE;;OAEG;IAEH,UAAU,CAAS;IAEnB;;OAEG;IAKH,QAAQ,CAAS;IAEjB;;OAEG;IAKH,YAAY,CAAS;IAErB;;OAEG;IAEH,KAAK,CAAS;IAEd;;OAEG;IAKH,WAAW,CAAS;IAEpB;;OAEG;IAKH,QAAQ,CAAS;IAEjB;;;OAGG;IAKH,SAAS,CAAO;IAEhB;;;OAGG;IAKH,OAAO,CAAO;IAEd;;OAEG;IAKH,QAAQ,CAAS;IAEjB;;OAEG;IAMH,IAAI,CAAS;IAEb;;OAEG;IAEH,UAAU,CAAO;IAEjB;;OAEG;IAEH,UAAU,CAAS;IAEnB;;OAEG;IAEH,QAAQ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E,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;8BAChC,IAAI;+DAAC;AAMjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+DACzB;AAMnB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAqB,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;6DAC5B;AAOzC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,yCAAyB,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;;2DACrC;AAM3C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,2CAAuB,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;;+DACzC;AAM7C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,yCAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;;2DACrB;AAM9C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qDAAgC,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC;;iEAC3B;sCAlI9C,2BAA2B;IADvC,IAAA,gBAAM,EAAC,wBAAwB,CAAC;;GACpB,2BAA2B,CAoKvC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Activity, CarTransmission, StatusType, TrainingRequest } from '@driveup/common';
|
|
2
|
+
import { StudentProgramEntity } from '../program.entity';
|
|
3
|
+
import { CompanyCourseEntity } from '../../../company/course/course.entity';
|
|
4
|
+
import { TrackableEntity } from '../../../../utils';
|
|
5
|
+
export declare class StudentTrainingRequestEntity extends TrackableEntity<TrainingRequest> {
|
|
6
|
+
/**
|
|
7
|
+
* Student program
|
|
8
|
+
*/
|
|
9
|
+
programId: number;
|
|
10
|
+
/**
|
|
11
|
+
* Company course
|
|
12
|
+
*/
|
|
13
|
+
courseId: number;
|
|
14
|
+
/**
|
|
15
|
+
* Current status of the training request (Pending, Approved, or Rejected)
|
|
16
|
+
* @default StatusType.Pending
|
|
17
|
+
*/
|
|
18
|
+
status: StatusType;
|
|
19
|
+
/**
|
|
20
|
+
* Requested start date for the training
|
|
21
|
+
*/
|
|
22
|
+
startDate: Date;
|
|
23
|
+
/**
|
|
24
|
+
* Preferred car transmission type for driving training
|
|
25
|
+
* @default CarTransmission.Manual
|
|
26
|
+
*/
|
|
27
|
+
transmission: CarTransmission;
|
|
28
|
+
/**
|
|
29
|
+
* Timestamp when the request was accepted
|
|
30
|
+
*/
|
|
31
|
+
acceptedOn: Date;
|
|
32
|
+
/**
|
|
33
|
+
* ID of the user who accepted the request
|
|
34
|
+
*/
|
|
35
|
+
acceptedBy: number;
|
|
36
|
+
/**
|
|
37
|
+
* ID of the user who rejected the request
|
|
38
|
+
*/
|
|
39
|
+
rejectedBy: number;
|
|
40
|
+
/**
|
|
41
|
+
* Timestamp when the request was rejected
|
|
42
|
+
*/
|
|
43
|
+
rejectedOn: Date;
|
|
44
|
+
/**
|
|
45
|
+
* Student program relation
|
|
46
|
+
*/
|
|
47
|
+
program: Promise<StudentProgramEntity>;
|
|
48
|
+
/**
|
|
49
|
+
* Company training relation
|
|
50
|
+
*/
|
|
51
|
+
course: Promise<CompanyCourseEntity>;
|
|
52
|
+
constructor(props?: Partial<StudentTrainingRequestEntity>);
|
|
53
|
+
toModel(): Promise<TrainingRequest>;
|
|
54
|
+
toSummary(): Promise<TrainingRequest>;
|
|
55
|
+
getActivities(): Promise<Activity[]>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StudentTrainingRequestEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const common_1 = require("@driveup/common");
|
|
15
|
+
const program_entity_1 = require("../program.entity");
|
|
16
|
+
const course_entity_1 = require("../../../company/course/course.entity");
|
|
17
|
+
const utils_1 = require("../../../../utils");
|
|
18
|
+
let StudentTrainingRequestEntity = class StudentTrainingRequestEntity extends utils_1.TrackableEntity {
|
|
19
|
+
/**
|
|
20
|
+
* Student program
|
|
21
|
+
*/
|
|
22
|
+
programId;
|
|
23
|
+
/**
|
|
24
|
+
* Company course
|
|
25
|
+
*/
|
|
26
|
+
courseId;
|
|
27
|
+
/**
|
|
28
|
+
* Current status of the training request (Pending, Approved, or Rejected)
|
|
29
|
+
* @default StatusType.Pending
|
|
30
|
+
*/
|
|
31
|
+
status;
|
|
32
|
+
/**
|
|
33
|
+
* Requested start date for the training
|
|
34
|
+
*/
|
|
35
|
+
startDate;
|
|
36
|
+
/**
|
|
37
|
+
* Preferred car transmission type for driving training
|
|
38
|
+
* @default CarTransmission.Manual
|
|
39
|
+
*/
|
|
40
|
+
transmission;
|
|
41
|
+
/**
|
|
42
|
+
* Timestamp when the request was accepted
|
|
43
|
+
*/
|
|
44
|
+
acceptedOn;
|
|
45
|
+
/**
|
|
46
|
+
* ID of the user who accepted the request
|
|
47
|
+
*/
|
|
48
|
+
acceptedBy;
|
|
49
|
+
/**
|
|
50
|
+
* ID of the user who rejected the request
|
|
51
|
+
*/
|
|
52
|
+
rejectedBy;
|
|
53
|
+
/**
|
|
54
|
+
* Timestamp when the request was rejected
|
|
55
|
+
*/
|
|
56
|
+
rejectedOn;
|
|
57
|
+
/**
|
|
58
|
+
* Student program relation
|
|
59
|
+
*/
|
|
60
|
+
program;
|
|
61
|
+
/**
|
|
62
|
+
* Company training relation
|
|
63
|
+
*/
|
|
64
|
+
course;
|
|
65
|
+
constructor(props) {
|
|
66
|
+
super();
|
|
67
|
+
Object.assign(this, props);
|
|
68
|
+
}
|
|
69
|
+
async toModel() {
|
|
70
|
+
const student = await (await this.program).student;
|
|
71
|
+
return new common_1.TrainingRequest({
|
|
72
|
+
id: this.id,
|
|
73
|
+
course: await (await this.course).toModel(),
|
|
74
|
+
student: await student.toModel(),
|
|
75
|
+
status: this.status,
|
|
76
|
+
startDate: this.startDate,
|
|
77
|
+
transmission: this.transmission,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async toSummary() {
|
|
81
|
+
return this.toModel();
|
|
82
|
+
}
|
|
83
|
+
async getActivities() {
|
|
84
|
+
const activities = [];
|
|
85
|
+
activities.push(await (0, utils_1.toActivity)(this.createdBy, common_1.ActivityType.createdBy));
|
|
86
|
+
activities.push(await (0, utils_1.toActivity)(this.createdOn, common_1.ActivityType.createdOn));
|
|
87
|
+
activities.push(await (0, utils_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy));
|
|
88
|
+
activities.push(await (0, utils_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
89
|
+
activities.push(await (0, utils_1.toActivity)(this.acceptedBy, common_1.ActivityType.acceptedBy));
|
|
90
|
+
activities.push(await (0, utils_1.toActivity)(this.acceptedOn, common_1.ActivityType.acceptedOn));
|
|
91
|
+
activities.push(await (0, utils_1.toActivity)(this.rejectedBy, common_1.ActivityType.rejectedBy));
|
|
92
|
+
activities.push(await (0, utils_1.toActivity)(this.rejectedOn, common_1.ActivityType.rejectedOn));
|
|
93
|
+
return activities.filter(a => a);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
exports.StudentTrainingRequestEntity = StudentTrainingRequestEntity;
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typeorm_1.Column)(),
|
|
99
|
+
__metadata("design:type", Number)
|
|
100
|
+
], StudentTrainingRequestEntity.prototype, "programId", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, typeorm_1.Column)(),
|
|
103
|
+
__metadata("design:type", Number)
|
|
104
|
+
], StudentTrainingRequestEntity.prototype, "courseId", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, typeorm_1.Column)({
|
|
107
|
+
type: 'enum',
|
|
108
|
+
enum: [
|
|
109
|
+
common_1.StatusType.Pending,
|
|
110
|
+
common_1.StatusType.Approved,
|
|
111
|
+
common_1.StatusType.Rejected
|
|
112
|
+
],
|
|
113
|
+
default: common_1.StatusType.Pending,
|
|
114
|
+
nullable: false
|
|
115
|
+
}),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], StudentTrainingRequestEntity.prototype, "status", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, typeorm_1.Column)(),
|
|
120
|
+
__metadata("design:type", Date)
|
|
121
|
+
], StudentTrainingRequestEntity.prototype, "startDate", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, typeorm_1.Column)({
|
|
124
|
+
type: 'enum',
|
|
125
|
+
enum: common_1.CarTransmission,
|
|
126
|
+
default: common_1.CarTransmission.Manual,
|
|
127
|
+
nullable: false
|
|
128
|
+
}),
|
|
129
|
+
__metadata("design:type", String)
|
|
130
|
+
], StudentTrainingRequestEntity.prototype, "transmission", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
133
|
+
__metadata("design:type", Date)
|
|
134
|
+
], StudentTrainingRequestEntity.prototype, "acceptedOn", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
137
|
+
__metadata("design:type", Number)
|
|
138
|
+
], StudentTrainingRequestEntity.prototype, "acceptedBy", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
141
|
+
__metadata("design:type", Number)
|
|
142
|
+
], StudentTrainingRequestEntity.prototype, "rejectedBy", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
145
|
+
__metadata("design:type", Date)
|
|
146
|
+
], StudentTrainingRequestEntity.prototype, "rejectedOn", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, typeorm_1.ManyToOne)(() => program_entity_1.StudentProgramEntity, program => program.requestes),
|
|
149
|
+
__metadata("design:type", Promise)
|
|
150
|
+
], StudentTrainingRequestEntity.prototype, "program", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, typeorm_1.ManyToOne)(() => course_entity_1.CompanyCourseEntity, training => training.studentRequestes),
|
|
153
|
+
__metadata("design:type", Promise)
|
|
154
|
+
], StudentTrainingRequestEntity.prototype, "course", void 0);
|
|
155
|
+
exports.StudentTrainingRequestEntity = StudentTrainingRequestEntity = __decorate([
|
|
156
|
+
(0, typeorm_1.Entity)('studentTrainingRequests'),
|
|
157
|
+
__metadata("design:paramtypes", [Object])
|
|
158
|
+
], StudentTrainingRequestEntity);
|
|
159
|
+
//# sourceMappingURL=request.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/training/request.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AACpD,4CAAuG;AACvG,sDAAyD;AACzD,yEAA4E;AAC5E,6CAAgE;AAGzD,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,uBAAgC;IAEjF;;OAEG;IAEH,SAAS,CAAS;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AA,gBAAM,EAAC;QACP,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,wBAAe;QACrB,OAAO,EAAE,wBAAe,CAAC,MAAM;QAC/B,QAAQ,EAAE,KAAK;KACf,CAAC;;kEAC4B;AAM9B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC9B,IAAI;gEAAC;AAMjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;gEACvB;AAMnB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;gEACvB;AAMnB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC9B,IAAI;gEAAC;AAMjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAoB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC;;6DAC7B;AAMvC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAmB,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;;4DACvC;uCAlFzB,4BAA4B;IADxC,IAAA,gBAAM,EAAC,yBAAyB,CAAC;;GACrB,4BAA4B,CAqHxC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Activity, Topic, Skill } from '@driveup/common';
|
|
2
|
+
import { CompanyCourseTopicEntity } from '../../../company/course/topic.entity';
|
|
3
|
+
import { StudentTrainingLessonEntity } from './lesson.entity';
|
|
4
|
+
import { StudentTrainingAppointmentEntity } from './appointment.entity';
|
|
5
|
+
import { TrackableEntity } from '../../../../utils';
|
|
6
|
+
/**
|
|
7
|
+
* Student training topic entity representing topics within a training lesson.
|
|
8
|
+
* Topics are copied from company course topics and tracked individually per student.
|
|
9
|
+
* This allows tracking progress and maintaining data integrity even if company topics change.
|
|
10
|
+
* Extends TrackableEntity to track creation and update information.
|
|
11
|
+
*/
|
|
12
|
+
export declare class StudentTrainingTopicEntity extends TrackableEntity<Topic> {
|
|
13
|
+
/**
|
|
14
|
+
* Student training lesson
|
|
15
|
+
*/
|
|
16
|
+
lessonId: number;
|
|
17
|
+
/**
|
|
18
|
+
* Company lesson topic
|
|
19
|
+
* Keep reference to company topic
|
|
20
|
+
* in case by in progress training the topic is updated or deleted
|
|
21
|
+
*/
|
|
22
|
+
topicId: number;
|
|
23
|
+
/**
|
|
24
|
+
* Topic title
|
|
25
|
+
* Keep copy of title in case company topic is updated or deleted
|
|
26
|
+
*/
|
|
27
|
+
title: string;
|
|
28
|
+
/**
|
|
29
|
+
* Topic description
|
|
30
|
+
* Keep copy of description in case company topic is updated or deleted
|
|
31
|
+
*/
|
|
32
|
+
description: string;
|
|
33
|
+
/**
|
|
34
|
+
* Topic image URL
|
|
35
|
+
* Keep copy of image URL in case company topic is updated or deleted
|
|
36
|
+
*/
|
|
37
|
+
imageUrl: string;
|
|
38
|
+
/**
|
|
39
|
+
* Allow sorting of topics for each student seperately
|
|
40
|
+
*/
|
|
41
|
+
sort: number;
|
|
42
|
+
/**
|
|
43
|
+
* Indicate if the topic has been completed by the student
|
|
44
|
+
*/
|
|
45
|
+
done: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Skills associated with this topic and their assessment scores
|
|
48
|
+
*/
|
|
49
|
+
skills: Skill[];
|
|
50
|
+
/**
|
|
51
|
+
* ID of the user who marked this topic as completed
|
|
52
|
+
*/
|
|
53
|
+
completedBy: number;
|
|
54
|
+
/**
|
|
55
|
+
* Timestamp when this topic was marked as completed
|
|
56
|
+
*/
|
|
57
|
+
completedOn: Date;
|
|
58
|
+
/**
|
|
59
|
+
* Student training lesson relation
|
|
60
|
+
*/
|
|
61
|
+
lesson: Promise<StudentTrainingLessonEntity>;
|
|
62
|
+
/**
|
|
63
|
+
* Company course lesson topic
|
|
64
|
+
* Keep relation to be able to fetch updates if needed
|
|
65
|
+
*/
|
|
66
|
+
topic: Promise<CompanyCourseTopicEntity>;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new StudentTrainingTopicEntity instance
|
|
69
|
+
* @param props - Partial properties to initialize the entity with
|
|
70
|
+
*/
|
|
71
|
+
constructor(props?: Partial<StudentTrainingTopicEntity>);
|
|
72
|
+
/**
|
|
73
|
+
* Converts the entity to a Topic model instance
|
|
74
|
+
* @returns Topic model with topic details and associated skills
|
|
75
|
+
*/
|
|
76
|
+
toModel(): Topic;
|
|
77
|
+
/**
|
|
78
|
+
* Returns a summary representation of the topic
|
|
79
|
+
* @returns Topic model instance (same as toModel())
|
|
80
|
+
*/
|
|
81
|
+
toSummary(): Topic;
|
|
82
|
+
/**
|
|
83
|
+
* Calculates the average score for this topic across all appointments
|
|
84
|
+
* @returns The average score or 0 if no scores are available
|
|
85
|
+
*/
|
|
86
|
+
getScore(): Promise<number>;
|
|
87
|
+
/**
|
|
88
|
+
* Checks if this topic has been included in any training appointments
|
|
89
|
+
* @returns True if the topic has been used in at least one appointment, false otherwise
|
|
90
|
+
*/
|
|
91
|
+
isTouched(): Promise<boolean>;
|
|
92
|
+
/**
|
|
93
|
+
* Checks if this topic has been assessed in a specific training appointment
|
|
94
|
+
* @param session - The training appointment to check for assessment
|
|
95
|
+
* @returns True if the topic has been assessed in the given session, false otherwise
|
|
96
|
+
*/
|
|
97
|
+
hasAssessment(session: StudentTrainingAppointmentEntity): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* Counts how many times this topic has been assessed across all appointments
|
|
100
|
+
* @returns The number of appointments where this topic received an assessment
|
|
101
|
+
*/
|
|
102
|
+
getRepetition(): Promise<number>;
|
|
103
|
+
/**
|
|
104
|
+
* Retrieves all tracked activities for this topic
|
|
105
|
+
* Includes creation, update, and completion timestamps and associated users
|
|
106
|
+
* @returns Array of Activity objects filtered to exclude null values
|
|
107
|
+
*/
|
|
108
|
+
getActivities(): Promise<Activity[]>;
|
|
109
|
+
}
|