@driveup/schema 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.d.ts +1 -5
- package/lib/profile/company/medical/examination.entity.js +2 -9
- package/lib/profile/company/medical/examination.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 +9 -3
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
- package/lib/profile/student/program/medical/examination.entity.d.ts +65 -0
- package/lib/profile/student/program/medical/examination.entity.js +157 -0
- package/lib/profile/student/program/medical/examination.entity.js.map +1 -0
- package/lib/profile/student/program/medical/examination.model.d.ts +0 -2
- package/lib/profile/student/program/medical/examination.model.js +6 -5
- package/lib/profile/student/program/medical/examination.model.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +1 -1
- package/lib/profile/student/student.entity.js +2 -2
- package/lib/profile/student/student.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export * from './profile/company/company.entity';
|
|
|
38
38
|
export * from './profile/instructor/instructor.entity';
|
|
39
39
|
export * from './profile/student/program/licence/licence.entity';
|
|
40
40
|
export * from './profile/student/program/medical/certificate.entity';
|
|
41
|
-
export * from './profile/student/program/medical/examination.
|
|
41
|
+
export * from './profile/student/program/medical/examination.entity';
|
|
42
42
|
export * from './profile/student/program/training/appointment.entity';
|
|
43
43
|
export * from './profile/student/program/training/exam.entity';
|
|
44
44
|
export * from './profile/student/program/training/lesson.entity';
|
package/lib/index.js
CHANGED
|
@@ -59,7 +59,7 @@ __exportStar(require("./profile/instructor/instructor.entity"), exports);
|
|
|
59
59
|
// profile: strudent
|
|
60
60
|
__exportStar(require("./profile/student/program/licence/licence.entity"), exports);
|
|
61
61
|
__exportStar(require("./profile/student/program/medical/certificate.entity"), exports);
|
|
62
|
-
__exportStar(require("./profile/student/program/medical/examination.
|
|
62
|
+
__exportStar(require("./profile/student/program/medical/examination.entity"), exports);
|
|
63
63
|
__exportStar(require("./profile/student/program/training/appointment.entity"), exports);
|
|
64
64
|
__exportStar(require("./profile/student/program/training/exam.entity"), exports);
|
|
65
65
|
__exportStar(require("./profile/student/program/training/lesson.entity"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,+DAA6C;AAC7C,iEAA+C;AAC/C,uEAAqD;AACrD,mEAAiD;AACjD,qEAAmD;AACnD,mEAAiD;AACjD,mEAAiD;AACjD,qEAAmD;AACnD,uEAAqD;AACrD,uEAAqD;AACrD,sEAAoD;AACpD,yEAAuD;AACvD,iBAAiB;AACjB,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,mBAAmB;AACnB,8EAA4D;AAC5D,yEAAuD;AACvD,yEAAuD;AACvD,wEAAsD;AACtD,iFAA+D;AAC/D,iFAA+D;AAC/D,wFAAsE;AACtE,qFAAmE;AACnE,oFAAkE;AAClE,sFAAoE;AACpE,oFAAkE;AAClE,iFAA+D;AAC/D,mFAAiE;AACjE,iFAA+D;AAC/D,2EAAyD;AACzD,+EAA6D;AAC7D,2EAAyD;AACzD,yEAAuD;AACvD,6EAA2D;AAC3D,2EAAyD;AACzD,2EAAyD;AACzD,mEAAiD;AACjD,sBAAsB;AACtB,yEAAuD;AACvD,oBAAoB;AACpB,mFAAiE;AACjE,uFAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,+DAA6C;AAC7C,iEAA+C;AAC/C,uEAAqD;AACrD,mEAAiD;AACjD,qEAAmD;AACnD,mEAAiD;AACjD,mEAAiD;AACjD,qEAAmD;AACnD,uEAAqD;AACrD,uEAAqD;AACrD,sEAAoD;AACpD,yEAAuD;AACvD,iBAAiB;AACjB,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,mBAAmB;AACnB,8EAA4D;AAC5D,yEAAuD;AACvD,yEAAuD;AACvD,wEAAsD;AACtD,iFAA+D;AAC/D,iFAA+D;AAC/D,wFAAsE;AACtE,qFAAmE;AACnE,oFAAkE;AAClE,sFAAoE;AACpE,oFAAkE;AAClE,iFAA+D;AAC/D,mFAAiE;AACjE,iFAA+D;AAC/D,2EAAyD;AACzD,+EAA6D;AAC7D,2EAAyD;AACzD,yEAAuD;AACvD,6EAA2D;AAC3D,2EAAyD;AACzD,2EAAyD;AACzD,mEAAiD;AACjD,sBAAsB;AACtB,yEAAuD;AACvD,oBAAoB;AACpB,mFAAiE;AACjE,uFAAqE;AACrE,uFAAqE;AACrE,wFAAsE;AACtE,iFAA+D;AAC/D,mFAAiE;AACjE,oFAAkE;AAClE,kFAAgE;AAChE,qFAAmE;AACnE,wFAAsE;AACtE,2EAAyD;AACzD,mEAAiD;AACjD,SAAS;AACT,qEAAmD;AACnD,oEAAkD;AAClD,kEAAgD;AAChD,oEAAkD;AAClD,mEAAiD;AACjD,kEAAgD;AAChD,iEAA+C;AAC/C,4DAA0C;AAC1C,gEAA8C;AAC9C,8DAA4C;AAC5C,sDAAoC;AACpC,wDAAsC;AACtC,uDAAqC;AACrC,6DAA2C;AAC3C,uDAAqC;AACrC,qDAAmC;AACnC,6DAA2C;AAC3C,QAAQ;AACR,0DAAwC;AACxC,4DAA0C;AAC1C,4DAA0C;AAC1C,oDAAkC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Activity, MedicalExamination, Person, WeekDay } from '@driveup/common';
|
|
2
2
|
import { CompanyMedicalProductEntity } from './product.entity';
|
|
3
|
-
import { StudentMedicalExaminationEntity } from '../../student/program/medical/examination.
|
|
3
|
+
import { StudentMedicalExaminationEntity } from '../../student/program/medical/examination.entity';
|
|
4
4
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
5
5
|
export declare class CompanyMedicalExaminationEntity extends TrackableEntity<MedicalExamination> {
|
|
6
6
|
medicalProductId: number;
|
|
7
|
-
/**
|
|
8
|
-
* Default examioner for this examination
|
|
9
|
-
*/
|
|
10
|
-
examinerId: number;
|
|
11
7
|
/**
|
|
12
8
|
* Start date of the recurring examination appointments
|
|
13
9
|
*/
|
|
@@ -13,7 +13,7 @@ exports.CompanyMedicalExaminationEntity = void 0;
|
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const common_1 = require("@driveup/common");
|
|
15
15
|
const product_entity_1 = require("./product.entity");
|
|
16
|
-
const
|
|
16
|
+
const examination_entity_1 = require("../../student/program/medical/examination.entity");
|
|
17
17
|
const trackable_1 = require("../../../utils/trackable");
|
|
18
18
|
const activity_helper_1 = require("../../../utils/activity.helper");
|
|
19
19
|
let CompanyMedicalExaminationEntity = class CompanyMedicalExaminationEntity extends trackable_1.TrackableEntity {
|
|
@@ -52,13 +52,6 @@ __decorate([
|
|
|
52
52
|
(0, typeorm_1.Column)(),
|
|
53
53
|
__metadata("design:type", Number)
|
|
54
54
|
], CompanyMedicalExaminationEntity.prototype, "medicalProductId", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, typeorm_1.Column)({
|
|
57
|
-
nullable: true,
|
|
58
|
-
default: null
|
|
59
|
-
}),
|
|
60
|
-
__metadata("design:type", Number)
|
|
61
|
-
], CompanyMedicalExaminationEntity.prototype, "examinerId", void 0);
|
|
62
55
|
__decorate([
|
|
63
56
|
(0, typeorm_1.Column)(),
|
|
64
57
|
__metadata("design:type", Date)
|
|
@@ -123,7 +116,7 @@ __decorate([
|
|
|
123
116
|
__metadata("design:type", Promise)
|
|
124
117
|
], CompanyMedicalExaminationEntity.prototype, "medicalProduct", void 0);
|
|
125
118
|
__decorate([
|
|
126
|
-
(0, typeorm_1.OneToMany)(() =>
|
|
119
|
+
(0, typeorm_1.OneToMany)(() => examination_entity_1.StudentMedicalExaminationEntity, student => student.examination),
|
|
127
120
|
__metadata("design:type", Promise)
|
|
128
121
|
], CompanyMedicalExaminationEntity.prototype, "students", void 0);
|
|
129
122
|
exports.CompanyMedicalExaminationEntity = CompanyMedicalExaminationEntity = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"examination.entity.js","sourceRoot":"","sources":["../../../../src/profile/company/medical/examination.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAA8F;AAC9F,qDAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"examination.entity.js","sourceRoot":"","sources":["../../../../src/profile/company/medical/examination.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAA8F;AAC9F,qDAA+D;AAC/D,yFAAmG;AACnG,wDAA2D;AAC3D,oEAA4D;AAGrD,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,2BAAmC;IA8FvF,YAAY,KAAgD;QAC3D,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO;QACN,OAAO,IAAI,2BAAkB,CAAC;YAC7B,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,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,IAAI,CAAC,YAAY;YAC/B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;SACzB,CA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;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;qEACmB;AAUrB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;gEAIE;AAUJ;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;8BACQ,eAAM;iEAAC;AAUjB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;kEAIE;AAMJ;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4CAA2B,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;;uEACzB;AAQrD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oDAA+B,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;;iEAC5B;0CA5FzC,+BAA+B;IAD3C,IAAA,gBAAM,EAAC,4BAA4B,CAAC;;GACxB,+BAA+B,CA8H3C"}
|
|
@@ -2,7 +2,7 @@ import { Activity, Customer, MedicalCertificate, Note, ProductType } from '@driv
|
|
|
2
2
|
import { DrivingCategoryEntity } from '../../../../system/driving/category.entity';
|
|
3
3
|
import { StudentEntity } from '../../student.entity';
|
|
4
4
|
import { StudentProgramEntity } from '../program.entity';
|
|
5
|
-
import { StudentMedicalExaminationEntity } from './examination.
|
|
5
|
+
import { StudentMedicalExaminationEntity } from './examination.entity';
|
|
6
6
|
import { TrackableEntity } from '../../../../utils/trackable';
|
|
7
7
|
export declare class StudentMedicalCertificateEntity extends TrackableEntity<MedicalCertificate> {
|
|
8
8
|
/**
|
|
@@ -66,7 +66,7 @@ export declare class StudentMedicalCertificateEntity extends TrackableEntity<Med
|
|
|
66
66
|
/**
|
|
67
67
|
* Examination linked to this medical certificate
|
|
68
68
|
*/
|
|
69
|
-
examination: Promise<StudentMedicalExaminationEntity>;
|
|
69
|
+
examination: Promise<StudentMedicalExaminationEntity | null>;
|
|
70
70
|
/**
|
|
71
71
|
* Driving category linked to this medical certificate.
|
|
72
72
|
* Optionally, if the certificate is category specific.
|
|
@@ -15,7 +15,7 @@ const common_1 = require("@driveup/common");
|
|
|
15
15
|
const category_entity_1 = require("../../../../system/driving/category.entity");
|
|
16
16
|
const student_entity_1 = require("../../student.entity");
|
|
17
17
|
const program_entity_1 = require("../program.entity");
|
|
18
|
-
const
|
|
18
|
+
const examination_entity_1 = require("./examination.entity");
|
|
19
19
|
const trackable_1 = require("../../../../utils/trackable");
|
|
20
20
|
const activity_helper_1 = require("../../../../utils/activity.helper");
|
|
21
21
|
let StudentMedicalCertificateEntity = class StudentMedicalCertificateEntity extends trackable_1.TrackableEntity {
|
|
@@ -24,7 +24,13 @@ let StudentMedicalCertificateEntity = class StudentMedicalCertificateEntity exte
|
|
|
24
24
|
Object.assign(this, props);
|
|
25
25
|
}
|
|
26
26
|
async toModel() {
|
|
27
|
-
|
|
27
|
+
let examination;
|
|
28
|
+
if (this.examinationId) {
|
|
29
|
+
const examinationEntity = await examination_entity_1.StudentMedicalExaminationEntity.findOneBy({
|
|
30
|
+
id: this.examinationId
|
|
31
|
+
});
|
|
32
|
+
examination = examinationEntity ? (await examinationEntity.toSummary()) : null;
|
|
33
|
+
}
|
|
28
34
|
const category = this.categoryId ? (await this.category).toModel() : null;
|
|
29
35
|
return new common_1.MedicalCertificate({
|
|
30
36
|
id: this.id,
|
|
@@ -154,7 +160,7 @@ __decorate([
|
|
|
154
160
|
__metadata("design:type", Promise)
|
|
155
161
|
], StudentMedicalCertificateEntity.prototype, "student", void 0);
|
|
156
162
|
__decorate([
|
|
157
|
-
(0, typeorm_1.OneToOne)(() =>
|
|
163
|
+
(0, typeorm_1.OneToOne)(() => examination_entity_1.StudentMedicalExaminationEntity, examination => examination.certificate, { nullable: true }),
|
|
158
164
|
(0, typeorm_1.JoinColumn)(),
|
|
159
165
|
__metadata("design:type", Promise)
|
|
160
166
|
], StudentMedicalCertificateEntity.prototype, "examination", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"certificate.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/medical/certificate.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAsF;AACtF,
|
|
1
|
+
{"version":3,"file":"certificate.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/medical/certificate.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAsF;AACtF,4CAAuH;AACvH,gFAAmF;AACnF,yDAAqD;AACrD,sDAAyD;AACzD,6DAAuE;AACvE,2DAA8D;AAC9D,uEAA+D;AAIxD,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,2BAAmC;IAsJvF,YAAY,KAAgD;QAC3D,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,OAAO;QAEZ,IAAI,WAAwB,CAAC;QAE7B,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM,iBAAiB,GAAG,MAAM,oDAA+B,CAAC,SAAS,CAAC;gBACzE,EAAE,EAAE,IAAI,CAAC,aAAa;aACtB,CAAC,CAAC;YACH,WAAW,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,MAAM,iBAAiB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChF,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAE1E,OAAO,IAAI,2BAAkB,C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Note, StatusType } from '@driveup/common';
|
|
3
|
+
import { StudentEntity } from '../../student.entity';
|
|
4
|
+
import { StudentMedicalCertificateEntity } from './certificate.entity';
|
|
5
|
+
import { CompanyMedicalExaminationEntity } from '../../../company/medical/examination.entity';
|
|
6
|
+
import { TrackableEntity } from '../../../../utils/trackable';
|
|
7
|
+
export declare class StudentMedicalExaminationEntity extends TrackableEntity<Appointment> {
|
|
8
|
+
/**
|
|
9
|
+
* Reference to the student taking this medical examination
|
|
10
|
+
*/
|
|
11
|
+
studentId: number;
|
|
12
|
+
/**
|
|
13
|
+
* Company medical examination
|
|
14
|
+
*/
|
|
15
|
+
examinationId: number;
|
|
16
|
+
/**
|
|
17
|
+
* Current status of the medical examination (Pending, Passed, or Failed)
|
|
18
|
+
* @default StatusType.Pending
|
|
19
|
+
*/
|
|
20
|
+
status: StatusType;
|
|
21
|
+
/**
|
|
22
|
+
* Title of the medical examination
|
|
23
|
+
*/
|
|
24
|
+
title: string;
|
|
25
|
+
/**
|
|
26
|
+
* Detailed description of the medical examination
|
|
27
|
+
*/
|
|
28
|
+
description: string;
|
|
29
|
+
/**
|
|
30
|
+
* Date of the examination
|
|
31
|
+
*/
|
|
32
|
+
startDate: Date;
|
|
33
|
+
/**
|
|
34
|
+
* Duration of the examination in minutes
|
|
35
|
+
*/
|
|
36
|
+
endDate: Date;
|
|
37
|
+
/**
|
|
38
|
+
* Name of the doctor conducting the examination
|
|
39
|
+
*/
|
|
40
|
+
doctorName: string;
|
|
41
|
+
/**
|
|
42
|
+
* Physical location where the examination takes place
|
|
43
|
+
*/
|
|
44
|
+
location: Address;
|
|
45
|
+
/**
|
|
46
|
+
* Additional notes or comments about the examination
|
|
47
|
+
*/
|
|
48
|
+
note: Note;
|
|
49
|
+
/**
|
|
50
|
+
* Student relation
|
|
51
|
+
*/
|
|
52
|
+
student: Promise<StudentEntity>;
|
|
53
|
+
/**
|
|
54
|
+
* Company medical examination relation
|
|
55
|
+
*/
|
|
56
|
+
examination: Promise<CompanyMedicalExaminationEntity>;
|
|
57
|
+
/**
|
|
58
|
+
* Certificate issued for this examination
|
|
59
|
+
*/
|
|
60
|
+
certificate: Promise<StudentMedicalCertificateEntity>;
|
|
61
|
+
constructor(props?: Partial<StudentMedicalExaminationEntity>);
|
|
62
|
+
toModel(): Promise<Appointment>;
|
|
63
|
+
toSummary(): Promise<Appointment>;
|
|
64
|
+
getActivities(): Promise<Activity[]>;
|
|
65
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
var StudentMedicalExaminationEntity_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.StudentMedicalExaminationEntity = void 0;
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const common_1 = require("@driveup/common");
|
|
16
|
+
const common_2 = require("@driveup/common");
|
|
17
|
+
const student_entity_1 = require("../../student.entity");
|
|
18
|
+
const certificate_entity_1 = require("./certificate.entity");
|
|
19
|
+
const examination_entity_1 = require("../../../company/medical/examination.entity");
|
|
20
|
+
const product_entity_1 = require("../../../company/product/product.entity");
|
|
21
|
+
const product_entity_2 = require("../../../company/medical/product.entity");
|
|
22
|
+
const product_entity_3 = require("../../../../catalog/product/product.entity");
|
|
23
|
+
const trackable_1 = require("../../../../utils/trackable");
|
|
24
|
+
const activity_helper_1 = require("../../../../utils/activity.helper");
|
|
25
|
+
let StudentMedicalExaminationEntity = StudentMedicalExaminationEntity_1 = class StudentMedicalExaminationEntity extends trackable_1.TrackableEntity {
|
|
26
|
+
constructor(props) {
|
|
27
|
+
super();
|
|
28
|
+
Object.assign(this, props);
|
|
29
|
+
}
|
|
30
|
+
async toModel() {
|
|
31
|
+
// get company medical product
|
|
32
|
+
const companyMedicalProduct = await product_entity_2.CompanyMedicalProductEntity.createQueryBuilder('cmp')
|
|
33
|
+
.innerJoin('cmp.examinations', 'cme')
|
|
34
|
+
.innerJoin(StudentMedicalExaminationEntity_1, 'sme', 'sme.examinationId = cme.id')
|
|
35
|
+
.where('sme.id = :id', { id: this.id })
|
|
36
|
+
.getOne();
|
|
37
|
+
// get driveup product
|
|
38
|
+
const product = await product_entity_3.ProductEntity.createQueryBuilder('p')
|
|
39
|
+
.innerJoin(product_entity_1.CompanyProductEntity, 'cp', 'cp.productId = p.id')
|
|
40
|
+
.innerJoin(product_entity_2.CompanyMedicalProductEntity, 'cmp', 'cmp.productId = cp.id')
|
|
41
|
+
.where('cmp.id = :id', { id: companyMedicalProduct.id })
|
|
42
|
+
.getOne();
|
|
43
|
+
return new common_1.Appointment({
|
|
44
|
+
id: this.id,
|
|
45
|
+
type: common_1.AppointmentType.Medical,
|
|
46
|
+
product: product.type,
|
|
47
|
+
status: this.status,
|
|
48
|
+
title: this.title,
|
|
49
|
+
subtitle: this.description,
|
|
50
|
+
startDate: this.startDate,
|
|
51
|
+
endDate: this.endDate,
|
|
52
|
+
color: product.color,
|
|
53
|
+
location: this.location ? common_2.Address.toInstance(this.location) : null,
|
|
54
|
+
note: this.note ? common_2.Note.toInstance(this.note) : null,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async toSummary() {
|
|
58
|
+
return new common_1.Appointment({
|
|
59
|
+
id: this.id,
|
|
60
|
+
type: common_1.AppointmentType.Medical,
|
|
61
|
+
status: this.status,
|
|
62
|
+
title: this.title,
|
|
63
|
+
subtitle: this.description,
|
|
64
|
+
startDate: this.startDate,
|
|
65
|
+
endDate: this.endDate,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
async getActivities() {
|
|
69
|
+
const activities = [];
|
|
70
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, common_1.ActivityType.createdBy));
|
|
71
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdOn, common_1.ActivityType.createdOn));
|
|
72
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy));
|
|
73
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
74
|
+
return activities.filter(a => a);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
exports.StudentMedicalExaminationEntity = StudentMedicalExaminationEntity;
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.Column)(),
|
|
80
|
+
__metadata("design:type", Number)
|
|
81
|
+
], StudentMedicalExaminationEntity.prototype, "studentId", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, typeorm_1.Column)(),
|
|
84
|
+
__metadata("design:type", Number)
|
|
85
|
+
], StudentMedicalExaminationEntity.prototype, "examinationId", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({
|
|
88
|
+
type: 'enum',
|
|
89
|
+
enum: [
|
|
90
|
+
common_2.StatusType.Pending,
|
|
91
|
+
common_2.StatusType.Passed,
|
|
92
|
+
common_2.StatusType.Failed
|
|
93
|
+
],
|
|
94
|
+
default: common_2.StatusType.Pending,
|
|
95
|
+
nullable: false
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", String)
|
|
98
|
+
], StudentMedicalExaminationEntity.prototype, "status", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)(),
|
|
101
|
+
__metadata("design:type", String)
|
|
102
|
+
], StudentMedicalExaminationEntity.prototype, "title", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typeorm_1.Column)({
|
|
105
|
+
nullable: true,
|
|
106
|
+
default: null
|
|
107
|
+
}),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], StudentMedicalExaminationEntity.prototype, "description", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, typeorm_1.Column)(),
|
|
112
|
+
__metadata("design:type", Date)
|
|
113
|
+
], StudentMedicalExaminationEntity.prototype, "startDate", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Column)(),
|
|
116
|
+
__metadata("design:type", Date)
|
|
117
|
+
], StudentMedicalExaminationEntity.prototype, "endDate", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, typeorm_1.Column)({
|
|
120
|
+
nullable: true,
|
|
121
|
+
default: null
|
|
122
|
+
}),
|
|
123
|
+
__metadata("design:type", String)
|
|
124
|
+
], StudentMedicalExaminationEntity.prototype, "doctorName", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, typeorm_1.Column)({
|
|
127
|
+
type: 'simple-json',
|
|
128
|
+
nullable: true,
|
|
129
|
+
default: null
|
|
130
|
+
}),
|
|
131
|
+
__metadata("design:type", common_2.Address)
|
|
132
|
+
], StudentMedicalExaminationEntity.prototype, "location", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, typeorm_1.Column)({
|
|
135
|
+
type: 'simple-json',
|
|
136
|
+
nullable: true,
|
|
137
|
+
default: null
|
|
138
|
+
}),
|
|
139
|
+
__metadata("design:type", common_2.Note)
|
|
140
|
+
], StudentMedicalExaminationEntity.prototype, "note", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, typeorm_1.ManyToOne)(() => student_entity_1.StudentEntity, student => student.medicalExaminations),
|
|
143
|
+
__metadata("design:type", Promise)
|
|
144
|
+
], StudentMedicalExaminationEntity.prototype, "student", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, typeorm_1.ManyToOne)(() => examination_entity_1.CompanyMedicalExaminationEntity, examination => examination.students),
|
|
147
|
+
__metadata("design:type", Promise)
|
|
148
|
+
], StudentMedicalExaminationEntity.prototype, "examination", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, typeorm_1.OneToOne)(() => certificate_entity_1.StudentMedicalCertificateEntity, certificate => certificate.examination),
|
|
151
|
+
__metadata("design:type", Promise)
|
|
152
|
+
], StudentMedicalExaminationEntity.prototype, "certificate", void 0);
|
|
153
|
+
exports.StudentMedicalExaminationEntity = StudentMedicalExaminationEntity = StudentMedicalExaminationEntity_1 = __decorate([
|
|
154
|
+
(0, typeorm_1.Entity)('studentMedicalExaminations'),
|
|
155
|
+
__metadata("design:paramtypes", [Object])
|
|
156
|
+
], StudentMedicalExaminationEntity);
|
|
157
|
+
//# sourceMappingURL=examination.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"examination.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/medical/examination.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAA8D;AAC9D,4CAAuF;AACvF,4CAA4D;AAC5D,yDAAqD;AACrD,6DAAuE;AACvE,oFAA8F;AAC9F,4EAA+E;AAC/E,4EAAsF;AACtF,+EAA2E;AAC3E,2DAA8D;AAC9D,uEAA+D;AAGxD,IAAM,+BAA+B,uCAArC,MAAM,+BAAgC,SAAQ,2BAA4B;IAwGhF,YAAY,KAAgD;QAC3D,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,OAAO;QAEZ,8BAA8B;QAC9B,MAAM,qBAAqB,GAAG,MAAM,4CAA2B,CAAC,kBAAkB,CAAC,KAAK,CAAC;aACvF,SAAS,CAAC,kBAAkB,EAAE,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DACK;AASd;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;oEACkB;AAMpB;IADC,IAAA,gBAAM,GAAE;8BACE,IAAI;kEAAC;AAMhB;IADC,IAAA,gBAAM,GAAE;8BACA,IAAI;gEAAC;AASd;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;mEACiB;AAUnB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;8BACQ,gBAAO;iEAAC;AAUlB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;8BACI,aAAI;6DAAC;AAMX;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8BAAa,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC;;gEACvC;AAMhC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oDAA+B,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC;;oEAChC;AAMtD;IADC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,oDAA+B,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC;;oEAClC;0CAtG1C,+BAA+B;IAD3C,IAAA,gBAAM,EAAC,4BAA4B,CAAC;;GACxB,+BAA+B,CAgK3C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Activity, Appointment } from '@driveup/common';
|
|
2
2
|
import { Address, Note, StatusType } from '@driveup/common';
|
|
3
3
|
import { StudentEntity } from '../../student.entity';
|
|
4
|
-
import { StudentMedicalCertificateEntity } from './certificate.entity';
|
|
5
4
|
import { CompanyMedicalExaminationEntity } from '../../../company/medical/examination.entity';
|
|
6
5
|
import { TrackableEntity } from '../../../../utils/trackable';
|
|
7
6
|
export declare class StudentMedicalExaminationEntity extends TrackableEntity<Appointment> {
|
|
@@ -57,7 +56,6 @@ export declare class StudentMedicalExaminationEntity extends TrackableEntity<App
|
|
|
57
56
|
/**
|
|
58
57
|
* Certificate issued for this examination
|
|
59
58
|
*/
|
|
60
|
-
certificate: Promise<StudentMedicalCertificateEntity>;
|
|
61
59
|
constructor(props?: Partial<StudentMedicalExaminationEntity>);
|
|
62
60
|
toModel(): Promise<Appointment>;
|
|
63
61
|
toSummary(): Promise<Appointment>;
|
|
@@ -15,7 +15,7 @@ const typeorm_1 = require("typeorm");
|
|
|
15
15
|
const common_1 = require("@driveup/common");
|
|
16
16
|
const common_2 = require("@driveup/common");
|
|
17
17
|
const student_entity_1 = require("../../student.entity");
|
|
18
|
-
|
|
18
|
+
// import { StudentMedicalCertificateEntity } from './certificate.entity';
|
|
19
19
|
const examination_entity_1 = require("../../../company/medical/examination.entity");
|
|
20
20
|
const product_entity_1 = require("../../../company/product/product.entity");
|
|
21
21
|
const product_entity_2 = require("../../../company/medical/product.entity");
|
|
@@ -23,6 +23,11 @@ const product_entity_3 = require("../../../../catalog/product/product.entity");
|
|
|
23
23
|
const trackable_1 = require("../../../../utils/trackable");
|
|
24
24
|
const activity_helper_1 = require("../../../../utils/activity.helper");
|
|
25
25
|
let StudentMedicalExaminationEntity = StudentMedicalExaminationEntity_1 = class StudentMedicalExaminationEntity extends trackable_1.TrackableEntity {
|
|
26
|
+
/**
|
|
27
|
+
* Certificate issued for this examination
|
|
28
|
+
*/
|
|
29
|
+
// @OneToOne(() => StudentMedicalCertificateEntity, certificate => certificate.examination)
|
|
30
|
+
// certificate: Promise<StudentMedicalCertificateEntity>;
|
|
26
31
|
constructor(props) {
|
|
27
32
|
super();
|
|
28
33
|
Object.assign(this, props);
|
|
@@ -146,10 +151,6 @@ __decorate([
|
|
|
146
151
|
(0, typeorm_1.ManyToOne)(() => examination_entity_1.CompanyMedicalExaminationEntity, examination => examination.students),
|
|
147
152
|
__metadata("design:type", Promise)
|
|
148
153
|
], StudentMedicalExaminationEntity.prototype, "examination", void 0);
|
|
149
|
-
__decorate([
|
|
150
|
-
(0, typeorm_1.OneToOne)(() => certificate_entity_1.StudentMedicalCertificateEntity, certificate => certificate.examination),
|
|
151
|
-
__metadata("design:type", Promise)
|
|
152
|
-
], StudentMedicalExaminationEntity.prototype, "certificate", void 0);
|
|
153
154
|
exports.StudentMedicalExaminationEntity = StudentMedicalExaminationEntity = StudentMedicalExaminationEntity_1 = __decorate([
|
|
154
155
|
(0, typeorm_1.Entity)('studentMedicalExaminations'),
|
|
155
156
|
__metadata("design:paramtypes", [Object])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"examination.model.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/medical/examination.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAA8D;AAC9D,4CAAuF;AACvF,4CAA4D;AAC5D,yDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"examination.model.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/medical/examination.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAA8D;AAC9D,4CAAuF;AACvF,4CAA4D;AAC5D,yDAAqD;AACrD,0EAA0E;AAC1E,oFAA8F;AAC9F,4EAA+E;AAC/E,4EAAsF;AACtF,+EAA2E;AAC3E,2DAA8D;AAC9D,uEAA+D;AAGxD,IAAM,+BAA+B,uCAArC,MAAM,+BAAgC,SAAQ,2BAA4B;IAkGhF;;OAEG;IACH,2FAA2F;IAC3F,yDAAyD;IAEzD,YAAY,KAAgD;QAC3D,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,OAAO;QAEZ,8BAA8B;QAC9B,MAAM,qBAAqB,GAAG,MAAM,4CAA2B,CAA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E,KAAK;KACf,CAAC;;+DACiB;AAMnB;IADC,IAAA,gBAAM,GAAE;;8DACK;AASd;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;oEACkB;AAMpB;IADC,IAAA,gBAAM,GAAE;8BACE,IAAI;kEAAC;AAMhB;IADC,IAAA,gBAAM,GAAE;8BACA,IAAI;gEAAC;AASd;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;mEACiB;AAUnB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;8BACQ,gBAAO;iEAAC;AAUlB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;8BACI,aAAI;6DAAC;AAMX;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8BAAa,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC;;gEACvC;AAMhC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oDAA+B,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC;;oEAChC;0CAhG1C,+BAA+B;IAD3C,IAAA,gBAAM,EAAC,4BAA4B,CAAC;;GACxB,+BAA+B,CAgK3C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AccountStatus, Language, Preference, Activity, Student } from '@driveup/common';
|
|
2
2
|
import { UserEntity } from '../../user/user.entity';
|
|
3
3
|
import { StudentLicenceEntity } from './program/licence/licence.entity';
|
|
4
|
-
import { StudentMedicalExaminationEntity } from './program/medical/examination.
|
|
4
|
+
import { StudentMedicalExaminationEntity } from './program/medical/examination.entity';
|
|
5
5
|
import { StudentProgramEntity } from './program/program.entity';
|
|
6
6
|
import { StudentMedicalCertificateEntity } from './program/medical/certificate.entity';
|
|
7
7
|
import { TrackableEntity } from '../../utils/trackable';
|
|
@@ -14,7 +14,7 @@ const typeorm_1 = require("typeorm");
|
|
|
14
14
|
const common_1 = require("@driveup/common");
|
|
15
15
|
const user_entity_1 = require("../../user/user.entity");
|
|
16
16
|
const licence_entity_1 = require("./program/licence/licence.entity");
|
|
17
|
-
const
|
|
17
|
+
const examination_entity_1 = require("./program/medical/examination.entity");
|
|
18
18
|
const program_entity_1 = require("./program/program.entity");
|
|
19
19
|
const certificate_entity_1 = require("./program/medical/certificate.entity");
|
|
20
20
|
const trackable_1 = require("../../utils/trackable");
|
|
@@ -108,7 +108,7 @@ __decorate([
|
|
|
108
108
|
__metadata("design:type", Promise)
|
|
109
109
|
], StudentEntity.prototype, "medicalCertificates", void 0);
|
|
110
110
|
__decorate([
|
|
111
|
-
(0, typeorm_1.OneToMany)(() =>
|
|
111
|
+
(0, typeorm_1.OneToMany)(() => examination_entity_1.StudentMedicalExaminationEntity, certificate => certificate.student),
|
|
112
112
|
__metadata("design:type", Promise)
|
|
113
113
|
], StudentEntity.prototype, "medicalExaminations", void 0);
|
|
114
114
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student.entity.js","sourceRoot":"","sources":["../../../src/profile/student/student.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAAuG;AACvG,wDAAoD;AACpD,qEAAwE;AACxE,
|
|
1
|
+
{"version":3,"file":"student.entity.js","sourceRoot":"","sources":["../../../src/profile/student/student.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAAuG;AACvG,wDAAoD;AACpD,qEAAwE;AACxE,6EAAuF;AACvF,6DAAgE;AAChE,6EAAuF;AACvF,qDAAwD;AACxD,iEAAyD;AAGlD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,2BAAwB;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