Person Overview

Person class and test data added
This commit is contained in:
Tobias Leiter
2022-12-10 15:13:36 +01:00
parent 5725f02fe6
commit 4326dfb0e3
10 changed files with 795 additions and 50 deletions
+70
View File
@@ -0,0 +1,70 @@
import 'react-native-get-random-values';
import { v4 as generateUniqueKey } from 'uuid';
export class Person {
constructor(name, birthday, category, image) {
this._key = generateUniqueKey();
this._name = name;
const tempBirthday = new Date(birthday);
if (tempBirthday.toString() === 'Invalid Date') {
this._birthday = null;
} else {
this._birthday = tempBirthday;
}
this._category = category;
this._image = image;
this._interests = []
this._giftList = []; // TODO: might not be needed
this._eventList = []; // TODO: might not be needed
}
get name() {
return this._name;
}
set name(value) {
this._name = value;
}
get birthday() {
return this._birthday;
}
set birthday(value) {
this._birthday = value;
}
get category() {
return this._category;
}
set category(value) {
this._category = value;
}
get image() {
return this._image;
}
set image(value) {
this._image = value;
}
get key() {
return this._key;
}
get giftList() {
return this._giftList;
}
get eventList() {
return this._eventList;
}
get interests() {
return this._interests;
}
}