@driveup/schema 0.2.7 → 0.3.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/lib/catalog/addon/addon.entity.d.ts +2 -2
- package/lib/catalog/addon/addon.entity.js +2 -2
- package/lib/catalog/addon/addon.entity.js.map +1 -1
- package/lib/catalog/addon/country.entity.d.ts +2 -2
- package/lib/catalog/addon/country.entity.js +1 -2
- package/lib/catalog/addon/country.entity.js.map +1 -1
- package/lib/catalog/priceplan/priceplan.entity.d.ts +9 -4
- package/lib/catalog/priceplan/priceplan.entity.js +11 -4
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/country.entity.d.ts +12 -4
- package/lib/catalog/product/country.entity.js +19 -3
- package/lib/catalog/product/country.entity.js.map +1 -1
- package/lib/catalog/product/priceplan.entity.d.ts +6 -18
- package/lib/catalog/product/priceplan.entity.js +11 -33
- package/lib/catalog/product/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/product.entity.d.ts +2 -2
- package/lib/catalog/product/product.entity.js +2 -2
- 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 +2 -2
- package/lib/catalog/program/program.entity.js.map +1 -1
- package/lib/catalog/seed/assets/asset.entity.d.ts +2 -2
- package/lib/catalog/seed/assets/asset.entity.js +3 -4
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
- package/lib/catalog/seed/courses/course.entity.d.ts +2 -2
- package/lib/catalog/seed/courses/course.entity.js +2 -2
- 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 +2 -2
- 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 +3 -3
- package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
- package/lib/catalog/seed/expense/category.entity.d.ts +2 -2
- package/lib/catalog/seed/expense/category.entity.js +2 -2
- package/lib/catalog/seed/expense/category.entity.js.map +1 -1
- package/lib/index.d.ts +6 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/profile/agent/agent.entity.d.ts +2 -1
- package/lib/profile/agent/agent.entity.js +17 -15
- package/lib/profile/agent/agent.entity.js.map +1 -1
- package/lib/profile/agent/asset.entity.d.ts +2 -2
- package/lib/profile/agent/asset.entity.js +1 -2
- package/lib/profile/agent/asset.entity.js.map +1 -1
- package/lib/profile/agent/payout.entity.d.ts +2 -2
- package/lib/profile/agent/payout.entity.js +2 -2
- package/lib/profile/agent/payout.entity.js.map +1 -1
- package/lib/profile/agent/promotion.entity.d.ts +3 -11
- package/lib/profile/agent/promotion.entity.js +3 -15
- package/lib/profile/agent/promotion.entity.js.map +1 -1
- package/lib/profile/company/company.entity.d.ts +43 -3
- package/lib/profile/company/company.entity.js +106 -33
- package/lib/profile/company/company.entity.js.map +1 -1
- package/lib/profile/company/course/appointment.entity.d.ts +271 -0
- package/lib/profile/company/course/appointment.entity.js +736 -0
- package/lib/profile/company/course/appointment.entity.js.map +1 -0
- package/lib/profile/company/course/course.entity.d.ts +8 -2
- package/lib/profile/company/course/course.entity.js +11 -4
- package/lib/profile/company/course/course.entity.js.map +1 -1
- package/lib/profile/company/course/lesson.entity.d.ts +10 -1
- package/lib/profile/company/course/lesson.entity.js +16 -2
- package/lib/profile/company/course/lesson.entity.js.map +1 -1
- package/lib/profile/company/course/schedule.entity.d.ts +8 -4
- package/lib/profile/company/course/schedule.entity.js +5 -0
- package/lib/profile/company/course/schedule.entity.js.map +1 -1
- package/lib/profile/company/course/topic.entity.d.ts +4 -3
- package/lib/profile/company/course/topic.entity.js +3 -3
- package/lib/profile/company/course/topic.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/bill.entity.d.ts +8 -1
- package/lib/profile/company/finances/billing/bill.entity.js +35 -1
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/item.entity.d.ts +15 -1
- package/lib/profile/company/finances/billing/item.entity.js +17 -1
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +5 -3
- package/lib/profile/company/finances/billing/transaction.entity.js +2 -2
- package/lib/profile/company/finances/billing/transaction.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 +8 -8
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
- package/lib/profile/company/finances/payment/method.entity.d.ts +16 -2
- package/lib/profile/company/finances/payment/method.entity.js +18 -2
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
- package/lib/profile/company/instructor/instructor.entity.d.ts +29 -15
- package/lib/profile/company/instructor/instructor.entity.js +59 -20
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.d.ts +2 -2
- package/lib/profile/company/medical/examination.entity.js +1 -1
- package/lib/profile/company/medical/examination.entity.js.map +1 -1
- package/lib/profile/company/medical/product.entity.d.ts +2 -3
- package/lib/profile/company/medical/product.entity.js +8 -9
- package/lib/profile/company/medical/product.entity.js.map +1 -1
- package/lib/profile/company/product/addon.entity.d.ts +2 -2
- package/lib/profile/company/product/addon.entity.js +2 -3
- package/lib/profile/company/product/addon.entity.js.map +1 -1
- package/lib/profile/company/product/priceplan.entity.d.ts +14 -13
- package/lib/profile/company/product/priceplan.entity.js +14 -15
- package/lib/profile/company/product/priceplan.entity.js.map +1 -1
- package/lib/profile/company/product/product.entity.d.ts +29 -4
- package/lib/profile/company/product/product.entity.js +54 -6
- package/lib/profile/company/product/product.entity.js.map +1 -1
- package/lib/profile/instructor/instructor.entity.d.ts +2 -2
- package/lib/profile/instructor/instructor.entity.js +4 -3
- package/lib/profile/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/student/program/licence/licence.entity.d.ts +10 -2
- package/lib/profile/student/program/licence/licence.entity.js +14 -3
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
- package/lib/profile/student/program/medical/certificate.entity.d.ts +2 -2
- package/lib/profile/student/program/medical/certificate.entity.js +2 -2
- 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 +4 -4
- package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
- package/lib/profile/student/program/program.entity.d.ts +4 -4
- package/lib/profile/student/program/program.entity.js +5 -10
- package/lib/profile/student/program/program.entity.js.map +1 -1
- package/lib/profile/student/program/training/appointment.entity.d.ts +21 -13
- package/lib/profile/student/program/training/appointment.entity.js +49 -23
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
- package/lib/profile/student/program/training/exam.entity.d.ts +6 -1
- package/lib/profile/student/program/training/exam.entity.js +16 -8
- package/lib/profile/student/program/training/exam.entity.js.map +1 -1
- package/lib/profile/student/program/training/lesson.entity.d.ts +3 -3
- package/lib/profile/student/program/training/lesson.entity.js +4 -4
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
- package/lib/profile/student/program/training/topic.entity.d.ts +6 -5
- package/lib/profile/student/program/training/topic.entity.js +9 -6
- package/lib/profile/student/program/training/topic.entity.js.map +1 -1
- package/lib/profile/student/program/training/training-balance.view.d.ts +4 -0
- package/lib/profile/student/program/training/training-balance.view.js +37 -0
- package/lib/profile/student/program/training/training-balance.view.js.map +1 -0
- package/lib/profile/student/program/training/training-cost.view.d.ts +4 -0
- package/lib/profile/student/program/training/training-cost.view.js +45 -0
- package/lib/profile/student/program/training/training-cost.view.js.map +1 -0
- package/lib/profile/student/program/training/training-sessions.view.d.ts +8 -0
- package/lib/profile/student/program/training/training-sessions.view.js +50 -0
- package/lib/profile/student/program/training/training-sessions.view.js.map +1 -0
- package/lib/profile/student/program/training/training.entity.d.ts +4 -1
- package/lib/profile/student/program/training/training.entity.js +43 -36
- 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 +3 -3
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +2 -2
- package/lib/profile/student/student.entity.js +5 -4
- package/lib/profile/student/student.entity.js.map +1 -1
- package/lib/public/faq.d.ts +25 -0
- package/lib/public/faq.js +60 -0
- package/lib/public/faq.js.map +1 -0
- package/lib/public/feature-item.d.ts +54 -0
- package/lib/public/feature-item.js +78 -0
- package/lib/public/feature-item.js.map +1 -0
- package/lib/public/feature.d.ts +46 -0
- package/lib/public/feature.js +76 -0
- package/lib/public/feature.js.map +1 -0
- package/lib/public/learning-hub.d.ts +30 -0
- package/lib/public/learning-hub.js +77 -0
- package/lib/public/learning-hub.js.map +1 -0
- package/lib/public/testimonial.d.ts +40 -0
- package/lib/public/testimonial.js +85 -0
- package/lib/public/testimonial.js.map +1 -0
- package/lib/system/campaign/campaign.entity.d.ts +3 -3
- package/lib/system/campaign/campaign.entity.js +4 -4
- package/lib/system/campaign/campaign.entity.js.map +1 -1
- package/lib/system/campaign/gifcode.entity.d.ts +2 -2
- package/lib/system/campaign/gifcode.entity.js +3 -3
- package/lib/system/campaign/gifcode.entity.js.map +1 -1
- package/lib/system/country/country.entity.d.ts +7 -5
- package/lib/system/country/country.entity.js +11 -6
- package/lib/system/country/country.entity.js.map +1 -1
- package/lib/system/driving/category.entity.d.ts +2 -2
- package/lib/system/driving/category.entity.js +2 -2
- package/lib/system/driving/category.entity.js.map +1 -1
- package/lib/system/ical/ical.entity.d.ts +63 -0
- package/lib/system/ical/ical.entity.js +70 -0
- package/lib/system/ical/ical.entity.js.map +1 -0
- package/lib/system/policy/policy.entity.d.ts +2 -2
- package/lib/system/policy/policy.entity.js +3 -3
- package/lib/system/policy/policy.entity.js.map +1 -1
- package/lib/system/staff/staff.entity.d.ts +2 -2
- package/lib/system/staff/staff.entity.js +3 -2
- package/lib/system/staff/staff.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/alert.entity.d.ts +2 -2
- package/lib/user/alert.entity.js.map +1 -1
- package/lib/user/device.entity.d.ts +2 -2
- package/lib/user/device.entity.js +3 -3
- package/lib/user/device.entity.js.map +1 -1
- package/lib/user/notification.entity.d.ts +2 -2
- package/lib/user/notification.entity.js +4 -4
- package/lib/user/notification.entity.js.map +1 -1
- package/lib/user/ticket.entity.d.ts +2 -2
- package/lib/user/ticket.entity.js +6 -4
- package/lib/user/ticket.entity.js.map +1 -1
- package/lib/user/user.entity.d.ts +14 -11
- package/lib/user/user.entity.js +20 -16
- package/lib/user/user.entity.js.map +1 -1
- package/lib/utils/activity.helper.d.ts +2 -2
- package/lib/utils/activity.helper.js.map +1 -1
- package/lib/utils/trackable.d.ts +12 -1
- package/lib/utils/trackable.js +55 -0
- package/lib/utils/trackable.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Activity, Lesson } from '@driveup/common';
|
|
2
|
-
import {
|
|
2
|
+
import { CompanyInstructorEntity } from '../../../company/instructor/instructor.entity';
|
|
3
3
|
import { CompanyCourseEntity } from '../../../company/course/course.entity';
|
|
4
4
|
import { CompanyCourseLessonEntity } from '../../../company/course/lesson.entity';
|
|
5
|
-
import {
|
|
5
|
+
import { TrackableEntity } from '../../../../utils/trackable';
|
|
6
6
|
import { StudentEntity } from '../../student.entity';
|
|
7
7
|
import { StudentTrainingAppointmentEntity } from './appointment.entity';
|
|
8
|
-
import { StudentTrainingTopicEntity } from './topic.entity';
|
|
9
8
|
import { StudentTrainingEntity } from './training.entity';
|
|
9
|
+
import { StudentTrainingTopicEntity } from './topic.entity';
|
|
10
10
|
export declare class StudentTrainingLessonEntity extends TrackableEntity<Lesson> {
|
|
11
11
|
/**
|
|
12
12
|
* Student training
|
|
@@ -13,15 +13,15 @@ exports.StudentTrainingLessonEntity = void 0;
|
|
|
13
13
|
const common_1 = require("@driveup/common");
|
|
14
14
|
const shared_1 = require("@driveup/shared");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
|
-
const
|
|
17
|
-
const trackable_1 = require("../../../../utils/trackable");
|
|
16
|
+
const instructor_entity_1 = require("../../../company/instructor/instructor.entity");
|
|
18
17
|
const course_entity_1 = require("../../../company/course/course.entity");
|
|
19
18
|
const lesson_entity_1 = require("../../../company/course/lesson.entity");
|
|
20
|
-
const
|
|
19
|
+
const activity_helper_1 = require("../../../../utils/activity.helper");
|
|
20
|
+
const trackable_1 = require("../../../../utils/trackable");
|
|
21
21
|
const student_entity_1 = require("../../student.entity");
|
|
22
22
|
const appointment_entity_1 = require("./appointment.entity");
|
|
23
|
-
const topic_entity_1 = require("./topic.entity");
|
|
24
23
|
const training_entity_1 = require("./training.entity");
|
|
24
|
+
const topic_entity_1 = require("./topic.entity");
|
|
25
25
|
let StudentTrainingLessonEntity = class StudentTrainingLessonEntity extends trackable_1.TrackableEntity {
|
|
26
26
|
constructor(props) {
|
|
27
27
|
super();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lesson.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/training/lesson.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAmD;AACnD,4CAA+C;AAC/C,qCAA+D;AAE/D,uEAA+D;AAC/D,2DAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"lesson.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/training/lesson.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAmD;AACnD,4CAA+C;AAC/C,qCAA+D;AAE/D,qFAAwF;AACxF,yEAA4E;AAC5E,yEAAkF;AAClF,uEAA+D;AAC/D,2DAA8D;AAC9D,yDAAqD;AACrD,6DAAwE;AACxE,uDAA0D;AAC1D,iDAA4D;AAGrD,IAAM,2BAA2B,GAAjC,MAA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,CAAC,MAAM,CAAC;;2DACrB;AAM9C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qDAAgC,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC;;iEAC3B;sCAtI9C,2BAA2B;IADvC,IAAA,gBAAM,EAAC,wBAAwB,CAAC;;GACpB,2BAA2B,CAiMvC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Activity,
|
|
2
|
-
import { StatusType } from '@driveup/shared';
|
|
3
|
-
import {
|
|
1
|
+
import { Activity, Topic } from '@driveup/common';
|
|
2
|
+
import { Skill, StatusType } from '@driveup/shared';
|
|
3
|
+
import { EntityManager } from 'typeorm';
|
|
4
4
|
import { CompanyCourseTopicEntity } from '../../../company/course/topic.entity';
|
|
5
|
+
import { TrackableEntity } from '../../../../utils/trackable';
|
|
5
6
|
import { StudentEntity } from '../../student.entity';
|
|
6
7
|
import { StudentTrainingAppointmentEntity } from './appointment.entity';
|
|
7
|
-
import { StudentTrainingLessonEntity } from './lesson.entity';
|
|
8
8
|
import { StudentTrainingEntity } from './training.entity';
|
|
9
|
+
import { StudentTrainingLessonEntity } from './lesson.entity';
|
|
9
10
|
/**
|
|
10
11
|
* Student training topic entity representing topics within a training lesson.
|
|
11
12
|
* Topics are copied from company course topics and tracked individually per student.
|
|
@@ -110,7 +111,7 @@ export declare class StudentTrainingTopicEntity extends TrackableEntity<Topic> {
|
|
|
110
111
|
* Counts how many times this topic has been assessed across all appointments
|
|
111
112
|
* @returns The number of appointments where this topic received an assessment
|
|
112
113
|
*/
|
|
113
|
-
getRepetition(): Promise<number>;
|
|
114
|
+
getRepetition(manager?: EntityManager): Promise<number>;
|
|
114
115
|
/**
|
|
115
116
|
* Retrieves all tracked activities for this topic
|
|
116
117
|
* Includes creation, update, and completion timestamps and associated users
|
|
@@ -13,13 +13,13 @@ exports.StudentTrainingTopicEntity = void 0;
|
|
|
13
13
|
const common_1 = require("@driveup/common");
|
|
14
14
|
const shared_1 = require("@driveup/shared");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
|
+
const topic_entity_1 = require("../../../company/course/topic.entity");
|
|
16
17
|
const activity_helper_1 = require("../../../../utils/activity.helper");
|
|
17
18
|
const trackable_1 = require("../../../../utils/trackable");
|
|
18
|
-
const topic_entity_1 = require("../../../company/course/topic.entity");
|
|
19
19
|
const student_entity_1 = require("../../student.entity");
|
|
20
20
|
const appointment_entity_1 = require("./appointment.entity");
|
|
21
|
-
const lesson_entity_1 = require("./lesson.entity");
|
|
22
21
|
const training_entity_1 = require("./training.entity");
|
|
22
|
+
const lesson_entity_1 = require("./lesson.entity");
|
|
23
23
|
/**
|
|
24
24
|
* Student training topic entity representing topics within a training lesson.
|
|
25
25
|
* Topics are copied from company course topics and tracked individually per student.
|
|
@@ -47,7 +47,7 @@ let StudentTrainingTopicEntity = class StudentTrainingTopicEntity extends tracka
|
|
|
47
47
|
imageUrl: this.imageUrl,
|
|
48
48
|
sort: this.sort,
|
|
49
49
|
done: this.done,
|
|
50
|
-
skills: this.skills?.map(
|
|
50
|
+
skills: this.skills?.map(shared_1.Skill.toInstance) || []
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -113,6 +113,7 @@ let StudentTrainingTopicEntity = class StudentTrainingTopicEntity extends tracka
|
|
|
113
113
|
.createQueryBuilder('sda')
|
|
114
114
|
.where('sda.id = :id', { id: session.id })
|
|
115
115
|
.andWhere('JSON_CONTAINS(sda.topics, JSON_OBJECT("id", :topicId))', { topicId: this.id })
|
|
116
|
+
// TODO: ask admir, the assessment doesn't mean "score", maybe the topic was marked as "done" in that session
|
|
116
117
|
.andWhere('EXISTS (SELECT 1 FROM JSON_TABLE(sda.skills, "$[*]" COLUMNS(score INT PATH "$.score")) AS skill WHERE skill.score != :noScore)', { noScore: shared_1.Score.NoScoreSubmitted })
|
|
117
118
|
.getCount();
|
|
118
119
|
return count > 0;
|
|
@@ -121,9 +122,11 @@ let StudentTrainingTopicEntity = class StudentTrainingTopicEntity extends tracka
|
|
|
121
122
|
* Counts how many times this topic has been assessed across all appointments
|
|
122
123
|
* @returns The number of appointments where this topic received an assessment
|
|
123
124
|
*/
|
|
124
|
-
async getRepetition() {
|
|
125
|
-
const
|
|
126
|
-
|
|
125
|
+
async getRepetition(manager) {
|
|
126
|
+
const entityManager = manager ?? appointment_entity_1.StudentTrainingAppointmentEntity.getRepository().manager;
|
|
127
|
+
// TODO: ask admir, the repetition doesn't mean "score", maybe the topic was marked as "done" in that session
|
|
128
|
+
const count = await entityManager
|
|
129
|
+
.createQueryBuilder(appointment_entity_1.StudentTrainingAppointmentEntity, 'sda')
|
|
127
130
|
.where('JSON_CONTAINS(sda.topics, JSON_OBJECT("id", :topicId))', { topicId: this.id })
|
|
128
131
|
.andWhere('EXISTS (SELECT 1 FROM JSON_TABLE(sda.skills, "$[*]" COLUMNS(score INT PATH "$.score")) AS skill WHERE skill.score != :noScore)', { noScore: shared_1.Score.NoScoreSubmitted })
|
|
129
132
|
.getCount();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/training/topic.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"topic.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/training/topic.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAkD;AAClD,4CAAyE;AACzE,qCAAmE;AAEnE,uEAAgF;AAChF,uEAA+D;AAC/D,2DAA8D;AAC9D,yDAAqD;AACrD,6DAAwE;AACxE,uDAA0D;AAC1D,mDAA8D;AAE9D;;;;;GAKG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,2BAAsB;IA6GrE;;;OAGG;IACH,YAAY,KAA2C;QACtD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B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,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC7B,IAAI;+DAAC;AAMlB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,2CAA2B,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;;0DACzB;AAO7C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;;yDAC/B;qCA3G7B,0BAA0B;IADtC,IAAA,gBAAM,EAAC,uBAAuB,CAAC;;GACnB,0BAA0B,CAyPtC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.TrainingBalanceView = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let TrainingBalanceView = class TrainingBalanceView {
|
|
15
|
+
};
|
|
16
|
+
exports.TrainingBalanceView = TrainingBalanceView;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.ViewColumn)(),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], TrainingBalanceView.prototype, "trainingId", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.ViewColumn)(),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], TrainingBalanceView.prototype, "balance", void 0);
|
|
25
|
+
exports.TrainingBalanceView = TrainingBalanceView = __decorate([
|
|
26
|
+
(0, typeorm_1.ViewEntity)({
|
|
27
|
+
name: 'training_balance_view',
|
|
28
|
+
dependsOn: ['training_sessions_view'],
|
|
29
|
+
expression: `
|
|
30
|
+
SELECT
|
|
31
|
+
|
|
32
|
+
FROM studentTrainings t
|
|
33
|
+
INNER JOIN
|
|
34
|
+
`
|
|
35
|
+
})
|
|
36
|
+
], TrainingBalanceView);
|
|
37
|
+
//# sourceMappingURL=training-balance.view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"training-balance.view.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/training/training-balance.view.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiD;AAY1C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAO/B,CAAA;AAPY,kDAAmB;AAG/B;IADC,IAAA,oBAAU,GAAE;;uDACM;AAGnB;IADC,IAAA,oBAAU,GAAE;;oDACG;8BANJ,mBAAmB;IAV/B,IAAA,oBAAU,EAAC;QACX,IAAI,EAAE,uBAAuB;QAC7B,SAAS,EAAE,CAAC,wBAAwB,CAAC;QACrC,UAAU,EAAE;;;;;EAKX;KACD,CAAC;GACW,mBAAmB,CAO/B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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.TrainingCostView = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let TrainingCostView = class TrainingCostView {
|
|
15
|
+
};
|
|
16
|
+
exports.TrainingCostView = TrainingCostView;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.ViewColumn)(),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], TrainingCostView.prototype, "trainingId", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.ViewColumn)(),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], TrainingCostView.prototype, "cost", void 0);
|
|
25
|
+
exports.TrainingCostView = TrainingCostView = __decorate([
|
|
26
|
+
(0, typeorm_1.ViewEntity)({
|
|
27
|
+
name: 'training_cost_view',
|
|
28
|
+
dependsOn: ['training_sessions_view'],
|
|
29
|
+
expression: `
|
|
30
|
+
SELECT
|
|
31
|
+
t.id AS trainingId,
|
|
32
|
+
(
|
|
33
|
+
COALESCE(tsv.totalSessionsFee, 0)
|
|
34
|
+
+ COALESCE(t.administrationFee, 0)
|
|
35
|
+
- COALESCE(t.discount, 0)
|
|
36
|
+
) AS cost
|
|
37
|
+
FROM
|
|
38
|
+
studentTrainings t
|
|
39
|
+
LEFT JOIN
|
|
40
|
+
training_sessions_view tsv
|
|
41
|
+
ON t.id = tsv.trainingId
|
|
42
|
+
`
|
|
43
|
+
})
|
|
44
|
+
], TrainingCostView);
|
|
45
|
+
//# sourceMappingURL=training-cost.view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"training-cost.view.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/training/training-cost.view.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiD;AAoB1C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAO5B,CAAA;AAPY,4CAAgB;AAG5B;IADC,IAAA,oBAAU,GAAE;;oDACM;AAGnB;IADC,IAAA,oBAAU,GAAE;;8CACA;2BAND,gBAAgB;IAlB5B,IAAA,oBAAU,EAAC;QACX,IAAI,EAAE,oBAAoB;QAC1B,SAAS,EAAE,CAAC,wBAAwB,CAAC;QACrC,UAAU,EAAE;;;;;;;;;;;;;EAaX;KACD,CAAC;GACW,gBAAgB,CAO5B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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.TrainingSessionsView = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
/**
|
|
15
|
+
* This view calculates the total number of sessions and the total fee for student "driving" trainings.
|
|
16
|
+
*/
|
|
17
|
+
let TrainingSessionsView = class TrainingSessionsView {
|
|
18
|
+
};
|
|
19
|
+
exports.TrainingSessionsView = TrainingSessionsView;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.ViewColumn)(),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], TrainingSessionsView.prototype, "trainingId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.ViewColumn)(),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], TrainingSessionsView.prototype, "totalSessions", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ViewColumn)(),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], TrainingSessionsView.prototype, "totalSessionsFee", void 0);
|
|
32
|
+
exports.TrainingSessionsView = TrainingSessionsView = __decorate([
|
|
33
|
+
(0, typeorm_1.ViewEntity)({
|
|
34
|
+
name: 'training_sessions_view',
|
|
35
|
+
expression: `
|
|
36
|
+
SELECT
|
|
37
|
+
trainingId,
|
|
38
|
+
COUNT(id) AS totalSessions,
|
|
39
|
+
SUM(price) AS totalSessionsFee
|
|
40
|
+
FROM
|
|
41
|
+
studentTrainingAppointments
|
|
42
|
+
WHERE
|
|
43
|
+
type = 'driving'
|
|
44
|
+
AND (DATE_ADD(startDate, INTERVAL duration MINUTE) <= NOW() OR status = 'canceled')
|
|
45
|
+
AND deletedOn IS NULL
|
|
46
|
+
GROUP BY trainingId
|
|
47
|
+
`
|
|
48
|
+
})
|
|
49
|
+
], TrainingSessionsView);
|
|
50
|
+
//# sourceMappingURL=training-sessions.view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"training-sessions.view.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/training/training-sessions.view.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiD;AAEjD;;GAEG;AAiBI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAUhC,CAAA;AAVY,oDAAoB;AAGhC;IADC,IAAA,oBAAU,GAAE;;wDACM;AAGnB;IADC,IAAA,oBAAU,GAAE;;2DACS;AAGtB;IADC,IAAA,oBAAU,GAAE;;8DACY;+BATb,oBAAoB;IAhBhC,IAAA,oBAAU,EAAC;QACX,IAAI,EAAE,wBAAwB;QAC9B,UAAU,EAAE;;;;;;;;;;;;EAYX;KACD,CAAC;GACW,oBAAoB,CAUhC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Activity,
|
|
1
|
+
import { Activity, Student, Training } from '@driveup/common';
|
|
2
|
+
import { AddonUsage, Address, Note, Period, Person, Rating } from '@driveup/shared';
|
|
2
3
|
import { CarTransmission, StatusType, TrainingType } from '@driveup/shared';
|
|
3
4
|
import { TrackableEntity } from '../../../../utils/trackable';
|
|
4
5
|
import { CompanyCourseEntity } from '../../../company/course/course.entity';
|
|
@@ -161,6 +162,7 @@ export declare class StudentTrainingEntity extends TrackableEntity<Training> {
|
|
|
161
162
|
toModel(): Promise<Training>;
|
|
162
163
|
toSummary(): Promise<Training>;
|
|
163
164
|
toModelWithDetails(): Promise<Training>;
|
|
165
|
+
isArchived(): boolean;
|
|
164
166
|
/**
|
|
165
167
|
* Gets the student profile related to this training
|
|
166
168
|
* Loads the StudentEntity even if the training's program/student is soft-removed from db (withDeleted: true)
|
|
@@ -175,6 +177,7 @@ export declare class StudentTrainingEntity extends TrackableEntity<Training> {
|
|
|
175
177
|
*/
|
|
176
178
|
getProgram(): Promise<StudentProgramEntity>;
|
|
177
179
|
getCourse(): Promise<CompanyCourseEntity>;
|
|
180
|
+
getInstructor(): Promise<CompanyInstructorEntity>;
|
|
178
181
|
getProduct(): Promise<import("../../../..").CompanyProductEntity>;
|
|
179
182
|
getCompany(): Promise<import("../../../..").CompanyEntity>;
|
|
180
183
|
getDrivingCategory(): Promise<import("../../../..").DrivingCategoryEntity>;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.StudentTrainingEntity = void 0;
|
|
13
13
|
const common_1 = require("@driveup/common");
|
|
14
14
|
const shared_1 = require("@driveup/shared");
|
|
15
|
+
const shared_2 = require("@driveup/shared");
|
|
15
16
|
const luxon_1 = require("luxon");
|
|
16
17
|
const typeorm_1 = require("typeorm");
|
|
17
18
|
const activity_helper_1 = require("../../../../utils/activity.helper");
|
|
@@ -47,8 +48,8 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
47
48
|
paid: this.paid,
|
|
48
49
|
discount: this.discount,
|
|
49
50
|
refund: this.refund,
|
|
50
|
-
location: this.location ?
|
|
51
|
-
ratings: this.ratings ? this.ratings.map(
|
|
51
|
+
location: this.location ? shared_1.Address.toInstance(this.location) : null,
|
|
52
|
+
ratings: this.ratings ? this.ratings.map(shared_1.Rating.toInstance) : null,
|
|
52
53
|
transmission: this.transmission
|
|
53
54
|
});
|
|
54
55
|
}
|
|
@@ -67,13 +68,16 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
67
68
|
const training = await this.toModel();
|
|
68
69
|
// get all apointments notes
|
|
69
70
|
const appointtemnts = await this.appointments;
|
|
70
|
-
training.notes = appointtemnts?.map(a => a.note)?.map(
|
|
71
|
+
training.notes = appointtemnts?.map(a => a.note)?.map(shared_1.Note.toInstance);
|
|
71
72
|
// get ratings
|
|
72
|
-
training.ratings = this.ratings?.map(
|
|
73
|
+
training.ratings = this.ratings?.map(shared_1.Rating.toInstance) || null;
|
|
73
74
|
// get addons
|
|
74
|
-
training.addons = this.addons?.map(
|
|
75
|
+
training.addons = this.addons?.map(shared_1.AddonUsage.toInstance) || null;
|
|
75
76
|
return training;
|
|
76
77
|
}
|
|
78
|
+
isArchived() {
|
|
79
|
+
return [shared_2.StatusType.Completed, shared_2.StatusType.Terminated].includes(this.status);
|
|
80
|
+
}
|
|
77
81
|
/**
|
|
78
82
|
* Gets the student profile related to this training
|
|
79
83
|
* Loads the StudentEntity even if the training's program/student is soft-removed from db (withDeleted: true)
|
|
@@ -100,6 +104,9 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
100
104
|
async getCourse() {
|
|
101
105
|
return await this.course;
|
|
102
106
|
}
|
|
107
|
+
async getInstructor() {
|
|
108
|
+
return await this.instructor;
|
|
109
|
+
}
|
|
103
110
|
async getProduct() {
|
|
104
111
|
const course = await this.getCourse();
|
|
105
112
|
return await course.product;
|
|
@@ -120,8 +127,8 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
120
127
|
async getPaymentTransactions() {
|
|
121
128
|
const total = await transaction_entity_1.StudentTrainingTransactionEntity.sum('amount', {
|
|
122
129
|
trainingId: this.id,
|
|
123
|
-
type:
|
|
124
|
-
status: (0, typeorm_1.Not)(
|
|
130
|
+
type: shared_2.TransactionType.Payment,
|
|
131
|
+
status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled),
|
|
125
132
|
refTransactionId: (0, typeorm_1.IsNull)()
|
|
126
133
|
});
|
|
127
134
|
return total || 0;
|
|
@@ -133,9 +140,9 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
133
140
|
async getCashTransactions() {
|
|
134
141
|
const total = await transaction_entity_1.StudentTrainingTransactionEntity.sum('amount', {
|
|
135
142
|
trainingId: this.id,
|
|
136
|
-
type:
|
|
137
|
-
paymentType:
|
|
138
|
-
status: (0, typeorm_1.Not)(
|
|
143
|
+
type: shared_2.TransactionType.Payment,
|
|
144
|
+
paymentType: shared_2.PaymentType.Cash,
|
|
145
|
+
status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled),
|
|
139
146
|
refTransactionId: (0, typeorm_1.IsNull)()
|
|
140
147
|
});
|
|
141
148
|
return total || 0;
|
|
@@ -147,8 +154,8 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
147
154
|
async getDiscountTransactions() {
|
|
148
155
|
const total = await transaction_entity_1.StudentTrainingTransactionEntity.sum('amount', {
|
|
149
156
|
trainingId: this.id,
|
|
150
|
-
type:
|
|
151
|
-
status: (0, typeorm_1.Not)(
|
|
157
|
+
type: shared_2.TransactionType.Discount,
|
|
158
|
+
status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled),
|
|
152
159
|
refTransactionId: (0, typeorm_1.IsNull)()
|
|
153
160
|
});
|
|
154
161
|
return total || 0;
|
|
@@ -160,8 +167,8 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
160
167
|
async getRefundTransactions() {
|
|
161
168
|
const total = await transaction_entity_1.StudentTrainingTransactionEntity.sum('amount', {
|
|
162
169
|
trainingId: this.id,
|
|
163
|
-
type:
|
|
164
|
-
status: (0, typeorm_1.Not)(
|
|
170
|
+
type: shared_2.TransactionType.Refund,
|
|
171
|
+
status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled),
|
|
165
172
|
refTransactionId: (0, typeorm_1.IsNull)()
|
|
166
173
|
});
|
|
167
174
|
return total || 0;
|
|
@@ -176,8 +183,8 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
176
183
|
// TODO: ask admir about this. a cancelation item has type = TransactionType.Cancelation AND status = StatusType.Canceled
|
|
177
184
|
// therefore the bellow condition is never met
|
|
178
185
|
// or perhaps I'm wrong about my point
|
|
179
|
-
type:
|
|
180
|
-
status: (0, typeorm_1.Not)(
|
|
186
|
+
type: shared_2.TransactionType.Cancelation,
|
|
187
|
+
status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled),
|
|
181
188
|
});
|
|
182
189
|
return total || 0;
|
|
183
190
|
}
|
|
@@ -195,7 +202,7 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
195
202
|
*/
|
|
196
203
|
async getTrainingType() {
|
|
197
204
|
const product = await this.getProduct();
|
|
198
|
-
const trainingType = product.catalogType ===
|
|
205
|
+
const trainingType = product.catalogType === shared_2.CatalogType.Driving ? shared_2.TrainingType.Driving : shared_2.TrainingType.Course;
|
|
199
206
|
return trainingType;
|
|
200
207
|
}
|
|
201
208
|
async getTotalTopics() {
|
|
@@ -221,7 +228,7 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
221
228
|
where: {
|
|
222
229
|
trainingId: this.id,
|
|
223
230
|
startDate: (0, typeorm_1.MoreThanOrEqual)(luxon_1.DateTime.now().toJSDate()),
|
|
224
|
-
status: (0, typeorm_1.Not)(
|
|
231
|
+
status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled)
|
|
225
232
|
},
|
|
226
233
|
order: { startDate: 'ASC' }
|
|
227
234
|
});
|
|
@@ -234,7 +241,7 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
234
241
|
const total = await appointment_entity_1.StudentTrainingAppointmentEntity.countBy({
|
|
235
242
|
trainingId: this.id,
|
|
236
243
|
startDate: (0, typeorm_1.MoreThanOrEqual)(luxon_1.DateTime.now().toJSDate()),
|
|
237
|
-
status: (0, typeorm_1.Not)(
|
|
244
|
+
status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled)
|
|
238
245
|
});
|
|
239
246
|
return total || 0;
|
|
240
247
|
}
|
|
@@ -257,7 +264,7 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
257
264
|
const query = appointment_entity_1.StudentTrainingAppointmentEntity
|
|
258
265
|
.createQueryBuilder('a')
|
|
259
266
|
.where('a.trainingId = :trainingId', { trainingId: this.id })
|
|
260
|
-
.andWhere('a.status != :canceledStatus', { canceledStatus:
|
|
267
|
+
.andWhere('a.status != :canceledStatus', { canceledStatus: shared_2.StatusType.Canceled })
|
|
261
268
|
.andWhere(`
|
|
262
269
|
a.startDate < :endDate
|
|
263
270
|
AND
|
|
@@ -279,27 +286,27 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
279
286
|
*/
|
|
280
287
|
async getEstimatedExamDate() {
|
|
281
288
|
// If the training is not in-progress, estimation isn't calculated
|
|
282
|
-
if (this.status !==
|
|
289
|
+
if (this.status !== shared_2.StatusType.Progress)
|
|
283
290
|
return null;
|
|
284
291
|
// If the training has had less than 10 appointments, estimation isn't calculated
|
|
285
292
|
const totalPreviousAppointments = await appointment_entity_1.StudentTrainingAppointmentEntity.countBy({
|
|
286
293
|
trainingId: this.id,
|
|
287
294
|
startDate: (0, typeorm_1.LessThanOrEqual)(luxon_1.DateTime.now().toJSDate()),
|
|
288
|
-
status: (0, typeorm_1.Not)(
|
|
295
|
+
status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled),
|
|
289
296
|
isExam: false
|
|
290
297
|
});
|
|
291
298
|
if (totalPreviousAppointments < 10)
|
|
292
299
|
return null;
|
|
293
300
|
const firstAppointment = await appointment_entity_1.StudentTrainingAppointmentEntity.findOne({
|
|
294
301
|
order: { startDate: 'ASC' },
|
|
295
|
-
where: { trainingId: this.id, status: (0, typeorm_1.Not)(
|
|
302
|
+
where: { trainingId: this.id, status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled), isExam: false }
|
|
296
303
|
});
|
|
297
304
|
const latestAppointment = await appointment_entity_1.StudentTrainingAppointmentEntity.findOne({
|
|
298
305
|
order: { startDate: 'DESC' },
|
|
299
306
|
where: {
|
|
300
307
|
trainingId: this.id,
|
|
301
308
|
startDate: (0, typeorm_1.LessThanOrEqual)(luxon_1.DateTime.now().toJSDate()),
|
|
302
|
-
status: (0, typeorm_1.Not)(
|
|
309
|
+
status: (0, typeorm_1.Not)(shared_2.StatusType.Canceled),
|
|
303
310
|
isExam: false
|
|
304
311
|
}
|
|
305
312
|
});
|
|
@@ -324,7 +331,7 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
324
331
|
}
|
|
325
332
|
async getTotalParts() {
|
|
326
333
|
const trainingType = await this.getTrainingType();
|
|
327
|
-
if (trainingType !==
|
|
334
|
+
if (trainingType !== shared_2.TrainingType.Course) {
|
|
328
335
|
return null;
|
|
329
336
|
}
|
|
330
337
|
return await lesson_entity_1.StudentTrainingLessonEntity.countBy({
|
|
@@ -334,10 +341,10 @@ let StudentTrainingEntity = class StudentTrainingEntity extends trackable_1.Trac
|
|
|
334
341
|
}
|
|
335
342
|
async getActivities() {
|
|
336
343
|
const activities = [];
|
|
337
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn,
|
|
338
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn,
|
|
339
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.completedBy, this.completedOn,
|
|
340
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.terminatedBy, this.terminatedOn,
|
|
344
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_2.ActivityType.created));
|
|
345
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_2.ActivityType.updated));
|
|
346
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.completedBy, this.completedOn, shared_2.ActivityType.completed));
|
|
347
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.terminatedBy, this.terminatedOn, shared_2.ActivityType.terminated));
|
|
341
348
|
return activities.filter(a => a);
|
|
342
349
|
}
|
|
343
350
|
async getCreatedBy() {
|
|
@@ -378,8 +385,8 @@ __decorate([
|
|
|
378
385
|
__decorate([
|
|
379
386
|
(0, typeorm_1.Column)({
|
|
380
387
|
type: 'enum',
|
|
381
|
-
enum:
|
|
382
|
-
default:
|
|
388
|
+
enum: shared_2.StatusType,
|
|
389
|
+
default: shared_2.StatusType.Progress,
|
|
383
390
|
nullable: false
|
|
384
391
|
}),
|
|
385
392
|
__metadata("design:type", String)
|
|
@@ -478,7 +485,7 @@ __decorate([
|
|
|
478
485
|
nullable: true,
|
|
479
486
|
default: null
|
|
480
487
|
}),
|
|
481
|
-
__metadata("design:type",
|
|
488
|
+
__metadata("design:type", shared_1.Address)
|
|
482
489
|
], StudentTrainingEntity.prototype, "location", void 0);
|
|
483
490
|
__decorate([
|
|
484
491
|
(0, typeorm_1.Column)({
|
|
@@ -497,8 +504,8 @@ __decorate([
|
|
|
497
504
|
__decorate([
|
|
498
505
|
(0, typeorm_1.Column)({
|
|
499
506
|
type: 'enum',
|
|
500
|
-
enum:
|
|
501
|
-
default:
|
|
507
|
+
enum: shared_2.CarTransmission,
|
|
508
|
+
default: shared_2.CarTransmission.Manual,
|
|
502
509
|
nullable: false
|
|
503
510
|
}),
|
|
504
511
|
__metadata("design:type", String)
|
|
@@ -508,7 +515,7 @@ __decorate([
|
|
|
508
515
|
type: 'json',
|
|
509
516
|
nullable: false
|
|
510
517
|
}),
|
|
511
|
-
__metadata("design:type",
|
|
518
|
+
__metadata("design:type", shared_1.Person)
|
|
512
519
|
], StudentTrainingEntity.prototype, "studentSnapshot", void 0);
|
|
513
520
|
__decorate([
|
|
514
521
|
(0, typeorm_1.Column)({
|
|
@@ -524,7 +531,7 @@ __decorate([
|
|
|
524
531
|
nullable: true,
|
|
525
532
|
default: null
|
|
526
533
|
}),
|
|
527
|
-
__metadata("design:type",
|
|
534
|
+
__metadata("design:type", shared_1.Note)
|
|
528
535
|
], StudentTrainingEntity.prototype, "terminationNote", void 0);
|
|
529
536
|
__decorate([
|
|
530
537
|
(0, typeorm_1.Column)({
|