@driveup/schema 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +174 -0
  2. package/lib/catalog/addon/addon.entity.d.ts +109 -0
  3. package/lib/catalog/addon/addon.entity.js +260 -0
  4. package/lib/catalog/addon/addon.entity.js.map +1 -0
  5. package/lib/catalog/addon/country.entity.d.ts +112 -0
  6. package/lib/catalog/addon/country.entity.js +246 -0
  7. package/lib/catalog/addon/country.entity.js.map +1 -0
  8. package/lib/catalog/driving/category.entity.d.ts +122 -0
  9. package/lib/catalog/driving/category.entity.js +217 -0
  10. package/lib/catalog/driving/category.entity.js.map +1 -0
  11. package/lib/catalog/driving/vehicle.entity.d.ts +49 -0
  12. package/lib/catalog/driving/vehicle.entity.js +97 -0
  13. package/lib/catalog/driving/vehicle.entity.js.map +1 -0
  14. package/lib/catalog/priceplan/priceplan.entity.d.ts +123 -0
  15. package/lib/catalog/priceplan/priceplan.entity.js +288 -0
  16. package/lib/catalog/priceplan/priceplan.entity.js.map +1 -0
  17. package/lib/catalog/product/country.entity.d.ts +109 -0
  18. package/lib/catalog/product/country.entity.js +233 -0
  19. package/lib/catalog/product/country.entity.js.map +1 -0
  20. package/lib/catalog/product/priceplan.entity.d.ts +113 -0
  21. package/lib/catalog/product/priceplan.entity.js +251 -0
  22. package/lib/catalog/product/priceplan.entity.js.map +1 -0
  23. package/lib/catalog/product/product.entity.d.ts +104 -0
  24. package/lib/catalog/product/product.entity.js +262 -0
  25. package/lib/catalog/product/product.entity.js.map +1 -0
  26. package/lib/catalog/program/program.entity.d.ts +107 -0
  27. package/lib/catalog/program/program.entity.js +247 -0
  28. package/lib/catalog/program/program.entity.js.map +1 -0
  29. package/lib/catalog/seed/assets/asset.entity.d.ts +68 -0
  30. package/lib/catalog/seed/assets/asset.entity.js +163 -0
  31. package/lib/catalog/seed/assets/asset.entity.js.map +1 -0
  32. package/lib/catalog/seed/courses/course.entity.d.ts +98 -0
  33. package/lib/catalog/seed/courses/course.entity.js +216 -0
  34. package/lib/catalog/seed/courses/course.entity.js.map +1 -0
  35. package/lib/catalog/seed/courses/lesson.entity.d.ts +90 -0
  36. package/lib/catalog/seed/courses/lesson.entity.js +214 -0
  37. package/lib/catalog/seed/courses/lesson.entity.js.map +1 -0
  38. package/lib/catalog/seed/courses/topic.entity.d.ts +77 -0
  39. package/lib/catalog/seed/courses/topic.entity.js +185 -0
  40. package/lib/catalog/seed/courses/topic.entity.js.map +1 -0
  41. package/lib/catalog/seed/expense/category.entity.d.ts +61 -0
  42. package/lib/catalog/seed/expense/category.entity.js +153 -0
  43. package/lib/catalog/seed/expense/category.entity.js.map +1 -0
  44. package/lib/index.d.ts +67 -0
  45. package/lib/index.js +89 -0
  46. package/lib/index.js.map +1 -0
  47. package/lib/profile/agent/agent.entity.d.ts +95 -0
  48. package/lib/profile/agent/agent.entity.js +223 -0
  49. package/lib/profile/agent/agent.entity.js.map +1 -0
  50. package/lib/profile/agent/payout.entity.d.ts +70 -0
  51. package/lib/profile/agent/payout.entity.js +160 -0
  52. package/lib/profile/agent/payout.entity.js.map +1 -0
  53. package/lib/profile/agent/promotion.entity.d.ts +82 -0
  54. package/lib/profile/agent/promotion.entity.js +174 -0
  55. package/lib/profile/agent/promotion.entity.js.map +1 -0
  56. package/lib/profile/company/company.entity.d.ts +234 -0
  57. package/lib/profile/company/company.entity.js +558 -0
  58. package/lib/profile/company/company.entity.js.map +1 -0
  59. package/lib/profile/company/course/appointment.entity.d.ts +111 -0
  60. package/lib/profile/company/course/appointment.entity.js +240 -0
  61. package/lib/profile/company/course/appointment.entity.js.map +1 -0
  62. package/lib/profile/company/course/course.entity.d.ts +156 -0
  63. package/lib/profile/company/course/course.entity.js +365 -0
  64. package/lib/profile/company/course/course.entity.js.map +1 -0
  65. package/lib/profile/company/course/lesson.entity.d.ts +123 -0
  66. package/lib/profile/company/course/lesson.entity.js +288 -0
  67. package/lib/profile/company/course/lesson.entity.js.map +1 -0
  68. package/lib/profile/company/course/topic.entity.d.ts +55 -0
  69. package/lib/profile/company/course/topic.entity.js +147 -0
  70. package/lib/profile/company/course/topic.entity.js.map +1 -0
  71. package/lib/profile/company/finances/billing/bill.entity.d.ts +145 -0
  72. package/lib/profile/company/finances/billing/bill.entity.js +338 -0
  73. package/lib/profile/company/finances/billing/bill.entity.js.map +1 -0
  74. package/lib/profile/company/finances/billing/item.entity.d.ts +75 -0
  75. package/lib/profile/company/finances/billing/item.entity.js +219 -0
  76. package/lib/profile/company/finances/billing/item.entity.js.map +1 -0
  77. package/lib/profile/company/finances/billing/transaction.entity.d.ts +44 -0
  78. package/lib/profile/company/finances/billing/transaction.entity.js +158 -0
  79. package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -0
  80. package/lib/profile/company/finances/expense/category.entity.d.ts +55 -0
  81. package/lib/profile/company/finances/expense/category.entity.js +117 -0
  82. package/lib/profile/company/finances/expense/category.entity.js.map +1 -0
  83. package/lib/profile/company/finances/expense/expense.entity.d.ts +48 -0
  84. package/lib/profile/company/finances/expense/expense.entity.js +171 -0
  85. package/lib/profile/company/finances/expense/expense.entity.js.map +1 -0
  86. package/lib/profile/company/finances/handover/handover.entity.d.ts +44 -0
  87. package/lib/profile/company/finances/handover/handover.entity.js +202 -0
  88. package/lib/profile/company/finances/handover/handover.entity.js.map +1 -0
  89. package/lib/profile/company/finances/invoice/invoice.entity.d.ts +65 -0
  90. package/lib/profile/company/finances/invoice/invoice.entity.js +296 -0
  91. package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -0
  92. package/lib/profile/company/finances/invoice/item.entity.d.ts +25 -0
  93. package/lib/profile/company/finances/invoice/item.entity.js +148 -0
  94. package/lib/profile/company/finances/invoice/item.entity.js.map +1 -0
  95. package/lib/profile/company/finances/payment/method.entity.d.ts +35 -0
  96. package/lib/profile/company/finances/payment/method.entity.js +143 -0
  97. package/lib/profile/company/finances/payment/method.entity.js.map +1 -0
  98. package/lib/profile/company/finances/peyment/method.entity.d.ts +35 -0
  99. package/lib/profile/company/finances/peyment/method.entity.js +143 -0
  100. package/lib/profile/company/finances/peyment/method.entity.js.map +1 -0
  101. package/lib/profile/company/finances/peyment-method/payment-method.d.ts +34 -0
  102. package/lib/profile/company/finances/peyment-method/payment-method.js +118 -0
  103. package/lib/profile/company/finances/peyment-method/payment-method.js.map +1 -0
  104. package/lib/profile/company/instructor/instructor.entity.d.ts +85 -0
  105. package/lib/profile/company/instructor/instructor.entity.js +254 -0
  106. package/lib/profile/company/instructor/instructor.entity.js.map +1 -0
  107. package/lib/profile/company/instructor/task.entity.d.ts +60 -0
  108. package/lib/profile/company/instructor/task.entity.js +133 -0
  109. package/lib/profile/company/instructor/task.entity.js.map +1 -0
  110. package/lib/profile/company/medical/examination.entity.d.ts +59 -0
  111. package/lib/profile/company/medical/examination.entity.js +175 -0
  112. package/lib/profile/company/medical/examination.entity.js.map +1 -0
  113. package/lib/profile/company/medical/product.entity.d.ts +99 -0
  114. package/lib/profile/company/medical/product.entity.js +270 -0
  115. package/lib/profile/company/medical/product.entity.js.map +1 -0
  116. package/lib/profile/company/metrics/company.metric.d.ts +21 -0
  117. package/lib/profile/company/metrics/company.metric.js +122 -0
  118. package/lib/profile/company/metrics/company.metric.js.map +1 -0
  119. package/lib/profile/company/product/addon.entity.d.ts +93 -0
  120. package/lib/profile/company/product/addon.entity.js +234 -0
  121. package/lib/profile/company/product/addon.entity.js.map +1 -0
  122. package/lib/profile/company/product/priceplan.entity.d.ts +57 -0
  123. package/lib/profile/company/product/priceplan.entity.js +167 -0
  124. package/lib/profile/company/product/priceplan.entity.js.map +1 -0
  125. package/lib/profile/company/product/product.entity.d.ts +171 -0
  126. package/lib/profile/company/product/product.entity.js +383 -0
  127. package/lib/profile/company/product/product.entity.js.map +1 -0
  128. package/lib/profile/company/product/vehicle.entity.d.ts +46 -0
  129. package/lib/profile/company/product/vehicle.entity.js +144 -0
  130. package/lib/profile/company/product/vehicle.entity.js.map +1 -0
  131. package/lib/profile/instructor/instructor.entity.d.ts +80 -0
  132. package/lib/profile/instructor/instructor.entity.js +186 -0
  133. package/lib/profile/instructor/instructor.entity.js.map +1 -0
  134. package/lib/profile/student/program/licence/licence.entity.d.ts +66 -0
  135. package/lib/profile/student/program/licence/licence.entity.js +187 -0
  136. package/lib/profile/student/program/licence/licence.entity.js.map +1 -0
  137. package/lib/profile/student/program/medical/certificate.entity.d.ts +84 -0
  138. package/lib/profile/student/program/medical/certificate.entity.js +244 -0
  139. package/lib/profile/student/program/medical/certificate.entity.js.map +1 -0
  140. package/lib/profile/student/program/medical/examination.model.d.ts +65 -0
  141. package/lib/profile/student/program/medical/examination.model.js +209 -0
  142. package/lib/profile/student/program/medical/examination.model.js.map +1 -0
  143. package/lib/profile/student/program/program.entity.d.ts +78 -0
  144. package/lib/profile/student/program/program.entity.js +225 -0
  145. package/lib/profile/student/program/program.entity.js.map +1 -0
  146. package/lib/profile/student/program/training/appointment.entity.d.ts +151 -0
  147. package/lib/profile/student/program/training/appointment.entity.js +441 -0
  148. package/lib/profile/student/program/training/appointment.entity.js.map +1 -0
  149. package/lib/profile/student/program/training/exam.entity.d.ts +41 -0
  150. package/lib/profile/student/program/training/exam.entity.js +141 -0
  151. package/lib/profile/student/program/training/exam.entity.js.map +1 -0
  152. package/lib/profile/student/program/training/lesson.entity.d.ts +84 -0
  153. package/lib/profile/student/program/training/lesson.entity.js +221 -0
  154. package/lib/profile/student/program/training/lesson.entity.js.map +1 -0
  155. package/lib/profile/student/program/training/request.entity.d.ts +56 -0
  156. package/lib/profile/student/program/training/request.entity.js +159 -0
  157. package/lib/profile/student/program/training/request.entity.js.map +1 -0
  158. package/lib/profile/student/program/training/topic.entity.d.ts +109 -0
  159. package/lib/profile/student/program/training/topic.entity.js +255 -0
  160. package/lib/profile/student/program/training/topic.entity.js.map +1 -0
  161. package/lib/profile/student/program/training/training.entity.d.ts +167 -0
  162. package/lib/profile/student/program/training/training.entity.js +501 -0
  163. package/lib/profile/student/program/training/training.entity.js.map +1 -0
  164. package/lib/profile/student/program/training/transaction.entity.d.ts +111 -0
  165. package/lib/profile/student/program/training/transaction.entity.js +266 -0
  166. package/lib/profile/student/program/training/transaction.entity.js.map +1 -0
  167. package/lib/profile/student/student.entity.d.ts +89 -0
  168. package/lib/profile/student/student.entity.js +183 -0
  169. package/lib/profile/student/student.entity.js.map +1 -0
  170. package/lib/system/campaign/campaign.entity.d.ts +68 -0
  171. package/lib/system/campaign/campaign.entity.js +150 -0
  172. package/lib/system/campaign/campaign.entity.js.map +1 -0
  173. package/lib/system/campaign/gifcode.entity.d.ts +14 -0
  174. package/lib/system/campaign/gifcode.entity.js +77 -0
  175. package/lib/system/campaign/gifcode.entity.js.map +1 -0
  176. package/lib/system/campaigne/campaign.entity.d.ts +69 -0
  177. package/lib/system/campaigne/campaign.entity.js +179 -0
  178. package/lib/system/campaigne/campaign.entity.js.map +1 -0
  179. package/lib/system/campaigne/gifcode.entity.d.ts +54 -0
  180. package/lib/system/campaigne/gifcode.entity.js +126 -0
  181. package/lib/system/campaigne/gifcode.entity.js.map +1 -0
  182. package/lib/system/country/country.entity.d.ts +121 -0
  183. package/lib/system/country/country.entity.js +284 -0
  184. package/lib/system/country/country.entity.js.map +1 -0
  185. package/lib/system/country/country.metric.d.ts +12 -0
  186. package/lib/system/country/country.metric.js +68 -0
  187. package/lib/system/country/country.metric.js.map +1 -0
  188. package/lib/system/currency/currency.entity.d.ts +46 -0
  189. package/lib/system/currency/currency.entity.js +112 -0
  190. package/lib/system/currency/currency.entity.js.map +1 -0
  191. package/lib/system/driving/category.entity.d.ts +146 -0
  192. package/lib/system/driving/category.entity.js +321 -0
  193. package/lib/system/driving/category.entity.js.map +1 -0
  194. package/lib/system/driving/vehicle.entity.d.ts +54 -0
  195. package/lib/system/driving/vehicle.entity.js +130 -0
  196. package/lib/system/driving/vehicle.entity.js.map +1 -0
  197. package/lib/system/event/business.entity.d.ts +75 -0
  198. package/lib/system/event/business.entity.js +170 -0
  199. package/lib/system/event/business.entity.js.map +1 -0
  200. package/lib/system/event/log.entity.d.ts +103 -0
  201. package/lib/system/event/log.entity.js +202 -0
  202. package/lib/system/event/log.entity.js.map +1 -0
  203. package/lib/system/policy/policy.entity.d.ts +90 -0
  204. package/lib/system/policy/policy.entity.js +226 -0
  205. package/lib/system/policy/policy.entity.js.map +1 -0
  206. package/lib/system/staff/staff.entity.d.ts +72 -0
  207. package/lib/system/staff/staff.entity.js +186 -0
  208. package/lib/system/staff/staff.entity.js.map +1 -0
  209. package/lib/tsconfig.tsbuildinfo +1 -0
  210. package/lib/user/alert.entity.d.ts +95 -0
  211. package/lib/user/alert.entity.js +223 -0
  212. package/lib/user/alert.entity.js.map +1 -0
  213. package/lib/user/blocked.entity.d.ts +42 -0
  214. package/lib/user/blocked.entity.js +83 -0
  215. package/lib/user/blocked.entity.js.map +1 -0
  216. package/lib/user/device.entity.d.ts +72 -0
  217. package/lib/user/device.entity.js +182 -0
  218. package/lib/user/device.entity.js.map +1 -0
  219. package/lib/user/notification.entity.d.ts +87 -0
  220. package/lib/user/notification.entity.js +219 -0
  221. package/lib/user/notification.entity.js.map +1 -0
  222. package/lib/user/ticket.entity.d.ts +85 -0
  223. package/lib/user/ticket.entity.js +231 -0
  224. package/lib/user/ticket.entity.js.map +1 -0
  225. package/lib/user/user.entity.d.ts +235 -0
  226. package/lib/user/user.entity.js +573 -0
  227. package/lib/user/user.entity.js.map +1 -0
  228. package/lib/user/verification.entity.d.ts +75 -0
  229. package/lib/user/verification.entity.js +142 -0
  230. package/lib/user/verification.entity.js.map +1 -0
  231. package/lib/utils/activity.helper.d.ts +26 -0
  232. package/lib/utils/activity.helper.js +39 -0
  233. package/lib/utils/activity.helper.js.map +1 -0
  234. package/lib/utils/index.d.ts +4 -0
  235. package/lib/utils/index.js +21 -0
  236. package/lib/utils/index.js.map +1 -0
  237. package/lib/utils/json-metrics.transform.d.ts +35 -0
  238. package/lib/utils/json-metrics.transform.js +83 -0
  239. package/lib/utils/json-metrics.transform.js.map +1 -0
  240. package/lib/utils/numeric.transform.d.ts +38 -0
  241. package/lib/utils/numeric.transform.js +74 -0
  242. package/lib/utils/numeric.transform.js.map +1 -0
  243. package/lib/utils/trackable.entity.d.ts +82 -0
  244. package/lib/utils/trackable.entity.js +100 -0
  245. package/lib/utils/trackable.entity.js.map +1 -0
  246. package/package.json +49 -0
