@driveup/schema 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/catalog/addon/addon.entity.d.ts +2 -2
- package/lib/catalog/addon/addon.entity.js +17 -21
- package/lib/catalog/addon/addon.entity.js.map +1 -1
- package/lib/catalog/addon/country.entity.d.ts +4 -3
- package/lib/catalog/addon/country.entity.js +7 -10
- package/lib/catalog/addon/country.entity.js.map +1 -1
- package/lib/catalog/priceplan/priceplan.entity.d.ts +2 -3
- package/lib/catalog/priceplan/priceplan.entity.js +8 -11
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/country.entity.d.ts +10 -4
- package/lib/catalog/product/country.entity.js +37 -32
- package/lib/catalog/product/country.entity.js.map +1 -1
- package/lib/catalog/product/priceplan.entity.d.ts +4 -3
- package/lib/catalog/product/priceplan.entity.js +7 -11
- package/lib/catalog/product/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/product.entity.d.ts +6 -6
- package/lib/catalog/product/product.entity.js +33 -34
- package/lib/catalog/product/product.entity.js.map +1 -1
- package/lib/catalog/program/program.entity.d.ts +2 -2
- package/lib/catalog/program/program.entity.js +16 -20
- package/lib/catalog/program/program.entity.js.map +1 -1
- package/lib/catalog/seed/assets/asset.entity.d.ts +6 -7
- package/lib/catalog/seed/assets/asset.entity.js +24 -23
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
- package/lib/catalog/seed/courses/course.entity.d.ts +4 -3
- package/lib/catalog/seed/courses/course.entity.js +7 -8
- package/lib/catalog/seed/courses/course.entity.js.map +1 -1
- package/lib/catalog/seed/courses/lesson.entity.d.ts +2 -2
- package/lib/catalog/seed/courses/lesson.entity.js +8 -10
- package/lib/catalog/seed/courses/lesson.entity.js.map +1 -1
- package/lib/catalog/seed/courses/topic.entity.d.ts +2 -2
- package/lib/catalog/seed/courses/topic.entity.js +8 -10
- package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
- package/lib/catalog/seed/expense/category.entity.d.ts +2 -1
- package/lib/catalog/seed/expense/category.entity.js +6 -7
- package/lib/catalog/seed/expense/category.entity.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/profile/agent/agent.entity.d.ts +6 -12
- package/lib/profile/agent/agent.entity.js +23 -34
- package/lib/profile/agent/agent.entity.js.map +1 -1
- package/lib/profile/agent/asset.entity.d.ts +57 -0
- package/lib/profile/agent/asset.entity.js +95 -0
- package/lib/profile/agent/asset.entity.js.map +1 -0
- package/lib/profile/agent/payout.entity.d.ts +2 -2
- package/lib/profile/agent/payout.entity.js +7 -9
- package/lib/profile/agent/payout.entity.js.map +1 -1
- package/lib/profile/agent/promotion.entity.js +3 -4
- package/lib/profile/agent/promotion.entity.js.map +1 -1
- package/lib/profile/company/company.entity.d.ts +8 -6
- package/lib/profile/company/company.entity.js +38 -33
- package/lib/profile/company/company.entity.js.map +1 -1
- package/lib/profile/company/course/appointment.entity.d.ts +11 -6
- package/lib/profile/company/course/appointment.entity.js +42 -28
- package/lib/profile/company/course/appointment.entity.js.map +1 -1
- package/lib/profile/company/course/course.entity.d.ts +22 -4
- package/lib/profile/company/course/course.entity.js +55 -17
- package/lib/profile/company/course/course.entity.js.map +1 -1
- package/lib/profile/company/course/lesson.entity.d.ts +13 -3
- package/lib/profile/company/course/lesson.entity.js +42 -10
- package/lib/profile/company/course/lesson.entity.js.map +1 -1
- package/lib/profile/company/course/topic.entity.d.ts +7 -0
- package/lib/profile/company/course/topic.entity.js +36 -6
- package/lib/profile/company/course/topic.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/bill.entity.d.ts +2 -1
- package/lib/profile/company/finances/billing/bill.entity.js +5 -6
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/item.entity.d.ts +2 -2
- package/lib/profile/company/finances/billing/item.entity.js +4 -5
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +2 -1
- package/lib/profile/company/finances/billing/transaction.entity.js +10 -9
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/category.entity.js +3 -4
- package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/expense.entity.d.ts +2 -1
- package/lib/profile/company/finances/expense/expense.entity.js +9 -12
- package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
- package/lib/profile/company/finances/handover/handover.entity.js +5 -5
- package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/invoice.entity.d.ts +2 -2
- package/lib/profile/company/finances/invoice/invoice.entity.js +21 -26
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/item.entity.d.ts +2 -1
- package/lib/profile/company/finances/invoice/item.entity.js +5 -6
- package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
- package/lib/profile/company/finances/payment/method.entity.js +5 -6
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
- package/lib/profile/company/instructor/activity.entity.d.ts +33 -0
- package/lib/profile/company/instructor/activity.entity.js +53 -0
- package/lib/profile/company/instructor/activity.entity.js.map +1 -0
- package/lib/profile/company/instructor/calendar-state.entity.d.ts +67 -0
- package/lib/profile/company/instructor/calendar-state.entity.js +75 -0
- package/lib/profile/company/instructor/calendar-state.entity.js.map +1 -0
- package/lib/profile/company/instructor/instructor.entity.d.ts +23 -16
- package/lib/profile/company/instructor/instructor.entity.js +69 -46
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/company/instructor/task.entity.js +3 -4
- package/lib/profile/company/instructor/task.entity.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.d.ts +2 -1
- package/lib/profile/company/medical/examination.entity.js +3 -4
- package/lib/profile/company/medical/examination.entity.js.map +1 -1
- package/lib/profile/company/medical/product.entity.d.ts +3 -2
- package/lib/profile/company/medical/product.entity.js +6 -7
- package/lib/profile/company/medical/product.entity.js.map +1 -1
- package/lib/profile/company/product/addon.entity.d.ts +7 -8
- package/lib/profile/company/product/addon.entity.js +42 -38
- package/lib/profile/company/product/addon.entity.js.map +1 -1
- package/lib/profile/company/product/priceplan.entity.d.ts +7 -2
- package/lib/profile/company/product/priceplan.entity.js +10 -5
- package/lib/profile/company/product/priceplan.entity.js.map +1 -1
- package/lib/profile/company/product/product.entity.d.ts +19 -6
- package/lib/profile/company/product/product.entity.js +42 -19
- package/lib/profile/company/product/product.entity.js.map +1 -1
- package/lib/profile/company/product/vehicle.entity.d.ts +2 -1
- package/lib/profile/company/product/vehicle.entity.js +5 -6
- package/lib/profile/company/product/vehicle.entity.js.map +1 -1
- package/lib/profile/instructor/instructor.entity.d.ts +4 -12
- package/lib/profile/instructor/instructor.entity.js +15 -31
- package/lib/profile/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/student/program/licence/licence.entity.d.ts +2 -1
- package/lib/profile/student/program/licence/licence.entity.js +7 -8
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
- package/lib/profile/student/program/medical/certificate.entity.d.ts +2 -1
- package/lib/profile/student/program/medical/certificate.entity.js +9 -10
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
- package/lib/profile/student/program/medical/examination.entity.d.ts +2 -2
- package/lib/profile/student/program/medical/examination.entity.js +14 -16
- package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
- package/lib/profile/student/program/program.entity.d.ts +2 -1
- package/lib/profile/student/program/program.entity.js +7 -8
- package/lib/profile/student/program/program.entity.js.map +1 -1
- package/lib/profile/student/program/training/appointment.entity.d.ts +6 -8
- package/lib/profile/student/program/training/appointment.entity.js +12 -13
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
- package/lib/profile/student/program/training/exam.entity.d.ts +1 -2
- package/lib/profile/student/program/training/exam.entity.js +10 -12
- package/lib/profile/student/program/training/exam.entity.js.map +1 -1
- package/lib/profile/student/program/training/lesson.entity.js +3 -4
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
- package/lib/profile/student/program/training/request.entity.d.ts +2 -1
- package/lib/profile/student/program/training/request.entity.js +11 -14
- package/lib/profile/student/program/training/request.entity.js.map +1 -1
- package/lib/profile/student/program/training/topic.entity.js +6 -8
- package/lib/profile/student/program/training/topic.entity.js.map +1 -1
- package/lib/profile/student/program/training/training.entity.d.ts +3 -4
- package/lib/profile/student/program/training/training.entity.js +26 -31
- package/lib/profile/student/program/training/training.entity.js.map +1 -1
- package/lib/profile/student/program/training/transaction.entity.d.ts +2 -2
- package/lib/profile/student/program/training/transaction.entity.js +12 -14
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +4 -11
- package/lib/profile/student/student.entity.js +15 -30
- package/lib/profile/student/student.entity.js.map +1 -1
- package/lib/system/campaign/campaign.entity.d.ts +2 -2
- package/lib/system/campaign/campaign.entity.js +7 -9
- package/lib/system/campaign/campaign.entity.js.map +1 -1
- package/lib/system/campaign/gifcode.entity.d.ts +3 -2
- package/lib/system/campaign/gifcode.entity.js +7 -8
- package/lib/system/campaign/gifcode.entity.js.map +1 -1
- package/lib/system/country/country.entity.d.ts +4 -3
- package/lib/system/country/country.entity.js +8 -11
- package/lib/system/country/country.entity.js.map +1 -1
- package/lib/system/currency/currency.entity.js +3 -4
- package/lib/system/currency/currency.entity.js.map +1 -1
- package/lib/system/driving/category.entity.d.ts +2 -2
- package/lib/system/driving/category.entity.js +10 -14
- package/lib/system/driving/category.entity.js.map +1 -1
- package/lib/system/driving/vehicle.entity.d.ts +2 -1
- package/lib/system/driving/vehicle.entity.js +5 -6
- package/lib/system/driving/vehicle.entity.js.map +1 -1
- package/lib/system/event/event.entity.d.ts +2 -1
- package/lib/system/event/event.entity.js +10 -10
- package/lib/system/event/event.entity.js.map +1 -1
- package/lib/system/event/log.entity.d.ts +13 -12
- package/lib/system/event/log.entity.js +22 -21
- package/lib/system/event/log.entity.js.map +1 -1
- package/lib/system/policy/policy.entity.d.ts +2 -2
- package/lib/system/policy/policy.entity.js +14 -18
- package/lib/system/policy/policy.entity.js.map +1 -1
- package/lib/system/staff/staff.entity.d.ts +2 -1
- package/lib/system/staff/staff.entity.js +9 -10
- package/lib/system/staff/staff.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/alert.entity.d.ts +13 -2
- package/lib/user/alert.entity.js +29 -11
- package/lib/user/alert.entity.js.map +1 -1
- package/lib/user/blocked.entity.js +2 -5
- package/lib/user/blocked.entity.js.map +1 -1
- package/lib/user/device.entity.js +3 -4
- package/lib/user/device.entity.js.map +1 -1
- package/lib/user/notification.entity.d.ts +2 -2
- package/lib/user/notification.entity.js +11 -13
- package/lib/user/notification.entity.js.map +1 -1
- package/lib/user/ticket.entity.d.ts +2 -2
- package/lib/user/ticket.entity.js +16 -20
- package/lib/user/ticket.entity.js.map +1 -1
- package/lib/user/user.entity.d.ts +16 -6
- package/lib/user/user.entity.js +94 -50
- package/lib/user/user.entity.js.map +1 -1
- package/lib/user/verification.entity.js +3 -5
- package/lib/user/verification.entity.js.map +1 -1
- package/lib/utils/activity.helper.d.ts +3 -2
- package/lib/utils/activity.helper.js +9 -9
- package/lib/utils/activity.helper.js.map +1 -1
- package/lib/utils/trackable.d.ts +2 -1
- package/lib/utils/trackable.js +4 -3
- package/lib/utils/trackable.js.map +1 -1
- package/package.json +6 -5
|
@@ -13,8 +13,8 @@ exports.SeedCourseLessonEntity = void 0;
|
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const typeorm_2 = require("typeorm");
|
|
15
15
|
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
16
|
+
const shared_1 = require("@driveup/shared");
|
|
16
17
|
const common_1 = require("@driveup/common");
|
|
17
|
-
const common_2 = require("@driveup/common");
|
|
18
18
|
const staff_entity_1 = require("../../../system/staff/staff.entity");
|
|
19
19
|
const course_entity_1 = require("./course.entity");
|
|
20
20
|
const topic_entity_1 = require("./topic.entity");
|
|
@@ -44,11 +44,11 @@ let SeedCourseLessonEntity = class SeedCourseLessonEntity extends trackable_1.Tr
|
|
|
44
44
|
*/
|
|
45
45
|
toModel(lang) {
|
|
46
46
|
const translation = this.getTranslation(lang);
|
|
47
|
-
return new
|
|
47
|
+
return new common_1.Lesson({
|
|
48
48
|
id: this.id,
|
|
49
49
|
title: translation?.title,
|
|
50
50
|
description: translation?.description,
|
|
51
|
-
imageUrl: translation?.
|
|
51
|
+
imageUrl: translation?.url || this.imageUrl,
|
|
52
52
|
number: this.number,
|
|
53
53
|
duration: this.duration,
|
|
54
54
|
sort: this.sort
|
|
@@ -74,7 +74,7 @@ let SeedCourseLessonEntity = class SeedCourseLessonEntity extends trackable_1.Tr
|
|
|
74
74
|
title: translation?.title,
|
|
75
75
|
description: translation?.description,
|
|
76
76
|
content: translation?.content,
|
|
77
|
-
|
|
77
|
+
url: translation?.url,
|
|
78
78
|
link: translation?.link,
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -87,7 +87,7 @@ let SeedCourseLessonEntity = class SeedCourseLessonEntity extends trackable_1.Tr
|
|
|
87
87
|
title: t.title,
|
|
88
88
|
description: t.description,
|
|
89
89
|
content: t.content,
|
|
90
|
-
|
|
90
|
+
url: t.url,
|
|
91
91
|
link: t.link,
|
|
92
92
|
language: t.language
|
|
93
93
|
}));
|
|
@@ -99,7 +99,7 @@ let SeedCourseLessonEntity = class SeedCourseLessonEntity extends trackable_1.Tr
|
|
|
99
99
|
*/
|
|
100
100
|
getGallery(lang) {
|
|
101
101
|
const galleryImages = lang ? this.gallery?.filter(i => i.language === lang) : this.gallery;
|
|
102
|
-
return galleryImages?.map(m =>
|
|
102
|
+
return galleryImages?.map(m => common_1.Picture.toInstance(m));
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Retrieves activity history for this lesson
|
|
@@ -107,10 +107,8 @@ let SeedCourseLessonEntity = class SeedCourseLessonEntity extends trackable_1.Tr
|
|
|
107
107
|
*/
|
|
108
108
|
async getActivities() {
|
|
109
109
|
const activities = [];
|
|
110
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
111
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
112
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy, staff_entity_1.StaffEntity));
|
|
113
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
110
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created, staff_entity_1.StaffEntity));
|
|
111
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated, staff_entity_1.StaffEntity));
|
|
114
112
|
return activities.filter(a => a);
|
|
115
113
|
}
|
|
116
114
|
};
|
|
@@ -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;AAC/C,6CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"lesson.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/courses/lesson.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,qCAA+C;AAC/C,6CAA0C;AAC1C,4CAAyD;AACzD,4CAAsE;AACtE,qEAAiE;AACjE,mDAAmD;AACnD,iDAAuD;AACvD,wDAA2D;AAC3D,oEAA4D;AAE5D;;;;;;;GAOG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,2BAAuB;IA6ElE;;;OAGG;IACH,YAAY,KAAuC;QAClD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IA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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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Language } from '@driveup/shared';
|
|
2
|
+
import { Activity, Content, Skill, Topic } from '@driveup/common';
|
|
3
3
|
import { SeedCourseLessonEntity } from './lesson.entity';
|
|
4
4
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
5
5
|
/**
|
|
@@ -13,8 +13,8 @@ exports.SeedCourseTopicEntity = void 0;
|
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const typeorm_2 = require("typeorm");
|
|
15
15
|
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
16
|
+
const shared_1 = require("@driveup/shared");
|
|
16
17
|
const common_1 = require("@driveup/common");
|
|
17
|
-
const common_2 = require("@driveup/common");
|
|
18
18
|
const lesson_entity_1 = require("./lesson.entity");
|
|
19
19
|
const staff_entity_1 = require("../../../system/staff/staff.entity");
|
|
20
20
|
const trackable_1 = require("../../../utils/trackable");
|
|
@@ -42,11 +42,11 @@ let SeedCourseTopicEntity = class SeedCourseTopicEntity extends trackable_1.Trac
|
|
|
42
42
|
*/
|
|
43
43
|
toModel(lang) {
|
|
44
44
|
const translation = this.getTranslation(lang);
|
|
45
|
-
return new
|
|
45
|
+
return new common_1.Topic({
|
|
46
46
|
id: this.id,
|
|
47
47
|
title: translation?.title,
|
|
48
48
|
description: translation?.description,
|
|
49
|
-
imageUrl: translation?.
|
|
49
|
+
imageUrl: translation?.url || this.imageUrl,
|
|
50
50
|
sort: this.sort
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -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 common_1.Skill({
|
|
69
69
|
id: s.id,
|
|
70
70
|
title: s.title,
|
|
71
71
|
sort: s.sort
|
|
@@ -83,7 +83,7 @@ let SeedCourseTopicEntity = class SeedCourseTopicEntity extends trackable_1.Trac
|
|
|
83
83
|
title: translation?.title,
|
|
84
84
|
description: translation?.description,
|
|
85
85
|
content: translation?.content,
|
|
86
|
-
|
|
86
|
+
url: translation?.url,
|
|
87
87
|
link: translation?.link,
|
|
88
88
|
});
|
|
89
89
|
}
|
|
@@ -96,7 +96,7 @@ let SeedCourseTopicEntity = class SeedCourseTopicEntity extends trackable_1.Trac
|
|
|
96
96
|
title: t.title,
|
|
97
97
|
description: t.description,
|
|
98
98
|
content: t.content,
|
|
99
|
-
|
|
99
|
+
url: t.url,
|
|
100
100
|
link: t.link,
|
|
101
101
|
language: t.language
|
|
102
102
|
}));
|
|
@@ -107,10 +107,8 @@ let SeedCourseTopicEntity = class SeedCourseTopicEntity extends trackable_1.Trac
|
|
|
107
107
|
*/
|
|
108
108
|
async getActivities() {
|
|
109
109
|
const activities = [];
|
|
110
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
111
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
112
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy, staff_entity_1.StaffEntity));
|
|
113
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
110
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created, staff_entity_1.StaffEntity));
|
|
111
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated, staff_entity_1.StaffEntity));
|
|
114
112
|
return activities.filter(a => a);
|
|
115
113
|
}
|
|
116
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/courses/topic.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,qCAAoC;AACpC,6CAA0C;AAC1C,4CAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"topic.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/courses/topic.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,qCAAoC;AACpC,6CAA0C;AAC1C,4CAAyD;AACzD,4CAAkE;AAClE,mDAAyD;AACzD,qEAAiE;AACjE,wDAA2D;AAC3D,oEAA4D;AAE5D;;;;;;GAMG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,2BAAsB;IAsDhE;;;OAGG;IACH,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a;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;2DACsB;AASxB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;uDACe;AAWjB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;qDACc;AAUhB;IALC,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,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Language } from '@driveup/shared';
|
|
2
|
+
import { Activity, Category, Content } from '@driveup/common';
|
|
2
3
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
3
4
|
/**
|
|
4
5
|
* Represents a seed expense category template in the system.
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.SeedExpenseCategoryEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
15
|
+
const shared_1 = require("@driveup/shared");
|
|
15
16
|
const common_1 = require("@driveup/common");
|
|
16
17
|
const staff_entity_1 = require("../../../system/staff/staff.entity");
|
|
17
18
|
const trackable_1 = require("../../../utils/trackable");
|
|
@@ -45,7 +46,7 @@ let SeedExpenseCategoryEntity = class SeedExpenseCategoryEntity extends trackabl
|
|
|
45
46
|
name: this.name,
|
|
46
47
|
title: transaltion?.title,
|
|
47
48
|
description: transaltion?.description,
|
|
48
|
-
imageUrl: transaltion?.
|
|
49
|
+
imageUrl: transaltion?.url || this.imageUrl,
|
|
49
50
|
sort: this.sort
|
|
50
51
|
});
|
|
51
52
|
}
|
|
@@ -69,7 +70,7 @@ let SeedExpenseCategoryEntity = class SeedExpenseCategoryEntity extends trackabl
|
|
|
69
70
|
title: translation?.title,
|
|
70
71
|
description: translation?.description,
|
|
71
72
|
content: translation?.content,
|
|
72
|
-
|
|
73
|
+
url: translation?.url,
|
|
73
74
|
link: translation?.link,
|
|
74
75
|
});
|
|
75
76
|
}
|
|
@@ -82,7 +83,7 @@ let SeedExpenseCategoryEntity = class SeedExpenseCategoryEntity extends trackabl
|
|
|
82
83
|
title: t.title,
|
|
83
84
|
description: t.description,
|
|
84
85
|
content: t.content,
|
|
85
|
-
|
|
86
|
+
url: t.url,
|
|
86
87
|
link: t.link,
|
|
87
88
|
language: t.language
|
|
88
89
|
}));
|
|
@@ -93,10 +94,8 @@ let SeedExpenseCategoryEntity = class SeedExpenseCategoryEntity extends trackabl
|
|
|
93
94
|
*/
|
|
94
95
|
async getActivities() {
|
|
95
96
|
const activities = [];
|
|
96
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
97
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
98
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy, staff_entity_1.StaffEntity));
|
|
99
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
97
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created, staff_entity_1.StaffEntity));
|
|
98
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated, staff_entity_1.StaffEntity));
|
|
100
99
|
return activities.filter(a => a);
|
|
101
100
|
}
|
|
102
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/expense/category.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,6CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"category.entity.js","sourceRoot":"","sources":["../../../../src/catalog/seed/expense/category.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,6CAA0C;AAC1C,4CAAyD;AACzD,4CAA8D;AAC9D,qEAAiE;AACjE,wDAA2D;AAC3D,oEAA4D;AAE5D;;;;;;;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,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,WAAW,EAAE,KAAK;YACzB,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,IAAI,CAAC,QAAQ;YAC3C,IAAI,EAAE,IAAI,CAAC,IAAI;SACf,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,IAAe;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,IAAe;QAC7B,MAAM,QAAQ,GAAG,IAAI,IAAI,yBAAW,CAAC,OAAO,EAAE,EAAE,IAAgB,CAAC;QACjE,MAAM,WAAW,GAAG,IAA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AM,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
|
@@ -11,6 +11,7 @@ export * from './catalog/seed/courses/lesson.entity';
|
|
|
11
11
|
export * from './catalog/seed/courses/topic.entity';
|
|
12
12
|
export * from './catalog/seed/expense/category.entity';
|
|
13
13
|
export * from './profile/agent/agent.entity';
|
|
14
|
+
export * from './profile/agent/asset.entity';
|
|
14
15
|
export * from './profile/agent/payout.entity';
|
|
15
16
|
export * from './profile/agent/promotion.entity';
|
|
16
17
|
export * from './profile/company/course/appointment.entity';
|
|
@@ -26,6 +27,8 @@ export * from './profile/company/finances/handover/handover.entity';
|
|
|
26
27
|
export * from './profile/company/finances/invoice/invoice.entity';
|
|
27
28
|
export * from './profile/company/finances/invoice/item.entity';
|
|
28
29
|
export * from './profile/company/finances/payment/method.entity';
|
|
30
|
+
export * from './profile/company/instructor/activity.entity';
|
|
31
|
+
export * from './profile/company/instructor/calendar-state.entity';
|
|
29
32
|
export * from './profile/company/instructor/instructor.entity';
|
|
30
33
|
export * from './profile/company/instructor/task.entity';
|
|
31
34
|
export * from './profile/company/medical/examination.entity';
|
package/lib/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __exportStar(require("./catalog/seed/courses/topic.entity"), exports);
|
|
|
29
29
|
__exportStar(require("./catalog/seed/expense/category.entity"), exports);
|
|
30
30
|
// profile: agent
|
|
31
31
|
__exportStar(require("./profile/agent/agent.entity"), exports);
|
|
32
|
+
__exportStar(require("./profile/agent/asset.entity"), exports);
|
|
32
33
|
__exportStar(require("./profile/agent/payout.entity"), exports);
|
|
33
34
|
__exportStar(require("./profile/agent/promotion.entity"), exports);
|
|
34
35
|
// profile: company
|
|
@@ -45,6 +46,8 @@ __exportStar(require("./profile/company/finances/handover/handover.entity"), exp
|
|
|
45
46
|
__exportStar(require("./profile/company/finances/invoice/invoice.entity"), exports);
|
|
46
47
|
__exportStar(require("./profile/company/finances/invoice/item.entity"), exports);
|
|
47
48
|
__exportStar(require("./profile/company/finances/payment/method.entity"), exports);
|
|
49
|
+
__exportStar(require("./profile/company/instructor/activity.entity"), exports);
|
|
50
|
+
__exportStar(require("./profile/company/instructor/calendar-state.entity"), exports);
|
|
48
51
|
__exportStar(require("./profile/company/instructor/instructor.entity"), exports);
|
|
49
52
|
__exportStar(require("./profile/company/instructor/task.entity"), exports);
|
|
50
53
|
__exportStar(require("./profile/company/medical/examination.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,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,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
|
+
{"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,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,+EAA6D;AAC7D,qFAAmE;AACnE,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,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,9 +1,10 @@
|
|
|
1
|
-
import { AccountStatus, Language
|
|
2
|
-
import { BankAccount, Preference } from '@driveup/common';
|
|
1
|
+
import { AccountStatus, Language } from '@driveup/shared';
|
|
2
|
+
import { Activity, Agent, Person, BankAccount, Preference } from '@driveup/common';
|
|
3
3
|
import { UserEntity } from '../../user/user.entity';
|
|
4
4
|
import { AgentPayoutEntity } from './payout.entity';
|
|
5
5
|
import { AgentPromotionEntity } from './promotion.entity';
|
|
6
6
|
import { TrackableEntity } from '../../utils/trackable';
|
|
7
|
+
import { AgentAssetEntity } from './asset.entity';
|
|
7
8
|
/**
|
|
8
9
|
* Represents an agent profile in the system.
|
|
9
10
|
* Agents are users who promote Driveup services and earn commissions
|
|
@@ -62,6 +63,7 @@ export declare class AgentEntity extends TrackableEntity<Agent> {
|
|
|
62
63
|
* Promotion payouts
|
|
63
64
|
*/
|
|
64
65
|
payouts: Promise<AgentPayoutEntity[]>;
|
|
66
|
+
assets: Promise<AgentAssetEntity[]>;
|
|
65
67
|
/**
|
|
66
68
|
* Creates an instance of AgentEntity
|
|
67
69
|
* @param props - Partial properties to initialize the entity
|
|
@@ -93,12 +95,6 @@ export declare class AgentEntity extends TrackableEntity<Agent> {
|
|
|
93
95
|
* @returns Array of Preference objects or undefined if not set
|
|
94
96
|
*/
|
|
95
97
|
getPreferences(): Preference<boolean>[];
|
|
96
|
-
/**
|
|
97
|
-
* Checks if notifications are enabled for a specific event
|
|
98
|
-
* @param event Event name to check
|
|
99
|
-
* @returns True if notifications are enabled, false otherwise
|
|
100
|
-
*/
|
|
101
|
-
isNotificationEnabled(event: string): boolean;
|
|
102
98
|
/**
|
|
103
99
|
* Retrieves activity history for this agent
|
|
104
100
|
* @returns Promise resolving to array of Activity instances tracking creation and updates
|
|
@@ -108,15 +104,13 @@ export declare class AgentEntity extends TrackableEntity<Agent> {
|
|
|
108
104
|
* Log agent event
|
|
109
105
|
* @param event Event type
|
|
110
106
|
* @param metadata Content render data (in agent language)
|
|
111
|
-
* @param entityId Optional related entity ID
|
|
112
107
|
*/
|
|
113
|
-
log(event: string, metadata?: any
|
|
108
|
+
log(event: string, metadata?: any): Promise<void>;
|
|
114
109
|
/**
|
|
115
110
|
* Log agent from author perspective
|
|
116
111
|
* Author logs are used to capture actions taken by the agent themselves
|
|
117
112
|
* @param event Event type
|
|
118
113
|
* @param metadata Content render data (in student language)
|
|
119
|
-
* @param entityId Optional related entity ID
|
|
120
114
|
*/
|
|
121
|
-
logAsAuthor(event: string, metadata?: any
|
|
115
|
+
logAsAuthor(event: string, metadata?: any): Promise<void>;
|
|
122
116
|
}
|
|
@@ -12,14 +12,15 @@ var AgentEntity_1;
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.AgentEntity = void 0;
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
|
+
const shared_1 = require("@driveup/shared");
|
|
15
16
|
const common_1 = require("@driveup/common");
|
|
16
|
-
const common_2 = require("@driveup/common");
|
|
17
17
|
const user_entity_1 = require("../../user/user.entity");
|
|
18
18
|
const log_entity_1 = require("../../system/event/log.entity");
|
|
19
19
|
const payout_entity_1 = require("./payout.entity");
|
|
20
20
|
const promotion_entity_1 = require("./promotion.entity");
|
|
21
21
|
const trackable_1 = require("../../utils/trackable");
|
|
22
22
|
const activity_helper_1 = require("../../utils/activity.helper");
|
|
23
|
+
const asset_entity_1 = require("./asset.entity");
|
|
23
24
|
/**
|
|
24
25
|
* Represents an agent profile in the system.
|
|
25
26
|
* Agents are users who promote Driveup services and earn commissions
|
|
@@ -59,7 +60,7 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
59
60
|
code: this.code,
|
|
60
61
|
percentage: this.percentage,
|
|
61
62
|
status: this.status,
|
|
62
|
-
bankAccount:
|
|
63
|
+
bankAccount: common_1.BankAccount.toInstance(this.bankAccount)
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
@@ -97,19 +98,7 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
97
98
|
getPreferences() {
|
|
98
99
|
if (!this.preferences)
|
|
99
100
|
return;
|
|
100
|
-
return this.preferences.map(
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Checks if notifications are enabled for a specific event
|
|
104
|
-
* @param event Event name to check
|
|
105
|
-
* @returns True if notifications are enabled, false otherwise
|
|
106
|
-
*/
|
|
107
|
-
isNotificationEnabled(event) {
|
|
108
|
-
const preferences = this.getPreferences();
|
|
109
|
-
if (!preferences)
|
|
110
|
-
return true;
|
|
111
|
-
const eventPref = preferences.find(p => p.name === event && p.scope === common_1.PreferenceScope.Notification);
|
|
112
|
-
return eventPref.value === true;
|
|
101
|
+
return this.preferences.map(common_1.Preference.toInstance);
|
|
113
102
|
}
|
|
114
103
|
/**
|
|
115
104
|
* Retrieves activity history for this agent
|
|
@@ -117,26 +106,23 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
117
106
|
*/
|
|
118
107
|
async getActivities() {
|
|
119
108
|
const activities = [];
|
|
120
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
121
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
122
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy));
|
|
123
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
109
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created));
|
|
110
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated));
|
|
124
111
|
return activities.filter(a => a);
|
|
125
112
|
}
|
|
126
113
|
/**
|
|
127
114
|
* Log agent event
|
|
128
115
|
* @param event Event type
|
|
129
116
|
* @param metadata Content render data (in agent language)
|
|
130
|
-
* @param entityId Optional related entity ID
|
|
131
117
|
*/
|
|
132
|
-
async log(event, metadata
|
|
118
|
+
async log(event, metadata) {
|
|
133
119
|
if (!this.id)
|
|
134
120
|
return;
|
|
135
121
|
await log_entity_1.LogEntity.from({
|
|
136
|
-
type:
|
|
122
|
+
type: shared_1.LogType.Agent,
|
|
123
|
+
profile: shared_1.ProfileType.Agent,
|
|
137
124
|
event: event,
|
|
138
|
-
entityId:
|
|
139
|
-
profile: { type: common_1.ProfileType.Agent, id: this.id },
|
|
125
|
+
entityId: this.id,
|
|
140
126
|
content: log_entity_1.LogEntity.toAgentContent(event, this.language, metadata)
|
|
141
127
|
});
|
|
142
128
|
}
|
|
@@ -145,16 +131,15 @@ let AgentEntity = AgentEntity_1 = class AgentEntity extends trackable_1.Trackabl
|
|
|
145
131
|
* Author logs are used to capture actions taken by the agent themselves
|
|
146
132
|
* @param event Event type
|
|
147
133
|
* @param metadata Content render data (in student language)
|
|
148
|
-
* @param entityId Optional related entity ID
|
|
149
134
|
*/
|
|
150
|
-
async logAsAuthor(event, metadata
|
|
135
|
+
async logAsAuthor(event, metadata) {
|
|
151
136
|
if (!this.id)
|
|
152
137
|
return;
|
|
153
138
|
await log_entity_1.LogEntity.from({
|
|
154
|
-
type:
|
|
139
|
+
type: shared_1.LogType.Agent,
|
|
140
|
+
profile: shared_1.ProfileType.Agent,
|
|
155
141
|
event: event,
|
|
156
|
-
entityId:
|
|
157
|
-
profile: { type: common_1.ProfileType.Agent, id: this.id },
|
|
142
|
+
entityId: this.id,
|
|
158
143
|
content: log_entity_1.LogEntity.toAuthorContent(event, this.language, metadata)
|
|
159
144
|
});
|
|
160
145
|
}
|
|
@@ -167,8 +152,8 @@ __decorate([
|
|
|
167
152
|
__decorate([
|
|
168
153
|
(0, typeorm_1.Column)({
|
|
169
154
|
type: 'enum',
|
|
170
|
-
enum:
|
|
171
|
-
default:
|
|
155
|
+
enum: shared_1.AccountStatus,
|
|
156
|
+
default: shared_1.AccountStatus.Pending,
|
|
172
157
|
nullable: false
|
|
173
158
|
}),
|
|
174
159
|
__metadata("design:type", String)
|
|
@@ -183,8 +168,8 @@ __decorate([
|
|
|
183
168
|
__decorate([
|
|
184
169
|
(0, typeorm_1.Column)({
|
|
185
170
|
type: 'enum',
|
|
186
|
-
enum:
|
|
187
|
-
default:
|
|
171
|
+
enum: shared_1.Language,
|
|
172
|
+
default: shared_1.Language.En,
|
|
188
173
|
nullable: true
|
|
189
174
|
}),
|
|
190
175
|
__metadata("design:type", String)
|
|
@@ -203,7 +188,7 @@ __decorate([
|
|
|
203
188
|
nullable: true,
|
|
204
189
|
default: null
|
|
205
190
|
}),
|
|
206
|
-
__metadata("design:type",
|
|
191
|
+
__metadata("design:type", common_1.BankAccount)
|
|
207
192
|
], AgentEntity.prototype, "bankAccount", void 0);
|
|
208
193
|
__decorate([
|
|
209
194
|
(0, typeorm_1.Column)({
|
|
@@ -225,6 +210,10 @@ __decorate([
|
|
|
225
210
|
(0, typeorm_1.OneToMany)(() => payout_entity_1.AgentPayoutEntity, payout => payout.agent),
|
|
226
211
|
__metadata("design:type", Promise)
|
|
227
212
|
], AgentEntity.prototype, "payouts", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
(0, typeorm_1.OneToMany)(() => asset_entity_1.AgentAssetEntity, asset => asset.agent),
|
|
215
|
+
__metadata("design:type", Promise)
|
|
216
|
+
], AgentEntity.prototype, "assets", void 0);
|
|
228
217
|
exports.AgentEntity = AgentEntity = AgentEntity_1 = __decorate([
|
|
229
218
|
(0, typeorm_1.Entity)('agents'),
|
|
230
219
|
__metadata("design:paramtypes", [Object])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/agent.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"agent.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/agent.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAA8F;AAC9F,4CAAmF;AACnF,wDAAoD;AACpD,8DAA0D;AAC1D,mDAAoD;AACpD,yDAA0D;AAC1D,qDAAwD;AACxD,iEAAyD;AACzD,iDAAkD;AAElD;;;;;;;GAOG;AAEI,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,2BAAsB;IAiGtD;;;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,O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C,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC;;yCAC/B;AAMzB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAoB,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC;;+CACxB;AAM5C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,iCAAiB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;;4CACrB;AAGtC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,+BAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;;2CACpB;sBA/FxB,WAAW;IADvB,IAAA,gBAAM,EAAC,QAAQ,CAAC;;GACJ,WAAW,CAuNvB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AssetType } from '@driveup/shared';
|
|
2
|
+
import { Activity, Asset } from '@driveup/common';
|
|
3
|
+
import { TrackableEntity } from '../../utils/trackable';
|
|
4
|
+
import { AgentEntity } from './agent.entity';
|
|
5
|
+
/**
|
|
6
|
+
* Represents an agent profile in the system.
|
|
7
|
+
* Agents are users who promote Driveup services and earn commissions
|
|
8
|
+
* through a unique promotion code. They can receive payouts based on
|
|
9
|
+
* their generated revenue.
|
|
10
|
+
*
|
|
11
|
+
* @extends TrackableEntity<Agent>
|
|
12
|
+
*/
|
|
13
|
+
export declare class AgentAssetEntity extends TrackableEntity<Asset> {
|
|
14
|
+
/**
|
|
15
|
+
* Agent account reference
|
|
16
|
+
*/
|
|
17
|
+
agentId: number;
|
|
18
|
+
/**
|
|
19
|
+
* MIME type of the asset (Image, Video, Document)
|
|
20
|
+
* @default AssetType.Image
|
|
21
|
+
*/
|
|
22
|
+
type: AssetType;
|
|
23
|
+
/**
|
|
24
|
+
* Asset title
|
|
25
|
+
* Used for assets tab in agent profile
|
|
26
|
+
*/
|
|
27
|
+
title: string;
|
|
28
|
+
/**
|
|
29
|
+
* Asset title
|
|
30
|
+
* Used for assets tab in agent profile
|
|
31
|
+
*/
|
|
32
|
+
url: string;
|
|
33
|
+
/**
|
|
34
|
+
* Agent account reference
|
|
35
|
+
*/
|
|
36
|
+
agent: Promise<AgentEntity>;
|
|
37
|
+
/**
|
|
38
|
+
* Creates an instance of AgentEntity
|
|
39
|
+
* @param props - Partial properties to initialize the entity
|
|
40
|
+
*/
|
|
41
|
+
constructor(props?: Partial<AgentAssetEntity>);
|
|
42
|
+
/**
|
|
43
|
+
* Converts the entity to an Agent model instance
|
|
44
|
+
* @returns Agent model with basic information
|
|
45
|
+
*/
|
|
46
|
+
toModel(): Asset;
|
|
47
|
+
/**
|
|
48
|
+
* Converts the entity to an Agent model instance
|
|
49
|
+
* @returns Agent model with basic information
|
|
50
|
+
*/
|
|
51
|
+
toSummary(): Asset;
|
|
52
|
+
/**
|
|
53
|
+
* Retrieves activity history for this agent
|
|
54
|
+
* @returns Promise resolving to array of Activity instances tracking creation and updates
|
|
55
|
+
*/
|
|
56
|
+
getActivities(): Promise<Activity[]>;
|
|
57
|
+
}
|