-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.js
82 lines (70 loc) · 1.5 KB
/
user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import Example from '../../helpers/data/example';
/**
* User class to wrap the simple user examples.
* @extends Example
* @todo add a constructor with some form of interface enforcement for
* which properties can be passed, throw on unknown properties.
*/
class User extends Example {
/*
Static constants.
*/
/**
* CHANGING_LENDER label.
* @constant {string}
* @static
*/
static get CHANGING_LENDER() { return 'changing lender'; }
/**
* FIRST_HOME label.
* @constant {string}
* @static
*/
static get FIRST_HOME() { return 'buying my first home'; }
/*
Instance getters.
*/
/**
* Does the user have a Nationwide mortgage?
* @type {boolean}
*/
get hasNationwideMortgage() {
return this.data.hasNationwideMortgage;
}
/**
* The user's application type.
* @type {string}
*/
get applicationType() {
return this.data.applicationType;
}
/**
* Is the user changing lender?
* @type {boolean}
*/
get isChangingLender() {
return this.data.applicationType === User.CHANGING_LENDER;
}
/**
* The value of the target property in GBP.
* @type {int}
*/
get propertyValue() {
return this.data.propertyValue;
}
/**
* The requested value of mortgage in GBP.
* @type {int}
*/
get mortgageAmount() {
return this.data.mortgageAmount;
}
/**
* The requested term length in years.
* @type {int}
*/
get termLengthYears() {
return this.data.termLengthYears;
}
}
export default User;