@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.
Files changed (220) hide show
  1. package/lib/catalog/addon/addon.entity.d.ts +3 -3
  2. package/lib/catalog/addon/addon.entity.js +7 -7
  3. package/lib/catalog/addon/addon.entity.js.map +1 -1
  4. package/lib/catalog/addon/country.entity.d.ts +4 -4
  5. package/lib/catalog/addon/country.entity.js +5 -6
  6. package/lib/catalog/addon/country.entity.js.map +1 -1
  7. package/lib/catalog/priceplan/priceplan.entity.d.ts +8 -3
  8. package/lib/catalog/priceplan/priceplan.entity.js +14 -7
  9. package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
  10. package/lib/catalog/product/country.entity.d.ts +6 -6
  11. package/lib/catalog/product/country.entity.js +9 -10
  12. package/lib/catalog/product/country.entity.js.map +1 -1
  13. package/lib/catalog/product/priceplan.entity.d.ts +9 -4
  14. package/lib/catalog/product/priceplan.entity.js +19 -9
  15. package/lib/catalog/product/priceplan.entity.js.map +1 -1
  16. package/lib/catalog/product/product.entity.d.ts +3 -3
  17. package/lib/catalog/product/product.entity.js +8 -8
  18. package/lib/catalog/product/product.entity.js.map +1 -1
  19. package/lib/catalog/program/program.entity.d.ts +2 -2
  20. package/lib/catalog/program/program.entity.js +7 -7
  21. package/lib/catalog/program/program.entity.js.map +1 -1
  22. package/lib/catalog/seed/assets/asset.entity.d.ts +2 -2
  23. package/lib/catalog/seed/assets/asset.entity.js +6 -6
  24. package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
  25. package/lib/catalog/seed/courses/course.entity.d.ts +4 -4
  26. package/lib/catalog/seed/courses/course.entity.js +9 -9
  27. package/lib/catalog/seed/courses/course.entity.js.map +1 -1
  28. package/lib/catalog/seed/courses/lesson.entity.d.ts +3 -3
  29. package/lib/catalog/seed/courses/lesson.entity.js +7 -7
  30. package/lib/catalog/seed/courses/lesson.entity.js.map +1 -1
  31. package/lib/catalog/seed/courses/topic.entity.d.ts +3 -3
  32. package/lib/catalog/seed/courses/topic.entity.js +8 -8
  33. package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
  34. package/lib/catalog/seed/expense/category.entity.d.ts +2 -2
  35. package/lib/catalog/seed/expense/category.entity.js +6 -6
  36. package/lib/catalog/seed/expense/category.entity.js.map +1 -1
  37. package/lib/index.d.ts +2 -2
  38. package/lib/index.js +2 -2
  39. package/lib/index.js.map +1 -1
  40. package/lib/profile/agent/agent.entity.d.ts +13 -4
  41. package/lib/profile/agent/agent.entity.js +46 -20
  42. package/lib/profile/agent/agent.entity.js.map +1 -1
  43. package/lib/profile/agent/asset.entity.d.ts +1 -1
  44. package/lib/profile/agent/asset.entity.js +2 -2
  45. package/lib/profile/agent/asset.entity.js.map +1 -1
  46. package/lib/profile/agent/payout.entity.d.ts +3 -3
  47. package/lib/profile/agent/payout.entity.js +6 -6
  48. package/lib/profile/agent/payout.entity.js.map +1 -1
  49. package/lib/profile/agent/promotion.entity.d.ts +3 -3
  50. package/lib/profile/agent/promotion.entity.js +6 -6
  51. package/lib/profile/agent/promotion.entity.js.map +1 -1
  52. package/lib/profile/company/company.entity.d.ts +80 -9
  53. package/lib/profile/company/company.entity.js +246 -36
  54. package/lib/profile/company/company.entity.js.map +1 -1
  55. package/lib/profile/company/course/appointment.entity.d.ts +73 -4
  56. package/lib/profile/company/course/appointment.entity.js +247 -0
  57. package/lib/profile/company/course/appointment.entity.js.map +1 -1
  58. package/lib/profile/company/course/course.entity.d.ts +41 -8
  59. package/lib/profile/company/course/course.entity.js +58 -12
  60. package/lib/profile/company/course/course.entity.js.map +1 -1
  61. package/lib/profile/company/course/lesson.entity.d.ts +30 -7
  62. package/lib/profile/company/course/lesson.entity.js +93 -12
  63. package/lib/profile/company/course/lesson.entity.js.map +1 -1
  64. package/lib/profile/company/course/schedule.entity.d.ts +276 -0
  65. package/lib/profile/company/course/schedule.entity.js +744 -0
  66. package/lib/profile/company/course/schedule.entity.js.map +1 -0
  67. package/lib/profile/company/course/topic.entity.d.ts +9 -4
  68. package/lib/profile/company/course/topic.entity.js +14 -7
  69. package/lib/profile/company/course/topic.entity.js.map +1 -1
  70. package/lib/profile/company/finances/billing/bill.entity.d.ts +9 -2
  71. package/lib/profile/company/finances/billing/bill.entity.js +38 -4
  72. package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
  73. package/lib/profile/company/finances/billing/item.entity.d.ts +8 -3
  74. package/lib/profile/company/finances/billing/item.entity.js +10 -6
  75. package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
  76. package/lib/profile/company/finances/billing/transaction.entity.d.ts +7 -5
  77. package/lib/profile/company/finances/billing/transaction.entity.js +6 -6
  78. package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
  79. package/lib/profile/company/finances/expense/category.entity.d.ts +1 -1
  80. package/lib/profile/company/finances/expense/category.entity.js +4 -4
  81. package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
  82. package/lib/profile/company/finances/expense/expense.entity.d.ts +6 -2
  83. package/lib/profile/company/finances/expense/expense.entity.js +32 -4
  84. package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
  85. package/lib/profile/company/finances/handover/handover.entity.d.ts +3 -3
  86. package/lib/profile/company/finances/handover/handover.entity.js +6 -6
  87. package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
  88. package/lib/profile/company/finances/invoice/invoice.entity.d.ts +8 -7
  89. package/lib/profile/company/finances/invoice/invoice.entity.js +15 -14
  90. package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
  91. package/lib/profile/company/finances/invoice/item.entity.d.ts +2 -2
  92. package/lib/profile/company/finances/invoice/item.entity.js +4 -4
  93. package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
  94. package/lib/profile/company/finances/payment/method.entity.d.ts +24 -4
  95. package/lib/profile/company/finances/payment/method.entity.js +40 -5
  96. package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
  97. package/lib/profile/company/instructor/activity.entity.js.map +1 -1
  98. package/lib/profile/company/instructor/calendar-state.entity.js.map +1 -1
  99. package/lib/profile/company/instructor/instructor.entity.d.ts +34 -17
  100. package/lib/profile/company/instructor/instructor.entity.js +143 -25
  101. package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
  102. package/lib/profile/company/instructor/task.entity.d.ts +2 -1
  103. package/lib/profile/company/instructor/task.entity.js +9 -4
  104. package/lib/profile/company/instructor/task.entity.js.map +1 -1
  105. package/lib/profile/company/medical/examination.entity.d.ts +4 -4
  106. package/lib/profile/company/medical/examination.entity.js +6 -6
  107. package/lib/profile/company/medical/examination.entity.js.map +1 -1
  108. package/lib/profile/company/medical/product.entity.d.ts +4 -5
  109. package/lib/profile/company/medical/product.entity.js +13 -14
  110. package/lib/profile/company/medical/product.entity.js.map +1 -1
  111. package/lib/profile/company/product/addon.entity.d.ts +3 -3
  112. package/lib/profile/company/product/addon.entity.js +6 -7
  113. package/lib/profile/company/product/addon.entity.js.map +1 -1
  114. package/lib/profile/company/product/priceplan.entity.d.ts +15 -13
  115. package/lib/profile/company/product/priceplan.entity.js +20 -16
  116. package/lib/profile/company/product/priceplan.entity.js.map +1 -1
  117. package/lib/profile/company/product/product.entity.d.ts +34 -8
  118. package/lib/profile/company/product/product.entity.js +70 -12
  119. package/lib/profile/company/product/product.entity.js.map +1 -1
  120. package/lib/profile/company/product/vehicle.entity.d.ts +2 -2
  121. package/lib/profile/company/product/vehicle.entity.js +4 -4
  122. package/lib/profile/company/product/vehicle.entity.js.map +1 -1
  123. package/lib/profile/instructor/instructor.entity.d.ts +6 -3
  124. package/lib/profile/instructor/instructor.entity.js +31 -9
  125. package/lib/profile/instructor/instructor.entity.js.map +1 -1
  126. package/lib/profile/student/program/licence/licence.entity.d.ts +13 -5
  127. package/lib/profile/student/program/licence/licence.entity.js +19 -8
  128. package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
  129. package/lib/profile/student/program/medical/certificate.entity.d.ts +3 -3
  130. package/lib/profile/student/program/medical/certificate.entity.js +6 -6
  131. package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
  132. package/lib/profile/student/program/medical/examination.entity.d.ts +4 -4
  133. package/lib/profile/student/program/medical/examination.entity.js +14 -14
  134. package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
  135. package/lib/profile/student/program/program.entity.d.ts +4 -4
  136. package/lib/profile/student/program/program.entity.js +8 -13
  137. package/lib/profile/student/program/program.entity.js.map +1 -1
  138. package/lib/profile/student/program/training/appointment.entity.d.ts +32 -9
  139. package/lib/profile/student/program/training/appointment.entity.js +144 -21
  140. package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
  141. package/lib/profile/student/program/training/exam.entity.d.ts +9 -2
  142. package/lib/profile/student/program/training/exam.entity.js +28 -12
  143. package/lib/profile/student/program/training/exam.entity.js.map +1 -1
  144. package/lib/profile/student/program/training/lesson.entity.d.ts +8 -3
  145. package/lib/profile/student/program/training/lesson.entity.js +28 -6
  146. package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
  147. package/lib/profile/student/program/training/request.entity.d.ts +6 -3
  148. package/lib/profile/student/program/training/request.entity.js +26 -5
  149. package/lib/profile/student/program/training/request.entity.js.map +1 -1
  150. package/lib/profile/student/program/training/topic.entity.d.ts +16 -4
  151. package/lib/profile/student/program/training/topic.entity.js +36 -9
  152. package/lib/profile/student/program/training/topic.entity.js.map +1 -1
  153. package/lib/profile/student/program/training/training.entity.d.ts +50 -6
  154. package/lib/profile/student/program/training/training.entity.js +217 -33
  155. package/lib/profile/student/program/training/training.entity.js.map +1 -1
  156. package/lib/profile/student/program/training/transaction.entity.d.ts +8 -3
  157. package/lib/profile/student/program/training/transaction.entity.js +43 -6
  158. package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
  159. package/lib/profile/student/student.entity.d.ts +11 -6
  160. package/lib/profile/student/student.entity.js +59 -11
  161. package/lib/profile/student/student.entity.js.map +1 -1
  162. package/lib/system/campaign/campaign.entity.d.ts +4 -4
  163. package/lib/system/campaign/campaign.entity.js +10 -10
  164. package/lib/system/campaign/campaign.entity.js.map +1 -1
  165. package/lib/system/campaign/gifcode.entity.d.ts +4 -4
  166. package/lib/system/campaign/gifcode.entity.js +8 -8
  167. package/lib/system/campaign/gifcode.entity.js.map +1 -1
  168. package/lib/system/country/country.entity.d.ts +8 -6
  169. package/lib/system/country/country.entity.js +15 -9
  170. package/lib/system/country/country.entity.js.map +1 -1
  171. package/lib/system/currency/currency.entity.d.ts +1 -1
  172. package/lib/system/currency/currency.entity.js +4 -4
  173. package/lib/system/currency/currency.entity.js.map +1 -1
  174. package/lib/system/driving/category.entity.d.ts +7 -7
  175. package/lib/system/driving/category.entity.js +14 -14
  176. package/lib/system/driving/category.entity.js.map +1 -1
  177. package/lib/system/driving/vehicle.entity.d.ts +2 -2
  178. package/lib/system/driving/vehicle.entity.js +4 -4
  179. package/lib/system/driving/vehicle.entity.js.map +1 -1
  180. package/lib/system/event/event.entity.d.ts +2 -2
  181. package/lib/system/event/event.entity.js +4 -4
  182. package/lib/system/event/event.entity.js.map +1 -1
  183. package/lib/system/event/log.entity.d.ts +2 -2
  184. package/lib/system/event/log.entity.js +3 -3
  185. package/lib/system/event/log.entity.js.map +1 -1
  186. package/lib/system/ical/ical.entity.d.ts +63 -0
  187. package/lib/system/ical/ical.entity.js +70 -0
  188. package/lib/system/ical/ical.entity.js.map +1 -0
  189. package/lib/system/policy/policy.entity.d.ts +2 -2
  190. package/lib/system/policy/policy.entity.js +8 -8
  191. package/lib/system/policy/policy.entity.js.map +1 -1
  192. package/lib/system/staff/staff.entity.d.ts +1 -1
  193. package/lib/system/staff/staff.entity.js +5 -4
  194. package/lib/system/staff/staff.entity.js.map +1 -1
  195. package/lib/tsconfig.tsbuildinfo +1 -1
  196. package/lib/user/alert.entity.d.ts +4 -3
  197. package/lib/user/alert.entity.js +11 -4
  198. package/lib/user/alert.entity.js.map +1 -1
  199. package/lib/user/blocked.entity.js +2 -2
  200. package/lib/user/blocked.entity.js.map +1 -1
  201. package/lib/user/device.entity.d.ts +17 -2
  202. package/lib/user/device.entity.js +29 -3
  203. package/lib/user/device.entity.js.map +1 -1
  204. package/lib/user/notification.entity.d.ts +3 -3
  205. package/lib/user/notification.entity.js +8 -8
  206. package/lib/user/notification.entity.js.map +1 -1
  207. package/lib/user/ticket.entity.d.ts +8 -3
  208. package/lib/user/ticket.entity.js +16 -7
  209. package/lib/user/ticket.entity.js.map +1 -1
  210. package/lib/user/user.entity.d.ts +101 -89
  211. package/lib/user/user.entity.js +272 -270
  212. package/lib/user/user.entity.js.map +1 -1
  213. package/lib/user/verification.entity.js +2 -2
  214. package/lib/user/verification.entity.js.map +1 -1
  215. package/lib/utils/activity.helper.d.ts +2 -2
  216. package/lib/utils/activity.helper.js.map +1 -1
  217. package/lib/utils/trackable.d.ts +13 -2
  218. package/lib/utils/trackable.js +55 -0
  219. package/lib/utils/trackable.js.map +1 -1
  220. 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 { AccountStatus, Language, ProfileType, SelectedProfile } from '@driveup/shared';
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 { AgentEntity } from '../profile/agent/agent.entity';
7
+ import { InstructorEntity } from '../profile/instructor/instructor.entity';
9
8
  import { StudentEntity } from '../profile/student/student.entity';
