@propxchain/core-client 0.3.0-canary.38 → 0.4.0-canary.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jurisdiction.d.ts +50 -0
- package/dist/jurisdiction.d.ts.map +1 -0
- package/dist/jurisdiction.js +109 -0
- package/dist/jurisdiction.js.map +1 -0
- package/package.json +5 -1
- package/src/jurisdiction.ts +117 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 PropXchain. All rights reserved.
|
|
3
|
+
* Proprietary and confidential.
|
|
4
|
+
*
|
|
5
|
+
* Which legal system a UK property sits in, from its postcode.
|
|
6
|
+
*
|
|
7
|
+
* PropXchain operates in England and Wales only. Scotland runs an entirely
|
|
8
|
+
* different conveyancing system — missives rather than exchange, the Land
|
|
9
|
+
* Register of Scotland rather than HM Land Registry, and no CON29 or LLC1 at
|
|
10
|
+
* all. Northern Ireland is different again. None of our searches, forms or
|
|
11
|
+
* title pulls mean anything there.
|
|
12
|
+
*
|
|
13
|
+
* This exists because nothing stopped an out-of-jurisdiction property entering
|
|
14
|
+
* the flow. On 2026-08-10 a Scottish UPRN went all the way to a priced tmGroup
|
|
15
|
+
* draft and came back at £0.00 with an empty failure list — the searches simply
|
|
16
|
+
* do not exist in Scotland, so there was nothing to price and nothing to
|
|
17
|
+
* report. tmGroup confirmed it: "That UPRN is in Scotland and therefore
|
|
18
|
+
* authority look-ups do not apply." A £0 quote is the LAST place that should be
|
|
19
|
+
* caught. The address is the first.
|
|
20
|
+
*/
|
|
21
|
+
export type Jurisdiction = 'england-wales' | 'scotland' | 'northern-ireland' | 'crown-dependency' | 'ambiguous' | 'unknown';
|
|
22
|
+
/**
|
|
23
|
+
* The postcode AREA — the leading letters before the first digit. `EH10 6QL`
|
|
24
|
+
* gives `EH`, `G1 1AA` gives `G`.
|
|
25
|
+
*
|
|
26
|
+
* Deliberately tolerant of missing spaces and lower case, because this runs on
|
|
27
|
+
* whatever a person typed. It is deliberately NOT tolerant of things that are
|
|
28
|
+
* not postcodes: an unparseable value returns null and the caller decides,
|
|
29
|
+
* rather than being silently treated as England.
|
|
30
|
+
*/
|
|
31
|
+
export declare function postcodeArea(postcode: string | null | undefined): string | null;
|
|
32
|
+
/** Which legal system this postcode falls in. */
|
|
33
|
+
export declare function jurisdictionFromPostcode(postcode: string | null | undefined): Jurisdiction;
|
|
34
|
+
/**
|
|
35
|
+
* Can PropXchain handle this property?
|
|
36
|
+
*
|
|
37
|
+
* 'ambiguous' and 'unknown' both pass. That is deliberate: this is a guard
|
|
38
|
+
* against the clearly-wrong, not an address validator. Refusing every postcode
|
|
39
|
+
* we failed to parse would turn a typo into a dead end, and refusing Berwick
|
|
40
|
+
* would turn a correct English address into one. What must never happen is a
|
|
41
|
+
* confidently Scottish property reaching a payment screen.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isSupportedJurisdiction(postcode: string | null | undefined): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* What to tell the person, in their terms. Never "invalid postcode" — their
|
|
46
|
+
* postcode is perfectly valid, it is our coverage that is limited, and saying
|
|
47
|
+
* so plainly is the difference between a clear no and a broken form.
|
|
48
|
+
*/
|
|
49
|
+
export declare function unsupportedJurisdictionMessage(postcode: string | null | undefined): string | null;
|
|
50
|
+
//# sourceMappingURL=jurisdiction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jurisdiction.d.ts","sourceRoot":"","sources":["../src/jurisdiction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAyBH,MAAM,MAAM,YAAY,GACpB,eAAe,GACf,UAAU,GACV,kBAAkB,GAClB,kBAAkB,GAClB,WAAW,GACX,SAAS,CAAC;AAEd;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAO/E;AAED,iDAAiD;AACjD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,CAQ1F;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAKpF;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAcjG"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 PropXchain. All rights reserved.
|
|
3
|
+
* Proprietary and confidential.
|
|
4
|
+
*
|
|
5
|
+
* Which legal system a UK property sits in, from its postcode.
|
|
6
|
+
*
|
|
7
|
+
* PropXchain operates in England and Wales only. Scotland runs an entirely
|
|
8
|
+
* different conveyancing system — missives rather than exchange, the Land
|
|
9
|
+
* Register of Scotland rather than HM Land Registry, and no CON29 or LLC1 at
|
|
10
|
+
* all. Northern Ireland is different again. None of our searches, forms or
|
|
11
|
+
* title pulls mean anything there.
|
|
12
|
+
*
|
|
13
|
+
* This exists because nothing stopped an out-of-jurisdiction property entering
|
|
14
|
+
* the flow. On 2026-08-10 a Scottish UPRN went all the way to a priced tmGroup
|
|
15
|
+
* draft and came back at £0.00 with an empty failure list — the searches simply
|
|
16
|
+
* do not exist in Scotland, so there was nothing to price and nothing to
|
|
17
|
+
* report. tmGroup confirmed it: "That UPRN is in Scotland and therefore
|
|
18
|
+
* authority look-ups do not apply." A £0 quote is the LAST place that should be
|
|
19
|
+
* caught. The address is the first.
|
|
20
|
+
*/
|
|
21
|
+
/** Postcode areas wholly within Scotland. */
|
|
22
|
+
const SCOTLAND_AREAS = new Set([
|
|
23
|
+
'AB', 'DD', 'DG', 'EH', 'FK', 'G', 'HS', 'IV',
|
|
24
|
+
'KA', 'KW', 'KY', 'ML', 'PA', 'PH', 'ZE',
|
|
25
|
+
]);
|
|
26
|
+
/**
|
|
27
|
+
* Areas that straddle the border, so the postcode alone cannot decide.
|
|
28
|
+
*
|
|
29
|
+
* TD covers the Scottish Borders but also Berwick-upon-Tweed (TD15), which is
|
|
30
|
+
* in England. CA is Cumbria but a handful of CA6 addresses are Scottish.
|
|
31
|
+
* Guessing either way is wrong for real people in real houses, so these resolve
|
|
32
|
+
* to 'ambiguous' and the caller must confirm another way — for a tmGroup order
|
|
33
|
+
* the local-authority lookup is the answer, because it names the actual council.
|
|
34
|
+
*/
|
|
35
|
+
const BORDER_AREAS = new Set(['TD', 'CA']);
|
|
36
|
+
/** Northern Ireland. Separate legal system, separate registry. */
|
|
37
|
+
const NORTHERN_IRELAND_AREAS = new Set(['BT']);
|
|
38
|
+
/** Crown dependencies. Not the UK for these purposes, and not our market. */
|
|
39
|
+
const CROWN_DEPENDENCY_AREAS = new Set(['IM', 'GY', 'JE']);
|
|
40
|
+
/**
|
|
41
|
+
* The postcode AREA — the leading letters before the first digit. `EH10 6QL`
|
|
42
|
+
* gives `EH`, `G1 1AA` gives `G`.
|
|
43
|
+
*
|
|
44
|
+
* Deliberately tolerant of missing spaces and lower case, because this runs on
|
|
45
|
+
* whatever a person typed. It is deliberately NOT tolerant of things that are
|
|
46
|
+
* not postcodes: an unparseable value returns null and the caller decides,
|
|
47
|
+
* rather than being silently treated as England.
|
|
48
|
+
*/
|
|
49
|
+
export function postcodeArea(postcode) {
|
|
50
|
+
if (typeof postcode !== 'string')
|
|
51
|
+
return null;
|
|
52
|
+
const cleaned = postcode.trim().toUpperCase().replace(/\s+/g, '');
|
|
53
|
+
if (!cleaned)
|
|
54
|
+
return null;
|
|
55
|
+
// A UK outward code is 1-2 letters, then a digit. Anything else is not one.
|
|
56
|
+
const match = /^([A-Z]{1,2})[0-9]/.exec(cleaned);
|
|
57
|
+
return match ? match[1] : null;
|
|
58
|
+
}
|
|
59
|
+
/** Which legal system this postcode falls in. */
|
|
60
|
+
export function jurisdictionFromPostcode(postcode) {
|
|
61
|
+
const area = postcodeArea(postcode);
|
|
62
|
+
if (!area)
|
|
63
|
+
return 'unknown';
|
|
64
|
+
if (SCOTLAND_AREAS.has(area))
|
|
65
|
+
return 'scotland';
|
|
66
|
+
if (NORTHERN_IRELAND_AREAS.has(area))
|
|
67
|
+
return 'northern-ireland';
|
|
68
|
+
if (CROWN_DEPENDENCY_AREAS.has(area))
|
|
69
|
+
return 'crown-dependency';
|
|
70
|
+
if (BORDER_AREAS.has(area))
|
|
71
|
+
return 'ambiguous';
|
|
72
|
+
return 'england-wales';
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Can PropXchain handle this property?
|
|
76
|
+
*
|
|
77
|
+
* 'ambiguous' and 'unknown' both pass. That is deliberate: this is a guard
|
|
78
|
+
* against the clearly-wrong, not an address validator. Refusing every postcode
|
|
79
|
+
* we failed to parse would turn a typo into a dead end, and refusing Berwick
|
|
80
|
+
* would turn a correct English address into one. What must never happen is a
|
|
81
|
+
* confidently Scottish property reaching a payment screen.
|
|
82
|
+
*/
|
|
83
|
+
export function isSupportedJurisdiction(postcode) {
|
|
84
|
+
const jurisdiction = jurisdictionFromPostcode(postcode);
|
|
85
|
+
return jurisdiction !== 'scotland'
|
|
86
|
+
&& jurisdiction !== 'northern-ireland'
|
|
87
|
+
&& jurisdiction !== 'crown-dependency';
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* What to tell the person, in their terms. Never "invalid postcode" — their
|
|
91
|
+
* postcode is perfectly valid, it is our coverage that is limited, and saying
|
|
92
|
+
* so plainly is the difference between a clear no and a broken form.
|
|
93
|
+
*/
|
|
94
|
+
export function unsupportedJurisdictionMessage(postcode) {
|
|
95
|
+
switch (jurisdictionFromPostcode(postcode)) {
|
|
96
|
+
case 'scotland':
|
|
97
|
+
return 'PropXchain currently covers England and Wales only. Scotland has a separate '
|
|
98
|
+
+ 'conveyancing system and its own land register, so we cannot handle this property yet.';
|
|
99
|
+
case 'northern-ireland':
|
|
100
|
+
return 'PropXchain currently covers England and Wales only. Northern Ireland has a '
|
|
101
|
+
+ 'separate conveyancing system and its own land registry, so we cannot handle this property yet.';
|
|
102
|
+
case 'crown-dependency':
|
|
103
|
+
return 'PropXchain currently covers England and Wales only, which does not include the '
|
|
104
|
+
+ 'Isle of Man or the Channel Islands.';
|
|
105
|
+
default:
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=jurisdiction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jurisdiction.js","sourceRoot":"","sources":["../src/jurisdiction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,6CAA6C;AAC7C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI;IAC7C,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CACzC,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE3C,kEAAkE;AAClE,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAE/C,6EAA6E;AAC7E,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAU3D;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,QAAmC;IAC9D,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAClE,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,4EAA4E;IAC5E,MAAM,KAAK,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,wBAAwB,CAAC,QAAmC;IAC1E,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,UAAU,CAAC;IAChD,IAAI,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,kBAAkB,CAAC;IAChE,IAAI,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,kBAAkB,CAAC;IAChE,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,WAAW,CAAC;IAC/C,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAmC;IACzE,MAAM,YAAY,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACxD,OAAO,YAAY,KAAK,UAAU;WAC7B,YAAY,KAAK,kBAAkB;WACnC,YAAY,KAAK,kBAAkB,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAAC,QAAmC;IAChF,QAAQ,wBAAwB,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3C,KAAK,UAAU;YACb,OAAO,8EAA8E;kBACjF,uFAAuF,CAAC;QAC9F,KAAK,kBAAkB;YACrB,OAAO,6EAA6E;kBAChF,gGAAgG,CAAC;QACvG,KAAK,kBAAkB;YACrB,OAAO,iFAAiF;kBACpF,qCAAqC,CAAC;QAC5C;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propxchain/core-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-canary.39",
|
|
4
4
|
"description": "Typed TypeScript client for the PropXchain core canisters on the Internet Computer. Includes a deterministic mock mode for local development and tests.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"./auth": {
|
|
19
19
|
"types": "./dist/auth.d.ts",
|
|
20
20
|
"import": "./dist/auth.js"
|
|
21
|
+
},
|
|
22
|
+
"./jurisdiction": {
|
|
23
|
+
"types": "./dist/jurisdiction.d.ts",
|
|
24
|
+
"import": "./dist/jurisdiction.js"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"files": [
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 PropXchain. All rights reserved.
|
|
3
|
+
* Proprietary and confidential.
|
|
4
|
+
*
|
|
5
|
+
* Which legal system a UK property sits in, from its postcode.
|
|
6
|
+
*
|
|
7
|
+
* PropXchain operates in England and Wales only. Scotland runs an entirely
|
|
8
|
+
* different conveyancing system — missives rather than exchange, the Land
|
|
9
|
+
* Register of Scotland rather than HM Land Registry, and no CON29 or LLC1 at
|
|
10
|
+
* all. Northern Ireland is different again. None of our searches, forms or
|
|
11
|
+
* title pulls mean anything there.
|
|
12
|
+
*
|
|
13
|
+
* This exists because nothing stopped an out-of-jurisdiction property entering
|
|
14
|
+
* the flow. On 2026-08-10 a Scottish UPRN went all the way to a priced tmGroup
|
|
15
|
+
* draft and came back at £0.00 with an empty failure list — the searches simply
|
|
16
|
+
* do not exist in Scotland, so there was nothing to price and nothing to
|
|
17
|
+
* report. tmGroup confirmed it: "That UPRN is in Scotland and therefore
|
|
18
|
+
* authority look-ups do not apply." A £0 quote is the LAST place that should be
|
|
19
|
+
* caught. The address is the first.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/** Postcode areas wholly within Scotland. */
|
|
23
|
+
const SCOTLAND_AREAS = new Set([
|
|
24
|
+
'AB', 'DD', 'DG', 'EH', 'FK', 'G', 'HS', 'IV',
|
|
25
|
+
'KA', 'KW', 'KY', 'ML', 'PA', 'PH', 'ZE',
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Areas that straddle the border, so the postcode alone cannot decide.
|
|
30
|
+
*
|
|
31
|
+
* TD covers the Scottish Borders but also Berwick-upon-Tweed (TD15), which is
|
|
32
|
+
* in England. CA is Cumbria but a handful of CA6 addresses are Scottish.
|
|
33
|
+
* Guessing either way is wrong for real people in real houses, so these resolve
|
|
34
|
+
* to 'ambiguous' and the caller must confirm another way — for a tmGroup order
|
|
35
|
+
* the local-authority lookup is the answer, because it names the actual council.
|
|
36
|
+
*/
|
|
37
|
+
const BORDER_AREAS = new Set(['TD', 'CA']);
|
|
38
|
+
|
|
39
|
+
/** Northern Ireland. Separate legal system, separate registry. */
|
|
40
|
+
const NORTHERN_IRELAND_AREAS = new Set(['BT']);
|
|
41
|
+
|
|
42
|
+
/** Crown dependencies. Not the UK for these purposes, and not our market. */
|
|
43
|
+
const CROWN_DEPENDENCY_AREAS = new Set(['IM', 'GY', 'JE']);
|
|
44
|
+
|
|
45
|
+
export type Jurisdiction =
|
|
46
|
+
| 'england-wales'
|
|
47
|
+
| 'scotland'
|
|
48
|
+
| 'northern-ireland'
|
|
49
|
+
| 'crown-dependency'
|
|
50
|
+
| 'ambiguous'
|
|
51
|
+
| 'unknown';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The postcode AREA — the leading letters before the first digit. `EH10 6QL`
|
|
55
|
+
* gives `EH`, `G1 1AA` gives `G`.
|
|
56
|
+
*
|
|
57
|
+
* Deliberately tolerant of missing spaces and lower case, because this runs on
|
|
58
|
+
* whatever a person typed. It is deliberately NOT tolerant of things that are
|
|
59
|
+
* not postcodes: an unparseable value returns null and the caller decides,
|
|
60
|
+
* rather than being silently treated as England.
|
|
61
|
+
*/
|
|
62
|
+
export function postcodeArea(postcode: string | null | undefined): string | null {
|
|
63
|
+
if (typeof postcode !== 'string') return null;
|
|
64
|
+
const cleaned = postcode.trim().toUpperCase().replace(/\s+/g, '');
|
|
65
|
+
if (!cleaned) return null;
|
|
66
|
+
// A UK outward code is 1-2 letters, then a digit. Anything else is not one.
|
|
67
|
+
const match = /^([A-Z]{1,2})[0-9]/.exec(cleaned);
|
|
68
|
+
return match ? match[1] : null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Which legal system this postcode falls in. */
|
|
72
|
+
export function jurisdictionFromPostcode(postcode: string | null | undefined): Jurisdiction {
|
|
73
|
+
const area = postcodeArea(postcode);
|
|
74
|
+
if (!area) return 'unknown';
|
|
75
|
+
if (SCOTLAND_AREAS.has(area)) return 'scotland';
|
|
76
|
+
if (NORTHERN_IRELAND_AREAS.has(area)) return 'northern-ireland';
|
|
77
|
+
if (CROWN_DEPENDENCY_AREAS.has(area)) return 'crown-dependency';
|
|
78
|
+
if (BORDER_AREAS.has(area)) return 'ambiguous';
|
|
79
|
+
return 'england-wales';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Can PropXchain handle this property?
|
|
84
|
+
*
|
|
85
|
+
* 'ambiguous' and 'unknown' both pass. That is deliberate: this is a guard
|
|
86
|
+
* against the clearly-wrong, not an address validator. Refusing every postcode
|
|
87
|
+
* we failed to parse would turn a typo into a dead end, and refusing Berwick
|
|
88
|
+
* would turn a correct English address into one. What must never happen is a
|
|
89
|
+
* confidently Scottish property reaching a payment screen.
|
|
90
|
+
*/
|
|
91
|
+
export function isSupportedJurisdiction(postcode: string | null | undefined): boolean {
|
|
92
|
+
const jurisdiction = jurisdictionFromPostcode(postcode);
|
|
93
|
+
return jurisdiction !== 'scotland'
|
|
94
|
+
&& jurisdiction !== 'northern-ireland'
|
|
95
|
+
&& jurisdiction !== 'crown-dependency';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* What to tell the person, in their terms. Never "invalid postcode" — their
|
|
100
|
+
* postcode is perfectly valid, it is our coverage that is limited, and saying
|
|
101
|
+
* so plainly is the difference between a clear no and a broken form.
|
|
102
|
+
*/
|
|
103
|
+
export function unsupportedJurisdictionMessage(postcode: string | null | undefined): string | null {
|
|
104
|
+
switch (jurisdictionFromPostcode(postcode)) {
|
|
105
|
+
case 'scotland':
|
|
106
|
+
return 'PropXchain currently covers England and Wales only. Scotland has a separate '
|
|
107
|
+
+ 'conveyancing system and its own land register, so we cannot handle this property yet.';
|
|
108
|
+
case 'northern-ireland':
|
|
109
|
+
return 'PropXchain currently covers England and Wales only. Northern Ireland has a '
|
|
110
|
+
+ 'separate conveyancing system and its own land registry, so we cannot handle this property yet.';
|
|
111
|
+
case 'crown-dependency':
|
|
112
|
+
return 'PropXchain currently covers England and Wales only, which does not include the '
|
|
113
|
+
+ 'Isle of Man or the Channel Islands.';
|
|
114
|
+
default:
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|