-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFHOG.ts
70 lines (64 loc) · 1.55 KB
/
FHOG.ts
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
import type { EligibilityResult } from "../calculators/loan";
import type { FormResponse } from "../defaults";
import { State } from "../defaults";
const FHOGconfig: Record<State, any> = {
NSW: {
// https://www.revenue.nsw.gov.au/grants-schemes/first-home-buyer/new-homes
"new-property": {
max: 600000,
},
"vacant-land": {
max: 750000,
},
},
VIC: {
"new-property": {
max: 750000,
},
"vacant-land": {
max: 750000,
},
},
[State.ACT]: undefined,
[State.NT]: undefined,
[State.QLD]: {
// https://qro.qld.gov.au/property-concessions-grants/first-home-grant/eligibility/
"new-property": {
max: 750000,
},
"vacant-land": {
max: 750000,
},
},
[State.SA]: undefined,
[State.WA]: undefined,
};
export function qualifiesForFHOG(
purchasePrice: number,
{ propertyType, state, purpose }: FormResponse
): EligibilityResult {
const result: EligibilityResult = {
scheme: "FHOG",
reason: "",
eligible: false,
};
if (propertyType === "existing") {
return {
...result,
reason: "Only available for new properties",
};
}
if (purpose === "investor" && state === State.QLD) {
return {
...result,
reason: "Not available to purchase investment properties in QLD",
};
}
if (purchasePrice > FHOGconfig[state][propertyType].max) {
return {
...result,
reason: `Property value must not exceed $${FHOGconfig[state][propertyType].max.toLocaleString()}.`,
};
}
return { eligible: true, scheme: "FHOG" };
}