Person Overview
Person class and test data added
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user