10
- import { UserNotificationEntity } from './notification.entity';
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
- * Registred devices
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
- * Updates the last activity timestamp of the user to the current date and saves it.
133
- * Used to track when the user was last active in the system.
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
- isActivityOverdated(now: Date): boolean;
141
+ getPhone(): string;
142
+ hasPushNotificationsEnabled(): Promise<boolean>;
143
+ /**************************** profiles ****************************/
142
144
  /**
143
- * Retrieves the user's student profile if it exists, excluding closed profiles
144
- * @returns The student profile or null if not found
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
- getStudentProfile(): Promise<StudentEntity>;
149
+ getStudent(manager?: EntityManager): Promise<StudentEntity>;
147
150
  /**
148
- * Retrieves the user's active student profile
149
- * @returns The active student profile or null if not found
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
- getActiveStudentProfile(): Promise<StudentEntity>;
155
+ getAgent(manager?: EntityManager): Promise<AgentEntity>;
152
156
  /**
153
- * Retrieves the user's agent profile if it exists, excluding closed profiles
154
- * @returns The agent profile or null if not found
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
- getAgentProfile(): Promise<AgentEntity>;
161
+ getInstructor(manager?: EntityManager): Promise<InstructorEntity>;
157
162
  /**
158
- * Retrieves the user's active agent profile
159
- * @returns The active agent profile or null if not found
163
+ * Get user company instructor profile
164
+ * @param company Company entity (required)
165
+ * @param manager EntityManager
166
+ * @returns CompanyInstructorEntity
160
167
  */
