feat: classes to ecapsulate the api calls better
This commit is contained in:
67
front/MyINPulse-front/src/ApiClasses/User.ts
Normal file
67
front/MyINPulse-front/src/ApiClasses/User.ts
Normal file
@ -0,0 +1,67 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
export default User;
|
Reference in New Issue
Block a user