@@ -0,0 +1,84 @@
1
+ import { Activity, Customer, MedicalCertificate, Note, ProductType } from '@driveup/common';
2
+ import { DrivingCategoryEntity } from '../../../../system/driving/category.entity';
3
+ import { StudentEntity } from '../../student.entity';
4
+ import { StudentProgramEntity } from '../program.entity';
5
+ import { StudentMedicalExaminationEntity } from './examination.model';
6
+ import { TrackableEntity } from '../../../../utils';
7
+ export declare class StudentMedicalCertificateEntity extends TrackableEntity<MedicalCertificate> {
8
+ /**
9
+ * Reference to the student who owns this medical certificate
10
+ */
11
+ studentId: number;
12
+ /**
13
+ * Student examination appointment
14
+ * This relations can be also null
15
+ * The student can upload a medical certificate without linking it to a examination
16
+ */
17
+ examinationId: number;
18
+ /**
19
+ * Driveup driving category
20
+ * Can be null if the certificate isn't category specific
21
+ */
22
+ categoryId: number;
23
+ /**
24
+ * Store product type allways to identify medical product
25
+ * in case if student manually uploads certificate
26
+ */
27
+ productType: ProductType;
28
+ /**
29
+ * Certificat name
30
+ * Will be named from product level to keep all product certificates consistent
31
+ */
32
+ name: string;
33
+ /**
34
+ * License or certificate number
35
+ */
36
+ licenseNumber: string;
37
+ /**
38
+ * Date when the certificate was issued
39
+ */
40
+ issuedOn: Date;
41
+ /**
42
+ * Date from which the certificate becomes valid
43
+ */
44
+ validFrom: Date;
45
+ /**
46
+ * Date when the certificate expires
47
+ */
48
+ validUntil: Date;
49
+ /**
50
+ * URL to the uploaded certificate document
51
+ */
52
+ documentUrl: string;
53
+ /**
54
+ * if the certificate is not linked to an examination
55
+ * the student can provide the issuer information directly
56
+ */
57
+ issuer: Customer;
58
+ /**
59
+ * Additional notes or comments about the certificate
60
+ */
61
+ note: Note;
62
+ /**
63
+ * Student who owns the medical certificate
64
+ */
65
+ student: Promise<StudentEntity>;
66
+ /**
67
+ * Examination linked to this medical certificate
68
+ */
69
+ examination: Promise<StudentMedicalExaminationEntity>;
70
+ /**
71
+ * Driving category linked to this medical certificate.
72
+ * Optionally, if the certificate is category specific.
73
+ */
74
+ category: Promise<DrivingCategoryEntity>;
75
+ /**
76
+ * Student programs linked to this medical certificate
77
+ * (pivot table relation)
78
+ */
79
+ programs: Promise<StudentProgramEntity[]>;
80
+ constructor(props?: Partial<StudentMedicalCertificateEntity>);
81
+ toModel(): Promise<MedicalCertificate>;
82
+ toSummary(): MedicalCertificate;
83
+ getActivities(): Promise<Activity[]>;
84
+ }
@@ -0,0 +1,244 @@
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.StudentMedicalCertificateEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const common_1 = require("@driveup/common");
15
+ const category_entity_1 = require("../../../../system/driving/category.entity");
16
+ const student_entity_1 = require("../../student.entity");
17
+ const program_entity_1 = require("../program.entity");
18
+ const examination_model_1 = require("./examination.model");
19
+ const utils_1 = require("../../../../utils");
20
+ let StudentMedicalCertificateEntity = class StudentMedicalCertificateEntity extends utils_1.TrackableEntity {
21
+ /**
22
+ * Reference to the student who owns this medical certificate
23
+ */
24
+ studentId;
25
+ /**
26
+ * Student examination appointment
27
+ * This relations can be also null
28
+ * The student can upload a medical certificate without linking it to a examination
29
+ */
30
+ examinationId;
31
+ /**
32
+ * Driveup driving category
33
+ * Can be null if the certificate isn't category specific
34
+ */
35
+ categoryId;
36
+ /**
37
+ * Store product type allways to identify medical product
38
+ * in case if student manually uploads certificate
39
+ */
40
+ productType;
41
+ /**
42
+ * Certificat name
43
+ * Will be named from product level to keep all product certificates consistent
44
+ */
45
+ name;
46
+ /**
47
+ * License or certificate number
48
+ */
49
+ licenseNumber;
50
+ /**
51
+ * Date when the certificate was issued
52
+ */
53
+ issuedOn;
54
+ /**
55
+ * Date from which the certificate becomes valid
56
+ */
57
+ validFrom;
58
+ /**
59
+ * Date when the certificate expires
60
+ */
61
+ validUntil;
62
+ /**
63
+ * URL to the uploaded certificate document
64
+ */
65
+ documentUrl;
66
+ /**
67
+ * if the certificate is not linked to an examination
68
+ * the student can provide the issuer information directly
69
+ */
70
+ issuer;
71
+ /**
72
+ * Additional notes or comments about the certificate
73
+ */
74
+ note;
75
+ /**
76
+ * Student who owns the medical certificate
77
+ */
78
+ student;
79
+ /**
80
+ * Examination linked to this medical certificate
81
+ */
82
+ examination;
83
+ /**
84
+ * Driving category linked to this medical certificate.
85
+ * Optionally, if the certificate is category specific.
86
+ */
87
+ category;
88
+ /**
89
+ * Student programs linked to this medical certificate
90
+ * (pivot table relation)
91
+ */
92
+ programs;
93
+ constructor(props) {
94
+ super();
95
+ Object.assign(this, props);
96
+ }
97
+ async toModel() {
98
+ const examination = this.examinationId ? await (await this.examination).toModel() : null;
99
+ const category = this.categoryId ? (await this.category).toModel() : null;
100
+ return new common_1.MedicalCertificate({
101
+ id: this.id,
102
+ category: category,
103
+ examination: examination,
104
+ issuer: this.issuer ? common_1.Customer.toInstance(this.issuer) : null,
105
+ issuedOn: this.issuedOn,
106
+ validFrom: this.validFrom,
107
+ validUntil: this.validUntil,
108
+ documentUrl: this.documentUrl,
109
+ note: this.note ? common_1.Note.toInstance(this.note) : null,
110
+ });
111
+ }
112
+ toSummary() {
113
+ return new common_1.MedicalCertificate({
114
+ id: this.id,
115
+ issuer: this.issuer ? common_1.Customer.toInstance(this.issuer) : null,
116
+ issuedOn: this.issuedOn,
117
+ validFrom: this.validFrom,
118
+ validUntil: this.validUntil,
119
+ documentUrl: this.documentUrl
120
+ });
121
+ }
122
+ async getActivities() {
123
+ const activities = [];
124
+ activities.push(await (0, utils_1.toActivity)(this.createdBy, common_1.ActivityType.createdBy));
125
+ activities.push(await (0, utils_1.toActivity)(this.createdOn, common_1.ActivityType.createdOn));
126
+ activities.push(await (0, utils_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy));
127
+ activities.push(await (0, utils_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
128
+ return activities.filter(a => a);
129
+ }
130
+ };
131
+ exports.StudentMedicalCertificateEntity = StudentMedicalCertificateEntity;
132
+ __decorate([
133
+ (0, typeorm_1.Column)(),
134
+ __metadata("design:type", Number)
135
+ ], StudentMedicalCertificateEntity.prototype, "studentId", void 0);
136
+ __decorate([
137
+ (0, typeorm_1.Column)({
138
+ nullable: true,
139
+ default: null
140
+ }),
141
+ __metadata("design:type", Number)
142
+ ], StudentMedicalCertificateEntity.prototype, "examinationId", void 0);
143
+ __decorate([
144
+ (0, typeorm_1.Column)({
145
+ nullable: true,
146
+ default: null
147
+ }),
148
+ __metadata("design:type", Number)
149
+ ], StudentMedicalCertificateEntity.prototype, "categoryId", void 0);
150
+ __decorate([
151
+ (0, typeorm_1.Column)({
152
+ type: 'enum',
153
+ enum: [
154
+ common_1.ProductType.MedicalEyeTest,
155
+ common_1.ProductType.MedicalHearingTest,
156
+ common_1.ProductType.MedicalGeneral,
157
+ common_1.ProductType.MedicalPsychological,
158
+ common_1.ProductType.MedicalOther,
159
+ ],
160
+ default: common_1.ProductType.MedicalEyeTest,
161
+ nullable: false
162
+ }),
163
+ __metadata("design:type", String)
164
+ ], StudentMedicalCertificateEntity.prototype, "productType", void 0);
165
+ __decorate([
166
+ (0, typeorm_1.Column)({
167
+ nullable: true,
168
+ default: null
169
+ }),
170
+ __metadata("design:type", String)
171
+ ], StudentMedicalCertificateEntity.prototype, "name", void 0);
172
+ __decorate([
173
+ (0, typeorm_1.Column)({
174
+ nullable: true,
175
+ default: null
176
+ }),
177
+ __metadata("design:type", String)
178
+ ], StudentMedicalCertificateEntity.prototype, "licenseNumber", void 0);
179
+ __decorate([
180
+ (0, typeorm_1.Column)({
181
+ nullable: true,
182
+ default: null
183
+ }),
184
+ __metadata("design:type", Date)
185
+ ], StudentMedicalCertificateEntity.prototype, "issuedOn", void 0);
186
+ __decorate([
187
+ (0, typeorm_1.Column)({
188
+ nullable: true,
189
+ default: null
190
+ }),
191
+ __metadata("design:type", Date)
192
+ ], StudentMedicalCertificateEntity.prototype, "validFrom", void 0);
193
+ __decorate([
194
+ (0, typeorm_1.Column)({
195
+ nullable: true,
196
+ default: null
197
+ }),
198
+ __metadata("design:type", Date)
199
+ ], StudentMedicalCertificateEntity.prototype, "validUntil", void 0);
200
+ __decorate([
201
+ (0, typeorm_1.Column)({
202
+ nullable: true,
203
+ default: null
204
+ }),
205
+ __metadata("design:type", String)
206
+ ], StudentMedicalCertificateEntity.prototype, "documentUrl", void 0);
207
+ __decorate([
208
+ (0, typeorm_1.Column)({
209
+ type: 'simple-json',
210
+ nullable: true,
211
+ default: null
212
+ }),
213
+ __metadata("design:type", common_1.Customer)
214
+ ], StudentMedicalCertificateEntity.prototype, "issuer", void 0);
215
+ __decorate([
216
+ (0, typeorm_1.Column)({
217
+ type: 'simple-json',
218
+ nullable: true,
219
+ default: null
220
+ }),
221
+ __metadata("design:type", common_1.Note)
222
+ ], StudentMedicalCertificateEntity.prototype, "note", void 0);
223
+ __decorate([
224
+ (0, typeorm_1.ManyToOne)(() => student_entity_1.StudentEntity, student => student.medicalCertificates),
225
+ __metadata("design:type", Promise)
226
+ ], StudentMedicalCertificateEntity.prototype, "student", void 0);
227
+ __decorate([
228
+ (0, typeorm_1.OneToOne)(() => examination_model_1.StudentMedicalExaminationEntity, examination => examination.certificate),
229
+ (0, typeorm_1.JoinColumn)(),
230
+ __metadata("design:type", Promise)
231
+ ], StudentMedicalCertificateEntity.prototype, "examination", void 0);
232
+ __decorate([
233
+ (0, typeorm_1.ManyToOne)(() => category_entity_1.DrivingCategoryEntity, category => category.studentCertificates),
234
+ __metadata("design:type", Promise)
235
+ ], StudentMedicalCertificateEntity.prototype, "category", void 0);
236
+ __decorate([
237
+ (0, typeorm_1.ManyToMany)(() => program_entity_1.StudentProgramEntity, program => program.certificates),
238
+ __metadata("design:type", Promise)
239
+ ], StudentMedicalCertificateEntity.prototype, "programs", void 0);
240
+ exports.StudentMedicalCertificateEntity = StudentMedicalCertificateEntity = __decorate([
241
+ (0, typeorm_1.Entity)('studentMedicalCertificates'),
242
+ __metadata("design:paramtypes", [Object])
243
+ ], StudentMedicalCertificateEntity);
244
+ //# sourceMappingURL=certificate.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"certificate.entity.js","sourceRoot":"","sources":["../../../../../src/profile/student/program/medical/certificate.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAsF;AACtF,4CAA0G;AAC1G,gFAAmF;AACnF,yDAAqD;AACrD,sDAAyD;AACzD,2DAAsE;AACtE,6CAAgE;AAIzD,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,uBAAmC;IAEvF;;OAEG;IAEH,SAAS,CAAS;IAElB;;;;OAIG;IAKH,aAAa,CAAS;IAEtB;;;OAGG;IAKH,UAAU,CAAS;IAEnB;;;OAGG;IAaH,WAAW,CAAc;IAEzB;;;OAGG;IAKH,IAAI,CAAS;IAEb;;OAEG;IAKH,aAAa,CAAS;IAEtB;;OAEG;IAKH,QAAQ,CAAO;IAEf;;OAEG;IAKH,SAAS,CAAO;IAEhB;;OAEG;IAKH,UAAU,CAAO;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mBAAS,EAAC,GAAG,EAAE,CAAC,8BAAa,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC;;gEACvC;AAOhC;IAFC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,mDAA+B,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC;IACvF,IAAA,oBAAU,GAAE;;oEACyC;AAOtD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAqB,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;;iEACxC;AAOzC;IADC,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,qCAAoB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;;iEAC9B;0CApJ9B,+BAA+B;IAD3C,IAAA,gBAAM,EAAC,4BAA4B,CAAC;;GACxB,+BAA+B,CA8L3C"}
@@ -0,0 +1,65 @@
1
+ import { Activity, Appointment } from '@driveup/common';
2
+ import { Address, 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';
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,209 @@
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 utils_1 = require("../../../../utils");
24
+ let StudentMedicalExaminationEntity = StudentMedicalExaminationEntity_1 = class StudentMedicalExaminationEntity extends utils_1.TrackableEntity {
25
+ /**
26
+ * Reference to the student taking this medical examination
27
+ */
28
+ studentId;
29
+ /**
30
+ * Company medical examination
31
+ */
32
+ examinationId;
33
+ /**
34
+ * Current status of the medical examination (Pending, Passed, or Failed)
35
+ * @default StatusType.Pending
36
+ */
37
+ status;
38
+ /**
39
+ * Title of the medical examination
40
+ */
41
+ title;
42
+ /**
43
+ * Detailed description of the medical examination
44
+ */
45
+ description;
46
+ /**
47
+ * Date of the examination
48
+ */
49
+ startDate;
50
+ /**
51
+ * Duration of the examination in minutes
52
+ */
53
+ endDate;
54
+ /**
55
+ * Name of the doctor conducting the examination
56
+ */
57
+ doctorName;
58
+ /**
59
+ * Physical location where the examination takes place
60
+ */
61
+ location;
62
+ /**
63
+ * Additional notes or comments about the examination
64
+ */
65
+ note;
66
+ /**
67
+ * Student relation
68
+ */
69
+ student;
70
+ /**
71
+ * Company medical examination relation
72
+ */
73
+ examination;
74
+ /**
75
+ * Certificate issued for this examination
76
+ */
77
+ certificate;
78
+ constructor(props) {
79
+ super();
80
+ Object.assign(this, props);
81
+ }
82
+ async toModel() {
83
+ // get company medical product
84
+ const companyMedicalProduct = await product_entity_2.CompanyMedicalProductEntity.createQueryBuilder('cmp')
85
+ .innerJoin('cmp.examinations', 'cme')
86
+ .innerJoin(StudentMedicalExaminationEntity_1, 'sme', 'sme.examinationId = cme.id')
87
+ .where('sme.id = :id', { id: this.id })
88
+ .getOne();
89
+ // get driveup product
90
+ const product = await product_entity_3.ProductEntity.createQueryBuilder('p')
91
+ .innerJoin(product_entity_1.CompanyProductEntity, 'cp', 'cp.productId = p.id')
92
+ .innerJoin(product_entity_2.CompanyMedicalProductEntity, 'cmp', 'cmp.productId = cp.id')
93
+ .where('cmp.id = :id', { id: companyMedicalProduct.id })
94
+ .getOne();
95
+ return new common_1.Appointment({
96
+ id: this.id,
97
+ type: common_1.AppointmentType.Medical,
98
+ product: product.type,
99
+ status: this.status,
100
+ title: this.title,
101
+ subtitle: this.description,
102
+ startDate: this.startDate,
103
+ endDate: this.endDate,
104
+ color: product.color,
105
+ location: this.location ? common_2.Address.toInstance(this.location) : null,
106
+ note: this.note ? common_2.Note.toInstance(this.note) : null,
107
+ });
108
+ }
109
+ async toSummary() {
110
+ return new common_1.Appointment({
111
+ id: this.id,
112
+ type: common_1.AppointmentType.Medical,
113
+ status: this.status,
114
+ title: this.title,
115
+ subtitle: this.description,
116
+ startDate: this.startDate,
117
+ endDate: this.endDate,
118
+ });
119
+ }
120
+ async getActivities() {
121
+ const activities = [];
122
+ activities.push(await (0, utils_1.toActivity)(this.createdBy, common_1.ActivityType.createdBy));
123
+ activities.push(await (0, utils_1.toActivity)(this.createdOn, common_1.ActivityType.createdOn));
124
+ activities.push(await (0, utils_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy));
125
+ activities.push(await (0, utils_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
126
+ return activities.filter(a => a);
127
+ }
128
+ };
129
+ exports.StudentMedicalExaminationEntity = StudentMedicalExaminationEntity;
130
+ __decorate([
131
+ (0, typeorm_1.Column)(),
132
+ __metadata("design:type", Number)
133
+ ], StudentMedicalExaminationEntity.prototype, "studentId", void 0);
134
+ __decorate([
135
+ (0, typeorm_1.Column)(),
136
+ __metadata("design:type", Number)
137
+ ], StudentMedicalExaminationEntity.prototype, "examinationId", void 0);
138
+ __decorate([
139
+ (0, typeorm_1.Column)({
140
+ type: 'enum',
141
+ enum: [
142
+ common_2.StatusType.Pending,
143
+ common_2.StatusType.Passed,
144
+ common_2.StatusType.Failed
145
+ ],
146
+ default: common_2.StatusType.Pending,
147
+ nullable: false
148
+ }),
149
+ __metadata("design:type", String)
150
+ ], StudentMedicalExaminationEntity.prototype, "status", void 0);
151
+ __decorate([
152
+ (0, typeorm_1.Column)(),
153
+ __metadata("design:type", String)
154
+ ], StudentMedicalExaminationEntity.prototype, "title", void 0);
155
+ __decorate([
156
+ (0, typeorm_1.Column)({
157
+ nullable: true,
158
+ default: null
159
+ }),
160
+ __metadata("design:type", String)
161
+ ], StudentMedicalExaminationEntity.prototype, "description", void 0);
162
+ __decorate([
163
+ (0, typeorm_1.Column)(),
164
+ __metadata("design:type", Date)
165
+ ], StudentMedicalExaminationEntity.prototype, "startDate", void 0);
166
+ __decorate([
167
+ (0, typeorm_1.Column)(),
168
+ __metadata("design:type", Date)
169
+ ], StudentMedicalExaminationEntity.prototype, "endDate", void 0);
170
+ __decorate([
171
+ (0, typeorm_1.Column)({
172
+ nullable: true,
173
+ default: null
174
+ }),
175
+ __metadata("design:type", String)
176
+ ], StudentMedicalExaminationEntity.prototype, "doctorName", void 0);
177
+ __decorate([
178
+ (0, typeorm_1.Column)({
179
+ type: 'simple-json',
180
+ nullable: true,
181
+ default: null
182
+ }),
183
+ __metadata("design:type", common_2.Address)
184
+ ], StudentMedicalExaminationEntity.prototype, "location", void 0);
185
+ __decorate([
186
+ (0, typeorm_1.Column)({
187
+ type: 'simple-json',
188
+ nullable: true,
189
+ default: null
190
+ }),
191
+ __metadata("design:type", common_2.Note)
192
+ ], StudentMedicalExaminationEntity.prototype, "note", void 0);
193
+ __decorate([
194
+ (0, typeorm_1.ManyToOne)(() => student_entity_1.StudentEntity, student => student.medicalExaminations),
195
+ __metadata("design:type", Promise)
196
+ ], StudentMedicalExaminationEntity.prototype, "student", void 0);
197
+ __decorate([
198
+ (0, typeorm_1.ManyToOne)(() => examination_entity_1.CompanyMedicalExaminationEntity, examination => examination.students),
199
+ __metadata("design:type", Promise)
200
+ ], StudentMedicalExaminationEntity.prototype, "examination", void 0);
201
+ __decorate([
202
+ (0, typeorm_1.OneToOne)(() => certificate_entity_1.StudentMedicalCertificateEntity, certificate => certificate.examination),
203
+ __metadata("design:type", Promise)
204
+ ], StudentMedicalExaminationEntity.prototype, "certificate", void 0);
205
+ exports.StudentMedicalExaminationEntity = StudentMedicalExaminationEntity = StudentMedicalExaminationEntity_1 = __decorate([
206
+ (0, typeorm_1.Entity)('studentMedicalExaminations'),
207
+ __metadata("design:paramtypes", [Object])
208
+ ], StudentMedicalExaminationEntity);
209
+ //# sourceMappingURL=examination.model.js.map
@@ -0,0 +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,6DAAuE;AACvE,oFAA8F;AAC9F,4EAA+E;AAC/E,4EAAsF;AACtF,+EAA2E;AAC3E,6CAAgE;AAGzD,IAAM,+BAA+B,uCAArC,MAAM,+BAAgC,SAAQ,uBAA4B;IAEhF;;OAEG;IAEH,SAAS,CAAS;IAElB;;OAEG;IAEH,aAAa,CAAS;IAEtB;;;OAGG;IAWH,MAAM,CAAa;IAEnB;;OAEG;IAEH,KAAK,CAAS;IAEd;;OAEG;IAKH,WAAW,CAAS;IAEpB;;OAEG;IAEH,SAAS,CAAO;IAEhB;;OAEG;IAEH,OAAO,CAAO;IAEd;;OAEG;IAKH,UAAU,CAAS;IAEnB;;OAEG;IAMH,QAAQ,CAAU;IAElB;;OAEG;IAMH,IAAI,CAAO;IAEX;;OAEG;IAEH,OAAO,CAAyB;IAEhC;;OAEG;IAEH,WAAW,CAA2C;IAEtD;;OAEG;IAEH,WAAW,CAA2C;IAEtD,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,KAAK,CAAC;aACpC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