161
- getActiveAgentProfile(): Promise<AgentEntity>;
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
- * 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>;
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
- getSelectedProfile(): Promise<StudentEntity | AgentEntity | CompanyInstructorEntity>;
184
+ deletePendingProfiles(): Promise<void>;
185
+ /***************************** profile *****************************/
188
186
  /**
189
- * Retrieves the selected student profile if currently selected
190
- * @returns The student entity or null if not selected or not found
187
+ *
188
+ * @param device UserDeviceEntity
189
+ * @returns SelectedProfile
191
190
  */
192
- getSelectedStudent(): Promise<StudentEntity>;
191
+ getSelectedProfile(device?: UserDeviceEntity): SelectedProfile;
193
192
  /**
194
- * Retrieves the selected agent profile if currently selected
195
- * @returns The agent entity or null if not selected or not found
193
+ * Reset selected profile for the user
194
+ * @param guid
195
+ * @returns UserEntity
196
196
  */
197
- getSelectedAgent(): Promise<AgentEntity>;
197
+ resetSelectedProfile(guid?: string): Promise<this>;
198
198
  /**
199
- * Retrieves the selected company profile if currently selected
200
- * @returns The company entity or null if not selected or not found
199
+ * Select student profile for the user
200
+ * @param student
201
+ * @param guid
202
+ * @returns UserEntity
201
203
  */
