@driveup/schema 0.2.6 → 0.2.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/catalog/addon/addon.entity.d.ts +3 -3
- package/lib/catalog/addon/addon.entity.js +7 -7
- package/lib/catalog/addon/addon.entity.js.map +1 -1
- package/lib/catalog/addon/country.entity.d.ts +4 -4
- package/lib/catalog/addon/country.entity.js +5 -6
- package/lib/catalog/addon/country.entity.js.map +1 -1
- package/lib/catalog/priceplan/priceplan.entity.d.ts +8 -3
- package/lib/catalog/priceplan/priceplan.entity.js +14 -7
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/country.entity.d.ts +6 -6
- package/lib/catalog/product/country.entity.js +9 -10
- package/lib/catalog/product/country.entity.js.map +1 -1
- package/lib/catalog/product/priceplan.entity.d.ts +9 -4
- package/lib/catalog/product/priceplan.entity.js +19 -9
- package/lib/catalog/product/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/product.entity.d.ts +3 -3
- package/lib/catalog/product/product.entity.js +8 -8
- 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 +7 -7
- 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 +6 -6
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
- package/lib/catalog/seed/courses/course.entity.d.ts +4 -4
- package/lib/catalog/seed/courses/course.entity.js +9 -9
- package/lib/catalog/seed/courses/course.entity.js.map +1 -1
- package/lib/catalog/seed/courses/lesson.entity.d.ts +3 -3
- package/lib/catalog/seed/courses/lesson.entity.js +7 -7
- package/lib/catalog/seed/courses/lesson.entity.js.map +1 -1
- package/lib/catalog/seed/courses/topic.entity.d.ts +3 -3
- package/lib/catalog/seed/courses/topic.entity.js +8 -8
- 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 +6 -6
- package/lib/catalog/seed/expense/category.entity.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/profile/agent/agent.entity.d.ts +13 -4
- package/lib/profile/agent/agent.entity.js +46 -20
- package/lib/profile/agent/agent.entity.js.map +1 -1
- package/lib/profile/agent/asset.entity.d.ts +1 -1
- package/lib/profile/agent/asset.entity.js +2 -2
- package/lib/profile/agent/asset.entity.js.map +1 -1
- package/lib/profile/agent/payout.entity.d.ts +3 -3
- package/lib/profile/agent/payout.entity.js +6 -6
- package/lib/profile/agent/payout.entity.js.map +1 -1
- package/lib/profile/agent/promotion.entity.d.ts +3 -3
- package/lib/profile/agent/promotion.entity.js +6 -6
- package/lib/profile/agent/promotion.entity.js.map +1 -1
- package/lib/profile/company/company.entity.d.ts +80 -9
- package/lib/profile/company/company.entity.js +246 -36
- package/lib/profile/company/company.entity.js.map +1 -1
- package/lib/profile/company/course/appointment.entity.d.ts +73 -4
- package/lib/profile/company/course/appointment.entity.js +247 -0
- package/lib/profile/company/course/appointment.entity.js.map +1 -1
- package/lib/profile/company/course/course.entity.d.ts +41 -8
- package/lib/profile/company/course/course.entity.js +58 -12
- package/lib/profile/company/course/course.entity.js.map +1 -1
- package/lib/profile/company/course/lesson.entity.d.ts +30 -7
- package/lib/profile/company/course/lesson.entity.js +93 -12
- package/lib/profile/company/course/lesson.entity.js.map +1 -1
- package/lib/profile/company/course/schedule.entity.d.ts +276 -0
- package/lib/profile/company/course/schedule.entity.js +744 -0
- package/lib/profile/company/course/schedule.entity.js.map +1 -0
- package/lib/profile/company/course/topic.entity.d.ts +9 -4
- package/lib/profile/company/course/topic.entity.js +14 -7
- package/lib/profile/company/course/topic.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/bill.entity.d.ts +9 -2
- package/lib/profile/company/finances/billing/bill.entity.js +38 -4
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/item.entity.d.ts +8 -3
- package/lib/profile/company/finances/billing/item.entity.js +10 -6
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +7 -5
- package/lib/profile/company/finances/billing/transaction.entity.js +6 -6
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/category.entity.d.ts +1 -1
- package/lib/profile/company/finances/expense/category.entity.js +4 -4
- package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/expense.entity.d.ts +6 -2
- package/lib/profile/company/finances/expense/expense.entity.js +32 -4
- package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
- package/lib/profile/company/finances/handover/handover.entity.d.ts +3 -3
- package/lib/profile/company/finances/handover/handover.entity.js +6 -6
- package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/invoice.entity.d.ts +8 -7
- package/lib/profile/company/finances/invoice/invoice.entity.js +15 -14
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/item.entity.d.ts +2 -2
- package/lib/profile/company/finances/invoice/item.entity.js +4 -4
- package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
- package/lib/profile/company/finances/payment/method.entity.d.ts +24 -4
- package/lib/profile/company/finances/payment/method.entity.js +40 -5
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
- package/lib/profile/company/instructor/activity.entity.js.map +1 -1
- package/lib/profile/company/instructor/calendar-state.entity.js.map +1 -1
- package/lib/profile/company/instructor/instructor.entity.d.ts +34 -17
- package/lib/profile/company/instructor/instructor.entity.js +143 -25
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/company/instructor/task.entity.d.ts +2 -1
- package/lib/profile/company/instructor/task.entity.js +9 -4
- package/lib/profile/company/instructor/task.entity.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.d.ts +4 -4
- package/lib/profile/company/medical/examination.entity.js +6 -6
- package/lib/profile/company/medical/examination.entity.js.map +1 -1
- package/lib/profile/company/medical/product.entity.d.ts +4 -5
- package/lib/profile/company/medical/product.entity.js +13 -14
- package/lib/profile/company/medical/product.entity.js.map +1 -1
- package/lib/profile/company/product/addon.entity.d.ts +3 -3
- package/lib/profile/company/product/addon.entity.js +6 -7
- package/lib/profile/company/product/addon.entity.js.map +1 -1
- package/lib/profile/company/product/priceplan.entity.d.ts +15 -13
- package/lib/profile/company/product/priceplan.entity.js +20 -16
- package/lib/profile/company/product/priceplan.entity.js.map +1 -1
- package/lib/profile/company/product/product.entity.d.ts +34 -8
- package/lib/profile/company/product/product.entity.js +70 -12
- package/lib/profile/company/product/product.entity.js.map +1 -1
- package/lib/profile/company/product/vehicle.entity.d.ts +2 -2
- package/lib/profile/company/product/vehicle.entity.js +4 -4
- package/lib/profile/company/product/vehicle.entity.js.map +1 -1
- package/lib/profile/instructor/instructor.entity.d.ts +6 -3
- package/lib/profile/instructor/instructor.entity.js +31 -9
- package/lib/profile/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/student/program/licence/licence.entity.d.ts +13 -5
- package/lib/profile/student/program/licence/licence.entity.js +19 -8
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
- package/lib/profile/student/program/medical/certificate.entity.d.ts +3 -3
- package/lib/profile/student/program/medical/certificate.entity.js +6 -6
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
- package/lib/profile/student/program/medical/examination.entity.d.ts +4 -4
- package/lib/profile/student/program/medical/examination.entity.js +14 -14
- 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 +8 -13
- package/lib/profile/student/program/program.entity.js.map +1 -1
- package/lib/profile/student/program/training/appointment.entity.d.ts +32 -9
- package/lib/profile/student/program/training/appointment.entity.js +144 -21
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
- package/lib/profile/student/program/training/exam.entity.d.ts +9 -2
- package/lib/profile/student/program/training/exam.entity.js +28 -12
- package/lib/profile/student/program/training/exam.entity.js.map +1 -1
- package/lib/profile/student/program/training/lesson.entity.d.ts +8 -3
- package/lib/profile/student/program/training/lesson.entity.js +28 -6
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
- package/lib/profile/student/program/training/request.entity.d.ts +6 -3
- package/lib/profile/student/program/training/request.entity.js +26 -5
- package/lib/profile/student/program/training/request.entity.js.map +1 -1
- package/lib/profile/student/program/training/topic.entity.d.ts +16 -4
- package/lib/profile/student/program/training/topic.entity.js +36 -9
- package/lib/profile/student/program/training/topic.entity.js.map +1 -1
- package/lib/profile/student/program/training/training.entity.d.ts +50 -6
- package/lib/profile/student/program/training/training.entity.js +217 -33
- package/lib/profile/student/program/training/training.entity.js.map +1 -1
- package/lib/profile/student/program/training/transaction.entity.d.ts +8 -3
- package/lib/profile/student/program/training/transaction.entity.js +43 -6
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +11 -6
- package/lib/profile/student/student.entity.js +59 -11
- package/lib/profile/student/student.entity.js.map +1 -1
- package/lib/system/campaign/campaign.entity.d.ts +4 -4
- package/lib/system/campaign/campaign.entity.js +10 -10
- package/lib/system/campaign/campaign.entity.js.map +1 -1
- package/lib/system/campaign/gifcode.entity.d.ts +4 -4
- package/lib/system/campaign/gifcode.entity.js +8 -8
- package/lib/system/campaign/gifcode.entity.js.map +1 -1
- package/lib/system/country/country.entity.d.ts +8 -6
- package/lib/system/country/country.entity.js +15 -9
- package/lib/system/country/country.entity.js.map +1 -1
- package/lib/system/currency/currency.entity.d.ts +1 -1
- package/lib/system/currency/currency.entity.js +4 -4
- package/lib/system/currency/currency.entity.js.map +1 -1
- package/lib/system/driving/category.entity.d.ts +7 -7
- package/lib/system/driving/category.entity.js +14 -14
- package/lib/system/driving/category.entity.js.map +1 -1
- package/lib/system/driving/vehicle.entity.d.ts +2 -2
- package/lib/system/driving/vehicle.entity.js +4 -4
- package/lib/system/driving/vehicle.entity.js.map +1 -1
- package/lib/system/event/event.entity.d.ts +2 -2
- package/lib/system/event/event.entity.js +4 -4
- package/lib/system/event/event.entity.js.map +1 -1
- package/lib/system/event/log.entity.d.ts +2 -2
- package/lib/system/event/log.entity.js +3 -3
- package/lib/system/event/log.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 +8 -8
- package/lib/system/policy/policy.entity.js.map +1 -1
- package/lib/system/staff/staff.entity.d.ts +1 -1
- package/lib/system/staff/staff.entity.js +5 -4
- package/lib/system/staff/staff.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/alert.entity.d.ts +4 -3
- package/lib/user/alert.entity.js +11 -4
- package/lib/user/alert.entity.js.map +1 -1
- package/lib/user/blocked.entity.js +2 -2
- package/lib/user/blocked.entity.js.map +1 -1
- package/lib/user/device.entity.d.ts +17 -2
- package/lib/user/device.entity.js +29 -3
- package/lib/user/device.entity.js.map +1 -1
- package/lib/user/notification.entity.d.ts +3 -3
- package/lib/user/notification.entity.js +8 -8
- package/lib/user/notification.entity.js.map +1 -1
- package/lib/user/ticket.entity.d.ts +8 -3
- package/lib/user/ticket.entity.js +16 -7
- package/lib/user/ticket.entity.js.map +1 -1
- package/lib/user/user.entity.d.ts +101 -89
- package/lib/user/user.entity.js +272 -270
- package/lib/user/user.entity.js.map +1 -1
- package/lib/user/verification.entity.js +2 -2
- package/lib/user/verification.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 +13 -2
- package/lib/utils/trackable.js +55 -0
- package/lib/utils/trackable.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Activity, Asset } from '@driveup/common';
|
|
2
|
+
import { AssetScope, AssetType, Content, Language } from '@driveup/shared';
|
|
3
3
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a catalog asset (image, video, document) for promotional or educational purposes.
|
|
@@ -10,13 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CatalogAssetEntity = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
15
|
-
const shared_1 = require("@driveup/shared");
|
|
16
13
|
const common_1 = require("@driveup/common");
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
15
|
+
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
17
|
const staff_entity_1 = require("../../../system/staff/staff.entity");
|
|
18
|
-
const trackable_1 = require("../../../utils/trackable");
|
|
19
18
|
const activity_helper_1 = require("../../../utils/activity.helper");
|
|
19
|
+
const trackable_1 = require("../../../utils/trackable");
|
|
20
20
|
/**
|
|
21
21
|
* Represents a catalog asset (image, video, document) for promotional or educational purposes.
|
|
22
22
|
* Assets are country-specific and can have multiple localized versions.
|
|
@@ -64,7 +64,7 @@ let CatalogAssetEntity = class CatalogAssetEntity extends trackable_1.TrackableE
|
|
|
64
64
|
getTranslation(lang) {
|
|
65
65
|
const language = lang || nestjs_i18n_1.I18nContext.current()?.lang;
|
|
66
66
|
const translation = this.translations?.find(t => t.language === language);
|
|
67
|
-
return new
|
|
67
|
+
return new shared_1.Content({
|
|
68
68
|
title: translation?.title,
|
|
69
69
|
description: translation?.description,
|
|
70
70
|
content: translation?.content,
|
|
@@ -76,7 +76,7 @@ let CatalogAssetEntity = class CatalogAssetEntity extends trackable_1.TrackableE
|
|
|
76
76
|
* @returns Array of Content instances for all languages
|
|
77
77
|
*/
|
|
78
78
|
getTranslations() {
|
|
79
|
-
return this.translations?.map(t => new
|
|
79
|
+
return this.translations?.map(t => new shared_1.Content({
|
|
80
80
|
title: t.title,
|
|
81
81
|
description: t.description,
|
|
82
82
|
content: t.content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/assets/asset.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"asset.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/assets/asset.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAkD;AAClD,4CAAyF;AACzF,6CAA0C;AAC1C,qCAAyC;AAEzC,qEAAiE;AACjE,oEAA4D;AAC5D,wDAA2D;AAE3D;;;;;;GAMG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAsB;IAoD7D;;;OAGG;IACH,YAAY,KAAmC;QAC9C,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,IAAe;QACtB,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,IAAI,cAAK,CAAC;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,KAAK,EAAE,WAAW,EAAE,KAAK;YACzB,WAAW,EAAE,WAAW,EAAE,WAAW;SACrC,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,IAAe;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,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QACrG,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;CACD,CAAA;AA/HY,gDAAkB;AAM9B;IADC,IAAA,gBAAM,GAAE;;qDACS;AAYlB;IANC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,mBAAU;QAChB,OAAO,EAAE,mBAAU,CAAC,gBAAgB;QACpC,QAAQ,EAAE,KAAK;KACf,CAAC;;iDACgB;AAalB;IAPC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,kBAAS;QACf,OAAO,EAAE,kBAAS,CAAC,KAAK;QACxB,QAAQ,EAAE,KAAK;KACf,CAAC;;gDACc;AAShB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;+CACU;AAUZ;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;wDACsB;6BAlDZ,kBAAkB;IAD9B,IAAA,gBAAM,EAAC,qBAAqB,CAAC;;GACjB,kBAAkB,CA+H9B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Activity, Course } from '@driveup/common';
|
|
2
|
+
import { Content, Language } from '@driveup/shared';
|
|
3
3
|
import { DrivingCategoryEntity } from '../../../system/driving/category.entity';
|
|
4
|
-
import { SeedCourseLessonEntity } from './lesson.entity';
|
|
5
|
-
import { CountryProductEntity } from '../../product/country.entity';
|
|
6
4
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
5
|
+
import { CountryProductEntity } from '../../product/country.entity';
|
|
6
|
+
import { SeedCourseLessonEntity } from './lesson.entity';
|
|
7
7
|
/**
|
|
8
8
|
* Represents a seed course template in the system.
|
|
9
9
|
* Seed courses are predefined training programs that companies can use
|
|
@@ -10,16 +10,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SeedCourseEntity = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
15
|
-
const shared_1 = require("@driveup/shared");
|
|
16
13
|
const common_1 = require("@driveup/common");
|
|
17
|
-
const
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
15
|
+
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
18
17
|
const category_entity_1 = require("../../../system/driving/category.entity");
|
|
19
|
-
const
|
|
20
|
-
const country_entity_1 = require("../../product/country.entity");
|
|
21
|
-
const trackable_1 = require("../../../utils/trackable");
|
|
18
|
+
const staff_entity_1 = require("../../../system/staff/staff.entity");
|
|
22
19
|
const activity_helper_1 = require("../../../utils/activity.helper");
|
|
20
|
+
const trackable_1 = require("../../../utils/trackable");
|
|
21
|
+
const country_entity_1 = require("../../product/country.entity");
|
|
22
|
+
const lesson_entity_1 = require("./lesson.entity");
|
|
23
23
|
/**
|
|
24
24
|
* Represents a seed course template in the system.
|
|
25
25
|
* Seed courses are predefined training programs that companies can use
|
|
@@ -85,7 +85,7 @@ let SeedCourseEntity = class SeedCourseEntity extends trackable_1.TrackableEntit
|
|
|
85
85
|
getTranslation(lang) {
|
|
86
86
|
const language = lang || nestjs_i18n_1.I18nContext.current()?.lang;
|
|
87
87
|
const translation = this.translations?.find(t => t.language === language);
|
|
88
|
-
return new
|
|
88
|
+
return new shared_1.Content({
|
|
89
89
|
title: translation?.title,
|
|
90
90
|
description: translation?.description,
|
|
91
91
|
content: translation?.content,
|
|
@@ -98,7 +98,7 @@ let SeedCourseEntity = class SeedCourseEntity extends trackable_1.TrackableEntit
|
|
|
98
98
|
* @returns Array of Content instances for all languages
|
|
99
99
|
*/
|
|
100
100
|
getTranslations() {
|
|
101
|
-
return this.translations?.map(t => new
|
|
101
|
+
return this.translations?.map(t => new shared_1.Content({
|
|
102
102
|
title: t.title,
|
|
103
103
|
description: t.description,
|
|
104
104
|
content: t.content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"course.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/courses/course.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"course.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/courses/course.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAmD;AACnD,4CAAkE;AAClE,6CAA0C;AAC1C,qCAA+D;AAE/D,6EAAgF;AAChF,qEAAiE;AACjE,oEAA4D;AAC5D,wDAA2D;AAC3D,iEAAoE;AACpE,mDAAyD;AAEzD;;;;;;;GAOG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,2BAAuB;IA0E5D;;;OAGG;IACH,YAAY,KAAiC;QAC5C,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,IAAe;QACtB,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,IAAI,eAAM,CAAC;YACjB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,WAAW,EAAE,KAAK;YACzB,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,IAAI,CAAC,QAAQ;YAC3C,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,IAAe;QACxB,OAAO,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E,CAAC,QAAQ,CAAC,WAAW,CAAC;;kDAChC;AAMzC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sCAAsB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;;iDACtB;2BAxE/B,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,aAAa,CAAC;;GACT,gBAAgB,CAyK5B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Activity, Lesson, Picture } from '@driveup/common';
|
|
2
|
+
import { Content, Language } from '@driveup/shared';
|
|
3
|
+
import { TrackableEntity } from '../../../utils/trackable';
|
|
3
4
|
import { SeedCourseEntity } from './course.entity';
|
|
4
5
|
import { SeedCourseTopicEntity } from './topic.entity';
|
|
5
|
-
import { TrackableEntity } from '../../../utils/trackable';
|
|
6
6
|
/**
|
|
7
7
|
* Represents a lesson within a seed course.
|
|
8
8
|
* Lessons are structured learning units that contain topics, have a specific
|
|
@@ -10,16 +10,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SeedCourseLessonEntity = void 0;
|
|
13
|
+
const common_1 = require("@driveup/common");
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
15
|
+
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
13
16
|
const typeorm_1 = require("typeorm");
|
|
14
17
|
const typeorm_2 = require("typeorm");
|
|
15
|
-
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
16
|
-
const shared_1 = require("@driveup/shared");
|
|
17
|
-
const common_1 = require("@driveup/common");
|
|
18
18
|
const staff_entity_1 = require("../../../system/staff/staff.entity");
|
|
19
|
+
const activity_helper_1 = require("../../../utils/activity.helper");
|
|
20
|
+
const trackable_1 = require("../../../utils/trackable");
|
|
19
21
|
const course_entity_1 = require("./course.entity");
|
|
20
22
|
const topic_entity_1 = require("./topic.entity");
|
|
21
|
-
const trackable_1 = require("../../../utils/trackable");
|
|
22
|
-
const activity_helper_1 = require("../../../utils/activity.helper");
|
|
23
23
|
/**
|
|
24
24
|
* Represents a lesson within a seed course.
|
|
25
25
|
* Lessons are structured learning units that contain topics, have a specific
|
|
@@ -70,7 +70,7 @@ let SeedCourseLessonEntity = class SeedCourseLessonEntity extends trackable_1.Tr
|
|
|
70
70
|
getTranslation(lang) {
|
|
71
71
|
const language = lang || nestjs_i18n_1.I18nContext.current()?.lang;
|
|
72
72
|
const translation = this.translations?.find(t => t.language === language);
|
|
73
|
-
return new
|
|
73
|
+
return new shared_1.Content({
|
|
74
74
|
title: translation?.title,
|
|
75
75
|
description: translation?.description,
|
|
76
76
|
content: translation?.content,
|
|
@@ -83,7 +83,7 @@ let SeedCourseLessonEntity = class SeedCourseLessonEntity extends trackable_1.Tr
|
|
|
83
83
|
* @returns Array of Content instances for all languages
|
|
84
84
|
*/
|
|
85
85
|
getTranslations() {
|
|
86
|
-
return this.translations?.map(t => new
|
|
86
|
+
return this.translations?.map(t => new shared_1.Content({
|
|
87
87
|
title: t.title,
|
|
88
88
|
description: t.description,
|
|
89
89
|
content: t.content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lesson.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/courses/lesson.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,qCAA+C;
|
|
1
|
+
{"version":3,"file":"lesson.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/courses/lesson.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA4D;AAC5D,4CAAkE;AAClE,6CAA0C;AAC1C,qCAAyC;AACzC,qCAA+C;AAE/C,qEAAiE;AACjE,oEAA4D;AAC5D,wDAA2D;AAC3D,mDAAmD;AACnD,iDAAuD;AAEvD;;;;;;;GAOG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,2BAA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P,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;4DACsB;AASxB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;wDACe;AAUjB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;uDACiB;AASnB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;sDACa;AASf;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;wDACe;AAUjB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;oDACW;AAMb;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gCAAgB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;;sDAC1B;AAMlC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oCAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;;sDACrB;iCA3E7B,sBAAsB;IADlC,IAAA,gBAAM,EAAC,mBAAmB,CAAC;;GACf,sBAAsB,CAqKlC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { SeedCourseLessonEntity } from './lesson.entity';
|
|
1
|
+
import { Activity, Topic } from '@driveup/common';
|
|
2
|
+
import { Content, Language, Skill } from '@driveup/shared';
|
|
4
3
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
4
|
+
import { SeedCourseLessonEntity } from './lesson.entity';
|
|
5
5
|
/**
|
|
6
6
|
* Represents a topic within a lesson.
|
|
7
7
|
* Topics are the smallest learning units that define specific skills and knowledge areas.
|
|
@@ -10,15 +10,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SeedCourseTopicEntity = void 0;
|
|
13
|
+
const common_1 = require("@driveup/common");
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
15
|
+
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
13
16
|
const typeorm_1 = require("typeorm");
|
|
14
17
|
const typeorm_2 = require("typeorm");
|
|
15
|
-
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
16
|
-
const shared_1 = require("@driveup/shared");
|
|
17
|
-
const common_1 = require("@driveup/common");
|
|
18
|
-
const lesson_entity_1 = require("./lesson.entity");
|
|
19
18
|
const staff_entity_1 = require("../../../system/staff/staff.entity");
|
|
20
|
-
const trackable_1 = require("../../../utils/trackable");
|
|
21
19
|
const activity_helper_1 = require("../../../utils/activity.helper");
|
|
20
|
+
const trackable_1 = require("../../../utils/trackable");
|
|
21
|
+
const lesson_entity_1 = require("./lesson.entity");
|
|
22
22
|
/**
|
|
23
23
|
* Represents a topic within a lesson.
|
|
24
24
|
* Topics are the smallest learning units that define specific skills and knowledge areas.
|
|
@@ -65,7 +65,7 @@ let SeedCourseTopicEntity = class SeedCourseTopicEntity extends trackable_1.Trac
|
|
|
65
65
|
*/
|
|
66
66
|
getSkills(lang) {
|
|
67
67
|
const language = lang || nestjs_i18n_1.I18nContext.current()?.lang;
|
|
68
|
-
return this.skills?.filter(s => s.language === language).map(s => new
|
|
68
|
+
return this.skills?.filter(s => s.language === language).map(s => new shared_1.Skill({
|
|
69
69
|
id: s.id,
|
|
70
70
|
title: s.title,
|
|
71
71
|
sort: s.sort
|
|
@@ -79,7 +79,7 @@ let SeedCourseTopicEntity = class SeedCourseTopicEntity extends trackable_1.Trac
|
|
|
79
79
|
getTranslation(lang) {
|
|
80
80
|
const language = lang || nestjs_i18n_1.I18nContext.current()?.lang;
|
|
81
81
|
const translation = this.translations?.find(t => t.language === language);
|
|
82
|
-
return new
|
|
82
|
+
return new shared_1.Content({
|
|
83
83
|
title: translation?.title,
|
|
84
84
|
description: translation?.description,
|
|
85
85
|
content: translation?.content,
|
|
@@ -92,7 +92,7 @@ let SeedCourseTopicEntity = class SeedCourseTopicEntity extends trackable_1.Trac
|
|
|
92
92
|
* @returns Array of Content instances for all languages
|
|
93
93
|
*/
|
|
94
94
|
getTranslations() {
|
|
95
|
-
return this.translations?.map(t => new
|
|
95
|
+
return this.translations?.map(t => new shared_1.Content({
|
|
96
96
|
title: t.title,
|
|
97
97
|
description: t.description,
|
|
98
98
|
content: t.content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/courses/topic.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"topic.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/courses/topic.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAkD;AAClD,4CAAyE;AACzE,6CAA0C;AAC1C,qCAAyC;AACzC,qCAAoC;AAEpC,qEAAiE;AACjE,oEAA4D;AAC5D,wDAA2D;AAC3D,mDAAyD;AAEzD;;;;;;GAMG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,2BAAsB;IAsDhE;;;OAGG;IACH,YAAY,KAAsC;QACjD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,IAAe;QACtB,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,IAAI,cAAK,CAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,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,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;mDACW;AAMb;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sCAAsB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;;qDACzB;gCApD5B,qBAAqB;IADjC,IAAA,gBAAM,EAAC,kBAAkB,CAAC;;GACd,qBAAqB,CAkJjC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Activity, Category } from '@driveup/common';
|
|
2
|
+
import { Content, Language } from '@driveup/shared';
|
|
3
3
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a seed expense category template in the system.
|
|
@@ -10,13 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SeedExpenseCategoryEntity = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
15
|
-
const shared_1 = require("@driveup/shared");
|
|
16
13
|
const common_1 = require("@driveup/common");
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
15
|
+
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
17
|
const staff_entity_1 = require("../../../system/staff/staff.entity");
|
|
18
|
-
const trackable_1 = require("../../../utils/trackable");
|
|
19
18
|
const activity_helper_1 = require("../../../utils/activity.helper");
|
|
19
|
+
const trackable_1 = require("../../../utils/trackable");
|
|
20
20
|
/**
|
|
21
21
|
* Represents a seed expense category template in the system.
|
|
22
22
|
* Expense categories are predefined classifications for company expenses
|
|
@@ -66,7 +66,7 @@ let SeedExpenseCategoryEntity = class SeedExpenseCategoryEntity extends trackabl
|
|
|
66
66
|
getTranslation(lang) {
|
|
67
67
|
const language = lang || nestjs_i18n_1.I18nContext.current()?.lang;
|
|
68
68
|
const translation = this.translations?.find(t => t.language === language);
|
|
69
|
-
return new
|
|
69
|
+
return new shared_1.Content({
|
|
70
70
|
title: translation?.title,
|
|
71
71
|
description: translation?.description,
|
|
72
72
|
content: translation?.content,
|
|
@@ -79,7 +79,7 @@ let SeedExpenseCategoryEntity = class SeedExpenseCategoryEntity extends trackabl
|
|
|
79
79
|
* @returns Array of Content instances for all languages
|
|
80
80
|
*/
|
|
81
81
|
getTranslations() {
|
|
82
|
-
return this.translations?.map(t => new
|
|
82
|
+
return this.translations?.map(t => new shared_1.Content({
|
|
83
83
|
title: t.title,
|
|
84
84
|
description: t.description,
|
|
85
85
|
content: t.content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/expense/category.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"category.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/expense/category.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAqD;AACrD,4CAAkE;AAClE,6CAA0C;AAC1C,qCAAyC;AAEzC,qEAAiE;AACjE,oEAA4D;AAC5D,wDAA2D;AAE3D;;;;;;;GAOG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,2BAAyB;IAwCvE;;;OAGG;IACH,YAAY,KAA0C;QACrD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,IAAc;QACrB,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,IAAI,iBAAQ,CAAC;YACnB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,E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MAAM,UAAU,GAAe,EAAE,CAAC;QAClC,UAAU,CAAC,IAAI,CAAC,MAAM,IAAA,4BAAU,EAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,qBAAY,CAAC,OAAO,EAAE,0BAAW,CAAC,CAAC,CAAC;QACrG,UAAU,CAAC,IAAI,CAAC,MAAM,IAAA,4BAAU,EAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,qBAAY,CAAC,OAAO,EAAE,0BAAW,CAAC,CAAC,CAAC;QACrG,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;CACD,CAAA;AArHY,8DAAyB;AAUrC;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;+DACsB;AASxB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;uDACW;AASb;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;2DACe;AAUjB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;uDACW;oCAtCD,yBAAyB;IADrC,IAAA,gBAAM,EAAC,uBAAuB,CAAC;;GACnB,yBAAyB,CAqHrC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export * from './profile/agent/agent.entity';
|
|
|
14
14
|
export * from './profile/agent/asset.entity';
|
|
15
15
|
export * from './profile/agent/payout.entity';
|
|
16
16
|
export * from './profile/agent/promotion.entity';
|
|
17
|
-
export * from './profile/company/course/
|
|
17
|
+
export * from './profile/company/course/schedule.entity';
|
|
18
18
|
export * from './profile/company/course/course.entity';
|
|
19
19
|
export * from './profile/company/course/lesson.entity';
|
|
20
20
|
export * from './profile/company/course/topic.entity';
|
|
@@ -28,7 +28,6 @@ export * from './profile/company/finances/invoice/invoice.entity';
|
|
|
28
28
|
export * from './profile/company/finances/invoice/item.entity';
|
|
29
29
|
export * from './profile/company/finances/payment/method.entity';
|
|
30
30
|
export * from './profile/company/instructor/activity.entity';
|
|
31
|
-
export * from './profile/company/instructor/calendar-state.entity';
|
|
32
31
|
export * from './profile/company/instructor/instructor.entity';
|
|
33
32
|
export * from './profile/company/instructor/task.entity';
|
|
34
33
|
export * from './profile/company/medical/examination.entity';
|
|
@@ -59,6 +58,7 @@ export * from './system/driving/category.entity';
|
|
|
59
58
|
export * from './system/driving/vehicle.entity';
|
|
60
59
|
export * from './system/event/event.entity';
|
|
61
60
|
export * from './system/event/log.entity';
|
|
61
|
+
export * from './system/ical/ical.entity';
|
|
62
62
|
export * from './system/policy/policy.entity';
|
|
63
63
|
export * from './system/staff/staff.entity';
|
|
64
64
|
export * from './user/alert.entity';
|
package/lib/index.js
CHANGED
|
@@ -33,7 +33,7 @@ __exportStar(require("./profile/agent/asset.entity"), exports);
|
|
|
33
33
|
__exportStar(require("./profile/agent/payout.entity"), exports);
|
|
34
34
|
__exportStar(require("./profile/agent/promotion.entity"), exports);
|
|
35
35
|
// profile: company
|
|
36
|
-
__exportStar(require("./profile/company/course/
|
|
36
|
+
__exportStar(require("./profile/company/course/schedule.entity"), exports);
|
|
37
37
|
__exportStar(require("./profile/company/course/course.entity"), exports);
|
|
38
38
|
__exportStar(require("./profile/company/course/lesson.entity"), exports);
|
|
39
39
|
__exportStar(require("./profile/company/course/topic.entity"), exports);
|
|
@@ -47,7 +47,6 @@ __exportStar(require("./profile/company/finances/invoice/invoice.entity"), expor
|
|
|
47
47
|
__exportStar(require("./profile/company/finances/invoice/item.entity"), exports);
|
|
48
48
|
__exportStar(require("./profile/company/finances/payment/method.entity"), exports);
|
|
49
49
|
__exportStar(require("./profile/company/instructor/activity.entity"), exports);
|
|
50
|
-
__exportStar(require("./profile/company/instructor/calendar-state.entity"), exports);
|
|
51
50
|
__exportStar(require("./profile/company/instructor/instructor.entity"), exports);
|
|
52
51
|
__exportStar(require("./profile/company/instructor/task.entity"), exports);
|
|
53
52
|
__exportStar(require("./profile/company/medical/examination.entity"), exports);
|
|
@@ -81,6 +80,7 @@ __exportStar(require("./system/driving/category.entity"), exports);
|
|
|
81
80
|
__exportStar(require("./system/driving/vehicle.entity"), exports);
|
|
82
81
|
__exportStar(require("./system/event/event.entity"), exports);
|
|
83
82
|
__exportStar(require("./system/event/log.entity"), exports);
|
|
83
|
+
__exportStar(require("./system/ical/ical.entity"), exports);
|
|
84
84
|
__exportStar(require("./system/policy/policy.entity"), exports);
|
|
85
85
|
__exportStar(require("./system/staff/staff.entity"), exports);
|
|
86
86
|
__exportStar(require("./user/alert.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,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,mBAAmB;AACnB,
|
|
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,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,mBAAmB;AACnB,2EAAyD;AACzD,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,+EAA6D;AAC7D,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,oEAAkD;AAClD,mEAAiD;AACjD,kEAAgD;AAChD,oEAAkD;AAClD,mEAAiD;AACjD,kEAAgD;AAChD,8DAA4C;AAC5C,4DAA0C;AAC1C,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,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Activity, Agent } from '@driveup/common';
|
|
2
|
+
import { BankAccount, Person, Preference } from '@driveup/shared';
|
|
3
|
+
import { AccountStatus, Language, PreferenceScope } from '@driveup/shared';
|
|
3
4
|
import { UserEntity } from '../../user/user.entity';
|
|
4
|
-
import { AgentPayoutEntity } from './payout.entity';
|
|
5
|
-
import { AgentPromotionEntity } from './promotion.entity';
|
|
6
5
|
import { TrackableEntity } from '../../utils/trackable';
|
|
7
6
|
import { AgentAssetEntity } from './asset.entity';
|
|
7
|
+
import { AgentPayoutEntity } from './payout.entity';
|
|
8
|
+
import { AgentPromotionEntity } from './promotion.entity';
|
|
8
9
|
/**
|
|
9
10
|
* Represents an agent profile in the system.
|
|
10
11
|
* Agents are users who promote Driveup services and earn commissions
|
|
@@ -42,6 +43,12 @@ export declare class AgentEntity extends TrackableEntity<Agent> {
|
|
|
42
43
|
* @default 50
|
|
43
44
|
*/
|
|
44
45
|
percentage: number;
|
|
46
|
+
/**
|
|
47
|
+
* The gift credit amount that will recieve after applying this code
|
|
48
|
+
*
|
|
49
|
+
* By default is set to 50
|
|
50
|
+
*/
|
|
51
|
+
companyGift: number;
|
|
45
52
|
/**
|
|
46
53
|
* Bank account information for payouts
|
|
47
54
|
*/
|
|
@@ -95,6 +102,8 @@ export declare class AgentEntity extends TrackableEntity<Agent> {
|
|
|
95
102
|
* @returns Array of Preference objects or undefined if not set
|
|
96
103
|
*/
|
|
97
104
|
getPreferences(): Preference<boolean>[];
|
|
105
|
+
setPreference(name: string, value: any, scope: PreferenceScope): Promise<Preference<boolean>[]>;
|
|
106
|
+
removePreference(name: string): Promise<Preference<boolean>[]>;
|
|
98
107
|
/**
|
|
99
108
|
* Retrieves activity history for this agent
|
|
100
109
|
* @returns Promise resolving to array of Activity instances tracking creation and updates
|
|
@@ -11,16 +11,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var AgentEntity_1;
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.AgentEntity = void 0;
|
|
14
|
-
const typeorm_1 = require("typeorm");
|
|
15
|
-
const shared_1 = require("@driveup/shared");
|
|
16
14
|
const common_1 = require("@driveup/common");
|
|
17
|
-
const
|
|
15
|
+
const shared_1 = require("@driveup/shared");
|
|
16
|
+
const shared_2 = require("@driveup/shared");
|
|
17
|
+
const typeorm_1 = require("typeorm");
|
|
18
18
|
const log_entity_1 = require("../../system/event/log.entity");
|
|
19
|
-
const
|
|
20
|
-
const promotion_entity_1 = require("./promotion.entity");
|
|
21
|
-
const trackable_1 = require("../../utils/trackable");
|
|
19
|
+
const user_entity_1 = require("../../user/user.entity");
|
|
22
20
|
const activity_helper_1 = require("../../utils/activity.helper");
|
|
21
|
+
const trackable_1 = require("../../utils/trackable");
|
|
23
22
|
const asset_entity_1 = require("./asset.entity");
|
|
23
|
+
const payout_entity_1 = require("./payout.entity");
|
|
24
|
+
const promotion_entity_1 = require("./promotion.entity");
|
|
24
25
|
/**
|
|
25
26
|
* Represents an agent profile in the system.
|
|
26
27
|
* Agents are users who promote Driveup services and earn commissions
|
|
@@ -60,7 +61,7 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
60
61
|
code: this.code,
|
|
61
62
|
percentage: this.percentage,
|
|
62
63
|
status: this.status,
|
|
63
|
-
bankAccount:
|
|
64
|
+
bankAccount: shared_1.BankAccount.toInstance(this.bankAccount)
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
/**
|
|
@@ -83,10 +84,11 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
83
84
|
*/
|
|
84
85
|
async toPerson() {
|
|
85
86
|
const user = await this.user;
|
|
86
|
-
return new
|
|
87
|
+
return new shared_1.Person({
|
|
87
88
|
id: this.id,
|
|
88
89
|
name: this.name,
|
|
89
90
|
imageUrl: user.imageUrl,
|
|
91
|
+
image: user.imageUrl, // mvp only
|
|
90
92
|
phone: user.phone,
|
|
91
93
|
email: user.email
|
|
92
94
|
});
|
|
@@ -98,7 +100,24 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
98
100
|
getPreferences() {
|
|
99
101
|
if (!this.preferences)
|
|
100
102
|
return;
|
|
101
|
-
return this.preferences.map(
|
|
103
|
+
return this.preferences.map(shared_1.Preference.toInstance);
|
|
104
|
+
}
|
|
105
|
+
async setPreference(name, value, scope) {
|
|
106
|
+
this.preferences = this.preferences || [];
|
|
107
|
+
this.preferences = this.preferences.filter(p => p.name !== name);
|
|
108
|
+
this.preferences.push(new shared_1.Preference({
|
|
109
|
+
scope: scope,
|
|
110
|
+
name: name,
|
|
111
|
+
value: value
|
|
112
|
+
}));
|
|
113
|
+
await AgentEntity_1.save(this);
|
|
114
|
+
return this.preferences;
|
|
115
|
+
}
|
|
116
|
+
async removePreference(name) {
|
|
117
|
+
this.preferences = this.preferences || [];
|
|
118
|
+
this.preferences = this.preferences.filter(p => p.name !== name);
|
|
119
|
+
await AgentEntity_1.save(this);
|
|
120
|
+
return this.preferences;
|
|
102
121
|
}
|
|
103
122
|
/**
|
|
104
123
|
* Retrieves activity history for this agent
|
|
@@ -106,8 +125,8 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
106
125
|
*/
|
|
107
126
|
async getActivities() {
|
|
108
127
|
const activities = [];
|
|
109
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn,
|
|
110
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn,
|
|
128
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_2.ActivityType.created));
|
|
129
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_2.ActivityType.updated));
|
|
111
130
|
return activities.filter(a => a);
|
|
112
131
|
}
|
|
113
132
|
/**
|
|
@@ -119,8 +138,8 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
119
138
|
if (!this.id)
|
|
120
139
|
return;
|
|
121
140
|
await log_entity_1.LogEntity.from({
|
|
122
|
-
type:
|
|
123
|
-
profile:
|
|
141
|
+
type: shared_2.LogType.Agent,
|
|
142
|
+
profile: shared_2.ProfileType.Agent,
|
|
124
143
|
event: event,
|
|
125
144
|
entityId: this.id,
|
|
126
145
|
content: log_entity_1.LogEntity.toAgentContent(event, this.language, metadata)
|
|
@@ -136,8 +155,8 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
136
155
|
if (!this.id)
|
|
137
156
|
return;
|
|
138
157
|
await log_entity_1.LogEntity.from({
|
|
139
|
-
type:
|
|
140
|
-
profile:
|
|
158
|
+
type: shared_2.LogType.Agent,
|
|
159
|
+
profile: shared_2.ProfileType.Agent,
|
|
141
160
|
event: event,
|
|
142
161
|
entityId: this.id,
|
|
143
162
|
content: log_entity_1.LogEntity.toAuthorContent(event, this.language, metadata)
|
|
@@ -152,8 +171,8 @@ __decorate([
|
|
|
152
171
|
__decorate([
|
|
153
172
|
(0, typeorm_1.Column)({
|
|
154
173
|
type: 'enum',
|
|
155
|
-
enum:
|
|
156
|
-
default:
|
|
174
|
+
enum: shared_2.AccountStatus,
|
|
175
|
+
default: shared_2.AccountStatus.Pending,
|
|
157
176
|
nullable: false
|
|
158
177
|
}),
|
|
159
178
|
__metadata("design:type", String)
|
|
@@ -168,8 +187,8 @@ __decorate([
|
|
|
168
187
|
__decorate([
|
|
169
188
|
(0, typeorm_1.Column)({
|
|
170
189
|
type: 'enum',
|
|
171
|
-
enum:
|
|
172
|
-
default:
|
|
190
|
+
enum: shared_2.Language,
|
|
191
|
+
default: shared_2.Language.En,
|
|
173
192
|
nullable: true
|
|
174
193
|
}),
|
|
175
194
|
__metadata("design:type", String)
|
|
@@ -182,13 +201,20 @@ __decorate([
|
|
|
182
201
|
(0, typeorm_1.Column)({ default: 50 }),
|
|
183
202
|
__metadata("design:type", Number)
|
|
184
203
|
], AgentEntity.prototype, "percentage", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
(0, typeorm_1.Column)({
|
|
206
|
+
nullable: true,
|
|
207
|
+
default: 50
|
|
208
|
+
}),
|
|
209
|
+
__metadata("design:type", Number)
|
|
210
|
+
], AgentEntity.prototype, "companyGift", void 0);
|
|
185
211
|
__decorate([
|
|
186
212
|
(0, typeorm_1.Column)({
|
|
187
213
|
type: 'simple-json',
|
|
188
214
|
nullable: true,
|
|
189
215
|
default: null
|
|
190
216
|
}),
|
|
191
|
-
__metadata("design:type",
|
|
217
|
+
__metadata("design:type", shared_1.BankAccount)
|
|
192
218
|
], AgentEntity.prototype, "bankAccount", void 0);
|
|
193
219
|
__decorate([
|
|
194
220
|
(0, typeorm_1.Column)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/agent.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"agent.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/agent.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,4CAAkD;AAClD,4CAAkE;AAClE,4CAA+G;AAC/G,qCAA+D;AAE/D,8DAA0D;AAC1D,wDAAoD;AACpD,iEAAyD;AACzD,qDAAwD;AACxD,iDAAkD;AAClD,mDAAoD;AACpD,yDAA0D;AAE1D;;;;;;;GAOG;AAEI,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,2BAAsB;IA4GtD;;;OAGG;IACH,YAAY,KAA4B;QACvC,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,IAAY;QAClC,OAAO,aAAW,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACZ,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC;QAC7B,OAAO,IAAI,cAAK,CAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,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