fix: adding toObject in ApiClasses
Some checks failed
Format / formatting (push) Successful in 7s
Build / build (push) Successful in 44s
CI / build (push) Failing after 12s
Format / formatting (pull_request) Successful in 6s

This commit is contained in:
ALAMI Adnane 2025-04-29 22:15:20 +02:00
parent 8ec569e6ff
commit 5130c00796
8 changed files with 63 additions and 0 deletions

View File

@ -63,6 +63,17 @@ class Appointment {
set appointmentSubject(value: string | undefined) {
this._appointmentSubject = value;
}
toObject() {
return {
idAppointment: this.idAppointment,
appointmentDate: this.appointmentDate,
appointmentTime: this.appointmentTime,
appointmentDuration: this.appointmentDuration,
appointmentPlace: this.appointmentPlace,
appointmentSubject: this.appointmentSubject,
};
}
}
export default Appointment;

View File

@ -27,6 +27,13 @@ class JoinRequest {
set entrepreneur(value: UserEntrepreneur | undefined) {
this._entrepreneur = value;
}
toObject() {
return {
idProject: this.idProject,
entrepreneur: this.entrepreneur,
};
}
}
export default JoinRequest;

View File

@ -13,6 +13,12 @@ class JoinRequestDecision {
set isAccepted(value: boolean | undefined) {
this._isAccepted = value;
}
toObject() {
return {
isAccepted: this._isAccepted,
};
}
}
export default JoinRequestDecision;

View File

@ -33,6 +33,14 @@ class ProjectDecision {
set isAccepted(value: boolean | undefined) {
this._isAccepted = value;
}
toObject() {
return {
projectId: this._projectId,
adminId: this._adminId,
isAccepted: this._isAccepted,
};
}
}
export default ProjectDecision;

View File

@ -23,6 +23,13 @@ class Report {
set reportContent(value: string | undefined) {
this._reportContent = value;
}
toObject() {
return {
idReport: this._idReport,
reportContent: this._reportContent,
};
}
}
export default Report;

View File

@ -62,6 +62,17 @@ class User {
set phoneNumber(value: string | undefined) {
this._phoneNumber = value;
}
toObject() {
return {
idUser: this._idUser,
userSurname: this._userSurname,
userName: this._userName,
primaryMail: this._primaryMail,
secondaryMail: this._secondaryMail,
phoneNumber: this._phoneNumber,
};
}
}
export default User;

View File

@ -5,6 +5,10 @@ class UserAdmin extends User {
constructor(data: Partial<UserAdmin> = {}) {
super(data);
}
get idUser(): number | undefined {
return super.idUser;
}
}
export default UserAdmin;

View File

@ -36,6 +36,15 @@ class UserEntrepreneur extends User {
set sneeStatus(value: boolean | undefined) {
this._sneeStatus = value;
}
toObject() {
return {
...super.toObject(),
school: this._school,
course: this._course,
sneeStatus: this._sneeStatus,
};
}
}
export default UserEntrepreneur;