202
- getSelectedCompany(): Promise<CompanyEntity>;
204
+ selectStudent(student: StudentEntity, guid?: string): Promise<this>;
203
205
  /**
204
- * Retrieves the instructor profile for the user in the currently selected company
205
- * @returns The company instructor entity or undefined if no company is selected
206
+ * Select agent profile for the user
207
+ * @param agent
208
+ * @param guid
209
+ * @returns UserEntity
206
210
  */
207
- getSelectedInstructor(): Promise<CompanyInstructorEntity>;
211
+ selectAgent(agent: AgentEntity, guid?: string): Promise<this>;
208
212
  /**
209
- * Get the instructor profile for the user in the specified company, regardless of the profile status (pending, invited, etc...)
210
- * @param company - The company to get the instructor profile for
211
- * @returns The instructor profile for the user in the specified company
213
+ * Select company instructor profile for the user
214
+ * @param instructor
215
+ * @param guid
216
+ * @returns UserEntity
212
217
  */
213
- getInstructor(company: CompanyEntity): Promise<CompanyInstructorEntity>;
218
+ selectInstructor(instructor: CompanyInstructorEntity, guid?: string): Promise<this>;
214
219
  /**
215
- * Remove suffix from phone number if the account is closed
216
- * @returns phone number that should be returned to ui
220
+ * Check if user has at least one active profile
221
+ * @param manager EntityManager
222
+ * @returns boolean
217
223
  */
