@driveup/schema 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/catalog/addon/addon.entity.d.ts +3 -3
- package/lib/catalog/addon/addon.entity.js +5 -5
- package/lib/catalog/addon/addon.entity.js.map +1 -1
- package/lib/catalog/addon/country.entity.d.ts +3 -3
- package/lib/catalog/addon/country.entity.js +5 -5
- package/lib/catalog/addon/country.entity.js.map +1 -1
- package/lib/catalog/priceplan/priceplan.entity.d.ts +2 -2
- package/lib/catalog/priceplan/priceplan.entity.js +4 -4
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/country.entity.d.ts +4 -4
- package/lib/catalog/product/country.entity.js +9 -9
- package/lib/catalog/product/country.entity.js.map +1 -1
- package/lib/catalog/product/priceplan.entity.d.ts +3 -3
- package/lib/catalog/product/priceplan.entity.js +8 -8
- package/lib/catalog/product/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/product.entity.d.ts +3 -3
- package/lib/catalog/product/product.entity.js +6 -6
- package/lib/catalog/product/product.entity.js.map +1 -1
- package/lib/catalog/program/program.entity.d.ts +1 -1
- package/lib/catalog/program/program.entity.js +5 -5
- package/lib/catalog/program/program.entity.js.map +1 -1
- package/lib/catalog/seed/assets/asset.entity.d.ts +2 -2
- package/lib/catalog/seed/assets/asset.entity.js +4 -4
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
- package/lib/catalog/seed/courses/course.entity.d.ts +3 -3
- package/lib/catalog/seed/courses/course.entity.js +7 -7
- 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 +5 -5
- 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 +5 -5
- package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
- package/lib/catalog/seed/expense/category.entity.d.ts +1 -1
- package/lib/catalog/seed/expense/category.entity.js +4 -4
- package/lib/catalog/seed/expense/category.entity.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/profile/agent/agent.entity.d.ts +12 -4
- package/lib/profile/agent/agent.entity.js +30 -6
- package/lib/profile/agent/agent.entity.js.map +1 -1
- package/lib/profile/agent/asset.entity.d.ts +1 -1
- package/lib/profile/agent/asset.entity.js +2 -2
- package/lib/profile/agent/asset.entity.js.map +1 -1
- package/lib/profile/agent/payout.entity.d.ts +2 -2
- package/lib/profile/agent/payout.entity.js +4 -4
- package/lib/profile/agent/payout.entity.js.map +1 -1
- package/lib/profile/agent/promotion.entity.d.ts +3 -3
- package/lib/profile/agent/promotion.entity.js +6 -6
- package/lib/profile/agent/promotion.entity.js.map +1 -1
- package/lib/profile/company/company.entity.d.ts +39 -8
- package/lib/profile/company/company.entity.js +147 -10
- package/lib/profile/company/company.entity.js.map +1 -1
- package/lib/profile/company/course/course.entity.d.ts +35 -8
- package/lib/profile/company/course/course.entity.js +48 -9
- package/lib/profile/company/course/course.entity.js.map +1 -1
- package/lib/profile/company/course/lesson.entity.d.ts +20 -6
- package/lib/profile/company/course/lesson.entity.js +77 -10
- package/lib/profile/company/course/lesson.entity.js.map +1 -1
- package/lib/profile/company/course/{appointment.entity.d.ts → schedule.entity.d.ts} +78 -8
- package/lib/profile/company/course/{appointment.entity.js → schedule.entity.js} +257 -7
- package/lib/profile/company/course/schedule.entity.js.map +1 -0
- package/lib/profile/company/course/topic.entity.d.ts +6 -2
- package/lib/profile/company/course/topic.entity.js +12 -5
- package/lib/profile/company/course/topic.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/bill.entity.d.ts +3 -3
- package/lib/profile/company/finances/billing/bill.entity.js +5 -5
- 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 +5 -5
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +3 -3
- package/lib/profile/company/finances/billing/transaction.entity.js +6 -6
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/category.entity.d.ts +1 -1
- package/lib/profile/company/finances/expense/category.entity.js +4 -4
- package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/expense.entity.d.ts +6 -2
- package/lib/profile/company/finances/expense/expense.entity.js +32 -4
- package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
- package/lib/profile/company/finances/handover/handover.entity.d.ts +3 -3
- package/lib/profile/company/finances/handover/handover.entity.js +6 -6
- package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/invoice.entity.d.ts +7 -6
- package/lib/profile/company/finances/invoice/invoice.entity.js +9 -8
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/item.entity.d.ts +2 -2
- package/lib/profile/company/finances/invoice/item.entity.js +4 -4
- package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
- package/lib/profile/company/finances/payment/method.entity.d.ts +10 -4
- package/lib/profile/company/finances/payment/method.entity.js +24 -5
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
- package/lib/profile/company/instructor/activity.entity.js.map +1 -1
- package/lib/profile/company/instructor/calendar-state.entity.js.map +1 -1
- package/lib/profile/company/instructor/instructor.entity.d.ts +20 -11
- package/lib/profile/company/instructor/instructor.entity.js +111 -16
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/company/instructor/task.entity.d.ts +2 -1
- package/lib/profile/company/instructor/task.entity.js +9 -4
- package/lib/profile/company/instructor/task.entity.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.d.ts +3 -3
- package/lib/profile/company/medical/examination.entity.js +5 -5
- package/lib/profile/company/medical/examination.entity.js.map +1 -1
- package/lib/profile/company/medical/product.entity.d.ts +4 -4
- package/lib/profile/company/medical/product.entity.js +5 -5
- package/lib/profile/company/medical/product.entity.js.map +1 -1
- package/lib/profile/company/product/addon.entity.d.ts +2 -2
- package/lib/profile/company/product/addon.entity.js +5 -5
- package/lib/profile/company/product/addon.entity.js.map +1 -1
- package/lib/profile/company/product/priceplan.entity.d.ts +4 -3
- package/lib/profile/company/product/priceplan.entity.js +9 -4
- package/lib/profile/company/product/priceplan.entity.js.map +1 -1
- package/lib/profile/company/product/product.entity.d.ts +8 -7
- package/lib/profile/company/product/product.entity.js +19 -9
- package/lib/profile/company/product/product.entity.js.map +1 -1
- package/lib/profile/company/product/vehicle.entity.d.ts +2 -2
- package/lib/profile/company/product/vehicle.entity.js +4 -4
- package/lib/profile/company/product/vehicle.entity.js.map +1 -1
- package/lib/profile/instructor/instructor.entity.d.ts +6 -3
- package/lib/profile/instructor/instructor.entity.js +28 -7
- package/lib/profile/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/student/program/licence/licence.entity.d.ts +3 -3
- package/lib/profile/student/program/licence/licence.entity.js +5 -5
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
- package/lib/profile/student/program/medical/certificate.entity.d.ts +2 -2
- package/lib/profile/student/program/medical/certificate.entity.js +4 -4
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
- package/lib/profile/student/program/medical/examination.entity.d.ts +3 -3
- package/lib/profile/student/program/medical/examination.entity.js +10 -10
- package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
- package/lib/profile/student/program/program.entity.d.ts +11 -6
- package/lib/profile/student/program/program.entity.js +14 -9
- package/lib/profile/student/program/program.entity.js.map +1 -1
- package/lib/profile/student/program/training/appointment.entity.d.ts +23 -9
- package/lib/profile/student/program/training/appointment.entity.js +115 -13
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
- package/lib/profile/student/program/training/exam.entity.d.ts +4 -2
- package/lib/profile/student/program/training/exam.entity.js +12 -4
- package/lib/profile/student/program/training/exam.entity.js.map +1 -1
- package/lib/profile/student/program/training/lesson.entity.d.ts +10 -4
- package/lib/profile/student/program/training/lesson.entity.js +32 -7
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
- package/lib/profile/student/program/training/request.entity.d.ts +6 -3
- package/lib/profile/student/program/training/request.entity.js +26 -5
- package/lib/profile/student/program/training/request.entity.js.map +1 -1
- package/lib/profile/student/program/training/topic.entity.d.ts +14 -3
- package/lib/profile/student/program/training/topic.entity.js +29 -5
- package/lib/profile/student/program/training/topic.entity.js.map +1 -1
- package/lib/profile/student/program/training/training.entity.d.ts +76 -8
- package/lib/profile/student/program/training/training.entity.js +226 -9
- package/lib/profile/student/program/training/training.entity.js.map +1 -1
- package/lib/profile/student/program/training/transaction.entity.d.ts +8 -3
- package/lib/profile/student/program/training/transaction.entity.js +41 -4
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +11 -6
- package/lib/profile/student/student.entity.js +57 -10
- 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 +6 -6
- package/lib/system/campaign/campaign.entity.js.map +1 -1
- package/lib/system/campaign/gifcode.entity.d.ts +2 -2
- package/lib/system/campaign/gifcode.entity.js +6 -6
- package/lib/system/campaign/gifcode.entity.js.map +1 -1
- package/lib/system/country/country.entity.d.ts +7 -5
- package/lib/system/country/country.entity.js +15 -9
- package/lib/system/country/country.entity.js.map +1 -1
- package/lib/system/currency/currency.entity.d.ts +1 -1
- package/lib/system/currency/currency.entity.js +4 -4
- package/lib/system/currency/currency.entity.js.map +1 -1
- package/lib/system/driving/category.entity.d.ts +7 -7
- package/lib/system/driving/category.entity.js +12 -12
- package/lib/system/driving/category.entity.js.map +1 -1
- package/lib/system/driving/vehicle.entity.d.ts +2 -2
- package/lib/system/driving/vehicle.entity.js +4 -4
- package/lib/system/driving/vehicle.entity.js.map +1 -1
- package/lib/system/event/event.entity.d.ts +2 -2
- package/lib/system/event/event.entity.js +4 -4
- package/lib/system/event/event.entity.js.map +1 -1
- package/lib/system/event/log.entity.d.ts +2 -2
- package/lib/system/event/log.entity.js +3 -3
- package/lib/system/event/log.entity.js.map +1 -1
- package/lib/system/policy/policy.entity.d.ts +1 -1
- package/lib/system/policy/policy.entity.js +5 -5
- package/lib/system/policy/policy.entity.js.map +1 -1
- package/lib/system/staff/staff.entity.d.ts +1 -1
- package/lib/system/staff/staff.entity.js +3 -3
- package/lib/system/staff/staff.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/alert.entity.d.ts +3 -2
- package/lib/user/alert.entity.js +11 -4
- package/lib/user/alert.entity.js.map +1 -1
- package/lib/user/blocked.entity.js +2 -2
- package/lib/user/blocked.entity.js.map +1 -1
- package/lib/user/device.entity.d.ts +15 -0
- package/lib/user/device.entity.js +26 -0
- package/lib/user/device.entity.js.map +1 -1
- package/lib/user/notification.entity.d.ts +2 -2
- package/lib/user/notification.entity.js +4 -4
- package/lib/user/notification.entity.js.map +1 -1
- package/lib/user/ticket.entity.d.ts +8 -3
- package/lib/user/ticket.entity.js +11 -4
- package/lib/user/ticket.entity.js.map +1 -1
- package/lib/user/user.entity.d.ts +91 -82
- package/lib/user/user.entity.js +257 -259
- package/lib/user/user.entity.js.map +1 -1
- package/lib/user/verification.entity.js +2 -2
- package/lib/user/verification.entity.js.map +1 -1
- package/lib/utils/activity.helper.d.ts +2 -2
- package/lib/utils/activity.helper.js.map +1 -1
- package/lib/utils/trackable.d.ts +2 -2
- package/lib/utils/trackable.js.map +1 -1
- package/package.json +2 -2
- package/lib/profile/company/course/appointment.entity.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Language, PolicyType, SelectedProfile, StatusType } from '@driveup/shared';
|
|
2
1
|
import { Activity, Alert, Metadata } from '@driveup/common';
|
|
3
|
-
import {
|
|
2
|
+
import { Language, PolicyType, SelectedProfile, StatusType } from '@driveup/shared';
|
|
4
3
|
import { PolicyEntity } from '../system/policy/policy.entity';
|
|
5
4
|
import { TrackableEntity } from '../utils/trackable';
|
|
5
|
+
import { UserEntity } from './user.entity';
|
|
6
6
|
/**
|
|
7
7
|
* Represents a user alert or notification requiring action.
|
|
8
8
|
* Alerts can be system-generated (from policies) or manually created,
|
|
@@ -38,6 +38,7 @@ export declare class UserAlertEntity extends TrackableEntity<Alert> {
|
|
|
38
38
|
* Business event associated with the alert.
|
|
39
39
|
*/
|
|
40
40
|
event: string;
|
|
41
|
+
acknowledged: boolean;
|
|
41
42
|
/**
|
|
42
43
|
* The profile type and company associated with the log entry.
|
|
43
44
|
* This is used to filter logs by profile and/or company.
|
package/lib/user/alert.entity.js
CHANGED
|
@@ -10,14 +10,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UserAlertEntity = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const shared_1 = require("@driveup/shared");
|
|
15
13
|
const common_1 = require("@driveup/common");
|
|
16
|
-
const
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
17
16
|
const policy_entity_1 = require("../system/policy/policy.entity");
|
|
18
17
|
const staff_entity_1 = require("../system/staff/staff.entity");
|
|
19
|
-
const trackable_1 = require("../utils/trackable");
|
|
20
18
|
const activity_helper_1 = require("../utils/activity.helper");
|
|
19
|
+
const trackable_1 = require("../utils/trackable");
|
|
20
|
+
const user_entity_1 = require("./user.entity");
|
|
21
21
|
/**
|
|
22
22
|
* Represents a user alert or notification requiring action.
|
|
23
23
|
* Alerts can be system-generated (from policies) or manually created,
|
|
@@ -139,6 +139,13 @@ __decorate([
|
|
|
139
139
|
}),
|
|
140
140
|
__metadata("design:type", String)
|
|
141
141
|
], UserAlertEntity.prototype, "event", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, typeorm_1.Column)({
|
|
144
|
+
nullable: true,
|
|
145
|
+
default: false
|
|
146
|
+
}),
|
|
147
|
+
__metadata("design:type", Boolean)
|
|
148
|
+
], UserAlertEntity.prototype, "acknowledged", void 0);
|
|
142
149
|
__decorate([
|
|
143
150
|
(0, typeorm_1.Column)({
|
|
144
151
|
type: 'simple-json',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.entity.js","sourceRoot":"","sources":["../../src/user/alert.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"alert.entity.js","sourceRoot":"","sources":["../../src/user/alert.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA4D;AAC5D,4CAAkG;AAClG,qCAAoD;AAEpD,kEAA8D;AAC9D,+DAA2D;AAC3D,8DAAsD;AACtD,kDAAqD;AACrD,+CAA2C;AAE3C;;;;;;;GAOG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAsB;IAyH1D;;;OAGG;IACH,YAAY,KAAgC;QAC3C,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACZ,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5E,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC9C,OAAO,IAAI,cAAK,CAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,UAAU;YACtB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EA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AAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BACjC,IAAI;gDAAC;AAMd;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC7B,IAAI;oDAAC;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;8BAC9B,IAAI;mDAAC;AAMjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wBAAU,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;6CACvB;AAM1B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4BAAY,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;;+CACzB;0BAvHlB,eAAe;IAD3B,IAAA,gBAAM,EAAC,YAAY,CAAC;;GACR,eAAe,CAiM3B"}
|
|
@@ -10,10 +10,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UserBlockedPhoneNumberEntity = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
13
|
const shared_1 = require("@driveup/shared");
|
|
15
|
-
const
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
16
15
|
const activity_helper_1 = require("../utils/activity.helper");
|
|
16
|
+
const trackable_1 = require("../utils/trackable");
|
|
17
17
|
/**
|
|
18
18
|
* Represents a blocked phone number.
|
|
19
19
|
* Used to prevent accounts from being created with specific phone numbers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocked.entity.js","sourceRoot":"","sources":["../../src/user/blocked.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"blocked.entity.js","sourceRoot":"","sources":["../../src/user/blocked.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,4CAA+C;AAC/C,qCAAyC;AAEzC,8DAAsD;AACtD,kDAAqD;AAErD;;;;;;GAMG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,2BAAe;IAkBhE;;;OAGG;IACH,YAAY,KAA6C;QACxD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO;QACN,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;SACjB,CAAA;IACF,CAAC;IAED;;;OAGG;IACH,SAAS;QACR,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa;QAClB,MAAM,UAAU,GAAe,EAAE,CAAC;QAClC,UAAU,CAAC,IAAI,CAAC,MAAM,IAAA,4BAAU,EAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,qBAAY,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9E,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;CACD,CAAA;AAnDY,oEAA4B;AAMxC;IADC,IAAA,gBAAM,GAAE;;2DACK;AAUd;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;8BACK,IAAI;2DAAC;uCAhBA,4BAA4B;IADxC,IAAA,gBAAM,EAAC,yBAAyB,CAAC;;GACrB,4BAA4B,CAmDxC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SelectedProfile } from '@driveup/shared';
|
|
1
2
|
import { Activity, Device } from '@driveup/common';
|
|
2
3
|
import { UserEntity } from './user.entity';
|
|
3
4
|
import { TrackableEntity } from '../utils/trackable';
|
|
@@ -17,6 +18,17 @@ export declare class UserDeviceEntity extends TrackableEntity<Device> {
|
|
|
17
18
|
* Global unique identifier for the device
|
|
18
19
|
*/
|
|
19
20
|
guid: string;
|
|
21
|
+
/**
|
|
22
|
+
* The last selected profile (Student, Agent, or Company)
|
|
23
|
+
* The same property is part of user entity, but this property is priorized over user entity
|
|
24
|
+
* Used to remember which profile the user last used when logging in
|
|
25
|
+
* Update this property only when user explicitly switches profile
|
|
26
|
+
*/
|
|
27
|
+
selectedProfile: SelectedProfile;
|
|
28
|
+
/**
|
|
29
|
+
* Timestamp of the user's last activity in the system
|
|
30
|
+
*/
|
|
31
|
+
lastActivity: Date;
|
|
20
32
|
/**
|
|
21
33
|
* FCM token or device signature for push notifications
|
|
22
34
|
*/
|
|
@@ -64,6 +76,9 @@ export declare class UserDeviceEntity extends TrackableEntity<Device> {
|
|
|
64
76
|
* @returns Model instance (same as toModel())
|
|
65
77
|
*/
|
|
66
78
|
toSummary(): Device;
|
|
79
|
+
getSelectedProfile(): SelectedProfile;
|
|
80
|
+
selectProfile(profile: SelectedProfile): Promise<void>;
|
|
81
|
+
updateActivity(): Promise<void>;
|
|
67
82
|
/**
|
|
68
83
|
* Retrieves all activity records for this device
|
|
69
84
|
* @returns Array of Activity objects
|
|
@@ -62,6 +62,17 @@ let UserDeviceEntity = class UserDeviceEntity extends trackable_1.TrackableEntit
|
|
|
62
62
|
signature: this.signature,
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
+
getSelectedProfile() {
|
|
66
|
+
return this.selectedProfile;
|
|
67
|
+
}
|
|
68
|
+
async selectProfile(profile) {
|
|
69
|
+
this.selectedProfile = profile;
|
|
70
|
+
await this.save();
|
|
71
|
+
}
|
|
72
|
+
async updateActivity() {
|
|
73
|
+
this.lastActivity = new Date();
|
|
74
|
+
await this.save();
|
|
75
|
+
}
|
|
65
76
|
/**
|
|
66
77
|
* Retrieves all activity records for this device
|
|
67
78
|
* @returns Array of Activity objects
|
|
@@ -85,6 +96,21 @@ __decorate([
|
|
|
85
96
|
}),
|
|
86
97
|
__metadata("design:type", String)
|
|
87
98
|
], UserDeviceEntity.prototype, "guid", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)({
|
|
101
|
+
type: 'simple-json',
|
|
102
|
+
nullable: true,
|
|
103
|
+
default: null
|
|
104
|
+
}),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], UserDeviceEntity.prototype, "selectedProfile", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, typeorm_1.Column)({
|
|
109
|
+
nullable: true,
|
|
110
|
+
default: null
|
|
111
|
+
}),
|
|
112
|
+
__metadata("design:type", Date)
|
|
113
|
+
], UserDeviceEntity.prototype, "lastActivity", void 0);
|
|
88
114
|
__decorate([
|
|
89
115
|
(0, typeorm_1.Column)({
|
|
90
116
|
nullable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.entity.js","sourceRoot":"","sources":["../../src/user/device.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AAAA,CAAC;AACrD,
|
|
1
|
+
{"version":3,"file":"device.entity.js","sourceRoot":"","sources":["../../src/user/device.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AAAA,CAAC;AACrD,4CAAgE;AAChE,4CAAmD;AACnD,+CAA0C;AAC1C,kDAAqD;AACrD,8DAAsD;AAEtD;;;;;;GAMG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,2BAAuB;IA4G5D;;;OAGG;IACH,YAAY,KAAiC;QAC5C,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,OAAO;QACN,OAAO,IAAI,eAAM,CAAC;YACjB,EAAE,EAAE,I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AAC,OAAO,CAAC;;8CACxB;2BA1Gd,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,aAAa,CAAC;;GACT,gBAAgB,CA4K5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ColorContext, NotificationChannel, SelectedProfile } from '@driveup/shared';
|
|
2
1
|
import { Activity, Notification, Person } from '@driveup/common';
|
|
3
|
-
import {
|
|
2
|
+
import { ColorContext, NotificationChannel, SelectedProfile } from '@driveup/shared';
|
|
4
3
|
import { TrackableEntity } from '../utils/trackable';
|
|
4
|
+
import { UserEntity } from './user.entity';
|
|
5
5
|
/**
|
|
6
6
|
* Represents a user notification sent through various channels.
|
|
7
7
|
* Notifications inform users about events, updates, or actions required.
|
|
@@ -10,12 +10,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UserNotificationEntity = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const shared_1 = require("@driveup/shared");
|
|
15
13
|
const common_1 = require("@driveup/common");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
18
16
|
const activity_helper_1 = require("../utils/activity.helper");
|
|
17
|
+
const trackable_1 = require("../utils/trackable");
|
|
18
|
+
const user_entity_1 = require("./user.entity");
|
|
19
19
|
/**
|
|
20
20
|
* Represents a user notification sent through various channels.
|
|
21
21
|
* Notifications inform users about events, updates, or actions required.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.entity.js","sourceRoot":"","sources":["../../src/user/notification.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"notification.entity.js","sourceRoot":"","sources":["../../src/user/notification.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,4CAAmG;AACnG,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;AAUb;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;8BACM,eAAM;sDAAC;AAUf;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;8BACM,eAAM;sDAAC;AAMf;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wBAAU,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC;;oDAC9B;iCAxHd,sBAAsB;IADlC,IAAA,gBAAM,EAAC,mBAAmB,CAAC;;GACf,sBAAsB,CAoKlC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { UserEntity } from './user.entity';
|
|
1
|
+
import { Activity, Asset, Person, Ticket } from '@driveup/common';
|
|
2
|
+
import { PriorityType, StatusType, TicketType } from '@driveup/shared';
|
|
4
3
|
import { TrackableEntity } from '../utils/trackable';
|
|
4
|
+
import { UserEntity } from './user.entity';
|
|
5
5
|
/**
|
|
6
6
|
* Represents a support ticket created by or for a user.
|
|
7
7
|
* Tickets track customer support requests, account recovery, and other issues.
|
|
@@ -46,6 +46,11 @@ export declare class UserTicketEntity extends TrackableEntity<Ticket> {
|
|
|
46
46
|
* Files or images attached to the ticket
|
|
47
47
|
*/
|
|
48
48
|
attachments: Asset[];
|
|
49
|
+
/**
|
|
50
|
+
* For tickets of type enterprise plan request.
|
|
51
|
+
* Number of team members the company will have.
|
|
52
|
+
*/
|
|
53
|
+
teamMembers: number;
|
|
49
54
|
/**
|
|
50
55
|
* ID of the staff member who completed the ticket
|
|
51
56
|
*/
|
|
@@ -10,13 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UserTicketEntity = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const shared_1 = require("@driveup/shared");
|
|
15
13
|
const common_1 = require("@driveup/common");
|
|
16
|
-
const
|
|
14
|
+
const shared_1 = require("@driveup/shared");
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
17
16
|
const staff_entity_1 = require("../system/staff/staff.entity");
|
|
18
|
-
const trackable_1 = require("../utils/trackable");
|
|
19
17
|
const activity_helper_1 = require("../utils/activity.helper");
|
|
18
|
+
const trackable_1 = require("../utils/trackable");
|
|
19
|
+
const user_entity_1 = require("./user.entity");
|
|
20
20
|
/**
|
|
21
21
|
* Represents a support ticket created by or for a user.
|
|
22
22
|
* Tickets track customer support requests, account recovery, and other issues.
|
|
@@ -144,6 +144,13 @@ __decorate([
|
|
|
144
144
|
}),
|
|
145
145
|
__metadata("design:type", Array)
|
|
146
146
|
], UserTicketEntity.prototype, "attachments", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, typeorm_1.Column)({
|
|
149
|
+
nullable: true,
|
|
150
|
+
default: null
|
|
151
|
+
}),
|
|
152
|
+
__metadata("design:type", Number)
|
|
153
|
+
], UserTicketEntity.prototype, "teamMembers", void 0);
|
|
147
154
|
__decorate([
|
|
148
155
|
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
149
156
|
__metadata("design:type", Number)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticket.entity.js","sourceRoot":"","sources":["../../src/user/ticket.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"ticket.entity.js","sourceRoot":"","sources":["../../src/user/ticket.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAkE;AAClE,4CAAqF;AACrF,qCAAoD;AAEpD,+DAA2D;AAC3D,8DAAsD;AACtD,kDAAqD;AACrD,+CAA2C;AAE3C;;;;;;GAMG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,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I,EAAE,CAAC;;oDACvB;AAMnB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC9B,IAAI;oDAAC;AAMjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wBAAU,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;8CACxB;2BAlId,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,aAAa,CAAC;;GACT,gBAAgB,CAsL5B"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { Activity, Address, Person, User } from '@driveup/common';
|
|
2
|
+
import { AccountStatus, Language, SelectedProfile } from '@driveup/shared';
|
|
1
3
|
import { EntityManager } from 'typeorm';
|
|
2
|
-
import {
|
|
3
|
-
import { User, Activity, Address, Person } from '@driveup/common';
|
|
4
|
-
import { CountryEntity } from '../system/country/country.entity';
|
|
4
|
+
import { AgentEntity } from '../profile/agent/agent.entity';
|
|
5
5
|
import { CompanyEntity } from '../profile/company/company.entity';
|
|
6
|
-
import { InstructorEntity } from '../profile/instructor/instructor.entity';
|
|
7
6
|
import { CompanyInstructorEntity } from '../profile/company/instructor/instructor.entity';
|
|
8
|
-
import {
|
|
7
|
+
import { InstructorEntity } from '../profile/instructor/instructor.entity';
|
|
9
8
|
import { StudentEntity } from '../profile/student/student.entity';
|
|
10
|
-
import {
|
|
9
|
+
import { CountryEntity } from '../system/country/country.entity';
|
|
10
|
+
import { TrackableEntity } from '../utils/trackable';
|
|
11
|
+
import { UserAlertEntity } from './alert.entity';
|
|
11
12
|
import { UserDeviceEntity } from './device.entity';
|
|
13
|
+
import { UserNotificationEntity } from './notification.entity';
|
|
12
14
|
import { UserTicketEntity } from './ticket.entity';
|
|
13
|
-
import { UserAlertEntity } from './alert.entity';
|
|
14
|
-
import { TrackableEntity } from '../utils/trackable';
|
|
15
15
|
/**
|
|
16
16
|
* User entity representing a user in the system.
|
|
17
17
|
* Extends TrackableEntity to track creation and update information.
|
|
@@ -53,10 +53,6 @@ export declare class UserEntity extends TrackableEntity<User> {
|
|
|
53
53
|
* Physical address of the user
|
|
54
54
|
*/
|
|
55
55
|
address: Address;
|
|
56
|
-
/**
|
|
57
|
-
* The currently active/selected profile (Student, Agent, or Company)
|
|
58
|
-
*/
|
|
59
|
-
selectedProfile: SelectedProfile;
|
|
60
56
|
/**
|
|
61
57
|
* Firebase Cloud Messaging tokens associated with the user's devices
|
|
62
58
|
* Used for sending push notifications to the user's devices
|
|
@@ -72,6 +68,13 @@ export declare class UserEntity extends TrackableEntity<User> {
|
|
|
72
68
|
* Timezone of the user (default: 'Europe/Zurich')
|
|
73
69
|
*/
|
|
74
70
|
timezone: string;
|
|
71
|
+
/**
|
|
72
|
+
* The last selected profile (Student, Agent, or Company)
|
|
73
|
+
* The same property is part of user device an is priorized over this one
|
|
74
|
+
* Used to remember which profile the user last used when logging in
|
|
75
|
+
* Update this property only when user explicitly switches profile
|
|
76
|
+
*/
|
|
77
|
+
selectedProfile: SelectedProfile;
|
|
75
78
|
/**
|
|
76
79
|
* Timestamp of the user's last activity in the system
|
|
77
80
|
*/
|
|
@@ -129,118 +132,124 @@ export declare class UserEntity extends TrackableEntity<User> {
|
|
|
129
132
|
*/
|
|
130
133
|
toPerson(): Person;
|
|
131
134
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* @returns The updated user entity
|
|
135
|
-
*/
|
|
136
|
-
updateActivity(): Promise<UserEntity>;
|
|
137
|
-
/**
|
|
138
|
-
* Check if user last activity is overdated
|
|
139
|
-
* @returns
|
|
135
|
+
* Remove suffix from phone number if the account is closed
|
|
136
|
+
* @returns phone number that should be returned to ui
|
|
140
137
|
*/
|
|
141
|
-
|
|
138
|
+
getPhone(): string;
|
|
139
|
+
hasPushNotificationsEnabled(): boolean;
|
|
140
|
+
/**************************** profiles ****************************/
|
|
142
141
|
/**
|
|
143
|
-
* Retrieves the user's student profile if it exists
|
|
144
|
-
*
|
|
142
|
+
* Retrieves the user's student profile if it exists
|
|
143
|
+
* User can have only one student profile which can be active or pending
|
|
144
|
+
* @returns The student profile
|
|
145
145
|
*/
|
|
146
|
-
|
|
146
|
+
getStudent(manager?: EntityManager): Promise<StudentEntity>;
|
|
147
147
|
/**
|
|
148
|
-
* Retrieves the user's
|
|
149
|
-
*
|
|
148
|
+
* Retrieves the user's agent profile if it exists
|
|
149
|
+
* User can have only one agent profile which can be active or pending
|
|
150
|
+
* @returns The agent profile
|
|
150
151
|
*/
|
|
151
|
-
|
|
152
|
+
getAgent(manager?: EntityManager): Promise<AgentEntity>;
|
|
152
153
|
/**
|
|
153
|
-
* Retrieves the user's
|
|
154
|
-
*
|
|
154
|
+
* Retrieves the user's instructor profile if it exists
|
|
155
|
+
* User can have only one instructor profile which can be active or pending
|
|
156
|
+
* @returns The agent profile
|
|
155
157
|
*/
|
|
156
|
-
|
|
158
|
+
getInstructor(manager?: EntityManager): Promise<InstructorEntity>;
|
|
157
159
|
/**
|
|
158
|
-
*
|
|
159
|
-
* @
|
|
160
|
+
* Get user company instructor profile
|
|
161
|
+
* @param company Company entity (required)
|
|
162
|
+
* @param manager EntityManager
|
|
163
|
+
* @returns CompanyInstructorEntity
|
|
160
164
|
*/
|
|
161
|
-
|
|
165
|
+
getCompanyInstructor(company: CompanyEntity, manager?: EntityManager): Promise<CompanyInstructorEntity>;
|
|
166
|
+
getCompanyInstructorById(id?: number, manager?: EntityManager): Promise<CompanyInstructorEntity>;
|
|
167
|
+
/************************* company profile *************************/
|
|
168
|
+
getCompany(companyId: number): Promise<CompanyEntity>;
|
|
162
169
|
/**
|
|
163
170
|
* Checks if the user belongs to a specific company.
|
|
164
171
|
*
|
|
165
172
|
* @param companyId - The ID of the company to check against.
|
|
173
|
+
* @param status - (Optional) The account status to filter by. Defaults to `AccountStatus.Active`.
|
|
166
174
|
* @returns A promise that resolves to `true` if the user belongs to the specified company, otherwise `false`.
|
|
167
175
|
*/
|
|
168
|
-
belongsToCompany(companyId: number): Promise<boolean>;
|
|
169
|
-
|
|
170
|
-
* Checks if the user has at least one active profile (student, agent, or instructor)
|
|
171
|
-
* @returns True if the user has an active profile, false otherwise
|
|
172
|
-
*/
|
|
173
|
-
hasActiveProfile(manager?: EntityManager): Promise<boolean>;
|
|
176
|
+
belongsToCompany(companyId: number, status?: AccountStatus): Promise<boolean>;
|
|
177
|
+
/************************* profile handlers *************************/
|
|
174
178
|
/**
|
|
175
|
-
*
|
|
176
|
-
* Used when the user removes their currently selected profile
|
|
177
|
-
* @returns Object containing profile type and ID, or null if no active profile exists
|
|
179
|
+
* Delete any pending profiles of the account
|
|
178
180
|
*/
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
id: number;
|
|
182
|
-
}>;
|
|
181
|
+
deletePendingProfiles(): Promise<void>;
|
|
182
|
+
/***************************** profile *****************************/
|
|
183
183
|
/**
|
|
184
|
-
*
|
|
185
|
-
* @
|
|
184
|
+
*
|
|
185
|
+
* @param device UserDeviceEntity
|
|
186
|
+
* @returns SelectedProfile
|
|
186
187
|
*/
|
|
187
|
-
getSelectedProfile():
|
|
188
|
+
getSelectedProfile(device?: UserDeviceEntity): SelectedProfile;
|
|
188
189
|
/**
|
|
189
|
-
*
|
|
190
|
-
* @
|
|
190
|
+
* Reset selected profile for the user
|
|
191
|
+
* @param guid
|
|
192
|
+
* @returns UserEntity
|
|
191
193
|
*/
|
|
192
|
-
|
|
194
|
+
resetSelectedProfile(guid?: string): Promise<this>;
|
|
193
195
|
/**
|
|
194
|
-
*
|
|
195
|
-
* @
|
|
196
|
+
* Select student profile for the user
|
|
197
|
+
* @param student
|
|
198
|
+
* @param guid
|
|
199
|
+
* @returns UserEntity
|
|
196
200
|
*/
|
|
197
|
-
|
|
201
|
+
selectStudent(student: StudentEntity, guid?: string): Promise<this>;
|
|
198
202
|
/**
|
|
199
|
-
*
|
|
200
|
-
* @
|
|
203
|
+
* Select agent profile for the user
|
|
204
|
+
* @param agent
|
|
205
|
+
* @param guid
|
|
206
|
+
* @returns UserEntity
|
|
201
207
|
*/
|
|
202
|
-
|
|
208
|
+
selectAgent(agent: AgentEntity, guid?: string): Promise<this>;
|
|
203
209
|
/**
|
|
204
|
-
*
|
|
205
|
-
* @
|
|
210
|
+
* Select company instructor profile for the user
|
|
211
|
+
* @param instructor
|
|
212
|
+
* @param guid
|
|
213
|
+
* @returns UserEntity
|
|
206
214
|
*/
|
|
207
|
-
|
|
215
|
+
selectInstructor(instructor: CompanyInstructorEntity, guid?: string): Promise<this>;
|
|
208
216
|
/**
|
|
209
|
-
*
|
|
210
|
-
* @param
|
|
211
|
-
* @returns
|
|
217
|
+
* Check if user has at least one active profile
|
|
218
|
+
* @param manager EntityManager
|
|
219
|
+
* @returns boolean
|
|
212
220
|
*/
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Remove suffix from phone number if the account is closed
|
|
216
|
-
* @returns phone number that should be returned to ui
|
|
217
|
-
*/
|
|
218
|
-
getPhone(): string;
|
|
219
|
-
hasPushNotificationsEnabled(): boolean;
|
|
221
|
+
hasActiveProfile(manager?: EntityManager): Promise<boolean>;
|
|
220
222
|
/**
|
|
221
|
-
*
|
|
223
|
+
* Select next active profile for the user
|
|
224
|
+
* @param guid Device guid
|
|
225
|
+
* @returns true if a profile was selected, false otherwise
|
|
222
226
|
*/
|
|
223
|
-
|
|
227
|
+
selectNextActiveProfile(guid?: string): Promise<boolean>;
|
|
224
228
|
/**
|
|
225
|
-
*
|
|
226
|
-
* @param
|
|
229
|
+
* Helper to select profile and update device if guid provided
|
|
230
|
+
* @param profile
|
|
231
|
+
* @param guid
|
|
232
|
+
* @returns UserEntity
|
|
227
233
|
*/
|
|
228
|
-
|
|
234
|
+
private selectProfile;
|
|
235
|
+
/***************************** activities *****************************/
|
|
229
236
|
/**
|
|
230
|
-
*
|
|
237
|
+
* Check if user last activity is overdated
|
|
238
|
+
* @returns
|
|
231
239
|
*/
|
|
232
|
-
|
|
240
|
+
isActivityOverdated(days?: number): boolean;
|
|
233
241
|
/**
|
|
234
|
-
*
|
|
242
|
+
* Updates the last activity timestamp of the user to the current date and saves it.
|
|
243
|
+
* Used to track when the user was last active in the system.
|
|
244
|
+
* @returns The updated user entity
|
|
235
245
|
*/
|
|
236
|
-
|
|
246
|
+
updateActivity(): Promise<UserEntity>;
|
|
237
247
|
/**
|
|
238
248
|
* Retrieves all tracked activities for this user (creation and update timestamps)
|
|
239
249
|
* @returns Array of Activity objects filtered to exclude null values
|
|
240
250
|
*/
|
|
241
251
|
getActivities(): Promise<Activity[]>;
|
|
242
|
-
|
|
243
|
-
getLanguageName(): string;
|
|
252
|
+
/***************************** logs *****************************/
|
|
244
253
|
/**
|
|
245
254
|
* Log user event
|
|
246
255
|
* @param event Event type
|