@driveup/schema 0.2.2 → 0.2.4
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/lib/catalog/addon/addon.entity.d.ts +2 -2
- package/lib/catalog/addon/addon.entity.js +17 -21
- package/lib/catalog/addon/addon.entity.js.map +1 -1
- package/lib/catalog/addon/country.entity.d.ts +4 -3
- package/lib/catalog/addon/country.entity.js +7 -10
- package/lib/catalog/addon/country.entity.js.map +1 -1
- package/lib/catalog/priceplan/priceplan.entity.d.ts +2 -3
- package/lib/catalog/priceplan/priceplan.entity.js +8 -11
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/country.entity.d.ts +10 -4
- package/lib/catalog/product/country.entity.js +37 -32
- package/lib/catalog/product/country.entity.js.map +1 -1
- package/lib/catalog/product/priceplan.entity.d.ts +4 -3
- package/lib/catalog/product/priceplan.entity.js +7 -11
- package/lib/catalog/product/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/product.entity.d.ts +6 -6
- package/lib/catalog/product/product.entity.js +33 -34
- package/lib/catalog/product/product.entity.js.map +1 -1
- package/lib/catalog/program/program.entity.d.ts +2 -2
- package/lib/catalog/program/program.entity.js +16 -20
- package/lib/catalog/program/program.entity.js.map +1 -1
- package/lib/catalog/seed/assets/asset.entity.d.ts +6 -7
- package/lib/catalog/seed/assets/asset.entity.js +24 -23
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
- package/lib/catalog/seed/courses/course.entity.d.ts +4 -3
- package/lib/catalog/seed/courses/course.entity.js +7 -8
- package/lib/catalog/seed/courses/course.entity.js.map +1 -1
- package/lib/catalog/seed/courses/lesson.entity.d.ts +2 -2
- package/lib/catalog/seed/courses/lesson.entity.js +8 -10
- package/lib/catalog/seed/courses/lesson.entity.js.map +1 -1
- package/lib/catalog/seed/courses/topic.entity.d.ts +2 -2
- package/lib/catalog/seed/courses/topic.entity.js +8 -10
- package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
- package/lib/catalog/seed/expense/category.entity.d.ts +2 -1
- package/lib/catalog/seed/expense/category.entity.js +6 -7
- package/lib/catalog/seed/expense/category.entity.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/profile/agent/agent.entity.d.ts +6 -12
- package/lib/profile/agent/agent.entity.js +23 -34
- package/lib/profile/agent/agent.entity.js.map +1 -1
- package/lib/profile/agent/asset.entity.d.ts +57 -0
- package/lib/profile/agent/asset.entity.js +95 -0
- package/lib/profile/agent/asset.entity.js.map +1 -0
- package/lib/profile/agent/payout.entity.d.ts +2 -2
- package/lib/profile/agent/payout.entity.js +7 -9
- package/lib/profile/agent/payout.entity.js.map +1 -1
- package/lib/profile/agent/promotion.entity.js +3 -4
- package/lib/profile/agent/promotion.entity.js.map +1 -1
- package/lib/profile/company/company.entity.d.ts +8 -6
- package/lib/profile/company/company.entity.js +38 -33
- package/lib/profile/company/company.entity.js.map +1 -1
- package/lib/profile/company/course/appointment.entity.d.ts +11 -6
- package/lib/profile/company/course/appointment.entity.js +42 -28
- package/lib/profile/company/course/appointment.entity.js.map +1 -1
- package/lib/profile/company/course/course.entity.d.ts +22 -4
- package/lib/profile/company/course/course.entity.js +55 -17
- package/lib/profile/company/course/course.entity.js.map +1 -1
- package/lib/profile/company/course/lesson.entity.d.ts +13 -3
- package/lib/profile/company/course/lesson.entity.js +42 -10
- package/lib/profile/company/course/lesson.entity.js.map +1 -1
- package/lib/profile/company/course/topic.entity.d.ts +7 -0
- package/lib/profile/company/course/topic.entity.js +36 -6
- package/lib/profile/company/course/topic.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/bill.entity.d.ts +2 -1
- package/lib/profile/company/finances/billing/bill.entity.js +5 -6
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/item.entity.d.ts +2 -2
- package/lib/profile/company/finances/billing/item.entity.js +4 -5
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +2 -1
- package/lib/profile/company/finances/billing/transaction.entity.js +10 -9
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/category.entity.js +3 -4
- package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/expense.entity.d.ts +2 -1
- package/lib/profile/company/finances/expense/expense.entity.js +9 -12
- package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
- package/lib/profile/company/finances/handover/handover.entity.js +5 -5
- package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/invoice.entity.d.ts +2 -2
- package/lib/profile/company/finances/invoice/invoice.entity.js +21 -26
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/item.entity.d.ts +2 -1
- package/lib/profile/company/finances/invoice/item.entity.js +5 -6
- package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
- package/lib/profile/company/finances/payment/method.entity.js +5 -6
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
- package/lib/profile/company/instructor/activity.entity.d.ts +33 -0
- package/lib/profile/company/instructor/activity.entity.js +53 -0
- package/lib/profile/company/instructor/activity.entity.js.map +1 -0
- package/lib/profile/company/instructor/calendar-state.entity.d.ts +67 -0
- package/lib/profile/company/instructor/calendar-state.entity.js +75 -0
- package/lib/profile/company/instructor/calendar-state.entity.js.map +1 -0
- package/lib/profile/company/instructor/instructor.entity.d.ts +23 -16
- package/lib/profile/company/instructor/instructor.entity.js +69 -46
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/company/instructor/task.entity.js +3 -4
- package/lib/profile/company/instructor/task.entity.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.d.ts +2 -1
- package/lib/profile/company/medical/examination.entity.js +3 -4
- package/lib/profile/company/medical/examination.entity.js.map +1 -1
- package/lib/profile/company/medical/product.entity.d.ts +3 -2
- package/lib/profile/company/medical/product.entity.js +6 -7
- package/lib/profile/company/medical/product.entity.js.map +1 -1
- package/lib/profile/company/product/addon.entity.d.ts +7 -8
- package/lib/profile/company/product/addon.entity.js +42 -38
- package/lib/profile/company/product/addon.entity.js.map +1 -1
- package/lib/profile/company/product/priceplan.entity.d.ts +7 -2
- package/lib/profile/company/product/priceplan.entity.js +10 -5
- package/lib/profile/company/product/priceplan.entity.js.map +1 -1
- package/lib/profile/company/product/product.entity.d.ts +19 -6
- package/lib/profile/company/product/product.entity.js +42 -19
- package/lib/profile/company/product/product.entity.js.map +1 -1
- package/lib/profile/company/product/vehicle.entity.d.ts +2 -1
- package/lib/profile/company/product/vehicle.entity.js +5 -6
- package/lib/profile/company/product/vehicle.entity.js.map +1 -1
- package/lib/profile/instructor/instructor.entity.d.ts +4 -12
- package/lib/profile/instructor/instructor.entity.js +15 -31
- package/lib/profile/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/student/program/licence/licence.entity.d.ts +2 -1
- package/lib/profile/student/program/licence/licence.entity.js +7 -8
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
- package/lib/profile/student/program/medical/certificate.entity.d.ts +2 -1
- package/lib/profile/student/program/medical/certificate.entity.js +9 -10
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
- package/lib/profile/student/program/medical/examination.entity.d.ts +2 -2
- package/lib/profile/student/program/medical/examination.entity.js +14 -16
- package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
- package/lib/profile/student/program/program.entity.d.ts +2 -1
- package/lib/profile/student/program/program.entity.js +7 -8
- package/lib/profile/student/program/program.entity.js.map +1 -1
- package/lib/profile/student/program/training/appointment.entity.d.ts +6 -8
- package/lib/profile/student/program/training/appointment.entity.js +12 -13
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
- package/lib/profile/student/program/training/exam.entity.d.ts +1 -2
- package/lib/profile/student/program/training/exam.entity.js +10 -12
- package/lib/profile/student/program/training/exam.entity.js.map +1 -1
- package/lib/profile/student/program/training/lesson.entity.js +3 -4
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
- package/lib/profile/student/program/training/request.entity.d.ts +2 -1
- package/lib/profile/student/program/training/request.entity.js +11 -14
- package/lib/profile/student/program/training/request.entity.js.map +1 -1
- package/lib/profile/student/program/training/topic.entity.js +6 -8
- package/lib/profile/student/program/training/topic.entity.js.map +1 -1
- package/lib/profile/student/program/training/training.entity.d.ts +3 -4
- package/lib/profile/student/program/training/training.entity.js +26 -31
- package/lib/profile/student/program/training/training.entity.js.map +1 -1
- package/lib/profile/student/program/training/transaction.entity.d.ts +2 -2
- package/lib/profile/student/program/training/transaction.entity.js +12 -14
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +4 -11
- package/lib/profile/student/student.entity.js +15 -30
- package/lib/profile/student/student.entity.js.map +1 -1
- package/lib/system/campaign/campaign.entity.d.ts +2 -2
- package/lib/system/campaign/campaign.entity.js +7 -9
- package/lib/system/campaign/campaign.entity.js.map +1 -1
- package/lib/system/campaign/gifcode.entity.d.ts +3 -2
- package/lib/system/campaign/gifcode.entity.js +7 -8
- package/lib/system/campaign/gifcode.entity.js.map +1 -1
- package/lib/system/country/country.entity.d.ts +4 -3
- package/lib/system/country/country.entity.js +8 -11
- package/lib/system/country/country.entity.js.map +1 -1
- package/lib/system/currency/currency.entity.js +3 -4
- package/lib/system/currency/currency.entity.js.map +1 -1
- package/lib/system/driving/category.entity.d.ts +2 -2
- package/lib/system/driving/category.entity.js +10 -14
- package/lib/system/driving/category.entity.js.map +1 -1
- package/lib/system/driving/vehicle.entity.d.ts +2 -1
- package/lib/system/driving/vehicle.entity.js +5 -6
- package/lib/system/driving/vehicle.entity.js.map +1 -1
- package/lib/system/event/event.entity.d.ts +2 -1
- package/lib/system/event/event.entity.js +10 -10
- package/lib/system/event/event.entity.js.map +1 -1
- package/lib/system/event/log.entity.d.ts +13 -12
- package/lib/system/event/log.entity.js +22 -21
- package/lib/system/event/log.entity.js.map +1 -1
- package/lib/system/policy/policy.entity.d.ts +2 -2
- package/lib/system/policy/policy.entity.js +14 -18
- package/lib/system/policy/policy.entity.js.map +1 -1
- package/lib/system/staff/staff.entity.d.ts +2 -1
- package/lib/system/staff/staff.entity.js +9 -10
- package/lib/system/staff/staff.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/alert.entity.d.ts +13 -2
- package/lib/user/alert.entity.js +29 -11
- package/lib/user/alert.entity.js.map +1 -1
- package/lib/user/blocked.entity.js +2 -5
- package/lib/user/blocked.entity.js.map +1 -1
- package/lib/user/device.entity.js +3 -4
- package/lib/user/device.entity.js.map +1 -1
- package/lib/user/notification.entity.d.ts +2 -2
- package/lib/user/notification.entity.js +11 -13
- package/lib/user/notification.entity.js.map +1 -1
- package/lib/user/ticket.entity.d.ts +2 -2
- package/lib/user/ticket.entity.js +16 -20
- package/lib/user/ticket.entity.js.map +1 -1
- package/lib/user/user.entity.d.ts +16 -6
- package/lib/user/user.entity.js +94 -50
- package/lib/user/user.entity.js.map +1 -1
- package/lib/user/verification.entity.js +3 -5
- package/lib/user/verification.entity.js.map +1 -1
- package/lib/utils/activity.helper.d.ts +3 -2
- package/lib/utils/activity.helper.js +9 -9
- package/lib/utils/activity.helper.js.map +1 -1
- package/lib/utils/trackable.d.ts +2 -1
- package/lib/utils/trackable.js +4 -3
- package/lib/utils/trackable.js.map +1 -1
- package/package.json +6 -5
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.CompanyCourseScheduleEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const common_1 = require("@driveup/common");
|
|
15
15
|
const lesson_entity_1 = require("./lesson.entity");
|
|
@@ -17,6 +17,7 @@ const appointment_entity_1 = require("../../student/program/training/appointment
|
|
|
17
17
|
const instructor_entity_1 = require("../instructor/instructor.entity");
|
|
18
18
|
const trackable_1 = require("../../../utils/trackable");
|
|
19
19
|
const activity_helper_1 = require("../../../utils/activity.helper");
|
|
20
|
+
const shared_1 = require("@driveup/shared");
|
|
20
21
|
/**
|
|
21
22
|
* Represents a series of training appointment offers managed by the company.
|
|
22
23
|
*
|
|
@@ -39,9 +40,9 @@ const activity_helper_1 = require("../../../utils/activity.helper");
|
|
|
39
40
|
* @see {@link CompanyCourseLessonEntity} for the associated course lesson
|
|
40
41
|
* @see {@link StudentTrainingEntity} for student bookings
|
|
41
42
|
*/
|
|
42
|
-
let
|
|
43
|
+
let CompanyCourseScheduleEntity = class CompanyCourseScheduleEntity extends trackable_1.TrackableEntity {
|
|
43
44
|
/**
|
|
44
|
-
* Creates a new
|
|
45
|
+
* Creates a new CompanyCourseScheduleEntity instance
|
|
45
46
|
* @param props - Partial properties to initialize the entity with
|
|
46
47
|
*/
|
|
47
48
|
constructor(props) {
|
|
@@ -84,44 +85,57 @@ let CompanyCourseAppointmentEntity = class CompanyCourseAppointmentEntity extend
|
|
|
84
85
|
*/
|
|
85
86
|
async getActivities() {
|
|
86
87
|
const activities = [];
|
|
87
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
88
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
89
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy));
|
|
90
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
88
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created));
|
|
89
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated));
|
|
91
90
|
return activities.filter(a => a);
|
|
92
91
|
}
|
|
92
|
+
async getCompany() {
|
|
93
|
+
const lesson = await this.lesson;
|
|
94
|
+
return lesson.getCompany();
|
|
95
|
+
}
|
|
96
|
+
async getCourse() {
|
|
97
|
+
const lesson = await this.lesson;
|
|
98
|
+
return lesson.getCourse();
|
|
99
|
+
}
|
|
100
|
+
async getInstructor() {
|
|
101
|
+
return await this.instructor;
|
|
102
|
+
}
|
|
103
|
+
async getInstructorByDate(date) {
|
|
104
|
+
const d = this.instructors?.find(i => i.date === date);
|
|
105
|
+
return d?.id ? await instructor_entity_1.CompanyInstructorEntity.findOneBy({ id: d.id }) : null;
|
|
106
|
+
}
|
|
93
107
|
};
|
|
94
|
-
exports.
|
|
108
|
+
exports.CompanyCourseScheduleEntity = CompanyCourseScheduleEntity;
|
|
95
109
|
__decorate([
|
|
96
110
|
(0, typeorm_1.Column)(),
|
|
97
111
|
__metadata("design:type", Number)
|
|
98
|
-
],
|
|
112
|
+
], CompanyCourseScheduleEntity.prototype, "lessonId", void 0);
|
|
99
113
|
__decorate([
|
|
100
114
|
(0, typeorm_1.Column)({
|
|
101
115
|
nullable: true,
|
|
102
116
|
default: null
|
|
103
117
|
}),
|
|
104
118
|
__metadata("design:type", Number)
|
|
105
|
-
],
|
|
119
|
+
], CompanyCourseScheduleEntity.prototype, "instructorId", void 0);
|
|
106
120
|
__decorate([
|
|
107
121
|
(0, typeorm_1.Column)(),
|
|
108
122
|
__metadata("design:type", Date)
|
|
109
|
-
],
|
|
123
|
+
], CompanyCourseScheduleEntity.prototype, "startDate", void 0);
|
|
110
124
|
__decorate([
|
|
111
125
|
(0, typeorm_1.Column)({
|
|
112
126
|
nullable: true,
|
|
113
127
|
default: null
|
|
114
128
|
}),
|
|
115
129
|
__metadata("design:type", Date)
|
|
116
|
-
],
|
|
130
|
+
], CompanyCourseScheduleEntity.prototype, "endDate", void 0);
|
|
117
131
|
__decorate([
|
|
118
132
|
(0, typeorm_1.Column)({ default: 60 }),
|
|
119
133
|
__metadata("design:type", Number)
|
|
120
|
-
],
|
|
134
|
+
], CompanyCourseScheduleEntity.prototype, "duration", void 0);
|
|
121
135
|
__decorate([
|
|
122
136
|
(0, typeorm_1.Column)({ default: false }),
|
|
123
137
|
__metadata("design:type", Boolean)
|
|
124
|
-
],
|
|
138
|
+
], CompanyCourseScheduleEntity.prototype, "repetition", void 0);
|
|
125
139
|
__decorate([
|
|
126
140
|
(0, typeorm_1.Column)({
|
|
127
141
|
type: 'simple-json',
|
|
@@ -129,7 +143,7 @@ __decorate([
|
|
|
129
143
|
default: null
|
|
130
144
|
}),
|
|
131
145
|
__metadata("design:type", Array)
|
|
132
|
-
],
|
|
146
|
+
], CompanyCourseScheduleEntity.prototype, "weekdays", void 0);
|
|
133
147
|
__decorate([
|
|
134
148
|
(0, typeorm_1.Column)({
|
|
135
149
|
type: 'simple-json',
|
|
@@ -137,7 +151,7 @@ __decorate([
|
|
|
137
151
|
default: null
|
|
138
152
|
}),
|
|
139
153
|
__metadata("design:type", Array)
|
|
140
|
-
],
|
|
154
|
+
], CompanyCourseScheduleEntity.prototype, "skippedDates", void 0);
|
|
141
155
|
__decorate([
|
|
142
156
|
(0, typeorm_1.Column)({
|
|
143
157
|
type: 'simple-json',
|
|
@@ -145,7 +159,7 @@ __decorate([
|
|
|
145
159
|
default: null
|
|
146
160
|
}),
|
|
147
161
|
__metadata("design:type", Array)
|
|
148
|
-
],
|
|
162
|
+
], CompanyCourseScheduleEntity.prototype, "updates", void 0);
|
|
149
163
|
__decorate([
|
|
150
164
|
(0, typeorm_1.Column)({
|
|
151
165
|
type: 'simple-json',
|
|
@@ -153,7 +167,7 @@ __decorate([
|
|
|
153
167
|
default: null
|
|
154
168
|
}),
|
|
155
169
|
__metadata("design:type", Array)
|
|
156
|
-
],
|
|
170
|
+
], CompanyCourseScheduleEntity.prototype, "instructors", void 0);
|
|
157
171
|
__decorate([
|
|
158
172
|
(0, typeorm_1.Column)({
|
|
159
173
|
type: 'simple-json',
|
|
@@ -161,21 +175,21 @@ __decorate([
|
|
|
161
175
|
default: null
|
|
162
176
|
}),
|
|
163
177
|
__metadata("design:type", Array)
|
|
164
|
-
],
|
|
178
|
+
], CompanyCourseScheduleEntity.prototype, "durations", void 0);
|
|
165
179
|
__decorate([
|
|
166
|
-
(0, typeorm_1.ManyToOne)(() => lesson_entity_1.CompanyCourseLessonEntity, lesson => lesson.
|
|
180
|
+
(0, typeorm_1.ManyToOne)(() => lesson_entity_1.CompanyCourseLessonEntity, lesson => lesson.schedule),
|
|
167
181
|
__metadata("design:type", Promise)
|
|
168
|
-
],
|
|
182
|
+
], CompanyCourseScheduleEntity.prototype, "lesson", void 0);
|
|
169
183
|
__decorate([
|
|
170
|
-
(0, typeorm_1.ManyToOne)(() => instructor_entity_1.CompanyInstructorEntity, lesson => lesson.
|
|
184
|
+
(0, typeorm_1.ManyToOne)(() => instructor_entity_1.CompanyInstructorEntity, lesson => lesson.companyCourseSchedule),
|
|
171
185
|
__metadata("design:type", Promise)
|
|
172
|
-
],
|
|
186
|
+
], CompanyCourseScheduleEntity.prototype, "instructor", void 0);
|
|
173
187
|
__decorate([
|
|
174
|
-
(0, typeorm_1.OneToMany)(() => appointment_entity_1.StudentTrainingAppointmentEntity, appointment => appointment.
|
|
188
|
+
(0, typeorm_1.OneToMany)(() => appointment_entity_1.StudentTrainingAppointmentEntity, appointment => appointment.schedule),
|
|
175
189
|
__metadata("design:type", Promise)
|
|
176
|
-
],
|
|
177
|
-
exports.
|
|
178
|
-
(0, typeorm_1.Entity)('
|
|
190
|
+
], CompanyCourseScheduleEntity.prototype, "studentSchedule", void 0);
|
|
191
|
+
exports.CompanyCourseScheduleEntity = CompanyCourseScheduleEntity = __decorate([
|
|
192
|
+
(0, typeorm_1.Entity)('companyCourseSchedules'),
|
|
179
193
|
__metadata("design:paramtypes", [Object])
|
|
180
|
-
],
|
|
194
|
+
], CompanyCourseScheduleEntity);
|
|
181
195
|
//# sourceMappingURL=appointment.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appointment.entity.js","sourceRoot":"","sources":["../../../../src/profile/company/course/appointment.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"appointment.entity.js","sourceRoot":"","sources":["../../../../src/profile/company/course/appointment.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAAiE;AACjE,mDAA4D;AAC5D,0FAAqG;AACrG,uEAA0E;AAC1E,wDAA2D;AAC3D,oEAA4D;AAC5D,4CAAqG;AAErG;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,2BAAqC;IAqHrF;;;OAGG;IACH,YAAY,KAA4C;QACvD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACZ,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACtE,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACxF,OAAO,IAAI,6BAAoB,CAAC;YAC/B,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,UAAU;YACtB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,YAAY,EAAE,IAA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C,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,yCAAyB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;;2DAC3B;AAM3C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,2CAAuB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC;;+DACpC;AAO7C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qDAAgC,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC;;oEAC1B;sCAnHjD,2BAA2B;IADvC,IAAA,gBAAM,EAAC,wBAAwB,CAAC;;GACpB,2BAA2B,CA2LvC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { StatusType,
|
|
2
|
-
import { AddonUsage, Activity } from '@driveup/common';
|
|
1
|
+
import { StatusType, CatalogType, ProductType } from '@driveup/shared';
|
|
2
|
+
import { AddonUsage, Activity, Course, Address } from '@driveup/common';
|
|
3
|
+
import { CompanyEntity } from '../company.entity';
|
|
3
4
|
import { CompanyProductEntity } from '../product/product.entity';
|
|
4
5
|
import { DrivingCategoryEntity } from '../../../system/driving/category.entity';
|
|
5
6
|
import { CompanyCourseLessonEntity } from './lesson.entity';
|
|
@@ -17,7 +18,7 @@ import { TrackableEntity } from '../../../utils/trackable';
|
|
|
17
18
|
* Supports both fixed schedule courses (with predefined times) and flexible courses
|
|
18
19
|
* (where students book individual appointments).
|
|
19
20
|
*
|
|
20
|
-
* @extends TrackableEntity
|
|
21
|
+
* @extends TrackableEntity<Course>
|
|
21
22
|
*/
|
|
22
23
|
export declare class CompanyCourseEntity extends TrackableEntity<Course> {
|
|
23
24
|
/**
|
|
@@ -36,12 +37,19 @@ export declare class CompanyCourseEntity extends TrackableEntity<Course> {
|
|
|
36
37
|
instructorId: number;
|
|
37
38
|
/**
|
|
38
39
|
* Allow booking only if the course is published
|
|
40
|
+
*
|
|
41
|
+
* - Allowed values: StatusType.Draft | StatusType.Published | StatusType.Ended | StatusType.Active | StatusType.Inactive
|
|
42
|
+
*
|
|
43
|
+
* For Driving courses, the status can be Active or Inactive
|
|
44
|
+
* For Others such as Preparation, Completion etc... , the status can be Draft, Published, or Ended
|
|
39
45
|
*/
|
|
40
46
|
status: StatusType;
|
|
47
|
+
catalogType: CatalogType;
|
|
48
|
+
productType: ProductType;
|
|
41
49
|
/******************* Content *******************/
|
|
42
50
|
/**
|
|
43
51
|
* Course name
|
|
44
|
-
*
|
|
52
|
+
* @example "Category B", "First Aid"
|
|
45
53
|
*/
|
|
46
54
|
title: string;
|
|
47
55
|
/**
|
|
@@ -55,6 +63,8 @@ export declare class CompanyCourseEntity extends TrackableEntity<Course> {
|
|
|
55
63
|
/******************* Finances ******************/
|
|
56
64
|
/**
|
|
57
65
|
* Course price for trainings
|
|
66
|
+
* - For Driving Courses, this is the price per session
|
|
67
|
+
* - For Theory courses, this is the total course price
|
|
58
68
|
*/
|
|
59
69
|
price: number;
|
|
60
70
|
/**
|
|
@@ -62,6 +72,11 @@ export declare class CompanyCourseEntity extends TrackableEntity<Course> {
|
|
|
62
72
|
*/
|
|
63
73
|
administrationFee: number;
|
|
64
74
|
/******************* Settings *******************/
|
|
75
|
+
/**
|
|
76
|
+
* Duration of each training session in minutes
|
|
77
|
+
* - Only for Driving courses
|
|
78
|
+
*/
|
|
79
|
+
sessionDuration: number;
|
|
65
80
|
/**
|
|
66
81
|
* Maximum number of students for each appointment
|
|
67
82
|
* Used only by course tranings
|
|
@@ -153,4 +168,7 @@ export declare class CompanyCourseEntity extends TrackableEntity<Course> {
|
|
|
153
168
|
* @returns Promise resolving to array of Activity objects filtered to exclude null values
|
|
154
169
|
*/
|
|
155
170
|
getActivities(): Promise<Activity[]>;
|
|
171
|
+
getCompany(): Promise<CompanyEntity>;
|
|
172
|
+
getProduct(): Promise<CompanyProductEntity>;
|
|
173
|
+
getInstructor(): Promise<CompanyInstructorEntity>;
|
|
156
174
|
}
|
|
@@ -8,11 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var CompanyCourseEntity_1;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.CompanyCourseEntity = void 0;
|
|
13
14
|
const typeorm_1 = require("typeorm");
|
|
15
|
+
const shared_1 = require("@driveup/shared");
|
|
14
16
|
const common_1 = require("@driveup/common");
|
|
15
|
-
const
|
|
17
|
+
const company_entity_1 = require("../company.entity");
|
|
16
18
|
const product_entity_1 = require("../product/product.entity");
|
|
17
19
|
const category_entity_1 = require("../../../system/driving/category.entity");
|
|
18
20
|
const lesson_entity_1 = require("./lesson.entity");
|
|
@@ -31,9 +33,9 @@ const activity_helper_1 = require("../../../utils/activity.helper");
|
|
|
31
33
|
* Supports both fixed schedule courses (with predefined times) and flexible courses
|
|
32
34
|
* (where students book individual appointments).
|
|
33
35
|
*
|
|
34
|
-
* @extends TrackableEntity
|
|
36
|
+
* @extends TrackableEntity<Course>
|
|
35
37
|
*/
|
|
36
|
-
let CompanyCourseEntity = class CompanyCourseEntity extends trackable_1.TrackableEntity {
|
|
38
|
+
let CompanyCourseEntity = CompanyCourseEntity_1 = class CompanyCourseEntity extends trackable_1.TrackableEntity {
|
|
37
39
|
/**
|
|
38
40
|
* Creates a new CompanyCourseEntity instance
|
|
39
41
|
* @param props - Partial properties to initialize the entity with
|
|
@@ -62,7 +64,7 @@ let CompanyCourseEntity = class CompanyCourseEntity extends trackable_1.Trackabl
|
|
|
62
64
|
maxStudents: this.maxStudents,
|
|
63
65
|
isFixed: this.isFixed,
|
|
64
66
|
location: this.location ? common_1.Address.toInstance(this.location) : null,
|
|
65
|
-
addons: this.addons ? this.addons.map(
|
|
67
|
+
addons: this.addons ? this.addons.map(common_1.AddonUsage.toInstance) : null
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
@@ -97,16 +99,25 @@ let CompanyCourseEntity = class CompanyCourseEntity extends trackable_1.Trackabl
|
|
|
97
99
|
*/
|
|
98
100
|
async getActivities() {
|
|
99
101
|
const activities = [];
|
|
100
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
101
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
102
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
103
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
104
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.publishedBy, common_2.ActivityType.publishedBy));
|
|
105
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.publishedOn, common_2.ActivityType.publishedOn));
|
|
106
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.endedBy, common_2.ActivityType.endedBy));
|
|
107
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.endedOn, common_2.ActivityType.endedOn));
|
|
102
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created));
|
|
103
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated));
|
|
104
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.publishedBy, this.publishedOn, shared_1.ActivityType.published));
|
|
105
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.endedBy, this.endedOn, shared_1.ActivityType.ended));
|
|
108
106
|
return activities.filter(a => a);
|
|
109
107
|
}
|
|
108
|
+
async getCompany() {
|
|
109
|
+
return await company_entity_1.CompanyEntity.createQueryBuilder('company')
|
|
110
|
+
.innerJoin(product_entity_1.CompanyProductEntity, 'product', 'product.companyId = company.id')
|
|
111
|
+
.innerJoin(CompanyCourseEntity_1, 'course', 'course.productId = product.id')
|
|
112
|
+
.where('course.id = :courseId', { courseId: this.id })
|
|
113
|
+
.getOne();
|
|
114
|
+
}
|
|
115
|
+
async getProduct() {
|
|
116
|
+
return await this.product;
|
|
117
|
+
}
|
|
118
|
+
async getInstructor() {
|
|
119
|
+
return await this.instructor;
|
|
120
|
+
}
|
|
110
121
|
};
|
|
111
122
|
exports.CompanyCourseEntity = CompanyCourseEntity;
|
|
112
123
|
__decorate([
|
|
@@ -131,15 +142,35 @@ __decorate([
|
|
|
131
142
|
(0, typeorm_1.Column)({
|
|
132
143
|
type: 'enum',
|
|
133
144
|
enum: [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
145
|
+
shared_1.StatusType.Draft,
|
|
146
|
+
shared_1.StatusType.Published,
|
|
147
|
+
shared_1.StatusType.Ended,
|
|
148
|
+
shared_1.StatusType.Active,
|
|
149
|
+
shared_1.StatusType.Inactive
|
|
137
150
|
],
|
|
138
|
-
default:
|
|
151
|
+
default: shared_1.StatusType.Draft,
|
|
139
152
|
nullable: false
|
|
140
153
|
}),
|
|
141
154
|
__metadata("design:type", String)
|
|
142
155
|
], CompanyCourseEntity.prototype, "status", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, typeorm_1.Column)({
|
|
158
|
+
type: 'enum',
|
|
159
|
+
enum: shared_1.CatalogType,
|
|
160
|
+
default: shared_1.CatalogType.Driving,
|
|
161
|
+
nullable: false
|
|
162
|
+
}),
|
|
163
|
+
__metadata("design:type", String)
|
|
164
|
+
], CompanyCourseEntity.prototype, "catalogType", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, typeorm_1.Column)({
|
|
167
|
+
type: 'enum',
|
|
168
|
+
enum: shared_1.ProductType,
|
|
169
|
+
default: shared_1.ProductType.DrivingCar,
|
|
170
|
+
nullable: false
|
|
171
|
+
}),
|
|
172
|
+
__metadata("design:type", String)
|
|
173
|
+
], CompanyCourseEntity.prototype, "productType", void 0);
|
|
143
174
|
__decorate([
|
|
144
175
|
(0, typeorm_1.Column)(),
|
|
145
176
|
__metadata("design:type", String)
|
|
@@ -178,6 +209,13 @@ __decorate([
|
|
|
178
209
|
}),
|
|
179
210
|
__metadata("design:type", Number)
|
|
180
211
|
], CompanyCourseEntity.prototype, "administrationFee", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, typeorm_1.Column)({
|
|
214
|
+
nullable: true,
|
|
215
|
+
default: null
|
|
216
|
+
}),
|
|
217
|
+
__metadata("design:type", Number)
|
|
218
|
+
], CompanyCourseEntity.prototype, "sessionDuration", void 0);
|
|
181
219
|
__decorate([
|
|
182
220
|
(0, typeorm_1.Column)({
|
|
183
221
|
nullable: false,
|
|
@@ -252,7 +290,7 @@ __decorate([
|
|
|
252
290
|
(0, typeorm_1.OneToMany)(() => item_entity_1.CompanyBillItemEntity, billItem => billItem.course),
|
|
253
291
|
__metadata("design:type", Promise)
|
|
254
292
|
], CompanyCourseEntity.prototype, "billItems", void 0);
|
|
255
|
-
exports.CompanyCourseEntity = CompanyCourseEntity = __decorate([
|
|
293
|
+
exports.CompanyCourseEntity = CompanyCourseEntity = CompanyCourseEntity_1 = __decorate([
|
|
256
294
|
(0, typeorm_1.Entity)('companyCourses'),
|
|
257
295
|
__metadata("design:paramtypes", [Object])
|
|
258
296
|
], CompanyCourseEntity);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"course.entity.js","sourceRoot":"","sources":["../../../../src/profile/company/course/course.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"course.entity.js","sourceRoot":"","sources":["../../../../src/profile/company/course/course.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAAqF;AACrF,4CAAwE;AACxE,sDAAkD;AAClD,8DAAiE;AACjE,6EAAgF;AAChF,mDAA4D;AAC5D,uEAA0E;AAC1E,oFAAuF;AACvF,kFAA6F;AAC7F,iEAAwE;AACxE,wDAA2D;AAC3D,oEAA4D;AAE5D;;;;;;;;;;GAUG;AAEI,IAAM,mBAAmB,2BAAzB,MAAM,mBAAoB,SAAQ,2BAAuB;IAmP/D;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,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;qDACvB;AAM3C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAA4B,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;6DACf;AAM1D;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAqB,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;;sDACxB;8BAjPhC,mBAAmB;IAD/B,IAAA,gBAAM,EAAC,gBAAgB,CAAC;;GACZ,mBAAmB,CA4U/B"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Address, Activity, Lesson, Picture } from '@driveup/common';
|
|
2
|
+
import { CompanyEntity } from '../company.entity';
|
|
3
|
+
import { CompanyProductEntity } from '../product/product.entity';
|
|
4
|
+
import { StudentEntity } from '../../student/student.entity';
|
|
2
5
|
import { CompanyCourseEntity } from './course.entity';
|
|
3
6
|
import { CompanyCourseTopicEntity } from './topic.entity';
|
|
4
|
-
import {
|
|
7
|
+
import { CompanyCourseScheduleEntity } from './appointment.entity';
|
|
5
8
|
import { CompanyInstructorEntity } from '../instructor/instructor.entity';
|
|
6
9
|
import { StudentTrainingLessonEntity } from '../../student/program/training/lesson.entity';
|
|
7
10
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
@@ -28,6 +31,8 @@ export declare class CompanyCourseLessonEntity extends TrackableEntity<Lesson> {
|
|
|
28
31
|
/****************** Content ******************/
|
|
29
32
|
/**
|
|
30
33
|
* Lesson number or sequence identifier
|
|
34
|
+
* - On "add new lesson", get the highest number in the course and increment by 1
|
|
35
|
+
* - Should be only updated when the sort is changed
|
|
31
36
|
*/
|
|
32
37
|
number: number;
|
|
33
38
|
/**
|
|
@@ -92,9 +97,9 @@ export declare class CompanyCourseLessonEntity extends TrackableEntity<Lesson> {
|
|
|
92
97
|
*/
|
|
93
98
|
topics: Promise<CompanyCourseTopicEntity[]>;
|
|
94
99
|
/**
|
|
95
|
-
* Company lesson
|
|
100
|
+
* Company lesson schedule
|
|
96
101
|
*/
|
|
97
|
-
|
|
102
|
+
schedule: Promise<CompanyCourseScheduleEntity[]>;
|
|
98
103
|
/**
|
|
99
104
|
* Student training lessons based on this lesson
|
|
100
105
|
*/
|
|
@@ -120,4 +125,9 @@ export declare class CompanyCourseLessonEntity extends TrackableEntity<Lesson> {
|
|
|
120
125
|
* @returns Promise resolving to array of Activity objects filtered to exclude null values
|
|
121
126
|
*/
|
|
122
127
|
getActivities(): Promise<Activity[]>;
|
|
128
|
+
getCompany(): Promise<CompanyEntity>;
|
|
129
|
+
getProduct(): Promise<CompanyProductEntity>;
|
|
130
|
+
getCourse(): Promise<CompanyCourseEntity>;
|
|
131
|
+
getInstructor(): Promise<CompanyInstructorEntity>;
|
|
132
|
+
getActiveStudentsByAppointments(): Promise<StudentEntity[]>;
|
|
123
133
|
}
|
|
@@ -8,10 +8,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var CompanyCourseLessonEntity_1;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.CompanyCourseLessonEntity = void 0;
|
|
13
14
|
const typeorm_1 = require("typeorm");
|
|
15
|
+
const luxon_1 = require("luxon");
|
|
16
|
+
const shared_1 = require("@driveup/shared");
|
|
14
17
|
const common_1 = require("@driveup/common");
|
|
18
|
+
const company_entity_1 = require("../company.entity");
|
|
19
|
+
const product_entity_1 = require("../product/product.entity");
|
|
20
|
+
const student_entity_1 = require("../../student/student.entity");
|
|
15
21
|
const course_entity_1 = require("./course.entity");
|
|
16
22
|
const topic_entity_1 = require("./topic.entity");
|
|
17
23
|
const appointment_entity_1 = require("./appointment.entity");
|
|
@@ -29,7 +35,7 @@ const activity_helper_1 = require("../../../utils/activity.helper");
|
|
|
29
35
|
* (e.g., Basic Vehicle Control, Simple Traffic Situations, Complex Traffic Situations, Special Manoeuvres, Driving on Motorway, Safety & Eco Driving)
|
|
30
36
|
* and topics are the specific session topics within those phases
|
|
31
37
|
*/
|
|
32
|
-
let CompanyCourseLessonEntity = class CompanyCourseLessonEntity extends trackable_1.TrackableEntity {
|
|
38
|
+
let CompanyCourseLessonEntity = CompanyCourseLessonEntity_1 = class CompanyCourseLessonEntity extends trackable_1.TrackableEntity {
|
|
33
39
|
/**
|
|
34
40
|
* Creates a new CompanyCourseLessonEntity instance
|
|
35
41
|
* @param props - Partial properties to initialize the entity with
|
|
@@ -80,14 +86,40 @@ let CompanyCourseLessonEntity = class CompanyCourseLessonEntity extends trackabl
|
|
|
80
86
|
*/
|
|
81
87
|
async getActivities() {
|
|
82
88
|
const activities = [];
|
|
83
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
84
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
85
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
86
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
87
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.canceledBy, common_1.ActivityType.canceledBy));
|
|
88
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.canceledOn, common_1.ActivityType.canceledOn));
|
|
89
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created));
|
|
90
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated));
|
|
91
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.canceledBy, this.canceledOn, shared_1.ActivityType.canceled));
|
|
89
92
|
return activities.filter(a => a);
|
|
90
93
|
}
|
|
94
|
+
async getCompany() {
|
|
95
|
+
return await company_entity_1.CompanyEntity.createQueryBuilder('company')
|
|
96
|
+
.innerJoin(product_entity_1.CompanyProductEntity, 'product', 'product.companyId = company.id')
|
|
97
|
+
.innerJoin(course_entity_1.CompanyCourseEntity, 'course', 'course.productId = product.id')
|
|
98
|
+
.innerJoin(CompanyCourseLessonEntity_1, 'lesson', 'lesson.courseId = course.id')
|
|
99
|
+
.where('lesson.id = :lessonId', { lessonId: this.id })
|
|
100
|
+
.getOne();
|
|
101
|
+
}
|
|
102
|
+
async getProduct() {
|
|
103
|
+
return await product_entity_1.CompanyProductEntity.createQueryBuilder('product')
|
|
104
|
+
.innerJoin(course_entity_1.CompanyCourseEntity, 'course', 'course.productId = product.id')
|
|
105
|
+
.innerJoin(CompanyCourseLessonEntity_1, 'lesson', 'lesson.courseId = course.id')
|
|
106
|
+
.where('lesson.id = :lessonId', { lessonId: this.id })
|
|
107
|
+
.getOne();
|
|
108
|
+
}
|
|
109
|
+
async getCourse() {
|
|
110
|
+
return await this.course;
|
|
111
|
+
}
|
|
112
|
+
async getInstructor() {
|
|
113
|
+
return await this.instructor;
|
|
114
|
+
}
|
|
115
|
+
async getActiveStudentsByAppointments() {
|
|
116
|
+
return student_entity_1.StudentEntity.createQueryBuilder('student')
|
|
117
|
+
.innerJoin('student.courseAppointments', 'appointment', 'appointment.studentId = student.id')
|
|
118
|
+
.innerJoin('appointment.lesson', 'lesson', 'lesson.id = :lessonId', { lessonId: this.id })
|
|
119
|
+
.where('student.canceledOn IS NULL')
|
|
120
|
+
.andWhere('appointment.startDate > : today', { today: luxon_1.DateTime.now().toJSDate() })
|
|
121
|
+
.getMany();
|
|
122
|
+
}
|
|
91
123
|
};
|
|
92
124
|
exports.CompanyCourseLessonEntity = CompanyCourseLessonEntity;
|
|
93
125
|
__decorate([
|
|
@@ -192,14 +224,14 @@ __decorate([
|
|
|
192
224
|
__metadata("design:type", Promise)
|
|
193
225
|
], CompanyCourseLessonEntity.prototype, "topics", void 0);
|
|
194
226
|
__decorate([
|
|
195
|
-
(0, typeorm_1.OneToMany)(() => appointment_entity_1.
|
|
227
|
+
(0, typeorm_1.OneToMany)(() => appointment_entity_1.CompanyCourseScheduleEntity, student => student.lesson),
|
|
196
228
|
__metadata("design:type", Promise)
|
|
197
|
-
], CompanyCourseLessonEntity.prototype, "
|
|
229
|
+
], CompanyCourseLessonEntity.prototype, "schedule", void 0);
|
|
198
230
|
__decorate([
|
|
199
231
|
(0, typeorm_1.OneToMany)(() => lesson_entity_1.StudentTrainingLessonEntity, student => student.lesson),
|
|
200
232
|
__metadata("design:type", Promise)
|
|
201
233
|
], CompanyCourseLessonEntity.prototype, "studentLessons", void 0);
|
|
202
|
-
exports.CompanyCourseLessonEntity = CompanyCourseLessonEntity = __decorate([
|
|
234
|
+
exports.CompanyCourseLessonEntity = CompanyCourseLessonEntity = CompanyCourseLessonEntity_1 = __decorate([
|
|
203
235
|
(0, typeorm_1.Entity)('companyCourseLessons'),
|
|
204
236
|
__metadata("design:paramtypes", [Object])
|
|
205
237
|
], CompanyCourseLessonEntity);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lesson.entity.js","sourceRoot":"","sources":["../../../../src/profile/company/course/lesson.entity.ts"],"names":[],"mappings":"
|
|
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,gFAA2F;AAC3F,wDAA2D;AAC3D,oEAA4D;AAE5D;;;;;;;;;GASG;AAEI,IAAM,yBAAyB,iCAA/B,MAAM,yBAA0B,SAAQ,2BAAuB;IAiKrE;;;OAGG;IACH,YAAY,KAA0C;QACrD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC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AM,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,4 +1,7 @@
|
|
|
1
1
|
import { Activity, Skill, Topic } from '@driveup/common';
|
|
2
|
+
import { CompanyEntity } from '../company.entity';
|
|
3
|
+
import { CompanyProductEntity } from '../product/product.entity';
|
|
4
|
+
import { CompanyCourseEntity } from './course.entity';
|
|
2
5
|
import { CompanyCourseLessonEntity } from './lesson.entity';
|
|
3
6
|
import { StudentTrainingTopicEntity } from '../../student/program/training/topic.entity';
|
|
4
7
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
@@ -52,4 +55,8 @@ export declare class CompanyCourseTopicEntity extends TrackableEntity<Topic> {
|
|
|
52
55
|
toModel(): Topic;
|
|
53
56
|
toSummary(): Topic;
|
|
54
57
|
getActivities(): Promise<Activity[]>;
|
|
58
|
+
getCompany(): Promise<CompanyEntity>;
|
|
59
|
+
getProduct(): Promise<CompanyProductEntity>;
|
|
60
|
+
getCourse(): Promise<CompanyCourseEntity>;
|
|
61
|
+
getLesson(): Promise<CompanyCourseLessonEntity>;
|
|
55
62
|
}
|