Files
MyINPulse/front/MyINPulse-front/src/ApiClasses/User.ts
ALAMI Adnane 5130c00796
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
fix: adding toObject in ApiClasses
2025-04-29 22:15:20 +02:00

79 lines
1.8 KiB
TypeScript

class User {
private _idUser?: number;
private _userSurname?: string;
private _userName?: string;
private _primaryMail?: string;
private _secondaryMail?: string;
private _phoneNumber?: string;
constructor(data: Partial<User> = {}) {
this._idUser = data.idUser;
this._userSurname = data.userSurname;
this._userName = data.userName;
this._primaryMail = data.primaryMail;
this._secondaryMail = data.secondaryMail;
this._phoneNumber = data.phoneNumber;
}
get idUser(): number | undefined {
return this._idUser;
}
set idUser(value: number | undefined) {
this._idUser = value;
}
get userSurname(): string | undefined {
return this._userSurname;
}
set userSurname(value: string | undefined) {
this._userSurname = value;
}
get userName(): string | undefined {
return this._userName;
}
set userName(value: string | undefined) {
this._userName = value;
}
get primaryMail(): string | undefined {
return this._primaryMail;
}
set primaryMail(value: string | undefined) {
this._primaryMail = value;
}
get secondaryMail(): string | undefined {
return this._secondaryMail;
}
set secondaryMail(value: string | undefined) {
this._secondaryMail = value;
}
get phoneNumber(): string | undefined {
return this._phoneNumber;
}
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;