feat: classes to ecapsulate the api calls better

This commit is contained in:
Mohamed Maoulainine Maoulainine
2025-04-27 13:29:31 +02:00
parent fcc20d1f42
commit a8e22de4a3
10 changed files with 422 additions and 0 deletions

View File

@ -0,0 +1,68 @@
// appointment.ts
class Appointment {
private _idAppointment?: number;
private _appointmentDate?: string;
private _appointmentTime?: string;
private _appointmentDuration?: string;
private _appointmentPlace?: string;
private _appointmentSubject?: string;
constructor(data: Partial<Appointment> = {}) {
this._idAppointment = data.idAppointment;
this._appointmentDate = data.appointmentDate;
this._appointmentTime = data.appointmentTime;
this._appointmentDuration = data.appointmentDuration;
this._appointmentPlace = data.appointmentPlace;
this._appointmentSubject = data.appointmentSubject;
}
get idAppointment(): number | undefined {
return this._idAppointment;
}
set idAppointment(value: number | undefined) {
this._idAppointment = value;
}
get appointmentDate(): string | undefined {
return this._appointmentDate;
}
set appointmentDate(value: string | undefined) {
this._appointmentDate = value;
}
get appointmentTime(): string | undefined {
return this._appointmentTime;
}
set appointmentTime(value: string | undefined) {
this._appointmentTime = value;
}
get appointmentDuration(): string | undefined {
return this._appointmentDuration;
}
set appointmentDuration(value: string | undefined) {
this._appointmentDuration = value;
}
get appointmentPlace(): string | undefined {
return this._appointmentPlace;
}
set appointmentPlace(value: string | undefined) {
this._appointmentPlace = value;
}
get appointmentSubject(): string | undefined {
return this._appointmentSubject;
}
set appointmentSubject(value: string | undefined) {
this._appointmentSubject = value;
}
}
export default Appointment;