218
- getPhone(): string;
219
- hasPushNotificationsEnabled(): boolean;
224
+ hasActiveProfile(manager?: EntityManager): Promise<boolean>;
220
225
  /**
221
- * Get the pending company profile for the user
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
- getPendingCompany(manager?: EntityManager): Promise<CompanyEntity>;
230
+ selectNextActiveProfile(guid?: string): Promise<SelectedProfile>;
224
231
  /**
225
- * Get the pending student profile for the user
226
- * @param manager EntityManager - optional transaction manager to use in a transaction
232
+ * Helper to select profile and update device if guid provided
233
+ * @param profile
234
+ * @param guid
235
+ * @returns UserEntity
227
236
  */
228
- getPendingStudent(manager?: EntityManager): Promise<StudentEntity>;
237
+ private selectProfile;
238
+ /***************************** activities *****************************/
229
239
  /**
230
- * Get the pending agent profile for the user
240
+ * Check if user last activity is overdated
241
+ * @returns
231
242
  */
232
- getPendingAgent(manager?: EntityManager): Promise<AgentEntity>;
243
+ isActivityOverdated(days?: number): boolean;
233
244
  /**
234
- * Delete any pending profiles of the account
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
- deletePendingProfiles(): Promise<void>;
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
- getProfileName(): string;
243
- getLanguageName(): string;
255
+ /***************************** logs *****************************/
244
256
  /**
245
257
  * Log user event
246
258
  * @param event Event type