@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ColorContext, Language, ProductType, AddonType } from '@driveup/shared';
|
|
2
|
+
import { Activity, Content, Addon } from '@driveup/common';
|
|
3
3
|
import { ProductEntity } from '../product/product.entity';
|
|
4
4
|
import { AddonCountryEntity } from './country.entity';
|
|
5
5
|
import { TrackableEntity } from '../../utils/trackable';
|
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.AddonEntity = 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
|
-
const common_2 = require("@driveup/common");
|
|
17
17
|
const staff_entity_1 = require("../../system/staff/staff.entity");
|
|
18
18
|
const product_entity_1 = require("../product/product.entity");
|
|
19
19
|
const country_entity_1 = require("./country.entity");
|
|
@@ -48,7 +48,7 @@ let AddonEntity = class AddonEntity extends trackable_1.TrackableEntity {
|
|
|
48
48
|
color: this.color,
|
|
49
49
|
title: translation.title,
|
|
50
50
|
description: translation.description,
|
|
51
|
-
imageUrl: translation?.
|
|
51
|
+
imageUrl: translation?.url || this.imageUrl,
|
|
52
52
|
active: this.active,
|
|
53
53
|
sort: this.sort,
|
|
54
54
|
});
|
|
@@ -69,11 +69,11 @@ let AddonEntity = class AddonEntity extends trackable_1.TrackableEntity {
|
|
|
69
69
|
getTranslation(lang) {
|
|
70
70
|
const language = lang || nestjs_i18n_1.I18nContext.current()?.lang;
|
|
71
71
|
const translation = this.translations?.find(t => t.language === language);
|
|
72
|
-
return new
|
|
72
|
+
return new common_1.Content({
|
|
73
73
|
title: translation?.title,
|
|
74
74
|
description: translation?.description,
|
|
75
75
|
content: translation?.content,
|
|
76
|
-
|
|
76
|
+
url: translation?.url || this.imageUrl,
|
|
77
77
|
link: translation?.link,
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -82,11 +82,11 @@ let AddonEntity = class AddonEntity extends trackable_1.TrackableEntity {
|
|
|
82
82
|
* @returns Array of Content objects for all languages
|
|
83
83
|
*/
|
|
84
84
|
getTranslations() {
|
|
85
|
-
return this.translations?.map(t => new
|
|
85
|
+
return this.translations?.map(t => new common_1.Content({
|
|
86
86
|
title: t.title,
|
|
87
87
|
description: t.description,
|
|
88
88
|
content: t.content,
|
|
89
|
-
|
|
89
|
+
url: t.url,
|
|
90
90
|
link: t.link,
|
|
91
91
|
language: t.language
|
|
92
92
|
}));
|
|
@@ -99,7 +99,7 @@ let AddonEntity = class AddonEntity extends trackable_1.TrackableEntity {
|
|
|
99
99
|
if (!this.products)
|
|
100
100
|
return [];
|
|
101
101
|
return await Promise.all(this.products?.map(async (type) => {
|
|
102
|
-
return await product_entity_1.ProductEntity.findOneBy({ type });
|
|
102
|
+
return await product_entity_1.ProductEntity.findOneBy({ productType: type });
|
|
103
103
|
}));
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
@@ -109,14 +109,10 @@ let AddonEntity = class AddonEntity extends trackable_1.TrackableEntity {
|
|
|
109
109
|
*/
|
|
110
110
|
async getActivities() {
|
|
111
111
|
const activities = [];
|
|
112
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
113
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
114
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
115
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
116
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.enabledBy, common_1.ActivityType.enabledBy, staff_entity_1.StaffEntity));
|
|
117
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.enabledOn, common_1.ActivityType.enabledOn));
|
|
118
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.disabledBy, common_1.ActivityType.disabledBy, staff_entity_1.StaffEntity));
|
|
119
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.disabledOn, common_1.ActivityType.disabledOn));
|
|
112
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created, staff_entity_1.StaffEntity));
|
|
113
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated, staff_entity_1.StaffEntity));
|
|
114
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.enabledBy, this.enabledOn, shared_1.ActivityType.enabled, staff_entity_1.StaffEntity));
|
|
115
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.disabledBy, this.disabledOn, shared_1.ActivityType.disabled, staff_entity_1.StaffEntity));
|
|
120
116
|
return activities.filter(a => a);
|
|
121
117
|
}
|
|
122
118
|
};
|
|
@@ -125,8 +121,8 @@ __decorate([
|
|
|
125
121
|
(0, typeorm_1.Column)({
|
|
126
122
|
type: 'enum',
|
|
127
123
|
name: 'addonType',
|
|
128
|
-
enum:
|
|
129
|
-
default:
|
|
124
|
+
enum: shared_1.AddonType,
|
|
125
|
+
default: shared_1.AddonType.StudentAppointmentReminder,
|
|
130
126
|
nullable: false
|
|
131
127
|
}),
|
|
132
128
|
__metadata("design:type", String)
|
|
@@ -134,8 +130,8 @@ __decorate([
|
|
|
134
130
|
__decorate([
|
|
135
131
|
(0, typeorm_1.Column)({
|
|
136
132
|
type: 'set',
|
|
137
|
-
enum:
|
|
138
|
-
default: [
|
|
133
|
+
enum: shared_1.ProductType,
|
|
134
|
+
default: [shared_1.ProductType.DrivingCar],
|
|
139
135
|
nullable: false
|
|
140
136
|
}),
|
|
141
137
|
__metadata("design:type", Array)
|
|
@@ -143,8 +139,8 @@ __decorate([
|
|
|
143
139
|
__decorate([
|
|
144
140
|
(0, typeorm_1.Column)({
|
|
145
141
|
type: 'enum',
|
|
146
|
-
enum:
|
|
147
|
-
default:
|
|
142
|
+
enum: shared_1.ColorContext,
|
|
143
|
+
default: shared_1.ColorContext.Primary,
|
|
148
144
|
nullable: false
|
|
149
145
|
}),
|
|
150
146
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addon.entity.js","sourceRoot":"","sources":["../../../src/catalog/addon/addon.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AACpD,6CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"addon.entity.js","sourceRoot":"","sources":["../../../src/catalog/addon/addon.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;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gBAAM,EAAC;QACP,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,IAAI;KACb,CAAC;;2CACc;AAShB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,CAAC;KACV,CAAC;;yCACW;AAMb;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CACxB;AAMlB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC/B,IAAI;8CAAC;AAMhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACvB;AAMnB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC9B,IAAI;+CAAC;AAOjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAkB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;;8CACrB;sBA7G7B,WAAW;IADvB,IAAA,gBAAM,EAAC,cAAc,CAAC;;GACV,WAAW,CA4MvB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Language } from '@driveup/shared';
|
|
2
|
+
import { Activity, Addon, Metadata } from '@driveup/common';
|
|
2
3
|
import { CountryEntity } from '../../system/country/country.entity';
|
|
3
|
-
import {
|
|
4
|
+
import { CompanyAddonEntity } from '../../profile/company/product/addon.entity';
|
|
4
5
|
import { AddonEntity } from './addon.entity';
|
|
5
6
|
import { TrackableEntity } from '../../utils/trackable';
|
|
6
7
|
/**
|
|
@@ -80,7 +81,7 @@ export declare class AddonCountryEntity extends TrackableEntity<Addon> {
|
|
|
80
81
|
* Company addon relation
|
|
81
82
|
* Companies that have this addon assigned
|
|
82
83
|
*/
|
|
83
|
-
|
|
84
|
+
companies: Promise<CompanyAddonEntity[]>;
|
|
84
85
|
/**
|
|
85
86
|
* Creates an instance of AddonCountryEntity
|
|
86
87
|
* @param props - Partial properties to initialize the entity
|
|
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.AddonCountryEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
14
15
|
const common_1 = require("@driveup/common");
|
|
15
16
|
const country_entity_1 = require("../../system/country/country.entity");
|
|
16
17
|
const staff_entity_1 = require("../../system/staff/staff.entity");
|
|
@@ -73,14 +74,10 @@ let AddonCountryEntity = class AddonCountryEntity extends trackable_1.TrackableE
|
|
|
73
74
|
*/
|
|
74
75
|
async getActivities() {
|
|
75
76
|
const activities = [];
|
|
76
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
77
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
78
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
79
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
80
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.enabledBy, common_1.ActivityType.enabledBy, staff_entity_1.StaffEntity));
|
|
81
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.enabledOn, common_1.ActivityType.enabledOn));
|
|
82
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.disabledBy, common_1.ActivityType.disabledBy, staff_entity_1.StaffEntity));
|
|
83
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.disabledOn, common_1.ActivityType.disabledOn));
|
|
77
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created, staff_entity_1.StaffEntity));
|
|
78
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated, staff_entity_1.StaffEntity));
|
|
79
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.enabledBy, this.enabledOn, shared_1.ActivityType.enabled, staff_entity_1.StaffEntity));
|
|
80
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.disabledBy, this.disabledOn, shared_1.ActivityType.disabled, staff_entity_1.StaffEntity));
|
|
84
81
|
return activities.filter(a => a);
|
|
85
82
|
}
|
|
86
83
|
};
|
|
@@ -167,9 +164,9 @@ __decorate([
|
|
|
167
164
|
__metadata("design:type", Promise)
|
|
168
165
|
], AddonCountryEntity.prototype, "country", void 0);
|
|
169
166
|
__decorate([
|
|
170
|
-
(0, typeorm_1.OneToMany)(() => addon_entity_1.
|
|
167
|
+
(0, typeorm_1.OneToMany)(() => addon_entity_1.CompanyAddonEntity, product => product.addon),
|
|
171
168
|
__metadata("design:type", Promise)
|
|
172
|
-
], AddonCountryEntity.prototype, "
|
|
169
|
+
], AddonCountryEntity.prototype, "companies", void 0);
|
|
173
170
|
exports.AddonCountryEntity = AddonCountryEntity = __decorate([
|
|
174
171
|
(0, typeorm_1.Entity)('systemAddonCountries'),
|
|
175
172
|
__metadata("design:paramtypes", [Object])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country.entity.js","sourceRoot":"","sources":["../../../src/catalog/addon/country.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"country.entity.js","sourceRoot":"","sources":["../../../src/catalog/addon/country.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAAyD;AACzD,4CAA4D;AAC5D,wEAAoE;AACpE,kEAA8D;AAC9D,6EAAgF;AAChF,iDAA6C;AAC7C,qDAAwD;AACxD,iEAAyD;AAEzD;;;;;;GAMG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAsB;IAgI7D;;;OAGG;IACH,YAAY,KAAmC;QAC9C,KA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gDACW;AAUb;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;oDACmB;AAMrB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qDACxB;AAMlB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC/B,IAAI;qDAAC;AAMhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;sDACvB;AAMnB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC9B,IAAI;sDAAC;AAMjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAW,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC;;iDAC/B;AAM5B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8BAAa,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;mDAC1B;AAOhC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,iCAAkB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;;qDACrB;6BA9H7B,kBAAkB;IAD9B,IAAA,gBAAM,EAAC,sBAAsB,CAAC;;GAClB,kBAAkB,CAyL9B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Content, Item,
|
|
2
|
-
import {
|
|
3
|
-
import { PricePlan, PricePlanFeature, PricePlanType } from '@driveup/common';
|
|
1
|
+
import { Content, Item, Metadata, PricePlan, Activity } from '@driveup/common';
|
|
2
|
+
import { Language, PricePlanFeature, PricePlanType } from '@driveup/shared';
|
|
4
3
|
import { ProductPricePlanEntity } from '../product/priceplan.entity';
|
|
5
4
|
import { TrackableEntity } from '../../utils/trackable';
|
|
6
5
|
/**
|
|
@@ -13,8 +13,7 @@ exports.PricePlanEntity = void 0;
|
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const nestjs_i18n_1 = require("nestjs-i18n");
|
|
15
15
|
const common_1 = require("@driveup/common");
|
|
16
|
-
const
|
|
17
|
-
const common_3 = require("@driveup/common");
|
|
16
|
+
const shared_1 = require("@driveup/shared");
|
|
18
17
|
const staff_entity_1 = require("../../system/staff/staff.entity");
|
|
19
18
|
const priceplan_entity_1 = require("../product/priceplan.entity");
|
|
20
19
|
const trackable_1 = require("../../utils/trackable");
|
|
@@ -43,7 +42,7 @@ let PricePlanEntity = class PricePlanEntity extends trackable_1.TrackableEntity
|
|
|
43
42
|
*/
|
|
44
43
|
toModel(lang) {
|
|
45
44
|
const translation = this.getTranslation(lang);
|
|
46
|
-
return new
|
|
45
|
+
return new common_1.PricePlan({
|
|
47
46
|
id: this.id,
|
|
48
47
|
type: this.type,
|
|
49
48
|
title: translation?.title,
|
|
@@ -75,7 +74,7 @@ let PricePlanEntity = class PricePlanEntity extends trackable_1.TrackableEntity
|
|
|
75
74
|
title: translation?.title,
|
|
76
75
|
description: translation?.description,
|
|
77
76
|
content: translation?.content,
|
|
78
|
-
|
|
77
|
+
url: translation?.url || this.imageUrl,
|
|
79
78
|
link: translation?.link,
|
|
80
79
|
});
|
|
81
80
|
}
|
|
@@ -88,7 +87,7 @@ let PricePlanEntity = class PricePlanEntity extends trackable_1.TrackableEntity
|
|
|
88
87
|
title: t.title,
|
|
89
88
|
description: t.description,
|
|
90
89
|
content: t.content,
|
|
91
|
-
|
|
90
|
+
url: t.url,
|
|
92
91
|
link: t.link,
|
|
93
92
|
language: t.language
|
|
94
93
|
}));
|
|
@@ -131,10 +130,8 @@ let PricePlanEntity = class PricePlanEntity extends trackable_1.TrackableEntity
|
|
|
131
130
|
*/
|
|
132
131
|
async getActivities() {
|
|
133
132
|
const activities = [];
|
|
134
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
135
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
136
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, common_2.ActivityType.updatedBy, staff_entity_1.StaffEntity));
|
|
137
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, common_2.ActivityType.updatedOn));
|
|
133
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created, staff_entity_1.StaffEntity));
|
|
134
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated, staff_entity_1.StaffEntity));
|
|
138
135
|
return activities.filter(a => a);
|
|
139
136
|
}
|
|
140
137
|
};
|
|
@@ -143,8 +140,8 @@ __decorate([
|
|
|
143
140
|
(0, typeorm_1.Column)({
|
|
144
141
|
type: 'enum',
|
|
145
142
|
name: 'pricePlanType',
|
|
146
|
-
enum:
|
|
147
|
-
default:
|
|
143
|
+
enum: shared_1.PricePlanType,
|
|
144
|
+
default: shared_1.PricePlanType.PayAsYouUse,
|
|
148
145
|
nullable: false
|
|
149
146
|
}),
|
|
150
147
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priceplan.entity.js","sourceRoot":"","sources":["../../../src/catalog/priceplan/priceplan.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AACpD,6CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"priceplan.entity.js","sourceRoot":"","sources":["../../../src/catalog/priceplan/priceplan.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AACpD,6CAA0C;AAC1C,4CAA+E;AAC/E,4CAA0F;AAC1F,kEAA8D;AAC9D,kEAAqE;AACrE,qDAAwD;AACxD,iEAAyD;AAEzD;;;;;;;GAOG;AAEI,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AE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;qDACsB;AAUxB;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;iDACmB;AASrB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,CAAC;KACV,CAAC;;6CACW;AAYb;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;KACd,CAAC;;+CACc;AAMhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;kDACxB;AAMlB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC/B,IAAI;kDAAC;AAMhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACvB;AAMnB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC9B,IAAI;mDAAC;AAOjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,yCAAsB,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC;;iDACpB;0BApHhC,eAAe;IAD3B,IAAA,gBAAM,EAAC,kBAAkB,CAAC;;GACd,eAAe,CAyO3B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Language
|
|
2
|
-
import { Activity, Metadata } from '@driveup/common';
|
|
1
|
+
import { Language } from '@driveup/shared';
|
|
2
|
+
import { Activity, Product, Metadata } from '@driveup/common';
|
|
3
3
|
import { CountryEntity } from '../../system/country/country.entity';
|
|
4
4
|
import { ProductPricePlanEntity } from './priceplan.entity';
|
|
5
5
|
import { ProductEntity } from './product.entity';
|
|
@@ -14,7 +14,7 @@ import { TrackableEntity } from '../../utils/trackable';
|
|
|
14
14
|
*
|
|
15
15
|
* @extends TrackableEntity<Product>
|
|
16
16
|
*/
|
|
17
|
-
export declare class
|
|
17
|
+
export declare class CountryProductEntity extends TrackableEntity<Product> {
|
|
18
18
|
/**
|
|
19
19
|
* Driveup product reference
|
|
20
20
|
* Each country product is linked to a specific product
|
|
@@ -83,7 +83,7 @@ export declare class ProductCountryEntity extends TrackableEntity<Product> {
|
|
|
83
83
|
* Creates a new ProductCountryEntity instance
|
|
84
84
|
* @param props - Partial properties to initialize the entity
|
|
85
85
|
*/
|
|
86
|
-
constructor(props?: Partial<
|
|
86
|
+
constructor(props?: Partial<CountryProductEntity>);
|
|
87
87
|
/**
|
|
88
88
|
* Converts the entity to a Product model instance
|
|
89
89
|
* @param lang - Optional language for translations
|
|
@@ -101,6 +101,12 @@ export declare class ProductCountryEntity extends TrackableEntity<Product> {
|
|
|
101
101
|
* @returns Array of Metadata instances
|
|
102
102
|
*/
|
|
103
103
|
getMetadata(): Metadata<any>[];
|
|
104
|
+
/**
|
|
105
|
+
* Gets the localized translation for the product
|
|
106
|
+
* @param lang - Optional language code; defaults to current i18n context
|
|
107
|
+
* @returns Content instance with translated title and description
|
|
108
|
+
*/
|
|
109
|
+
getTranslation(lang?: Language): Promise<import("@driveup/common").Content>;
|
|
104
110
|
/**
|
|
105
111
|
* Retrieves activity history for this country product
|
|
106
112
|
* @returns Promise resolving to array of Activity instances tracking creation, updates, and status changes
|
|
@@ -9,10 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.CountryProductEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
14
15
|
const common_1 = require("@driveup/common");
|
|
15
|
-
const common_2 = require("@driveup/common");
|
|
16
16
|
const country_entity_1 = require("../../system/country/country.entity");
|
|
17
17
|
const staff_entity_1 = require("../../system/staff/staff.entity");
|
|
18
18
|
const priceplan_entity_1 = require("./priceplan.entity");
|
|
@@ -29,7 +29,7 @@ const activity_helper_1 = require("../../utils/activity.helper");
|
|
|
29
29
|
*
|
|
30
30
|
* @extends TrackableEntity<Product>
|
|
31
31
|
*/
|
|
32
|
-
let
|
|
32
|
+
let CountryProductEntity = class CountryProductEntity extends trackable_1.TrackableEntity {
|
|
33
33
|
/**
|
|
34
34
|
* Creates a new ProductCountryEntity instance
|
|
35
35
|
* @param props - Partial properties to initialize the entity
|
|
@@ -47,7 +47,7 @@ let ProductCountryEntity = class ProductCountryEntity extends trackable_1.Tracka
|
|
|
47
47
|
const entity = await this.product;
|
|
48
48
|
const product = entity.toModel(lang);
|
|
49
49
|
product.id = this.id;
|
|
50
|
-
product.status =
|
|
50
|
+
product.status = shared_1.ProductStatus.Inactive;
|
|
51
51
|
product.vat = this.vat;
|
|
52
52
|
product.sort = this.sort;
|
|
53
53
|
product.metadata = this.getMetadata();
|
|
@@ -66,7 +66,16 @@ let ProductCountryEntity = class ProductCountryEntity extends trackable_1.Tracka
|
|
|
66
66
|
* @returns Array of Metadata instances
|
|
67
67
|
*/
|
|
68
68
|
getMetadata() {
|
|
69
|
-
return this.metadata?.map(m =>
|
|
69
|
+
return this.metadata?.map(m => common_1.Metadata.toInstance(m));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Gets the localized translation for the product
|
|
73
|
+
* @param lang - Optional language code; defaults to current i18n context
|
|
74
|
+
* @returns Content instance with translated title and description
|
|
75
|
+
*/
|
|
76
|
+
async getTranslation(lang) {
|
|
77
|
+
const systemProduct = await this.product;
|
|
78
|
+
return systemProduct.getTranslation(lang);
|
|
70
79
|
}
|
|
71
80
|
/**
|
|
72
81
|
* Retrieves activity history for this country product
|
|
@@ -74,26 +83,22 @@ let ProductCountryEntity = class ProductCountryEntity extends trackable_1.Tracka
|
|
|
74
83
|
*/
|
|
75
84
|
async getActivities() {
|
|
76
85
|
const activities = [];
|
|
77
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
78
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
79
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
80
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
81
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.enabledBy, common_2.ActivityType.enabledBy, staff_entity_1.StaffEntity));
|
|
82
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.enabledOn, common_2.ActivityType.createdOn));
|
|
83
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.disabledBy, common_2.ActivityType.disabledBy, staff_entity_1.StaffEntity));
|
|
84
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.disabledOn, common_2.ActivityType.disabledOn));
|
|
86
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created, staff_entity_1.StaffEntity));
|
|
87
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated, staff_entity_1.StaffEntity));
|
|
88
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.enabledBy, this.enabledOn, shared_1.ActivityType.enabled, staff_entity_1.StaffEntity));
|
|
89
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.disabledBy, this.disabledOn, shared_1.ActivityType.disabled, staff_entity_1.StaffEntity));
|
|
85
90
|
return activities.filter(a => a);
|
|
86
91
|
}
|
|
87
92
|
};
|
|
88
|
-
exports.
|
|
93
|
+
exports.CountryProductEntity = CountryProductEntity;
|
|
89
94
|
__decorate([
|
|
90
95
|
(0, typeorm_1.Column)(),
|
|
91
96
|
__metadata("design:type", Number)
|
|
92
|
-
],
|
|
97
|
+
], CountryProductEntity.prototype, "productId", void 0);
|
|
93
98
|
__decorate([
|
|
94
99
|
(0, typeorm_1.Column)(),
|
|
95
100
|
__metadata("design:type", Number)
|
|
96
|
-
],
|
|
101
|
+
], CountryProductEntity.prototype, "countryId", void 0);
|
|
97
102
|
__decorate([
|
|
98
103
|
(0, typeorm_1.Column)({
|
|
99
104
|
type: 'decimal',
|
|
@@ -103,21 +108,21 @@ __decorate([
|
|
|
103
108
|
default: null
|
|
104
109
|
}),
|
|
105
110
|
__metadata("design:type", Number)
|
|
106
|
-
],
|
|
111
|
+
], CountryProductEntity.prototype, "vat", void 0);
|
|
107
112
|
__decorate([
|
|
108
113
|
(0, typeorm_1.Column)({
|
|
109
114
|
nullable: false,
|
|
110
115
|
default: false
|
|
111
116
|
}),
|
|
112
117
|
__metadata("design:type", Boolean)
|
|
113
|
-
],
|
|
118
|
+
], CountryProductEntity.prototype, "active", void 0);
|
|
114
119
|
__decorate([
|
|
115
120
|
(0, typeorm_1.Column)({
|
|
116
121
|
nullable: false,
|
|
117
122
|
default: 1
|
|
118
123
|
}),
|
|
119
124
|
__metadata("design:type", Number)
|
|
120
|
-
],
|
|
125
|
+
], CountryProductEntity.prototype, "sort", void 0);
|
|
121
126
|
__decorate([
|
|
122
127
|
(0, typeorm_1.Column)({
|
|
123
128
|
type: 'simple-json',
|
|
@@ -125,45 +130,45 @@ __decorate([
|
|
|
125
130
|
default: null
|
|
126
131
|
}),
|
|
127
132
|
__metadata("design:type", Array)
|
|
128
|
-
],
|
|
133
|
+
], CountryProductEntity.prototype, "metadata", void 0);
|
|
129
134
|
__decorate([
|
|
130
135
|
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
131
136
|
__metadata("design:type", Number)
|
|
132
|
-
],
|
|
137
|
+
], CountryProductEntity.prototype, "enabledBy", void 0);
|
|
133
138
|
__decorate([
|
|
134
139
|
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
135
140
|
__metadata("design:type", Date)
|
|
136
|
-
],
|
|
141
|
+
], CountryProductEntity.prototype, "enabledOn", void 0);
|
|
137
142
|
__decorate([
|
|
138
143
|
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
139
144
|
__metadata("design:type", Number)
|
|
140
|
-
],
|
|
145
|
+
], CountryProductEntity.prototype, "disabledBy", void 0);
|
|
141
146
|
__decorate([
|
|
142
147
|
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
143
148
|
__metadata("design:type", Date)
|
|
144
|
-
],
|
|
149
|
+
], CountryProductEntity.prototype, "disabledOn", void 0);
|
|
145
150
|
__decorate([
|
|
146
151
|
(0, typeorm_1.ManyToOne)(() => product_entity_1.ProductEntity, product => product.countries),
|
|
147
152
|
__metadata("design:type", Promise)
|
|
148
|
-
],
|
|
153
|
+
], CountryProductEntity.prototype, "product", void 0);
|
|
149
154
|
__decorate([
|
|
150
155
|
(0, typeorm_1.ManyToOne)(() => country_entity_1.CountryEntity, country => country.products),
|
|
151
156
|
__metadata("design:type", Promise)
|
|
152
|
-
],
|
|
157
|
+
], CountryProductEntity.prototype, "country", void 0);
|
|
153
158
|
__decorate([
|
|
154
159
|
(0, typeorm_1.OneToMany)(() => priceplan_entity_1.ProductPricePlanEntity, plan => plan.product),
|
|
155
160
|
__metadata("design:type", Promise)
|
|
156
|
-
],
|
|
161
|
+
], CountryProductEntity.prototype, "pricePlans", void 0);
|
|
157
162
|
__decorate([
|
|
158
163
|
(0, typeorm_1.OneToMany)(() => product_entity_2.CompanyProductEntity, product => product.product),
|
|
159
164
|
__metadata("design:type", Promise)
|
|
160
|
-
],
|
|
165
|
+
], CountryProductEntity.prototype, "companies", void 0);
|
|
161
166
|
__decorate([
|
|
162
167
|
(0, typeorm_1.OneToMany)(() => course_entity_1.SeedCourseEntity, course => course.product),
|
|
163
168
|
__metadata("design:type", Promise)
|
|
164
|
-
],
|
|
165
|
-
exports.
|
|
166
|
-
(0, typeorm_1.Entity)('
|
|
169
|
+
], CountryProductEntity.prototype, "seedCourses", void 0);
|
|
170
|
+
exports.CountryProductEntity = CountryProductEntity = __decorate([
|
|
171
|
+
(0, typeorm_1.Entity)('systemCountryProducts'),
|
|
167
172
|
__metadata("design:paramtypes", [Object])
|
|
168
|
-
],
|
|
173
|
+
], CountryProductEntity);
|
|
169
174
|
//# sourceMappingURL=country.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country.entity.js","sourceRoot":"","sources":["../../../src/catalog/product/country.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"country.entity.js","sourceRoot":"","sources":["../../../src/catalog/product/country.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAAwE;AACxE,4CAA8D;AAC9D,wEAAoE;AACpE,kEAA8D;AAC9D,yDAA4D;AAC5D,qDAAiD;AACjD,iFAAoF;AACpF,iEAAiE;AACjE,qDAAwD;AACxD,iEAAyD;AAEzD;;;;;;;GAOG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,2BAAwB;IAgHjE;;;OAGG;IACH,YAAY,KAAqC;QAChD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,IAAe;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,MAAM,GAAG,sBAAa,CAAC,QAAQ,CAAC;QACxC,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACvB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;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;AAMhC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8BAAa,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;;qDAC5B;AAMhC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,yCAAsB,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;wDAChB;AAM9C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAoB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;uDACvB;AAM3C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gCAAgB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;;yDACnB;+BA9G7B,oBAAoB;IADhC,IAAA,gBAAM,EAAC,uBAAuB,CAAC;;GACnB,oBAAoB,CAgLhC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Language
|
|
1
|
+
import { Language } from '@driveup/shared';
|
|
2
|
+
import { Metadata, Activity, PricePlan } from '@driveup/common';
|
|
2
3
|
import { PricePlanEntity } from '../priceplan/priceplan.entity';
|
|
3
|
-
import {
|
|
4
|
+
import { CountryProductEntity } from './country.entity';
|
|
4
5
|
import { CompanyProductPricePlanEntity } from '../../profile/company/product/priceplan.entity';
|
|
5
6
|
import { TrackableEntity } from '../../utils/trackable';
|
|
6
7
|
/**
|
|
@@ -72,7 +73,7 @@ export declare class ProductPricePlanEntity extends TrackableEntity<PricePlan> {
|
|
|
72
73
|
/**
|
|
73
74
|
* Country product relation
|
|
74
75
|
*/
|
|
75
|
-
product: Promise<
|
|
76
|
+
product: Promise<CountryProductEntity>;
|
|
76
77
|
/**
|
|
77
78
|
* Company medical price plan relation
|
|
78
79
|
*/
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ProductPricePlanEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
|
-
const
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
15
15
|
const common_1 = require("@driveup/common");
|
|
16
16
|
const staff_entity_1 = require("../../system/staff/staff.entity");
|
|
17
17
|
const priceplan_entity_1 = require("../priceplan/priceplan.entity");
|
|
@@ -83,14 +83,10 @@ let ProductPricePlanEntity = class ProductPricePlanEntity extends trackable_1.Tr
|
|
|
83
83
|
*/
|
|
84
84
|
async getActivities() {
|
|
85
85
|
const activities = [];
|
|
86
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy,
|
|
87
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
88
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
89
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
90
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.enabledBy, common_1.ActivityType.enabledBy, staff_entity_1.StaffEntity));
|
|
91
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.enabledOn, common_1.ActivityType.createdOn));
|
|
92
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.disabledBy, common_1.ActivityType.disabledBy, staff_entity_1.StaffEntity));
|
|
93
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.disabledOn, common_1.ActivityType.disabledOn));
|
|
86
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created, staff_entity_1.StaffEntity));
|
|
87
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated, staff_entity_1.StaffEntity));
|
|
88
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.enabledBy, this.enabledOn, shared_1.ActivityType.enabled, staff_entity_1.StaffEntity));
|
|
89
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.disabledBy, this.disabledOn, shared_1.ActivityType.disabled, staff_entity_1.StaffEntity));
|
|
94
90
|
return activities.filter(a => a);
|
|
95
91
|
}
|
|
96
92
|
};
|
|
@@ -169,11 +165,11 @@ __decorate([
|
|
|
169
165
|
__metadata("design:type", Date)
|
|
170
166
|
], ProductPricePlanEntity.prototype, "disabledOn", void 0);
|
|
171
167
|
__decorate([
|
|
172
|
-
(0,
|
|
168
|
+
(0, typeorm_1.ManyToOne)(() => priceplan_entity_1.PricePlanEntity, plan => plan.products),
|
|
173
169
|
__metadata("design:type", Promise)
|
|
174
170
|
], ProductPricePlanEntity.prototype, "pricePlan", void 0);
|
|
175
171
|
__decorate([
|
|
176
|
-
(0,
|
|
172
|
+
(0, typeorm_1.ManyToOne)(() => country_entity_1.CountryProductEntity, country => country.pricePlans),
|
|
177
173
|
__metadata("design:type", Promise)
|
|
178
174
|
], ProductPricePlanEntity.prototype, "product", void 0);
|
|
179
175
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priceplan.entity.js","sourceRoot":"","sources":["../../../src/catalog/product/priceplan.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"priceplan.entity.js","sourceRoot":"","sources":["../../../src/catalog/product/priceplan.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAAyD;AACzD,4CAAgE;AAChE,kEAA8D;AAC9D,oEAAgE;AAChE,qDAAwD;AACxD,qFAA+F;AAC/F,qDAAwD;AACxD,iEAAyD;AAEzD;;;;;;;GAOG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,2BAA0B;IA0HrE;;;OAGG;IACH,YAAY,KAAuC;QAClD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,IAAe;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC;QACpC,MA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