@driveup/schema 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +174 -0
- package/lib/catalog/addon/addon.entity.d.ts +109 -0
- package/lib/catalog/addon/addon.entity.js +260 -0
- package/lib/catalog/addon/addon.entity.js.map +1 -0
- package/lib/catalog/addon/country.entity.d.ts +112 -0
- package/lib/catalog/addon/country.entity.js +246 -0
- package/lib/catalog/addon/country.entity.js.map +1 -0
- package/lib/catalog/driving/category.entity.d.ts +122 -0
- package/lib/catalog/driving/category.entity.js +217 -0
- package/lib/catalog/driving/category.entity.js.map +1 -0
- package/lib/catalog/driving/vehicle.entity.d.ts +49 -0
- package/lib/catalog/driving/vehicle.entity.js +97 -0
- package/lib/catalog/driving/vehicle.entity.js.map +1 -0
- package/lib/catalog/priceplan/priceplan.entity.d.ts +123 -0
- package/lib/catalog/priceplan/priceplan.entity.js +288 -0
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -0
- package/lib/catalog/product/country.entity.d.ts +109 -0
- package/lib/catalog/product/country.entity.js +233 -0
- package/lib/catalog/product/country.entity.js.map +1 -0
- package/lib/catalog/product/priceplan.entity.d.ts +113 -0
- package/lib/catalog/product/priceplan.entity.js +251 -0
- package/lib/catalog/product/priceplan.entity.js.map +1 -0
- package/lib/catalog/product/product.entity.d.ts +104 -0
- package/lib/catalog/product/product.entity.js +262 -0
- package/lib/catalog/product/product.entity.js.map +1 -0
- package/lib/catalog/program/program.entity.d.ts +107 -0
- package/lib/catalog/program/program.entity.js +247 -0
- package/lib/catalog/program/program.entity.js.map +1 -0
- package/lib/catalog/seed/assets/asset.entity.d.ts +68 -0
- package/lib/catalog/seed/assets/asset.entity.js +163 -0
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -0
- package/lib/catalog/seed/courses/course.entity.d.ts +98 -0
- package/lib/catalog/seed/courses/course.entity.js +216 -0
- package/lib/catalog/seed/courses/course.entity.js.map +1 -0
- package/lib/catalog/seed/courses/lesson.entity.d.ts +90 -0
- package/lib/catalog/seed/courses/lesson.entity.js +214 -0
- package/lib/catalog/seed/courses/lesson.entity.js.map +1 -0
- package/lib/catalog/seed/courses/topic.entity.d.ts +77 -0
- package/lib/catalog/seed/courses/topic.entity.js +185 -0
- package/lib/catalog/seed/courses/topic.entity.js.map +1 -0
- package/lib/catalog/seed/expense/category.entity.d.ts +61 -0
- package/lib/catalog/seed/expense/category.entity.js +153 -0
- package/lib/catalog/seed/expense/category.entity.js.map +1 -0
- package/lib/index.d.ts +67 -0
- package/lib/index.js +89 -0
- package/lib/index.js.map +1 -0
- package/lib/profile/agent/agent.entity.d.ts +95 -0
- package/lib/profile/agent/agent.entity.js +223 -0
- package/lib/profile/agent/agent.entity.js.map +1 -0
- package/lib/profile/agent/payout.entity.d.ts +70 -0
- package/lib/profile/agent/payout.entity.js +160 -0
- package/lib/profile/agent/payout.entity.js.map +1 -0
- package/lib/profile/agent/promotion.entity.d.ts +82 -0
- package/lib/profile/agent/promotion.entity.js +174 -0
- package/lib/profile/agent/promotion.entity.js.map +1 -0
- package/lib/profile/company/company.entity.d.ts +234 -0
- package/lib/profile/company/company.entity.js +558 -0
- package/lib/profile/company/company.entity.js.map +1 -0
- package/lib/profile/company/course/appointment.entity.d.ts +111 -0
- package/lib/profile/company/course/appointment.entity.js +240 -0
- package/lib/profile/company/course/appointment.entity.js.map +1 -0
- package/lib/profile/company/course/course.entity.d.ts +156 -0
- package/lib/profile/company/course/course.entity.js +365 -0
- package/lib/profile/company/course/course.entity.js.map +1 -0
- package/lib/profile/company/course/lesson.entity.d.ts +123 -0
- package/lib/profile/company/course/lesson.entity.js +288 -0
- package/lib/profile/company/course/lesson.entity.js.map +1 -0
- package/lib/profile/company/course/topic.entity.d.ts +55 -0
- package/lib/profile/company/course/topic.entity.js +147 -0
- package/lib/profile/company/course/topic.entity.js.map +1 -0
- package/lib/profile/company/finances/billing/bill.entity.d.ts +145 -0
- package/lib/profile/company/finances/billing/bill.entity.js +338 -0
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -0
- package/lib/profile/company/finances/billing/item.entity.d.ts +75 -0
- package/lib/profile/company/finances/billing/item.entity.js +219 -0
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -0
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +44 -0
- package/lib/profile/company/finances/billing/transaction.entity.js +158 -0
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -0
- package/lib/profile/company/finances/expense/category.entity.d.ts +55 -0
- package/lib/profile/company/finances/expense/category.entity.js +117 -0
- package/lib/profile/company/finances/expense/category.entity.js.map +1 -0
- package/lib/profile/company/finances/expense/expense.entity.d.ts +48 -0
- package/lib/profile/company/finances/expense/expense.entity.js +171 -0
- package/lib/profile/company/finances/expense/expense.entity.js.map +1 -0
- package/lib/profile/company/finances/handover/handover.entity.d.ts +44 -0
- package/lib/profile/company/finances/handover/handover.entity.js +202 -0
- package/lib/profile/company/finances/handover/handover.entity.js.map +1 -0
- package/lib/profile/company/finances/invoice/invoice.entity.d.ts +65 -0
- package/lib/profile/company/finances/invoice/invoice.entity.js +296 -0
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -0
- package/lib/profile/company/finances/invoice/item.entity.d.ts +25 -0
- package/lib/profile/company/finances/invoice/item.entity.js +148 -0
- package/lib/profile/company/finances/invoice/item.entity.js.map +1 -0
- package/lib/profile/company/finances/payment/method.entity.d.ts +35 -0
- package/lib/profile/company/finances/payment/method.entity.js +143 -0
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -0
- package/lib/profile/company/finances/peyment/method.entity.d.ts +35 -0
- package/lib/profile/company/finances/peyment/method.entity.js +143 -0
- package/lib/profile/company/finances/peyment/method.entity.js.map +1 -0
- package/lib/profile/company/finances/peyment-method/payment-method.d.ts +34 -0
- package/lib/profile/company/finances/peyment-method/payment-method.js +118 -0
- package/lib/profile/company/finances/peyment-method/payment-method.js.map +1 -0
- package/lib/profile/company/instructor/instructor.entity.d.ts +85 -0
- package/lib/profile/company/instructor/instructor.entity.js +254 -0
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -0
- package/lib/profile/company/instructor/task.entity.d.ts +60 -0
- package/lib/profile/company/instructor/task.entity.js +133 -0
- package/lib/profile/company/instructor/task.entity.js.map +1 -0
- package/lib/profile/company/medical/examination.entity.d.ts +59 -0
- package/lib/profile/company/medical/examination.entity.js +175 -0
- package/lib/profile/company/medical/examination.entity.js.map +1 -0
- package/lib/profile/company/medical/product.entity.d.ts +99 -0
- package/lib/profile/company/medical/product.entity.js +270 -0
- package/lib/profile/company/medical/product.entity.js.map +1 -0
- package/lib/profile/company/metrics/company.metric.d.ts +21 -0
- package/lib/profile/company/metrics/company.metric.js +122 -0
- package/lib/profile/company/metrics/company.metric.js.map +1 -0
- package/lib/profile/company/product/addon.entity.d.ts +93 -0
- package/lib/profile/company/product/addon.entity.js +234 -0
- package/lib/profile/company/product/addon.entity.js.map +1 -0
- package/lib/profile/company/product/priceplan.entity.d.ts +57 -0
- package/lib/profile/company/product/priceplan.entity.js +167 -0
- package/lib/profile/company/product/priceplan.entity.js.map +1 -0
- package/lib/profile/company/product/product.entity.d.ts +171 -0
- package/lib/profile/company/product/product.entity.js +383 -0
- package/lib/profile/company/product/product.entity.js.map +1 -0
- package/lib/profile/company/product/vehicle.entity.d.ts +46 -0
- package/lib/profile/company/product/vehicle.entity.js +144 -0
- package/lib/profile/company/product/vehicle.entity.js.map +1 -0
- package/lib/profile/instructor/instructor.entity.d.ts +80 -0
- package/lib/profile/instructor/instructor.entity.js +186 -0
- package/lib/profile/instructor/instructor.entity.js.map +1 -0
- package/lib/profile/student/program/licence/licence.entity.d.ts +66 -0
- package/lib/profile/student/program/licence/licence.entity.js +187 -0
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -0
- package/lib/profile/student/program/medical/certificate.entity.d.ts +84 -0
- package/lib/profile/student/program/medical/certificate.entity.js +244 -0
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -0
- package/lib/profile/student/program/medical/examination.model.d.ts +65 -0
- package/lib/profile/student/program/medical/examination.model.js +209 -0
- package/lib/profile/student/program/medical/examination.model.js.map +1 -0
- package/lib/profile/student/program/program.entity.d.ts +78 -0
- package/lib/profile/student/program/program.entity.js +225 -0
- package/lib/profile/student/program/program.entity.js.map +1 -0
- package/lib/profile/student/program/training/appointment.entity.d.ts +151 -0
- package/lib/profile/student/program/training/appointment.entity.js +441 -0
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -0
- package/lib/profile/student/program/training/exam.entity.d.ts +41 -0
- package/lib/profile/student/program/training/exam.entity.js +141 -0
- package/lib/profile/student/program/training/exam.entity.js.map +1 -0
- package/lib/profile/student/program/training/lesson.entity.d.ts +84 -0
- package/lib/profile/student/program/training/lesson.entity.js +221 -0
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -0
- package/lib/profile/student/program/training/request.entity.d.ts +56 -0
- package/lib/profile/student/program/training/request.entity.js +159 -0
- package/lib/profile/student/program/training/request.entity.js.map +1 -0
- package/lib/profile/student/program/training/topic.entity.d.ts +109 -0
- package/lib/profile/student/program/training/topic.entity.js +255 -0
- package/lib/profile/student/program/training/topic.entity.js.map +1 -0
- package/lib/profile/student/program/training/training.entity.d.ts +167 -0
- package/lib/profile/student/program/training/training.entity.js +501 -0
- package/lib/profile/student/program/training/training.entity.js.map +1 -0
- package/lib/profile/student/program/training/transaction.entity.d.ts +111 -0
- package/lib/profile/student/program/training/transaction.entity.js +266 -0
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -0
- package/lib/profile/student/student.entity.d.ts +89 -0
- package/lib/profile/student/student.entity.js +183 -0
- package/lib/profile/student/student.entity.js.map +1 -0
- package/lib/system/campaign/campaign.entity.d.ts +68 -0
- package/lib/system/campaign/campaign.entity.js +150 -0
- package/lib/system/campaign/campaign.entity.js.map +1 -0
- package/lib/system/campaign/gifcode.entity.d.ts +14 -0
- package/lib/system/campaign/gifcode.entity.js +77 -0
- package/lib/system/campaign/gifcode.entity.js.map +1 -0
- package/lib/system/campaigne/campaign.entity.d.ts +69 -0
- package/lib/system/campaigne/campaign.entity.js +179 -0
- package/lib/system/campaigne/campaign.entity.js.map +1 -0
- package/lib/system/campaigne/gifcode.entity.d.ts +54 -0
- package/lib/system/campaigne/gifcode.entity.js +126 -0
- package/lib/system/campaigne/gifcode.entity.js.map +1 -0
- package/lib/system/country/country.entity.d.ts +121 -0
- package/lib/system/country/country.entity.js +284 -0
- package/lib/system/country/country.entity.js.map +1 -0
- package/lib/system/country/country.metric.d.ts +12 -0
- package/lib/system/country/country.metric.js +68 -0
- package/lib/system/country/country.metric.js.map +1 -0
- package/lib/system/currency/currency.entity.d.ts +46 -0
- package/lib/system/currency/currency.entity.js +112 -0
- package/lib/system/currency/currency.entity.js.map +1 -0
- package/lib/system/driving/category.entity.d.ts +146 -0
- package/lib/system/driving/category.entity.js +321 -0
- package/lib/system/driving/category.entity.js.map +1 -0
- package/lib/system/driving/vehicle.entity.d.ts +54 -0
- package/lib/system/driving/vehicle.entity.js +130 -0
- package/lib/system/driving/vehicle.entity.js.map +1 -0
- package/lib/system/event/business.entity.d.ts +75 -0
- package/lib/system/event/business.entity.js +170 -0
- package/lib/system/event/business.entity.js.map +1 -0
- package/lib/system/event/log.entity.d.ts +103 -0
- package/lib/system/event/log.entity.js +202 -0
- package/lib/system/event/log.entity.js.map +1 -0
- package/lib/system/policy/policy.entity.d.ts +90 -0
- package/lib/system/policy/policy.entity.js +226 -0
- package/lib/system/policy/policy.entity.js.map +1 -0
- package/lib/system/staff/staff.entity.d.ts +72 -0
- package/lib/system/staff/staff.entity.js +186 -0
- package/lib/system/staff/staff.entity.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/user/alert.entity.d.ts +95 -0
- package/lib/user/alert.entity.js +223 -0
- package/lib/user/alert.entity.js.map +1 -0
- package/lib/user/blocked.entity.d.ts +42 -0
- package/lib/user/blocked.entity.js +83 -0
- package/lib/user/blocked.entity.js.map +1 -0
- package/lib/user/device.entity.d.ts +72 -0
- package/lib/user/device.entity.js +182 -0
- package/lib/user/device.entity.js.map +1 -0
- package/lib/user/notification.entity.d.ts +87 -0
- package/lib/user/notification.entity.js +219 -0
- package/lib/user/notification.entity.js.map +1 -0
- package/lib/user/ticket.entity.d.ts +85 -0
- package/lib/user/ticket.entity.js +231 -0
- package/lib/user/ticket.entity.js.map +1 -0
- package/lib/user/user.entity.d.ts +235 -0
- package/lib/user/user.entity.js +573 -0
- package/lib/user/user.entity.js.map +1 -0
- package/lib/user/verification.entity.d.ts +75 -0
- package/lib/user/verification.entity.js +142 -0
- package/lib/user/verification.entity.js.map +1 -0
- package/lib/utils/activity.helper.d.ts +26 -0
- package/lib/utils/activity.helper.js +39 -0
- package/lib/utils/activity.helper.js.map +1 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.js +21 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/json-metrics.transform.d.ts +35 -0
- package/lib/utils/json-metrics.transform.js +83 -0
- package/lib/utils/json-metrics.transform.js.map +1 -0
- package/lib/utils/numeric.transform.d.ts +38 -0
- package/lib/utils/numeric.transform.js +74 -0
- package/lib/utils/numeric.transform.js.map +1 -0
- package/lib/utils/trackable.entity.d.ts +82 -0
- package/lib/utils/trackable.entity.js +100 -0
- package/lib/utils/trackable.entity.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SeedVehicleEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const typeorm_2 = require("typeorm");
|
|
15
|
+
const common_1 = require("@driveup/common");
|
|
16
|
+
const staff_entity_1 = require("../staff/staff.entity");
|
|
17
|
+
const category_entity_1 = require("./category.entity");
|
|
18
|
+
const utils_1 = require("../../utils");
|
|
19
|
+
/**
|
|
20
|
+
* Represents a seed vehicle template in the system.
|
|
21
|
+
* Seed vehicles are predefined vehicle configurations that can be used
|
|
22
|
+
* by companies when setting up their fleet. Each vehicle is associated with
|
|
23
|
+
* a driving category and includes make, model, and transmission type.
|
|
24
|
+
*
|
|
25
|
+
* @extends TrackableEntity<Vehicle>
|
|
26
|
+
*/
|
|
27
|
+
let SeedVehicleEntity = class SeedVehicleEntity extends utils_1.TrackableEntity {
|
|
28
|
+
/**
|
|
29
|
+
* Reference to the driving category this vehicle belongs to
|
|
30
|
+
*/
|
|
31
|
+
categoryId;
|
|
32
|
+
/**
|
|
33
|
+
* Vehicle make (e.g. Toyota, Ford)
|
|
34
|
+
*/
|
|
35
|
+
make;
|
|
36
|
+
/**
|
|
37
|
+
* Vehicle model (e.g. Corolla, Focus)
|
|
38
|
+
*/
|
|
39
|
+
model;
|
|
40
|
+
/**
|
|
41
|
+
* Type of transmission (Automatic or Manual)
|
|
42
|
+
* @default CarTransmission.Automatic
|
|
43
|
+
*/
|
|
44
|
+
transmission;
|
|
45
|
+
/**
|
|
46
|
+
* Associated driving category
|
|
47
|
+
*/
|
|
48
|
+
category;
|
|
49
|
+
/**
|
|
50
|
+
* Creates a new SeedVehicleEntity instance
|
|
51
|
+
* @param props - Partial properties to initialize the entity
|
|
52
|
+
*/
|
|
53
|
+
constructor(props) {
|
|
54
|
+
super();
|
|
55
|
+
Object.assign(this, props);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Converts the entity to a Vehicle model instance
|
|
59
|
+
* @returns Vehicle model with id, make, model, and transmission
|
|
60
|
+
*/
|
|
61
|
+
toModel() {
|
|
62
|
+
return new common_1.Vehicle({
|
|
63
|
+
id: this.id,
|
|
64
|
+
make: this.make,
|
|
65
|
+
model: this.model,
|
|
66
|
+
transmission: this.transmission
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Converts the entity to a Vehicle model instance
|
|
71
|
+
* @returns Vehicle model with id, make, model, and transmission
|
|
72
|
+
*/
|
|
73
|
+
toSummary() {
|
|
74
|
+
return new common_1.Vehicle({
|
|
75
|
+
id: this.id,
|
|
76
|
+
make: this.make,
|
|
77
|
+
model: this.model,
|
|
78
|
+
transmission: this.transmission
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Retrieves activity history for this vehicle
|
|
83
|
+
* @returns Promise resolving to array of Activity instances tracking creation and updates
|
|
84
|
+
*/
|
|
85
|
+
async getActivities() {
|
|
86
|
+
const activities = [];
|
|
87
|
+
activities.push(await (0, utils_1.toActivity)(this.createdBy, common_1.ActivityType.createdBy, staff_entity_1.StaffEntity));
|
|
88
|
+
activities.push(await (0, utils_1.toActivity)(this.createdOn, common_1.ActivityType.createdOn));
|
|
89
|
+
activities.push(await (0, utils_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy, staff_entity_1.StaffEntity));
|
|
90
|
+
activities.push(await (0, utils_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
91
|
+
return activities.filter(a => a);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.SeedVehicleEntity = SeedVehicleEntity;
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, typeorm_1.Column)(),
|
|
97
|
+
__metadata("design:type", Number)
|
|
98
|
+
], SeedVehicleEntity.prototype, "categoryId", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)({
|
|
101
|
+
nullable: true,
|
|
102
|
+
default: null
|
|
103
|
+
}),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], SeedVehicleEntity.prototype, "make", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.Column)({
|
|
108
|
+
nullable: true,
|
|
109
|
+
default: null
|
|
110
|
+
}),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], SeedVehicleEntity.prototype, "model", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, typeorm_1.Column)({
|
|
115
|
+
type: 'enum',
|
|
116
|
+
enum: common_1.CarTransmission,
|
|
117
|
+
default: common_1.CarTransmission.Automatic,
|
|
118
|
+
nullable: false
|
|
119
|
+
}),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], SeedVehicleEntity.prototype, "transmission", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, typeorm_2.ManyToOne)(() => category_entity_1.DrivingCategoryEntity, categorry => categorry.seedVehicles),
|
|
124
|
+
__metadata("design:type", Promise)
|
|
125
|
+
], SeedVehicleEntity.prototype, "category", void 0);
|
|
126
|
+
exports.SeedVehicleEntity = SeedVehicleEntity = __decorate([
|
|
127
|
+
(0, typeorm_1.Entity)('seedVehicles'),
|
|
128
|
+
__metadata("design:paramtypes", [Object])
|
|
129
|
+
], SeedVehicleEntity);
|
|
130
|
+
//# sourceMappingURL=vehicle.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicle.entity.js","sourceRoot":"","sources":["../../../src/system/driving/vehicle.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,qCAAoC;AACpC,4CAAmF;AACnF,wDAAoD;AACpD,uDAA0D;AAC1D,uCAA0D;AAE1D;;;;;;;GAOG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,uBAAwB;IAE9D;;OAEG;IAEH,UAAU,CAAS;IAEnB;;OAEG;IAKH,IAAI,CAAS;IAEb;;OAEG;IAKH,KAAK,CAAS;IAEd;;;OAGG;IAOH,YAAY,CAA4B;IAExC;;OAEG;IAEH,QAAQ,CAAiC;IAEzC;;;OAGG;IACH,YAAY,KAAkC;QAC7C,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,OAAO;QACN,OAAO,IAAI,gBAAO,CAAC;YAClB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;SAC/B,CAAC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,SAAS;QACR,OAAO,IAAI,gBAAO,CAAC;YAClB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;SAC/B,CAAC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa;QAClB,MAAM,UAAU,GAAe,EAAE,CAAC;QAClC,UAAU,CAAC,IAAI,CAAC,MAAM,IAAA,kBAAU,EAAC,IAAI,CAAC,SAAS,EAAE,qBAAY,CAAC,SAAS,EAAE,0BAAW,CAAC,CAAC,CAAC;QACvF,UAAU,CAAC,IAAI,CAAC,MAAM,IAAA,kBAAU,EAAC,IAAI,CAAC,SAAS,EAAE,qBAAY,CAAC,SAAS,CAAC,CAAC,CAAC;QAC1E,UAAU,CAAC,IAAI,CAAC,MAAM,IAAA,kBAAU,EAAC,IAAI,CAAC,SAAS,EAAE,qBAAY,CAAC,SAAS,EAAE,0BAAW,CAAC,CAAC,CAAC;QACvF,UAAU,CAAC,IAAI,CAAC,MAAM,IAAA,kBAAU,EAAC,IAAI,CAAC,SAAS,EAAE,qBAAY,CAAC,SAAS,CAAC,CAAC,CAAC;QAC1E,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;CACD,CAAA;AA3FY,8CAAiB;AAM7B;IADC,IAAA,gBAAM,GAAE;;qDACU;AASnB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;+CACW;AASb;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;gDACY;AAYd;IANC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,wBAAe;QACrB,OAAO,EAAE,wBAAe,CAAC,SAAS;QAClC,QAAQ,EAAE,KAAK;KACf,CAAC;;uDACsC;AAMxC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAqB,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;;mDACnC;4BA1C7B,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,cAAc,CAAC;;GACV,iBAAiB,CA2F7B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Activity, ColorContext, Content, NotificationChannel, ProfileType } from '@driveup/common';
|
|
2
|
+
import { TrackableEntity } from '../../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a business event configuration in the system.
|
|
5
|
+
* Business events define system actions that can trigger notifications
|
|
6
|
+
* (e.g., account created, appointment scheduled, payment received).
|
|
7
|
+
* Each event can be configured with default preferences and notification channels.
|
|
8
|
+
*
|
|
9
|
+
* @extends TrackableEntity
|
|
10
|
+
*/
|
|
11
|
+
export declare class BusinessEvent extends TrackableEntity<BusinessEvent> {
|
|
12
|
+
/**
|
|
13
|
+
* Profile type that this event applies to
|
|
14
|
+
* @default ProfileType.Company
|
|
15
|
+
*/
|
|
16
|
+
scope: ProfileType;
|
|
17
|
+
/**
|
|
18
|
+
* This name is used to identify the event setting in the system.
|
|
19
|
+
* @description The event name should be unique and descriptive.
|
|
20
|
+
* @example 'user.account.closed'
|
|
21
|
+
* @see @driveup/common for a list of predefined event names.
|
|
22
|
+
*/
|
|
23
|
+
event: string;
|
|
24
|
+
/**
|
|
25
|
+
* Translations for the notification content.
|
|
26
|
+
* Exlain user what the notification is about in different languages.
|
|
27
|
+
*/
|
|
28
|
+
translations: Content[];
|
|
29
|
+
/**
|
|
30
|
+
* Color context for the notification.
|
|
31
|
+
* @type {Context}
|
|
32
|
+
* @default Context.Info
|
|
33
|
+
*/
|
|
34
|
+
color: ColorContext;
|
|
35
|
+
/**
|
|
36
|
+
* Notification channel
|
|
37
|
+
* @type {NotificationChannel}
|
|
38
|
+
* @default NotificationChannel.App
|
|
39
|
+
*/
|
|
40
|
+
channel: NotificationChannel;
|
|
41
|
+
/**
|
|
42
|
+
* Indicates if the notification setting is enabled by default.
|
|
43
|
+
* This is used to set the initial preference for users.
|
|
44
|
+
* If true, users will have this notification setting enabled by default.
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
isPrefered: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Sort order for the notification setting.
|
|
50
|
+
* This can be used to order the settings in the user interface.
|
|
51
|
+
* Lower numbers appear first.
|
|
52
|
+
* @default null
|
|
53
|
+
*/
|
|
54
|
+
sort: number;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a new BusinessEvent instance
|
|
57
|
+
* @param props - Partial properties to initialize the entity
|
|
58
|
+
*/
|
|
59
|
+
constructor(props?: Partial<BusinessEvent>);
|
|
60
|
+
/**
|
|
61
|
+
* Converts the entity to a BusinessEvent model instance
|
|
62
|
+
* @returns BusinessEvent model with all business event properties
|
|
63
|
+
*/
|
|
64
|
+
toModel(): BusinessEvent;
|
|
65
|
+
/**
|
|
66
|
+
* Returns a summary representation of the business event
|
|
67
|
+
* @returns BusinessEvent model instance (same as toModel())
|
|
68
|
+
*/
|
|
69
|
+
toSummary(): BusinessEvent;
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves activity history for this business event
|
|
72
|
+
* @returns Promise resolving to array of Activity instances tracking creation and updates
|
|
73
|
+
*/
|
|
74
|
+
getActivities(): Promise<Activity[]>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var BusinessEvent_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.BusinessEvent = void 0;
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const common_1 = require("@driveup/common");
|
|
16
|
+
const utils_1 = require("../../utils");
|
|
17
|
+
/**
|
|
18
|
+
* Represents a business event configuration in the system.
|
|
19
|
+
* Business events define system actions that can trigger notifications
|
|
20
|
+
* (e.g., account created, appointment scheduled, payment received).
|
|
21
|
+
* Each event can be configured with default preferences and notification channels.
|
|
22
|
+
*
|
|
23
|
+
* @extends TrackableEntity
|
|
24
|
+
*/
|
|
25
|
+
let BusinessEvent = BusinessEvent_1 = class BusinessEvent extends utils_1.TrackableEntity {
|
|
26
|
+
/**
|
|
27
|
+
* Profile type that this event applies to
|
|
28
|
+
* @default ProfileType.Company
|
|
29
|
+
*/
|
|
30
|
+
scope;
|
|
31
|
+
/**
|
|
32
|
+
* This name is used to identify the event setting in the system.
|
|
33
|
+
* @description The event name should be unique and descriptive.
|
|
34
|
+
* @example 'user.account.closed'
|
|
35
|
+
* @see @driveup/common for a list of predefined event names.
|
|
36
|
+
*/
|
|
37
|
+
event;
|
|
38
|
+
/**
|
|
39
|
+
* Translations for the notification content.
|
|
40
|
+
* Exlain user what the notification is about in different languages.
|
|
41
|
+
*/
|
|
42
|
+
translations;
|
|
43
|
+
/**
|
|
44
|
+
* Color context for the notification.
|
|
45
|
+
* @type {Context}
|
|
46
|
+
* @default Context.Info
|
|
47
|
+
*/
|
|
48
|
+
color;
|
|
49
|
+
/**
|
|
50
|
+
* Notification channel
|
|
51
|
+
* @type {NotificationChannel}
|
|
52
|
+
* @default NotificationChannel.App
|
|
53
|
+
*/
|
|
54
|
+
channel;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates if the notification setting is enabled by default.
|
|
57
|
+
* This is used to set the initial preference for users.
|
|
58
|
+
* If true, users will have this notification setting enabled by default.
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
isPrefered;
|
|
62
|
+
/**
|
|
63
|
+
* Sort order for the notification setting.
|
|
64
|
+
* This can be used to order the settings in the user interface.
|
|
65
|
+
* Lower numbers appear first.
|
|
66
|
+
* @default null
|
|
67
|
+
*/
|
|
68
|
+
sort;
|
|
69
|
+
/**
|
|
70
|
+
* Creates a new BusinessEvent instance
|
|
71
|
+
* @param props - Partial properties to initialize the entity
|
|
72
|
+
*/
|
|
73
|
+
constructor(props) {
|
|
74
|
+
super();
|
|
75
|
+
Object.assign(this, props);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Converts the entity to a BusinessEvent model instance
|
|
79
|
+
* @returns BusinessEvent model with all business event properties
|
|
80
|
+
*/
|
|
81
|
+
toModel() {
|
|
82
|
+
return new BusinessEvent_1({
|
|
83
|
+
id: this.id,
|
|
84
|
+
scope: this.scope,
|
|
85
|
+
event: this.event,
|
|
86
|
+
translations: this.translations,
|
|
87
|
+
color: this.color,
|
|
88
|
+
channel: this.channel,
|
|
89
|
+
isPrefered: this.isPrefered,
|
|
90
|
+
sort: this.sort
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Returns a summary representation of the business event
|
|
95
|
+
* @returns BusinessEvent model instance (same as toModel())
|
|
96
|
+
*/
|
|
97
|
+
toSummary() {
|
|
98
|
+
return this.toModel();
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Retrieves activity history for this business event
|
|
102
|
+
* @returns Promise resolving to array of Activity instances tracking creation and updates
|
|
103
|
+
*/
|
|
104
|
+
async getActivities() {
|
|
105
|
+
const activities = [];
|
|
106
|
+
activities.push(await (0, utils_1.toActivity)(this.createdBy, common_1.ActivityType.createdBy));
|
|
107
|
+
activities.push(await (0, utils_1.toActivity)(this.createdOn, common_1.ActivityType.createdOn));
|
|
108
|
+
activities.push(await (0, utils_1.toActivity)(this.updatedBy, common_1.ActivityType.updatedBy));
|
|
109
|
+
activities.push(await (0, utils_1.toActivity)(this.updatedOn, common_1.ActivityType.updatedOn));
|
|
110
|
+
return activities.filter(a => a);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
exports.BusinessEvent = BusinessEvent;
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Column)({
|
|
116
|
+
type: 'enum',
|
|
117
|
+
enum: common_1.ProfileType,
|
|
118
|
+
default: common_1.ProfileType.Company,
|
|
119
|
+
nullable: true
|
|
120
|
+
}),
|
|
121
|
+
__metadata("design:type", String)
|
|
122
|
+
], BusinessEvent.prototype, "scope", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, typeorm_1.Column)({ unique: true }),
|
|
125
|
+
__metadata("design:type", String)
|
|
126
|
+
], BusinessEvent.prototype, "event", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, typeorm_1.Column)({
|
|
129
|
+
type: 'simple-json',
|
|
130
|
+
nullable: true,
|
|
131
|
+
default: null
|
|
132
|
+
}),
|
|
133
|
+
__metadata("design:type", Array)
|
|
134
|
+
], BusinessEvent.prototype, "translations", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.Column)({
|
|
137
|
+
type: 'enum',
|
|
138
|
+
enum: common_1.ColorContext,
|
|
139
|
+
default: common_1.ColorContext.Info,
|
|
140
|
+
nullable: true
|
|
141
|
+
}),
|
|
142
|
+
__metadata("design:type", String)
|
|
143
|
+
], BusinessEvent.prototype, "color", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, typeorm_1.Column)({
|
|
146
|
+
type: 'enum',
|
|
147
|
+
enum: common_1.NotificationChannel,
|
|
148
|
+
default: common_1.NotificationChannel.App
|
|
149
|
+
}),
|
|
150
|
+
__metadata("design:type", String)
|
|
151
|
+
], BusinessEvent.prototype, "channel", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, typeorm_1.Column)({
|
|
154
|
+
nullable: false,
|
|
155
|
+
default: true
|
|
156
|
+
}),
|
|
157
|
+
__metadata("design:type", Boolean)
|
|
158
|
+
], BusinessEvent.prototype, "isPrefered", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, typeorm_1.Column)({
|
|
161
|
+
nullable: true,
|
|
162
|
+
default: null
|
|
163
|
+
}),
|
|
164
|
+
__metadata("design:type", Number)
|
|
165
|
+
], BusinessEvent.prototype, "sort", void 0);
|
|
166
|
+
exports.BusinessEvent = BusinessEvent = BusinessEvent_1 = __decorate([
|
|
167
|
+
(0, typeorm_1.Entity)('systemBusinessEvents'),
|
|
168
|
+
__metadata("design:paramtypes", [Object])
|
|
169
|
+
], BusinessEvent);
|
|
170
|
+
//# sourceMappingURL=business.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"business.entity.js","sourceRoot":"","sources":["../../../src/system/event/business.entity.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Activity, Log, LogType } from '@driveup/common';
|
|
2
|
+
import { TrackableEntity } from '../../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a system log entry for tracking events and activities.
|
|
5
|
+
* Logs record important actions and changes across different entity types
|
|
6
|
+
* (users, companies, agents, etc.) and can be localized for display.
|
|
7
|
+
*
|
|
8
|
+
* @extends TrackableEntity
|
|
9
|
+
*/
|
|
10
|
+
export declare class LogEntity extends TrackableEntity<Log> {
|
|
11
|
+
/**
|
|
12
|
+
* The type of event that is being logged.
|
|
13
|
+
* This can be used to categorize the log entry.
|
|
14
|
+
* @type {LogType}
|
|
15
|
+
*/
|
|
16
|
+
scope: LogType;
|
|
17
|
+
/**
|
|
18
|
+
* The type of event that is being logged.
|
|
19
|
+
* This can be used to categorize the log entry.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @example 'user.identity.nameChanged'
|
|
22
|
+
*/
|
|
23
|
+
event: string;
|
|
24
|
+
/**
|
|
25
|
+
* The id of the entity associated with the log entry.
|
|
26
|
+
* In relation with logType, can be userId, companyId, agentId, studentId, etc.
|
|
27
|
+
* This is used to filter logs by entity.
|
|
28
|
+
* @type {number}
|
|
29
|
+
*/
|
|
30
|
+
entityId: number;
|
|
31
|
+
/**
|
|
32
|
+
* The content of the log entry.
|
|
33
|
+
* This should contain the details of the event being logged.
|
|
34
|
+
* @type {string}
|
|
35
|
+
*/
|
|
36
|
+
content: string;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new LogEntity instance
|
|
39
|
+
* @param props - Partial properties to initialize the entity
|
|
40
|
+
*/
|
|
41
|
+
constructor(props?: Partial<LogEntity>);
|
|
42
|
+
/**
|
|
43
|
+
* Converts the entity to a Log model instance
|
|
44
|
+
* @returns Log model with type, event, content, and creation date
|
|
45
|
+
*/
|
|
46
|
+
toModel(): Log;
|
|
47
|
+
/**
|
|
48
|
+
* Converts the entity to a Log model instance
|
|
49
|
+
* @returns Log model with type, event, content, and creation date
|
|
50
|
+
*/
|
|
51
|
+
toSummary(): Log;
|
|
52
|
+
/**
|
|
53
|
+
* Creates and saves a new log entry
|
|
54
|
+
* @param props - Properties for the new log entry
|
|
55
|
+
* @returns Promise that resolves when the log is saved
|
|
56
|
+
*/
|
|
57
|
+
static from(props: Partial<LogEntity>): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Generates localized content for user log entries
|
|
60
|
+
* @param event - The event identifier
|
|
61
|
+
* @param lang - Language code for translation
|
|
62
|
+
* @param metadata - Optional metadata for i18n interpolation
|
|
63
|
+
* @returns Localized log content string, or empty string if translation not found
|
|
64
|
+
*/
|
|
65
|
+
static toUserContent(event: string, lang: string, metadata?: any): string;
|
|
66
|
+
/**
|
|
67
|
+
* Generates localized content for student log entries
|
|
68
|
+
* @param event - The event identifier
|
|
69
|
+
* @param lang - Language code for translation
|
|
70
|
+
* @param metadata - Optional metadata for i18n interpolation
|
|
71
|
+
* @returns Localized log content string, or empty string if translation not found
|
|
72
|
+
*/
|
|
73
|
+
static toStudentContent(event: string, lang: string, metadata?: any): string;
|
|
74
|
+
/**
|
|
75
|
+
* Generates localized content for agent log entries
|
|
76
|
+
* @param event - The event identifier
|
|
77
|
+
* @param lang - Language code for translation
|
|
78
|
+
* @param metadata - Optional metadata for i18n interpolation
|
|
79
|
+
* @returns Localized log content string, or empty string if translation not found
|
|
80
|
+
*/
|
|
81
|
+
static toAgentContent(event: string, lang: string, metadata?: any): string;
|
|
82
|
+
/**
|
|
83
|
+
* Generates localized content for instructor log entries
|
|
84
|
+
* @param event - The event identifier
|
|
85
|
+
* @param lang - Language code for translation
|
|
86
|
+
* @param metadata - Optional metadata for i18n interpolation
|
|
87
|
+
* @returns Localized log content string, or empty string if translation not found
|
|
88
|
+
*/
|
|
89
|
+
static toInstructorContent(event: string, lang: string, metadata?: any): string;
|
|
90
|
+
/**
|
|
91
|
+
* Generates localized content for company log entries
|
|
92
|
+
* @param event - The event identifier
|
|
93
|
+
* @param lang - Language code for translation
|
|
94
|
+
* @param metadata - Optional metadata for i18n interpolation
|
|
95
|
+
* @returns Localized log content string, or empty string if translation not found
|
|
96
|
+
*/
|
|
97
|
+
static toCompanyContent(event: string, lang: string, metadata?: any): string;
|
|
98
|
+
static toAuthorContent(event: string, lang: string, metadata?: any): string;
|
|
99
|
+
static toTargetContent(event: string, lang: string, metadata?: any): string;
|
|
100
|
+
static toSystemContent(event: string, metadata?: any): string;
|
|
101
|
+
static toJobContent(event: string, metadata?: any): string;
|
|
102
|
+
getActivities(): Promise<Activity[]>;
|
|
103
|
+
}
|