@driveup/schema 0.2.6 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/catalog/addon/addon.entity.d.ts +3 -3
- package/lib/catalog/addon/addon.entity.js +7 -7
- package/lib/catalog/addon/addon.entity.js.map +1 -1
- package/lib/catalog/addon/country.entity.d.ts +4 -4
- package/lib/catalog/addon/country.entity.js +5 -6
- package/lib/catalog/addon/country.entity.js.map +1 -1
- package/lib/catalog/priceplan/priceplan.entity.d.ts +8 -3
- package/lib/catalog/priceplan/priceplan.entity.js +14 -7
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/country.entity.d.ts +6 -6
- package/lib/catalog/product/country.entity.js +9 -10
- package/lib/catalog/product/country.entity.js.map +1 -1
- package/lib/catalog/product/priceplan.entity.d.ts +9 -4
- package/lib/catalog/product/priceplan.entity.js +19 -9
- package/lib/catalog/product/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/product.entity.d.ts +3 -3
- package/lib/catalog/product/product.entity.js +8 -8
- package/lib/catalog/product/product.entity.js.map +1 -1
- package/lib/catalog/program/program.entity.d.ts +2 -2
- package/lib/catalog/program/program.entity.js +7 -7
- package/lib/catalog/program/program.entity.js.map +1 -1
- package/lib/catalog/seed/assets/asset.entity.d.ts +2 -2
- package/lib/catalog/seed/assets/asset.entity.js +6 -6
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
- package/lib/catalog/seed/courses/course.entity.d.ts +4 -4
- package/lib/catalog/seed/courses/course.entity.js +9 -9
- package/lib/catalog/seed/courses/course.entity.js.map +1 -1
- package/lib/catalog/seed/courses/lesson.entity.d.ts +3 -3
- package/lib/catalog/seed/courses/lesson.entity.js +7 -7
- package/lib/catalog/seed/courses/lesson.entity.js.map +1 -1
- package/lib/catalog/seed/courses/topic.entity.d.ts +3 -3
- package/lib/catalog/seed/courses/topic.entity.js +8 -8
- package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
- package/lib/catalog/seed/expense/category.entity.d.ts +2 -2
- package/lib/catalog/seed/expense/category.entity.js +6 -6
- package/lib/catalog/seed/expense/category.entity.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/profile/agent/agent.entity.d.ts +13 -4
- package/lib/profile/agent/agent.entity.js +46 -20
- package/lib/profile/agent/agent.entity.js.map +1 -1
- package/lib/profile/agent/asset.entity.d.ts +1 -1
- package/lib/profile/agent/asset.entity.js +2 -2
- package/lib/profile/agent/asset.entity.js.map +1 -1
- package/lib/profile/agent/payout.entity.d.ts +3 -3
- package/lib/profile/agent/payout.entity.js +6 -6
- package/lib/profile/agent/payout.entity.js.map +1 -1
- package/lib/profile/agent/promotion.entity.d.ts +3 -3
- package/lib/profile/agent/promotion.entity.js +6 -6
- package/lib/profile/agent/promotion.entity.js.map +1 -1
- package/lib/profile/company/company.entity.d.ts +80 -9
- package/lib/profile/company/company.entity.js +246 -36
- package/lib/profile/company/company.entity.js.map +1 -1
- package/lib/profile/company/course/appointment.entity.d.ts +73 -4
- package/lib/profile/company/course/appointment.entity.js +247 -0
- package/lib/profile/company/course/appointment.entity.js.map +1 -1
- package/lib/profile/company/course/course.entity.d.ts +41 -8
- package/lib/profile/company/course/course.entity.js +58 -12
- package/lib/profile/company/course/course.entity.js.map +1 -1
- package/lib/profile/company/course/lesson.entity.d.ts +30 -7
- package/lib/profile/company/course/lesson.entity.js +93 -12
- package/lib/profile/company/course/lesson.entity.js.map +1 -1
- package/lib/profile/company/course/schedule.entity.d.ts +276 -0
- package/lib/profile/company/course/schedule.entity.js +744 -0
- package/lib/profile/company/course/schedule.entity.js.map +1 -0
- package/lib/profile/company/course/topic.entity.d.ts +9 -4
- package/lib/profile/company/course/topic.entity.js +14 -7
- package/lib/profile/company/course/topic.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/bill.entity.d.ts +9 -2
- package/lib/profile/company/finances/billing/bill.entity.js +38 -4
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/item.entity.d.ts +8 -3
- package/lib/profile/company/finances/billing/item.entity.js +10 -6
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +7 -5
- package/lib/profile/company/finances/billing/transaction.entity.js +6 -6
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/category.entity.d.ts +1 -1
- package/lib/profile/company/finances/expense/category.entity.js +4 -4
- package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/expense.entity.d.ts +6 -2
- package/lib/profile/company/finances/expense/expense.entity.js +32 -4
- package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
- package/lib/profile/company/finances/handover/handover.entity.d.ts +3 -3
- package/lib/profile/company/finances/handover/handover.entity.js +6 -6
- package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/invoice.entity.d.ts +8 -7
- package/lib/profile/company/finances/invoice/invoice.entity.js +15 -14
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/item.entity.d.ts +2 -2
- package/lib/profile/company/finances/invoice/item.entity.js +4 -4
- package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
- package/lib/profile/company/finances/payment/method.entity.d.ts +24 -4
- package/lib/profile/company/finances/payment/method.entity.js +40 -5
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
- package/lib/profile/company/instructor/activity.entity.js.map +1 -1
- package/lib/profile/company/instructor/calendar-state.entity.js.map +1 -1
- package/lib/profile/company/instructor/instructor.entity.d.ts +34 -17
- package/lib/profile/company/instructor/instructor.entity.js +143 -25
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/company/instructor/task.entity.d.ts +2 -1
- package/lib/profile/company/instructor/task.entity.js +9 -4
- package/lib/profile/company/instructor/task.entity.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.d.ts +4 -4
- package/lib/profile/company/medical/examination.entity.js +6 -6
- package/lib/profile/company/medical/examination.entity.js.map +1 -1
- package/lib/profile/company/medical/product.entity.d.ts +4 -5
- package/lib/profile/company/medical/product.entity.js +13 -14
- package/lib/profile/company/medical/product.entity.js.map +1 -1
- package/lib/profile/company/product/addon.entity.d.ts +3 -3
- package/lib/profile/company/product/addon.entity.js +6 -7
- package/lib/profile/company/product/addon.entity.js.map +1 -1
- package/lib/profile/company/product/priceplan.entity.d.ts +15 -13
- package/lib/profile/company/product/priceplan.entity.js +20 -16
- package/lib/profile/company/product/priceplan.entity.js.map +1 -1
- package/lib/profile/company/product/product.entity.d.ts +34 -8
- package/lib/profile/company/product/product.entity.js +70 -12
- package/lib/profile/company/product/product.entity.js.map +1 -1
- package/lib/profile/company/product/vehicle.entity.d.ts +2 -2
- package/lib/profile/company/product/vehicle.entity.js +4 -4
- package/lib/profile/company/product/vehicle.entity.js.map +1 -1
- package/lib/profile/instructor/instructor.entity.d.ts +6 -3
- package/lib/profile/instructor/instructor.entity.js +31 -9
- package/lib/profile/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/student/program/licence/licence.entity.d.ts +13 -5
- package/lib/profile/student/program/licence/licence.entity.js +19 -8
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
- package/lib/profile/student/program/medical/certificate.entity.d.ts +3 -3
- package/lib/profile/student/program/medical/certificate.entity.js +6 -6
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
- package/lib/profile/student/program/medical/examination.entity.d.ts +4 -4
- package/lib/profile/student/program/medical/examination.entity.js +14 -14
- package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
- package/lib/profile/student/program/program.entity.d.ts +4 -4
- package/lib/profile/student/program/program.entity.js +8 -13
- package/lib/profile/student/program/program.entity.js.map +1 -1
- package/lib/profile/student/program/training/appointment.entity.d.ts +32 -9
- package/lib/profile/student/program/training/appointment.entity.js +144 -21
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
- package/lib/profile/student/program/training/exam.entity.d.ts +9 -2
- package/lib/profile/student/program/training/exam.entity.js +28 -12
- package/lib/profile/student/program/training/exam.entity.js.map +1 -1
- package/lib/profile/student/program/training/lesson.entity.d.ts +8 -3
- package/lib/profile/student/program/training/lesson.entity.js +28 -6
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
- package/lib/profile/student/program/training/request.entity.d.ts +6 -3
- package/lib/profile/student/program/training/request.entity.js +26 -5
- package/lib/profile/student/program/training/request.entity.js.map +1 -1
- package/lib/profile/student/program/training/topic.entity.d.ts +16 -4
- package/lib/profile/student/program/training/topic.entity.js +36 -9
- package/lib/profile/student/program/training/topic.entity.js.map +1 -1
- package/lib/profile/student/program/training/training.entity.d.ts +50 -6
- package/lib/profile/student/program/training/training.entity.js +217 -33
- package/lib/profile/student/program/training/training.entity.js.map +1 -1
- package/lib/profile/student/program/training/transaction.entity.d.ts +8 -3
- package/lib/profile/student/program/training/transaction.entity.js +43 -6
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +11 -6
- package/lib/profile/student/student.entity.js +59 -11
- package/lib/profile/student/student.entity.js.map +1 -1
- package/lib/system/campaign/campaign.entity.d.ts +4 -4
- package/lib/system/campaign/campaign.entity.js +10 -10
- package/lib/system/campaign/campaign.entity.js.map +1 -1
- package/lib/system/campaign/gifcode.entity.d.ts +4 -4
- package/lib/system/campaign/gifcode.entity.js +8 -8
- package/lib/system/campaign/gifcode.entity.js.map +1 -1
- package/lib/system/country/country.entity.d.ts +8 -6
- package/lib/system/country/country.entity.js +15 -9
- package/lib/system/country/country.entity.js.map +1 -1
- package/lib/system/currency/currency.entity.d.ts +1 -1
- package/lib/system/currency/currency.entity.js +4 -4
- package/lib/system/currency/currency.entity.js.map +1 -1
- package/lib/system/driving/category.entity.d.ts +7 -7
- package/lib/system/driving/category.entity.js +14 -14
- package/lib/system/driving/category.entity.js.map +1 -1
- package/lib/system/driving/vehicle.entity.d.ts +2 -2
- package/lib/system/driving/vehicle.entity.js +4 -4
- package/lib/system/driving/vehicle.entity.js.map +1 -1
- package/lib/system/event/event.entity.d.ts +2 -2
- package/lib/system/event/event.entity.js +4 -4
- package/lib/system/event/event.entity.js.map +1 -1
- package/lib/system/event/log.entity.d.ts +2 -2
- package/lib/system/event/log.entity.js +3 -3
- package/lib/system/event/log.entity.js.map +1 -1
- package/lib/system/ical/ical.entity.d.ts +63 -0
- package/lib/system/ical/ical.entity.js +70 -0
- package/lib/system/ical/ical.entity.js.map +1 -0
- package/lib/system/policy/policy.entity.d.ts +2 -2
- package/lib/system/policy/policy.entity.js +8 -8
- package/lib/system/policy/policy.entity.js.map +1 -1
- package/lib/system/staff/staff.entity.d.ts +1 -1
- package/lib/system/staff/staff.entity.js +5 -4
- package/lib/system/staff/staff.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/alert.entity.d.ts +4 -3
- package/lib/user/alert.entity.js +11 -4
- package/lib/user/alert.entity.js.map +1 -1
- package/lib/user/blocked.entity.js +2 -2
- package/lib/user/blocked.entity.js.map +1 -1
- package/lib/user/device.entity.d.ts +17 -2
- package/lib/user/device.entity.js +29 -3
- package/lib/user/device.entity.js.map +1 -1
- package/lib/user/notification.entity.d.ts +3 -3
- package/lib/user/notification.entity.js +8 -8
- package/lib/user/notification.entity.js.map +1 -1
- package/lib/user/ticket.entity.d.ts +8 -3
- package/lib/user/ticket.entity.js +16 -7
- package/lib/user/ticket.entity.js.map +1 -1
- package/lib/user/user.entity.d.ts +101 -89
- package/lib/user/user.entity.js +272 -270
- package/lib/user/user.entity.js.map +1 -1
- package/lib/user/verification.entity.js +2 -2
- package/lib/user/verification.entity.js.map +1 -1
- package/lib/utils/activity.helper.d.ts +2 -2
- package/lib/utils/activity.helper.js.map +1 -1
- package/lib/utils/trackable.d.ts +13 -2
- package/lib/utils/trackable.js +55 -0
- package/lib/utils/trackable.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { UserEntity } from './user.entity';
|
|
1
|
+
import { Activity, Alert } from '@driveup/common';
|
|
2
|
+
import { Language, Metadata, 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,4CAAkD;AAClD,4CAA4G;AAC5G,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,IA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QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;iDACmB;AAMrB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,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';
|
|
@@ -18,9 +19,20 @@ export declare class UserDeviceEntity extends TrackableEntity<Device> {
|
|
|
18
19
|
*/
|
|
19
20
|
guid: string;
|
|
20
21
|
/**
|
|
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
|
|
22
26
|
*/
|
|
23
|
-
|
|
27
|
+
selectedProfile: SelectedProfile;
|
|
28
|
+
/**
|
|
29
|
+
* Timestamp of the user's last activity in the system
|
|
30
|
+
*/
|
|
31
|
+
lastActivity: Date;
|
|
32
|
+
/**
|
|
33
|
+
* FCM token of device for push notifications
|
|
34
|
+
*/
|
|
35
|
+
token: string;
|
|
24
36
|
/**
|
|
25
37
|
* Device model (e.g., "iPhone 12", "Samsung Galaxy S21")
|
|
26
38
|
*/
|
|
@@ -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
|
|
@@ -41,7 +41,7 @@ let UserDeviceEntity = class UserDeviceEntity extends trackable_1.TrackableEntit
|
|
|
41
41
|
return new common_1.Device({
|
|
42
42
|
id: this.id,
|
|
43
43
|
guid: this.guid,
|
|
44
|
-
signature: this.
|
|
44
|
+
signature: this.token,
|
|
45
45
|
model: this.model,
|
|
46
46
|
name: this.name,
|
|
47
47
|
brand: this.brand,
|
|
@@ -59,9 +59,20 @@ let UserDeviceEntity = class UserDeviceEntity extends trackable_1.TrackableEntit
|
|
|
59
59
|
model: this.model,
|
|
60
60
|
name: this.name,
|
|
61
61
|
brand: this.brand,
|
|
62
|
-
signature: this.
|
|
62
|
+
signature: this.token,
|
|
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,13 +96,28 @@ __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,
|
|
91
117
|
default: null
|
|
92
118
|
}),
|
|
93
119
|
__metadata("design:type", String)
|
|
94
|
-
], UserDeviceEntity.prototype, "
|
|
120
|
+
], UserDeviceEntity.prototype, "token", void 0);
|
|
95
121
|
__decorate([
|
|
96
122
|
(0, typeorm_1.Column)({
|
|
97
123
|
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,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;SAC7B,CAAC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,SAAS;QACR,OAAO,IAAI,eAAM,CAAC;YACjB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,K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CAAC;8BACY,IAAI;sDAAC;AAUnB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;+CACY;AASd;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;+CACY;AAQd;IAHC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,KAAK;KACf,CAAC;;8CACW;AASb;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;+CACY;AASd;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;4CACS;AASX;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;kDACe;AASjB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;qDACkB;AAMpB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wBAAU,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;8CACxB;2BA1Gd,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,aAAa,CAAC;;GACT,gBAAgB,CA4K5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { UserEntity } from './user.entity';
|
|
1
|
+
import { Activity, Notification } from '@driveup/common';
|
|
2
|
+
import { ColorContext, NotificationChannel, Person, 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.
|
|
@@ -45,8 +45,8 @@ let UserNotificationEntity = class UserNotificationEntity extends trackable_1.Tr
|
|
|
45
45
|
channel: this.channel,
|
|
46
46
|
seen: this.seen,
|
|
47
47
|
link: this.link,
|
|
48
|
-
author: this.author ?
|
|
49
|
-
target: this.target ?
|
|
48
|
+
author: this.author ? shared_1.Person.toInstance(this.author) : null,
|
|
49
|
+
target: this.target ? shared_1.Person.toInstance(this.target) : null,
|
|
50
50
|
createdOn: this.createdOn,
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -139,7 +139,7 @@ __decorate([
|
|
|
139
139
|
nullable: true,
|
|
140
140
|
default: null
|
|
141
141
|
}),
|
|
142
|
-
__metadata("design:type",
|
|
142
|
+
__metadata("design:type", shared_1.Person)
|
|
143
143
|
], UserNotificationEntity.prototype, "author", void 0);
|
|
144
144
|
__decorate([
|
|
145
145
|
(0, typeorm_1.Column)({
|
|
@@ -147,7 +147,7 @@ __decorate([
|
|
|
147
147
|
nullable: true,
|
|
148
148
|
default: null
|
|
149
149
|
}),
|
|
150
|
-
__metadata("design:type",
|
|
150
|
+
__metadata("design:type", shared_1.Person)
|
|
151
151
|
], UserNotificationEntity.prototype, "target", void 0);
|
|
152
152
|
__decorate([
|
|
153
153
|
(0, typeorm_1.ManyToOne)(() => user_entity_1.UserEntity, user => user.notifications),
|
|
@@ -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,4CAAyD;AACzD,4CAA2G;AAC3G,qCAAoD;AAEpD,8DAAsD;AACtD,kDAAqD;AACrD,+CAA2C;AAE3C;;;;;;GAMG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,2BAA6B;IA0HxE;;;OAGG;IACH,YAAY,KAAuC;QAClD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,OAAO;QACN,OAAO,IAAI,qBAAY,CAAC;YACvB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;YAC3D,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;YAC3D,SAAS,EAAE,IAAI,CAAC,SAAS;SACzB,CAAC,CAAC;IACJ,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,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;uDACuB;AAUzB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;KACd,CAAC;;oDACY;AAUd;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;KACd,CAAC;;yDACiB;AASnB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;oDACW;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, Ticket } from '@driveup/common';
|
|
2
|
+
import { Person, 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.
|
|
@@ -38,7 +38,8 @@ let UserTicketEntity = class UserTicketEntity extends trackable_1.TrackableEntit
|
|
|
38
38
|
* @returns Promise resolving to Ticket model
|
|
39
39
|
*/
|
|
40
40
|
async toModel() {
|
|
41
|
-
const person = this.userId ? (await user_entity_1.UserEntity.findOneBy({ id: this.userId })).toPerson() : new
|
|
41
|
+
const person = this.userId ? (await user_entity_1.UserEntity.findOneBy({ id: this.userId })).toPerson() : new shared_1.Person(this.person);
|
|
42
|
+
person.image = person.imageUrl;
|
|
42
43
|
const attachments = this.attachments ? this.attachments.map(common_1.Asset.toInstance) : [];
|
|
43
44
|
return new common_1.Ticket({
|
|
44
45
|
type: this.type,
|
|
@@ -55,7 +56,8 @@ let UserTicketEntity = class UserTicketEntity extends trackable_1.TrackableEntit
|
|
|
55
56
|
* @returns Promise resolving to Ticket model
|
|
56
57
|
*/
|
|
57
58
|
async toSummary() {
|
|
58
|
-
const person = this.userId ? (await user_entity_1.UserEntity.findOneBy({ id: this.userId })).toPerson() : new
|
|
59
|
+
const person = this.userId ? (await user_entity_1.UserEntity.findOneBy({ id: this.userId })).toPerson() : new shared_1.Person(this.person);
|
|
60
|
+
person.image = person.imageUrl;
|
|
59
61
|
return new common_1.Ticket({
|
|
60
62
|
type: this.type,
|
|
61
63
|
status: this.status,
|
|
@@ -134,7 +136,7 @@ __decorate([
|
|
|
134
136
|
nullable: true,
|
|
135
137
|
default: null
|
|
136
138
|
}),
|
|
137
|
-
__metadata("design:type",
|
|
139
|
+
__metadata("design:type", shared_1.Person)
|
|
138
140
|
], UserTicketEntity.prototype, "person", void 0);
|
|
139
141
|
__decorate([
|
|
140
142
|
(0, typeorm_1.Column)({
|
|
@@ -144,6 +146,13 @@ __decorate([
|
|
|
144
146
|
}),
|
|
145
147
|
__metadata("design:type", Array)
|
|
146
148
|
], UserTicketEntity.prototype, "attachments", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, typeorm_1.Column)({
|
|
151
|
+
nullable: true,
|
|
152
|
+
default: null
|
|
153
|
+
}),
|
|
154
|
+
__metadata("design:type", Number)
|
|
155
|
+
], UserTicketEntity.prototype, "teamMembers", void 0);
|
|
147
156
|
__decorate([
|
|
148
157
|
(0, typeorm_1.Column)({ nullable: true, default: null }),
|
|
149
158
|
__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":";;;;;;;;;;;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