@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,17 +1,17 @@
|
|
|
1
|
+
import { Activity, User } from '@driveup/common';
|
|
2
|
+
import { AccountStatus, Address, Language, Person, 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,16 +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
|
-
/**
|
|
61
|
-
* Firebase Cloud Messaging tokens associated with the user's devices
|
|
62
|
-
* Used for sending push notifications to the user's devices
|
|
63
|
-
* @todo Consider using Device.signature instead and potentially remove this property
|
|
64
|
-
*/
|
|
65
|
-
fcmTokens: string[];
|
|
66
56
|
/**
|
|
67
57
|
* Unique identifier (UUID) for the user
|
|
68
58
|
* Automatically generated on creation
|
|
@@ -72,6 +62,18 @@ export declare class UserEntity extends TrackableEntity<User> {
|
|
|
72
62
|
* Timezone of the user (default: 'Europe/Zurich')
|
|
73
63
|
*/
|
|
74
64
|
timezone: string;
|
|
65
|
+
/**
|
|
66
|
+
* This flag indicates whether the user has ever logged in successfully
|
|
67
|
+
* If the value is true, then the phone number of the account must never be changed
|
|
68
|
+
*/
|
|
69
|
+
identityConfirmed: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The last selected profile (Student, Agent, or Company)
|
|
72
|
+
* The same property is part of user device an is priorized over this one
|
|
73
|
+
* Used to remember which profile the user last used when logging in
|
|
74
|
+
* Update this property only when user explicitly switches profile
|
|
75
|
+
*/
|
|
76
|
+
selectedProfile: SelectedProfile;
|
|
75
77
|
/**
|
|
76
78
|
* Timestamp of the user's last activity in the system
|
|
77
79
|
*/
|
|
@@ -88,12 +90,16 @@ export declare class UserEntity extends TrackableEntity<User> {
|
|
|
88
90
|
* Instructor profiles
|
|
89
91
|
*/
|
|
90
92
|
instructorProfiles: Promise<InstructorEntity[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Company instructor profiles
|
|
95
|
+
*/
|
|
96
|
+
companyInstructors: Promise<CompanyInstructorEntity[]>;
|
|
91
97
|
/**
|
|
92
98
|
* User country
|
|
93
99
|
*/
|
|
94
100
|
country: Promise<CountryEntity>;
|
|
95
101
|
/**
|
|
96
|
-
*
|
|
102
|
+
* Registered devices
|
|
97
103
|
*/
|
|
98
104
|
devices: Promise<UserDeviceEntity[]>;
|
|
99
105
|
/**
|
|
@@ -129,118 +135,124 @@ export declare class UserEntity extends TrackableEntity<User> {
|
|
|
129
135
|
*/
|
|
130
136
|
toPerson(): Person;
|
|
131
137
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* @returns The updated user entity
|
|
135
|
-
*/
|
|
136
|
-
updateActivity(): Promise<UserEntity>;
|
|
137
|
-
/**
|
|
138
|
-
* Check if user last activity is overdated
|
|
139
|
-
* @returns
|
|
138
|
+
* Remove suffix from phone number if the account is closed
|
|
139
|
+
* @returns phone number that should be returned to ui
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
getPhone(): string;
|
|
142
|
+
hasPushNotificationsEnabled(): Promise<boolean>;
|
|
143
|
+
/**************************** profiles ****************************/
|
|
142
144
|
/**
|
|
143
|
-
* Retrieves the user's student profile if it exists
|
|
144
|
-
*
|
|
145
|
+
* Retrieves the user's student profile if it exists
|
|
146
|
+
* User can have only one student profile which can be active or pending
|
|
147
|
+
* @returns The student profile
|
|
145
148
|
*/
|
|
146
|
-
|
|
149
|
+
getStudent(manager?: EntityManager): Promise<StudentEntity>;
|
|
147
150
|
/**
|
|
148
|
-
* Retrieves the user's
|
|
149
|
-
*
|
|
151
|
+
* Retrieves the user's agent profile if it exists
|
|
152
|
+
* User can have only one agent profile which can be active or pending
|
|
153
|
+
* @returns The agent profile
|
|
150
154
|
*/
|
|
151
|
-
|
|
155
|
+
getAgent(manager?: EntityManager): Promise<AgentEntity>;
|
|
152
156
|
/**
|
|
153
|
-
* Retrieves the user's
|
|
154
|
-
*
|
|
157
|
+
* Retrieves the user's instructor profile if it exists
|
|
158
|
+
* User can have only one instructor profile which can be active or pending
|
|
159
|
+
* @returns The agent profile
|
|
155
160
|
*/
|
|
156
|
-
|
|
161
|
+
getInstructor(manager?: EntityManager): Promise<InstructorEntity>;
|
|
157
162
|
/**
|
|
158
|
-
*
|
|
159
|
-
* @
|
|
163
|
+
* Get user company instructor profile
|
|
164
|
+
* @param company Company entity (required)
|
|
165
|
+
* @param manager EntityManager
|
|
166
|
+
* @returns CompanyInstructorEntity
|
|
160
167
|
*/
|
|
161
|
-
|
|
168
|
+
getCompanyInstructor(company: CompanyEntity, manager?: EntityManager): Promise<CompanyInstructorEntity>;
|
|
169
|
+
getCompanyInstructorById(id?: number, manager?: EntityManager): Promise<CompanyInstructorEntity>;
|
|
170
|
+
/************************* company profile *************************/
|
|
171
|
+
getCompany(companyId: number): Promise<CompanyEntity>;
|
|
162
172
|
/**
|
|
163
173
|
* Checks if the user belongs to a specific company.
|
|
164
174
|
*
|
|
165
175
|
* @param companyId - The ID of the company to check against.
|
|
176
|
+
* @param status - (Optional) The account status to filter by. Defaults to `AccountStatus.Active`.
|
|
166
177
|
* @returns A promise that resolves to `true` if the user belongs to the specified company, otherwise `false`.
|
|
167
178
|
*/
|
|
168
|
-
belongsToCompany(companyId: number): Promise<boolean>;
|
|
179
|
+
belongsToCompany(companyId: number, status?: AccountStatus): Promise<boolean>;
|
|
180
|
+
/************************* profile handlers *************************/
|
|
169
181
|
/**
|
|
170
|
-
*
|
|
171
|
-
* @returns True if the user has an active profile, false otherwise
|
|
172
|
-
*/
|
|
173
|
-
hasActiveProfile(manager?: EntityManager): Promise<boolean>;
|
|
174
|
-
/**
|
|
175
|
-
* Retrieves the next active profile based on priority (Company > Agent > Student)
|
|
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
|
|
178
|
-
*/
|
|
179
|
-
getNextProfile(): Promise<{
|
|
180
|
-
type: ProfileType;
|
|
181
|
-
id: number;
|
|
182
|
-
}>;
|
|
183
|
-
/**
|
|
184
|
-
* Retrieves the entity for the user's currently selected profile
|
|
185
|
-
* @returns The selected profile entity (Student, Agent, or CompanyInstructor) or null
|
|
182
|
+
* Delete any pending profiles of the account
|
|
186
183
|
*/
|
|
187
|
-
|
|
184
|
+
deletePendingProfiles(): Promise<void>;
|
|
185
|
+
/***************************** profile *****************************/
|
|
188
186
|
/**
|
|
189
|
-
*
|
|
190
|
-
* @
|
|
187
|
+
*
|
|
188
|
+
* @param device UserDeviceEntity
|
|
189
|
+
* @returns SelectedProfile
|
|
191
190
|
*/
|
|
192
|
-
|
|
191
|
+
getSelectedProfile(device?: UserDeviceEntity): SelectedProfile;
|
|
193
192
|
/**
|
|
194
|
-
*
|
|
195
|
-
* @
|
|
193
|
+
* Reset selected profile for the user
|
|
194
|
+
* @param guid
|
|
195
|
+
* @returns UserEntity
|
|
196
196
|
*/
|
|
197
|
-
|
|
197
|
+
resetSelectedProfile(guid?: string): Promise<this>;
|
|
198
198
|
/**
|
|
199
|
-
*
|
|
200
|
-
* @
|
|
199
|
+
* Select student profile for the user
|
|
200
|
+
* @param student
|
|
201
|
+
* @param guid
|
|
202
|
+
* @returns UserEntity
|
|
201
203
|
*/
|
|
202
|
-
|
|
204
|
+
selectStudent(student: StudentEntity, guid?: string): Promise<this>;
|
|
203
205
|
/**
|
|
204
|
-
*
|
|
205
|
-
* @
|
|
206
|
+
* Select agent profile for the user
|
|
207
|
+
* @param agent
|
|
208
|
+
* @param guid
|
|
209
|
+
* @returns UserEntity
|
|
206
210
|
*/
|
|
207
|
-
|
|
211
|
+
selectAgent(agent: AgentEntity, guid?: string): Promise<this>;
|
|
208
212
|
/**
|
|
209
|
-
*
|
|
210
|
-
* @param
|
|
211
|
-
* @
|
|
213
|
+
* Select company instructor profile for the user
|
|
214
|
+
* @param instructor
|
|
215
|
+
* @param guid
|
|
216
|
+
* @returns UserEntity
|
|
212
217
|
*/
|
|
213
|
-
|
|
218
|
+
selectInstructor(instructor: CompanyInstructorEntity, guid?: string): Promise<this>;
|
|
214
219
|
/**
|
|
215
|
-
*
|
|
216
|
-
* @
|
|
220
|
+
* Check if user has at least one active profile
|
|
221
|
+
* @param manager EntityManager
|
|
222
|
+
* @returns boolean
|
|
217
223
|
*/
|
|
218
|
-
|
|
219
|
-
hasPushNotificationsEnabled(): boolean;
|
|
224
|
+
hasActiveProfile(manager?: EntityManager): Promise<boolean>;
|
|
220
225
|
/**
|
|
221
|
-
*
|
|
226
|
+
* Select next active profile for the user
|
|
227
|
+
* @param guid Device guid
|
|
228
|
+
* @returns true if a profile was selected, false otherwise
|
|
222
229
|
*/
|
|
223
|
-
|
|
230
|
+
selectNextActiveProfile(guid?: string): Promise<SelectedProfile>;
|
|
224
231
|
/**
|
|
225
|
-
*
|
|
226
|
-
* @param
|
|
232
|
+
* Helper to select profile and update device if guid provided
|
|
233
|
+
* @param profile
|
|
234
|
+
* @param guid
|
|
235
|
+
* @returns UserEntity
|
|
227
236
|
*/
|
|
228
|
-
|
|
237
|
+
private selectProfile;
|
|
238
|
+
/***************************** activities *****************************/
|
|
229
239
|
/**
|
|
230
|
-
*
|
|
240
|
+
* Check if user last activity is overdated
|
|
241
|
+
* @returns
|
|
231
242
|
*/
|
|
232
|
-
|
|
243
|
+
isActivityOverdated(days?: number): boolean;
|
|
233
244
|
/**
|
|
234
|
-
*
|
|
245
|
+
* Updates the last activity timestamp of the user to the current date and saves it.
|
|
246
|
+
* Used to track when the user was last active in the system.
|
|
247
|
+
* @returns The updated user entity
|
|
235
248
|
*/
|
|
236
|
-
|
|
249
|
+
updateActivity(): Promise<UserEntity>;
|
|
237
250
|
/**
|
|
238
251
|
* Retrieves all tracked activities for this user (creation and update timestamps)
|
|
239
252
|
* @returns Array of Activity objects filtered to exclude null values
|
|
240
253
|
*/
|
|
241
254
|
getActivities(): Promise<Activity[]>;
|
|
242
|
-
|
|
243
|
-
getLanguageName(): string;
|
|
255
|
+
/***************************** logs *****************************/
|
|
244
256
|
/**
|
|
245
257
|
* Log user event
|
|
246
258
|
* @param event Event type
|