@driveup/schema 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/catalog/addon/addon.entity.d.ts +2 -2
- package/lib/catalog/addon/addon.entity.js +2 -2
- package/lib/catalog/addon/addon.entity.js.map +1 -1
- package/lib/catalog/addon/country.entity.d.ts +2 -2
- package/lib/catalog/addon/country.entity.js +1 -2
- package/lib/catalog/addon/country.entity.js.map +1 -1
- package/lib/catalog/priceplan/priceplan.entity.d.ts +9 -4
- package/lib/catalog/priceplan/priceplan.entity.js +11 -4
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/country.entity.d.ts +12 -4
- package/lib/catalog/product/country.entity.js +19 -3
- package/lib/catalog/product/country.entity.js.map +1 -1
- package/lib/catalog/product/priceplan.entity.d.ts +6 -18
- package/lib/catalog/product/priceplan.entity.js +11 -33
- package/lib/catalog/product/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/product.entity.d.ts +2 -2
- package/lib/catalog/product/product.entity.js +2 -2
- 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 +2 -2
- 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 +3 -4
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
- package/lib/catalog/seed/courses/course.entity.d.ts +2 -2
- package/lib/catalog/seed/courses/course.entity.js +2 -2
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- package/lib/catalog/seed/expense/category.entity.js.map +1 -1
- package/lib/index.d.ts +6 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/profile/agent/agent.entity.d.ts +2 -1
- package/lib/profile/agent/agent.entity.js +17 -15
- package/lib/profile/agent/agent.entity.js.map +1 -1
- package/lib/profile/agent/asset.entity.d.ts +2 -2
- package/lib/profile/agent/asset.entity.js +1 -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 +2 -2
- package/lib/profile/agent/payout.entity.js.map +1 -1
- package/lib/profile/agent/promotion.entity.d.ts +3 -11
- package/lib/profile/agent/promotion.entity.js +3 -15
- package/lib/profile/agent/promotion.entity.js.map +1 -1
- package/lib/profile/company/company.entity.d.ts +43 -3
- package/lib/profile/company/company.entity.js +106 -33
- package/lib/profile/company/company.entity.js.map +1 -1
- package/lib/profile/company/course/appointment.entity.d.ts +271 -0
- package/lib/profile/company/course/appointment.entity.js +736 -0
- package/lib/profile/company/course/appointment.entity.js.map +1 -0
- package/lib/profile/company/course/course.entity.d.ts +8 -2
- package/lib/profile/company/course/course.entity.js +11 -4
- package/lib/profile/company/course/course.entity.js.map +1 -1
- package/lib/profile/company/course/lesson.entity.d.ts +10 -1
- package/lib/profile/company/course/lesson.entity.js +16 -2
- package/lib/profile/company/course/lesson.entity.js.map +1 -1
- package/lib/profile/company/course/schedule.entity.d.ts +8 -4
- package/lib/profile/company/course/schedule.entity.js +5 -0
- package/lib/profile/company/course/schedule.entity.js.map +1 -1
- package/lib/profile/company/course/topic.entity.d.ts +4 -3
- package/lib/profile/company/course/topic.entity.js +3 -3
- package/lib/profile/company/course/topic.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/bill.entity.d.ts +8 -1
- package/lib/profile/company/finances/billing/bill.entity.js +35 -1
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/item.entity.d.ts +15 -1
- package/lib/profile/company/finances/billing/item.entity.js +17 -1
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +5 -3
- package/lib/profile/company/finances/billing/transaction.entity.js +2 -2
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/invoice.entity.d.ts +2 -2
- package/lib/profile/company/finances/invoice/invoice.entity.js +8 -8
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
- package/lib/profile/company/finances/payment/method.entity.d.ts +16 -2
- package/lib/profile/company/finances/payment/method.entity.js +18 -2
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
- package/lib/profile/company/instructor/instructor.entity.d.ts +29 -15
- package/lib/profile/company/instructor/instructor.entity.js +59 -20
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.d.ts +2 -2
- package/lib/profile/company/medical/examination.entity.js +1 -1
- package/lib/profile/company/medical/examination.entity.js.map +1 -1
- package/lib/profile/company/medical/product.entity.d.ts +2 -3
- package/lib/profile/company/medical/product.entity.js +8 -9
- 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 +2 -3
- package/lib/profile/company/product/addon.entity.js.map +1 -1
- package/lib/profile/company/product/priceplan.entity.d.ts +14 -13
- package/lib/profile/company/product/priceplan.entity.js +14 -15
- package/lib/profile/company/product/priceplan.entity.js.map +1 -1
- package/lib/profile/company/product/product.entity.d.ts +29 -4
- package/lib/profile/company/product/product.entity.js +54 -6
- package/lib/profile/company/product/product.entity.js.map +1 -1
- package/lib/profile/instructor/instructor.entity.d.ts +2 -2
- package/lib/profile/instructor/instructor.entity.js +4 -3
- package/lib/profile/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/student/program/licence/licence.entity.d.ts +10 -2
- package/lib/profile/student/program/licence/licence.entity.js +14 -3
- 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 +2 -2
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
- package/lib/profile/student/program/medical/examination.entity.d.ts +2 -2
- package/lib/profile/student/program/medical/examination.entity.js +4 -4
- 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 +5 -10
- package/lib/profile/student/program/program.entity.js.map +1 -1
- package/lib/profile/student/program/training/appointment.entity.d.ts +21 -13
- package/lib/profile/student/program/training/appointment.entity.js +49 -23
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
- package/lib/profile/student/program/training/exam.entity.d.ts +6 -1
- package/lib/profile/student/program/training/exam.entity.js +16 -8
- package/lib/profile/student/program/training/exam.entity.js.map +1 -1
- package/lib/profile/student/program/training/lesson.entity.d.ts +3 -3
- package/lib/profile/student/program/training/lesson.entity.js +4 -4
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
- package/lib/profile/student/program/training/topic.entity.d.ts +6 -5
- package/lib/profile/student/program/training/topic.entity.js +9 -6
- package/lib/profile/student/program/training/topic.entity.js.map +1 -1
- package/lib/profile/student/program/training/training-balance.view.d.ts +4 -0
- package/lib/profile/student/program/training/training-balance.view.js +37 -0
- package/lib/profile/student/program/training/training-balance.view.js.map +1 -0
- package/lib/profile/student/program/training/training-cost.view.d.ts +4 -0
- package/lib/profile/student/program/training/training-cost.view.js +45 -0
- package/lib/profile/student/program/training/training-cost.view.js.map +1 -0
- package/lib/profile/student/program/training/training-sessions.view.d.ts +8 -0
- package/lib/profile/student/program/training/training-sessions.view.js +50 -0
- package/lib/profile/student/program/training/training-sessions.view.js.map +1 -0
- package/lib/profile/student/program/training/training.entity.d.ts +4 -1
- package/lib/profile/student/program/training/training.entity.js +43 -36
- package/lib/profile/student/program/training/training.entity.js.map +1 -1
- package/lib/profile/student/program/training/transaction.entity.d.ts +2 -2
- package/lib/profile/student/program/training/transaction.entity.js +3 -3
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +2 -2
- package/lib/profile/student/student.entity.js +5 -4
- package/lib/profile/student/student.entity.js.map +1 -1
- package/lib/public/faq.d.ts +25 -0
- package/lib/public/faq.js +60 -0
- package/lib/public/faq.js.map +1 -0
- package/lib/public/feature-item.d.ts +54 -0
- package/lib/public/feature-item.js +78 -0
- package/lib/public/feature-item.js.map +1 -0
- package/lib/public/feature.d.ts +46 -0
- package/lib/public/feature.js +76 -0
- package/lib/public/feature.js.map +1 -0
- package/lib/public/learning-hub.d.ts +30 -0
- package/lib/public/learning-hub.js +77 -0
- package/lib/public/learning-hub.js.map +1 -0
- package/lib/public/testimonial.d.ts +40 -0
- package/lib/public/testimonial.js +85 -0
- package/lib/public/testimonial.js.map +1 -0
- package/lib/system/campaign/campaign.entity.d.ts +3 -3
- package/lib/system/campaign/campaign.entity.js +4 -4
- 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 +3 -3
- 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 +11 -6
- package/lib/system/country/country.entity.js.map +1 -1
- package/lib/system/driving/category.entity.d.ts +2 -2
- package/lib/system/driving/category.entity.js +2 -2
- package/lib/system/driving/category.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 +3 -3
- package/lib/system/policy/policy.entity.js.map +1 -1
- package/lib/system/staff/staff.entity.d.ts +2 -2
- package/lib/system/staff/staff.entity.js +3 -2
- package/lib/system/staff/staff.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/alert.entity.d.ts +2 -2
- package/lib/user/alert.entity.js.map +1 -1
- package/lib/user/device.entity.d.ts +2 -2
- package/lib/user/device.entity.js +3 -3
- 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 +2 -2
- package/lib/user/ticket.entity.js +6 -4
- package/lib/user/ticket.entity.js.map +1 -1
- package/lib/user/user.entity.d.ts +14 -11
- package/lib/user/user.entity.js +20 -16
- package/lib/user/user.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 +12 -1
- package/lib/utils/trackable.js +55 -0
- package/lib/utils/trackable.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { Activity, Appointment, Period, RecurringAppointment } from '@driveup/common';
|
|
2
|
+
import { CompanyCourseLessonEntity } from './lesson.entity';
|
|
3
|
+
import { StudentTrainingAppointmentEntity } from '../../student/program/training/appointment.entity';
|
|
4
|
+
import { CompanyInstructorEntity } from '../instructor/instructor.entity';
|
|
5
|
+
import { TrackableEntity } from '../../../utils/trackable';
|
|
6
|
+
import { IDateAssignment, IDateDuration, IDateUpdate, WeekDay } from '@driveup/shared';
|
|
7
|
+
import { DateTime } from 'luxon';
|
|
8
|
+
/**
|
|
9
|
+
* Represents a series of training appointment offers managed by the company.
|
|
10
|
+
*
|
|
11
|
+
* This entity defines appointment templates that serve as available time slots
|
|
12
|
+
* for student training sessions. Companies manage these appointments to organize
|
|
13
|
+
* their course training schedules, which students can then book.
|
|
14
|
+
*
|
|
15
|
+
* Supports both single and recurring appointments with flexible scheduling options
|
|
16
|
+
* including:
|
|
17
|
+
* - Weekly repetitions on specific weekdays
|
|
18
|
+
* - Custom date ranges for recurring appointments
|
|
19
|
+
* - Exception handling for skipped dates
|
|
20
|
+
* - Per-date overrides for time, instructor, and duration
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* This is a company-managed entity that creates the foundation for student
|
|
24
|
+
* training bookings. Each appointment definition can generate multiple actual
|
|
25
|
+
* student appointments based on its repetition settings.
|
|
26
|
+
*
|
|
27
|
+
* @see {@link CompanyCourseLessonEntity} for the associated course lesson
|
|
28
|
+
* @see {@link StudentTrainingEntity} for student bookings
|
|
29
|
+
*/
|
|
30
|
+
export declare class CompanyCourseScheduleEntity extends TrackableEntity<RecurringAppointment> {
|
|
31
|
+
/**
|
|
32
|
+
* Company course lesson
|
|
33
|
+
*/
|
|
34
|
+
lessonId: number;
|
|
35
|
+
/**
|
|
36
|
+
* In-charge instructor for the appointment
|
|
37
|
+
* For driving courses, can be empty
|
|
38
|
+
*/
|
|
39
|
+
instructorId: number;
|
|
40
|
+
/**
|
|
41
|
+
* Represents the lesson start date for single appointments by student trainings.
|
|
42
|
+
* @remarks By recurring appoitmnets this field represents start of sierie
|
|
43
|
+
*/
|
|
44
|
+
startDate: Date;
|
|
45
|
+
/**
|
|
46
|
+
* Represents the lesson end date for single appointments by student trainings.
|
|
47
|
+
* @remarks By recurring appoitmnets this field represents end of sierie (repeat until this date)
|
|
48
|
+
*/
|
|
49
|
+
endDate: Date;
|
|
50
|
+
/**
|
|
51
|
+
* Duration of the appointment in minutes
|
|
52
|
+
* By fix courses this value is inherited from lesson
|
|
53
|
+
*/
|
|
54
|
+
duration: number;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates if the appointment is recurring
|
|
57
|
+
*/
|
|
58
|
+
repetition: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Weekdays on which the appointment recurs
|
|
61
|
+
*/
|
|
62
|
+
weekdays: WeekDay[];
|
|
63
|
+
/**
|
|
64
|
+
* Skipped dates for this recurring appointment
|
|
65
|
+
*/
|
|
66
|
+
skippedDates: Date[];
|
|
67
|
+
/**
|
|
68
|
+
* Changed dates for this recurring appointment
|
|
69
|
+
*/
|
|
70
|
+
updates: IDateUpdate[];
|
|
71
|
+
/**
|
|
72
|
+
* Different instructors for specific dates
|
|
73
|
+
*/
|
|
74
|
+
instructors: IDateAssignment[];
|
|
75
|
+
/**
|
|
76
|
+
* Different durations for specific dates
|
|
77
|
+
*/
|
|
78
|
+
durations: IDateDuration[];
|
|
79
|
+
/**
|
|
80
|
+
* Course lesson
|
|
81
|
+
*/
|
|
82
|
+
lesson: Promise<CompanyCourseLessonEntity>;
|
|
83
|
+
/**
|
|
84
|
+
* Company instructor relation
|
|
85
|
+
*/
|
|
86
|
+
instructor: Promise<CompanyInstructorEntity>;
|
|
87
|
+
/**
|
|
88
|
+
* Student training appointments relation
|
|
89
|
+
* - Will not be used for driving courses
|
|
90
|
+
*/
|
|
91
|
+
studentSchedule: Promise<StudentTrainingAppointmentEntity[]>;
|
|
92
|
+
/**
|
|
93
|
+
* Creates a new CompanyCourseScheduleEntity instance
|
|
94
|
+
* @param props - Partial properties to initialize the entity with
|
|
95
|
+
*/
|
|
96
|
+
constructor(props?: Partial<CompanyCourseScheduleEntity>);
|
|
97
|
+
/**
|
|
98
|
+
* Converts the entity to a RecurringAppointment model instance
|
|
99
|
+
* @returns Promise resolving to RecurringAppointment model with lesson, instructor, and scheduling details
|
|
100
|
+
*/
|
|
101
|
+
toModel(): Promise<RecurringAppointment<any>>;
|
|
102
|
+
/**
|
|
103
|
+
* Returns a summary representation of the appointment
|
|
104
|
+
* @returns Promise resolving to RecurringAppointment model (same as toModel())
|
|
105
|
+
*/
|
|
106
|
+
toSummary(): Promise<RecurringAppointment<any>>;
|
|
107
|
+
/**
|
|
108
|
+
* Retrieves all tracked activities for this appointment
|
|
109
|
+
* Includes creation and update timestamps and associated users
|
|
110
|
+
* @returns Promise resolving to array of Activity objects filtered to exclude null values
|
|
111
|
+
*/
|
|
112
|
+
getActivities(): Promise<Activity[]>;
|
|
113
|
+
getCompany(): Promise<import("../company.entity").CompanyEntity>;
|
|
114
|
+
getCourse(): Promise<import("./course.entity").CompanyCourseEntity>;
|
|
115
|
+
getInstructor(): Promise<CompanyInstructorEntity>;
|
|
116
|
+
getInstructorByDate(date: Date): Promise<CompanyInstructorEntity>;
|
|
117
|
+
/************************* Manage student appointments *************************/
|
|
118
|
+
/**
|
|
119
|
+
* Get list of related student training appointments, which's training is not terminated
|
|
120
|
+
* @param date Date - defaulted to this.startDate - Must be provided for flexible course appointments
|
|
121
|
+
* @returns StudentTrainingAppointmentEntity[]
|
|
122
|
+
*/
|
|
123
|
+
getStudentAppointments(date?: Date): Promise<StudentTrainingAppointmentEntity[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Get total number of students who attended the appointment in the given date
|
|
126
|
+
* @param date Date - defaulted to this.startDate - Must be provided for flexible course appointments
|
|
127
|
+
*/
|
|
128
|
+
getTotalAttended(date?: Date): Promise<number>;
|
|
129
|
+
/**
|
|
130
|
+
* Get total number of students who where absent in the appointment in the given date
|
|
131
|
+
* @param date Date - defaulted to this.startDate - Must be provided for flexible course appointments
|
|
132
|
+
*/
|
|
133
|
+
getTotalAbsent(date?: Date): Promise<number>;
|
|
134
|
+
/**
|
|
135
|
+
* Get the count of taken seats for this appointment
|
|
136
|
+
* - Only applicable for preparation catalog type courses. Returns null for other catalog types.
|
|
137
|
+
* @param startDate Date - Optional - Only send for flexible courses to specify the desired appointment's startDate
|
|
138
|
+
* @returns number - count of registered student appointments for this appointment
|
|
139
|
+
*/
|
|
140
|
+
getTakenSeats(startDate?: Date): Promise<number>;
|
|
141
|
+
/**
|
|
142
|
+
* Get the count of present students for this appointment
|
|
143
|
+
* - Only applicable for preparation catalog type courses. Returns null for other catalog types.
|
|
144
|
+
* @param startDate Date - Optional - Only send for flexible courses to specify the desired appointment's startDate
|
|
145
|
+
* @returns number - count of attended student appointments for this appointment
|
|
146
|
+
*/
|
|
147
|
+
getTotalPresentStudents(startDate?: Date): Promise<number>;
|
|
148
|
+
/************************* Flexible courses *************************/
|
|
149
|
+
/**
|
|
150
|
+
* Finds if there is an appointment in the given date (checking all of the updates), and returning it if is found
|
|
151
|
+
* @param date Date - the date to check if belongs to an existing appointment
|
|
152
|
+
* @returns Appointment if an appointment is found in the given date, null otherwise
|
|
153
|
+
*/
|
|
154
|
+
getAppointment(date: Date): Promise<Appointment>;
|
|
155
|
+
/**
|
|
156
|
+
* Load all appointments of the definition within the given period
|
|
157
|
+
* @description currently only works for flexible course schedules, and will return an empty array if the related course is fixed. but can and must be extended in the future to return the entire appointment list of the schedule, even if the appointment is fixed, or for another product type entirely.
|
|
158
|
+
* @param period Period
|
|
159
|
+
* @param instructorIds number[] - instructorId to filter by (return only appointments related to this instructor id)
|
|
160
|
+
* @param searchPhrase string - optional search phrase to filter appointments by (course title / part title / registered student name)
|
|
161
|
+
* @returns All appointments of the definition within the given period, filtered by instructorId if provided
|
|
162
|
+
*/
|
|
163
|
+
getAppointments(period: Period, instructorIds?: number[], searchPhrase?: string): Promise<Appointment[]>;
|
|
164
|
+
/**
|
|
165
|
+
* Check if there is one appointment with empty seats
|
|
166
|
+
*
|
|
167
|
+
* If the definition has no appointments in the given period, returns true.
|
|
168
|
+
* Since the functions is supposed to return wether any of the definition's appointments have empty seats
|
|
169
|
+
*/
|
|
170
|
+
hasAppointmentWithEmptySeats(period: Period): Promise<boolean>;
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
* @param period Period
|
|
174
|
+
* @returns DateTime if a first appointment is found, null otherwise
|
|
175
|
+
*/
|
|
176
|
+
getFirstAppointmentDateInPeriod(period: Period): DateTime;
|
|
177
|
+
/**
|
|
178
|
+
* @description Get detailed information about an appointment
|
|
179
|
+
* @param date - DateTime - is presumed to be related to an appointment in this definition
|
|
180
|
+
* @param filteredInstructorIds - number - optional - instrucotr id to filter the appointment by
|
|
181
|
+
* @returns Appointment - appointment information (id, start and end date, instructor information)
|
|
182
|
+
*/
|
|
183
|
+
getAppointmentInformation(date: DateTime, filteredInstructorIds?: number[]): Promise<Appointment>;
|
|
184
|
+
/**
|
|
185
|
+
* @description Only for repeted definitions (repetition = true)
|
|
186
|
+
* @description Finds the final date of the appointment, considering any date updates (updates in the startDate)
|
|
187
|
+
* @description If no date updates are found, the original date will be returned
|
|
188
|
+
* @param date DateTime - original date of the appointment (default return value, if no date updates are found)
|
|
189
|
+
* @returns DateTime - final date of the appointment
|
|
190
|
+
*/
|
|
191
|
+
getUpdatedDate(date: DateTime): DateTime;
|
|
192
|
+
/**
|
|
193
|
+
* @description Only for repeted definitions (repetition = true)
|
|
194
|
+
* @description Checks wether or not the appointment related to the given date has been removed from schedule (pushed in the skippedDates array)
|
|
195
|
+
* @param date DateTime - date of the appointment
|
|
196
|
+
* @returns DateTime - true if the appointment is skipped, false otherwise
|
|
197
|
+
*/
|
|
198
|
+
isDateSkipped(date: DateTime): boolean;
|
|
199
|
+
/**
|
|
200
|
+
* @description Only for repeted definitions (repetition = true)
|
|
201
|
+
* @description Finds the final duration of the appointment, considering any duration updates
|
|
202
|
+
* @description If no duration updates are found, this.duration will be returned by default
|
|
203
|
+
* @param date DateTime - date of the appointment
|
|
204
|
+
* @returns number - duration of the appointment (in minutes)
|
|
205
|
+
*/
|
|
206
|
+
getAppointmentDuration(date: DateTime): number;
|
|
207
|
+
/**
|
|
208
|
+
* @description Checks weather or not there is a student with a matching name registered in this schedule for the given appointment
|
|
209
|
+
* @description Currently only works for flexible course trainings (MVP logic), and will always return false for fixed course trainings
|
|
210
|
+
* Must be renamed and extended in the future to support fixed course trainings as well, but will remain as is for the sake of MVP Migration
|
|
211
|
+
* @param appointment Appointment - appointment to check for registered students
|
|
212
|
+
* @param studentName string - name of the student to check for registration
|
|
213
|
+
* @returns boolean - Weather or not there a student with the given name registered for the appointment
|
|
214
|
+
*/
|
|
215
|
+
isStudentRegistered(appointment: Appointment, studentName: string): Promise<boolean>;
|
|
216
|
+
/**
|
|
217
|
+
* @description Doesn't check for the definition's endDate, or updates and skippedDates
|
|
218
|
+
* @returns the next appointment based on repetition logic and weekdays assigned
|
|
219
|
+
*/
|
|
220
|
+
getNextAppointmentDate(date: DateTime): DateTime;
|
|
221
|
+
/**
|
|
222
|
+
* Get the instructor registered for the appointment (works for repeated and single appointments)
|
|
223
|
+
* @param date Date - the date of the appointment
|
|
224
|
+
* @returns Instructor - simple instructor model
|
|
225
|
+
*/
|
|
226
|
+
getAppointmentInstructor(date: DateTime): Promise<{
|
|
227
|
+
id: number;
|
|
228
|
+
name: string;
|
|
229
|
+
image: string;
|
|
230
|
+
phone: string;
|
|
231
|
+
role: import("@driveup/shared").Role;
|
|
232
|
+
status: import("@driveup/shared").AccountStatus;
|
|
233
|
+
canReinstate: boolean;
|
|
234
|
+
calendarLinks: import("@driveup/common").Link[];
|
|
235
|
+
}>;
|
|
236
|
+
/**
|
|
237
|
+
* @param date DateTime - is presumed to belong to an existing appointment
|
|
238
|
+
* @returns number - instructor id for the appointment of the given date
|
|
239
|
+
*/
|
|
240
|
+
getAppointmentInstructorId(date: DateTime): number;
|
|
241
|
+
/**
|
|
242
|
+
* Find instructor by id and map with simple information to User model
|
|
243
|
+
* @param id instructor id
|
|
244
|
+
* @returns Object - For the MVP it returns an object mapped like CompanyInstructorMapper.toSimple with the same interface. should be replaced with Person model in the future
|
|
245
|
+
*/
|
|
246
|
+
getInstructorById(id: number): Promise<{
|
|
247
|
+
id: number;
|
|
248
|
+
name: string;
|
|
249
|
+
image: string;
|
|
250
|
+
phone: string;
|
|
251
|
+
role: import("@driveup/shared").Role;
|
|
252
|
+
status: import("@driveup/shared").AccountStatus;
|
|
253
|
+
canReinstate: boolean;
|
|
254
|
+
calendarLinks: import("@driveup/common").Link[];
|
|
255
|
+
}>;
|
|
256
|
+
/**
|
|
257
|
+
* Get total number of appointments that have any update (duration/instructor/date) after the given date
|
|
258
|
+
* @param from Date - if null, from definition start date
|
|
259
|
+
* @returns number - total updated appointments
|
|
260
|
+
*/
|
|
261
|
+
getTotalUpdatedAppointments(from: Date): number;
|
|
262
|
+
getRemainingSeats(date: Date): Promise<number>;
|
|
263
|
+
/**
|
|
264
|
+
* This method must be called anytime when definition's endDate is changed to a value other than null/undefined
|
|
265
|
+
*
|
|
266
|
+
* Removes all 'updates', 'skippedDates', 'instructors' and 'durations' after the definition's endDate
|
|
267
|
+
*
|
|
268
|
+
* - Does not save the definition
|
|
269
|
+
*/
|
|
270
|
+
removeUpdatesAfterEndDate(): boolean;
|
|
271
|
+
}
|