@propxchain/core-client 0.2.1 → 0.3.0-canary.24

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.
Files changed (63) hide show
  1. package/README.md +2 -3
  2. package/dist/auth.d.ts +7 -7
  3. package/dist/auth.d.ts.map +1 -1
  4. package/dist/auth.js +5 -5
  5. package/dist/auth.js.map +1 -1
  6. package/dist/canisters/document_storage/document_storage.did.d.ts.map +1 -1
  7. package/dist/canisters/document_storage/document_storage.did.js +90 -21
  8. package/dist/canisters/document_storage/document_storage.did.js.map +1 -1
  9. package/dist/canisters/document_verification/document_verification.did.d.ts.map +1 -1
  10. package/dist/canisters/document_verification/document_verification.did.js +132 -0
  11. package/dist/canisters/document_verification/document_verification.did.js.map +1 -1
  12. package/dist/canisters/email_service/email_service.did.d.ts.map +1 -1
  13. package/dist/canisters/email_service/email_service.did.js +40 -0
  14. package/dist/canisters/email_service/email_service.did.js.map +1 -1
  15. package/dist/canisters/land_registry_integration/land_registry_integration.did.d.ts.map +1 -1
  16. package/dist/canisters/land_registry_integration/land_registry_integration.did.js +186 -12
  17. package/dist/canisters/land_registry_integration/land_registry_integration.did.js.map +1 -1
  18. package/dist/canisters/ledger_manager/ledger_manager.did.d.ts.map +1 -1
  19. package/dist/canisters/ledger_manager/ledger_manager.did.js +55 -0
  20. package/dist/canisters/ledger_manager/ledger_manager.did.js.map +1 -1
  21. package/dist/canisters/transaction_manager/transaction_manager.did.d.ts.map +1 -1
  22. package/dist/canisters/transaction_manager/transaction_manager.did.js +338 -40
  23. package/dist/canisters/transaction_manager/transaction_manager.did.js.map +1 -1
  24. package/dist/canisters/user_management/user_management.did.d.ts.map +1 -1
  25. package/dist/canisters/user_management/user_management.did.js +122 -2
  26. package/dist/canisters/user_management/user_management.did.js.map +1 -1
  27. package/dist/client.js +1 -1
  28. package/dist/client.js.map +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +1 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/mock.js +1 -1
  34. package/dist/mock.js.map +1 -1
  35. package/dist/types.d.ts +1 -1
  36. package/dist/types.d.ts.map +1 -1
  37. package/package.json +3 -6
  38. package/src/auth.ts +8 -9
  39. package/src/canisters/document_storage/document_storage.did +82 -12
  40. package/src/canisters/document_storage/document_storage.did.d.ts +86 -9
  41. package/src/canisters/document_storage/document_storage.did.js +128 -19
  42. package/src/canisters/document_verification/document_verification.did +150 -0
  43. package/src/canisters/document_verification/document_verification.did.d.ts +125 -1
  44. package/src/canisters/document_verification/document_verification.did.js +160 -0
  45. package/src/canisters/email_service/email_service.did +49 -0
  46. package/src/canisters/email_service/email_service.did.d.ts +49 -2
  47. package/src/canisters/email_service/email_service.did.js +68 -0
  48. package/src/canisters/land_registry_integration/land_registry_integration.did +118 -19
  49. package/src/canisters/land_registry_integration/land_registry_integration.did.d.ts +89 -19
  50. package/src/canisters/land_registry_integration/land_registry_integration.did.js +213 -11
  51. package/src/canisters/ledger_manager/ledger_manager.did +78 -0
  52. package/src/canisters/ledger_manager/ledger_manager.did.d.ts +66 -0
  53. package/src/canisters/ledger_manager/ledger_manager.did.js +75 -0
  54. package/src/canisters/transaction_manager/transaction_manager.did +438 -47
  55. package/src/canisters/transaction_manager/transaction_manager.did.d.ts +379 -36
  56. package/src/canisters/transaction_manager/transaction_manager.did.js +346 -40
  57. package/src/canisters/user_management/user_management.did +153 -3
  58. package/src/canisters/user_management/user_management.did.d.ts +121 -2
  59. package/src/canisters/user_management/user_management.did.js +166 -6
  60. package/src/client.ts +1 -1
  61. package/src/index.ts +2 -2
  62. package/src/mock.ts +1 -1
  63. package/src/types.ts +1 -1
@@ -2,10 +2,15 @@ import type { Principal } from '@dfinity/principal';
2
2
  import type { ActorMethod } from '@dfinity/agent';
3
3
  import type { IDL } from '@dfinity/candid';
4
4
 
5
+ export type ActorType = { 'agent' : null } |
6
+ { 'systemActor' : null } |
7
+ { 'user' : null };
5
8
  export interface AuditLog {
6
9
  'id' : bigint,
7
10
  'action' : string,
11
+ 'actorType' : ActorType,
8
12
  'metadata' : string,
13
+ 'delegatedBy' : [] | [Principal],
9
14
  'timestamp' : Time,
10
15
  'success' : boolean,
11
16
  'documentId' : bigint,
@@ -14,23 +19,52 @@ export interface AuditLog {
14
19
  export interface DocumentProof {
15
20
  'id' : bigint,
16
21
  'verified' : boolean,
22
+ 'uploadedChunks' : bigint,
17
23
  'contentType' : string,
24
+ 'titleNumber' : [] | [string],
18
25
  'fileHash' : string,
19
26
  'fileName' : string,
20
27
  'fileSize' : bigint,
28
+ 'documentSource' : DocumentSource,
29
+ 'totalChunks' : bigint,
30
+ 'fetchedFromApi' : boolean,
31
+ 'apiCostPence' : [] | [bigint],
32
+ 'landRegistryReference' : [] | [string],
21
33
  'storageLocation' : string,
22
34
  'docType' : string,
23
35
  'uploadedAt' : Time,
24
36
  'uploadedBy' : Principal,
37
+ 'validUntil' : [] | [bigint],
25
38
  'transactionId' : [] | [string],
26
39
  }
40
+ export type DocumentSource = { 'UserUploaded' : null } |
41
+ { 'LandRegistryAPI' : null } |
42
+ { 'LandRegistryNotification' : null } |
43
+ { 'SystemGenerated' : null };
27
44
  export type Result = { 'ok' : boolean } |
28
45
  { 'err' : string };
29
- export type Result_1 = { 'ok' : string } |
46
+ export type Result_1 = {
47
+ 'ok' : {
48
+ 'uploadedChunks' : bigint,
49
+ 'totalChunks' : bigint,
50
+ 'isComplete' : boolean,
51
+ }
52
+ } |
53
+ { 'err' : string };
54
+ export type Result_2 = { 'ok' : string } |
30
55
  { 'err' : string };
31
- export type Result_2 = { 'ok' : bigint } |
56
+ export type Result_3 = { 'ok' : bigint } |
32
57
  { 'err' : string };
33
- export type Result_3 = {
58
+ export type Result_4 = {
59
+ 'ok' : {
60
+ 'uploadedChunks' : bigint,
61
+ 'totalChunks' : bigint,
62
+ 'missingChunks' : Array<bigint>,
63
+ 'isComplete' : boolean,
64
+ }
65
+ } |
66
+ { 'err' : string };
67
+ export type Result_5 = {
34
68
  'ok' : {
35
69
  'id' : bigint,
36
70
  'contentType' : string,
@@ -45,15 +79,34 @@ export type Result_3 = {
45
79
  }
46
80
  } |
47
81
  { 'err' : string };
82
+ export type Result_6 = { 'ok' : Uint8Array | number[] } |
83
+ { 'err' : string };
48
84
  export type Time = bigint;
49
85
  export interface _SERVICE {
50
- 'deleteDocument' : ActorMethod<[bigint, string], Result_1>,
86
+ 'deleteDocument' : ActorMethod<[bigint, string], Result_2>,
87
+ 'downloadDocumentChunk' : ActorMethod<[bigint, bigint], Result_6>,
51
88
  'generateCSRFToken' : ActorMethod<[], string>,
52
89
  'getAuditLogs' : ActorMethod<[bigint], Array<AuditLog>>,
53
90
  'getCSRFToken' : ActorMethod<[], [] | [string]>,
54
91
  'getCycles' : ActorMethod<[], bigint>,
55
- 'getDocumentMetadata' : ActorMethod<[bigint], Result_3>,
92
+ 'getDocumentByLandRegistryReference' : ActorMethod<
93
+ [string],
94
+ [] | [DocumentProof]
95
+ >,
96
+ 'getDocumentMetadata' : ActorMethod<[bigint], Result_5>,
56
97
  'getDocumentProof' : ActorMethod<[bigint], [] | [DocumentProof]>,
98
+ 'getDocumentUploadStatus' : ActorMethod<[bigint], Result_4>,
99
+ 'getDocumentVerificationCanister' : ActorMethod<[], [] | [Principal]>,
100
+ 'getExpiredLandRegistryDocuments' : ActorMethod<[], Array<DocumentProof>>,
101
+ 'getLandRegistryCanister' : ActorMethod<[], [] | [Principal]>,
102
+ 'getLandRegistryDocumentsForTitle' : ActorMethod<
103
+ [string],
104
+ Array<DocumentProof>
105
+ >,
106
+ 'getLandRegistryDocumentsForTransaction' : ActorMethod<
107
+ [string],
108
+ Array<DocumentProof>
109
+ >,
57
110
  'getMyAuditLogs' : ActorMethod<[Principal], Array<AuditLog>>,
58
111
  'getRecentAuditLogs' : ActorMethod<[bigint], Array<AuditLog>>,
59
112
  'getStorageStats' : ActorMethod<
@@ -68,13 +121,37 @@ export interface _SERVICE {
68
121
  'getTransactionDocuments' : ActorMethod<[string], Array<DocumentProof>>,
69
122
  'getTransactionManagerCanister' : ActorMethod<[], [] | [Principal]>,
70
123
  'getUserManagementCanister' : ActorMethod<[], [] | [Principal]>,
71
- 'markDocumentDeleted' : ActorMethod<[bigint, string], Result_1>,
124
+ 'markDocumentDeleted' : ActorMethod<[bigint, string], Result_2>,
125
+ 'recordAuditEntry' : ActorMethod<
126
+ [ActorType, [] | [Principal], string, bigint, boolean, string],
127
+ Result_3
128
+ >,
72
129
  'registerDocumentProof' : ActorMethod<
73
130
  [string, string, bigint, string, string, [] | [string], string, string],
74
- Result_2
131
+ Result_3
132
+ >,
133
+ 'registerLandRegistryDocument' : ActorMethod<
134
+ [
135
+ string,
136
+ string,
137
+ string,
138
+ string,
139
+ bigint,
140
+ string,
141
+ string,
142
+ [] | [bigint],
143
+ bigint,
144
+ ],
145
+ Result_3
146
+ >,
147
+ 'setDocumentVerificationCanister' : ActorMethod<[Principal], Result_2>,
148
+ 'setLandRegistryCanister' : ActorMethod<[Principal], Result_2>,
149
+ 'setTransactionManagerCanister' : ActorMethod<[Principal, string], Result_2>,
150
+ 'setUserManagementCanister' : ActorMethod<[Principal, string], Result_2>,
151
+ 'uploadDocumentChunk' : ActorMethod<
152
+ [bigint, bigint, Uint8Array | number[], string],
153
+ Result_1
75
154
  >,
76
- 'setTransactionManagerCanister' : ActorMethod<[Principal, string], Result_1>,
77
- 'setUserManagementCanister' : ActorMethod<[Principal, string], Result_1>,
78
155
  'validateCSRFToken' : ActorMethod<[string], boolean>,
79
156
  'verifyDocumentHash' : ActorMethod<[bigint, string, string], Result>,
80
157
  }
@@ -1,16 +1,51 @@
1
1
  export const idlFactory = ({ IDL }) => {
2
- const Result_1 = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
2
+ const Result_2 = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
3
+ const Result_6 = IDL.Variant({ 'ok' : IDL.Vec(IDL.Nat8), 'err' : IDL.Text });
4
+ const ActorType = IDL.Variant({
5
+ 'agent' : IDL.Null,
6
+ 'systemActor' : IDL.Null,
7
+ 'user' : IDL.Null,
8
+ });
3
9
  const Time = IDL.Int;
4
10
  const AuditLog = IDL.Record({
5
11
  'id' : IDL.Nat,
6
12
  'action' : IDL.Text,
13
+ 'actorType' : ActorType,
7
14
  'metadata' : IDL.Text,
15
+ 'delegatedBy' : IDL.Opt(IDL.Principal),
8
16
  'timestamp' : Time,
9
17
  'success' : IDL.Bool,
10
18
  'documentId' : IDL.Nat,
11
19
  'actorPrincipal' : IDL.Principal,
12
20
  });
13
- const Result_3 = IDL.Variant({
21
+ const DocumentSource = IDL.Variant({
22
+ 'UserUploaded' : IDL.Null,
23
+ 'LandRegistryAPI' : IDL.Null,
24
+ 'LandRegistryNotification' : IDL.Null,
25
+ 'SystemGenerated' : IDL.Null,
26
+ });
27
+ const DocumentProof = IDL.Record({
28
+ 'id' : IDL.Nat,
29
+ 'verified' : IDL.Bool,
30
+ 'uploadedChunks' : IDL.Nat,
31
+ 'contentType' : IDL.Text,
32
+ 'titleNumber' : IDL.Opt(IDL.Text),
33
+ 'fileHash' : IDL.Text,
34
+ 'fileName' : IDL.Text,
35
+ 'fileSize' : IDL.Nat,
36
+ 'documentSource' : DocumentSource,
37
+ 'totalChunks' : IDL.Nat,
38
+ 'fetchedFromApi' : IDL.Bool,
39
+ 'apiCostPence' : IDL.Opt(IDL.Nat),
40
+ 'landRegistryReference' : IDL.Opt(IDL.Text),
41
+ 'storageLocation' : IDL.Text,
42
+ 'docType' : IDL.Text,
43
+ 'uploadedAt' : Time,
44
+ 'uploadedBy' : IDL.Principal,
45
+ 'validUntil' : IDL.Opt(IDL.Int),
46
+ 'transactionId' : IDL.Opt(IDL.Text),
47
+ });
48
+ const Result_5 = IDL.Variant({
14
49
  'ok' : IDL.Record({
15
50
  'id' : IDL.Nat,
16
51
  'contentType' : IDL.Text,
@@ -25,33 +60,69 @@ export const idlFactory = ({ IDL }) => {
25
60
  }),
26
61
  'err' : IDL.Text,
27
62
  });
28
- const DocumentProof = IDL.Record({
29
- 'id' : IDL.Nat,
30
- 'verified' : IDL.Bool,
31
- 'contentType' : IDL.Text,
32
- 'fileHash' : IDL.Text,
33
- 'fileName' : IDL.Text,
34
- 'fileSize' : IDL.Nat,
35
- 'storageLocation' : IDL.Text,
36
- 'docType' : IDL.Text,
37
- 'uploadedAt' : Time,
38
- 'uploadedBy' : IDL.Principal,
39
- 'transactionId' : IDL.Opt(IDL.Text),
63
+ const Result_4 = IDL.Variant({
64
+ 'ok' : IDL.Record({
65
+ 'uploadedChunks' : IDL.Nat,
66
+ 'totalChunks' : IDL.Nat,
67
+ 'missingChunks' : IDL.Vec(IDL.Nat),
68
+ 'isComplete' : IDL.Bool,
69
+ }),
70
+ 'err' : IDL.Text,
71
+ });
72
+ const Result_3 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text });
73
+ const Result_1 = IDL.Variant({
74
+ 'ok' : IDL.Record({
75
+ 'uploadedChunks' : IDL.Nat,
76
+ 'totalChunks' : IDL.Nat,
77
+ 'isComplete' : IDL.Bool,
78
+ }),
79
+ 'err' : IDL.Text,
40
80
  });
41
- const Result_2 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text });
42
81
  const Result = IDL.Variant({ 'ok' : IDL.Bool, 'err' : IDL.Text });
43
82
  return IDL.Service({
44
- 'deleteDocument' : IDL.Func([IDL.Nat, IDL.Text], [Result_1], []),
83
+ 'deleteDocument' : IDL.Func([IDL.Nat, IDL.Text], [Result_2], []),
84
+ 'downloadDocumentChunk' : IDL.Func([IDL.Nat, IDL.Nat], [Result_6], []),
45
85
  'generateCSRFToken' : IDL.Func([], [IDL.Text], []),
46
86
  'getAuditLogs' : IDL.Func([IDL.Nat], [IDL.Vec(AuditLog)], ['query']),
47
87
  'getCSRFToken' : IDL.Func([], [IDL.Opt(IDL.Text)], ['query']),
48
88
  'getCycles' : IDL.Func([], [IDL.Nat], ['query']),
49
- 'getDocumentMetadata' : IDL.Func([IDL.Nat], [Result_3], ['query']),
89
+ 'getDocumentByLandRegistryReference' : IDL.Func(
90
+ [IDL.Text],
91
+ [IDL.Opt(DocumentProof)],
92
+ ['query'],
93
+ ),
94
+ 'getDocumentMetadata' : IDL.Func([IDL.Nat], [Result_5], ['query']),
50
95
  'getDocumentProof' : IDL.Func(
51
96
  [IDL.Nat],
52
97
  [IDL.Opt(DocumentProof)],
53
98
  ['query'],
54
99
  ),
100
+ 'getDocumentUploadStatus' : IDL.Func([IDL.Nat], [Result_4], ['query']),
101
+ 'getDocumentVerificationCanister' : IDL.Func(
102
+ [],
103
+ [IDL.Opt(IDL.Principal)],
104
+ ['query'],
105
+ ),
106
+ 'getExpiredLandRegistryDocuments' : IDL.Func(
107
+ [],
108
+ [IDL.Vec(DocumentProof)],
109
+ ['query'],
110
+ ),
111
+ 'getLandRegistryCanister' : IDL.Func(
112
+ [],
113
+ [IDL.Opt(IDL.Principal)],
114
+ ['query'],
115
+ ),
116
+ 'getLandRegistryDocumentsForTitle' : IDL.Func(
117
+ [IDL.Text],
118
+ [IDL.Vec(DocumentProof)],
119
+ ['query'],
120
+ ),
121
+ 'getLandRegistryDocumentsForTransaction' : IDL.Func(
122
+ [IDL.Text],
123
+ [IDL.Vec(DocumentProof)],
124
+ ['query'],
125
+ ),
55
126
  'getMyAuditLogs' : IDL.Func(
56
127
  [IDL.Principal],
57
128
  [IDL.Vec(AuditLog)],
@@ -85,7 +156,19 @@ export const idlFactory = ({ IDL }) => {
85
156
  [IDL.Opt(IDL.Principal)],
86
157
  ['query'],
87
158
  ),
88
- 'markDocumentDeleted' : IDL.Func([IDL.Nat, IDL.Text], [Result_1], []),
159
+ 'markDocumentDeleted' : IDL.Func([IDL.Nat, IDL.Text], [Result_2], []),
160
+ 'recordAuditEntry' : IDL.Func(
161
+ [
162
+ ActorType,
163
+ IDL.Opt(IDL.Principal),
164
+ IDL.Text,
165
+ IDL.Nat,
166
+ IDL.Bool,
167
+ IDL.Text,
168
+ ],
169
+ [Result_3],
170
+ [],
171
+ ),
89
172
  'registerDocumentProof' : IDL.Func(
90
173
  [
91
174
  IDL.Text,
@@ -97,16 +180,42 @@ export const idlFactory = ({ IDL }) => {
97
180
  IDL.Text,
98
181
  IDL.Text,
99
182
  ],
183
+ [Result_3],
184
+ [],
185
+ ),
186
+ 'registerLandRegistryDocument' : IDL.Func(
187
+ [
188
+ IDL.Text,
189
+ IDL.Text,
190
+ IDL.Text,
191
+ IDL.Text,
192
+ IDL.Nat,
193
+ IDL.Text,
194
+ IDL.Text,
195
+ IDL.Opt(IDL.Int),
196
+ IDL.Nat,
197
+ ],
198
+ [Result_3],
199
+ [],
200
+ ),
201
+ 'setDocumentVerificationCanister' : IDL.Func(
202
+ [IDL.Principal],
100
203
  [Result_2],
101
204
  [],
102
205
  ),
206
+ 'setLandRegistryCanister' : IDL.Func([IDL.Principal], [Result_2], []),
103
207
  'setTransactionManagerCanister' : IDL.Func(
104
208
  [IDL.Principal, IDL.Text],
105
- [Result_1],
209
+ [Result_2],
106
210
  [],
107
211
  ),
108
212
  'setUserManagementCanister' : IDL.Func(
109
213
  [IDL.Principal, IDL.Text],
214
+ [Result_2],
215
+ [],
216
+ ),
217
+ 'uploadDocumentChunk' : IDL.Func(
218
+ [IDL.Nat, IDL.Nat, IDL.Vec(IDL.Nat8), IDL.Text],
110
219
  [Result_1],
111
220
  [],
112
221
  ),
@@ -3,15 +3,137 @@ type VerificationMethod =
3
3
  commercial_api: text;
4
4
  dvla_api;
5
5
  manual_solicitor;
6
+ oscar_ai: OscarVerificationDetails;
6
7
  passport_dcs;
7
8
  system_hash_only;
8
9
  };
10
+ type TransactionVerificationSummary =
11
+ record {
12
+ allDocumentsVerified: bool;
13
+ allLRDocumentsCurrent: bool;
14
+ daysUntilSearchExpiry: opt int;
15
+ expiredDocuments: nat;
16
+ hasOfficialSearch: bool;
17
+ lrDocuments: vec LRDocumentSummary;
18
+ missingDocuments: vec text;
19
+ officialSearchExpiry: opt int;
20
+ officialSearchValid: bool;
21
+ readyForCompletion: bool;
22
+ readyForExchange: bool;
23
+ readyForSubmission: bool;
24
+ titleNumber: text;
25
+ totalDocuments: nat;
26
+ transactionId: text;
27
+ unverifiedDocuments: nat;
28
+ verifiedDocuments: nat;
29
+ };
9
30
  type Time = int;
31
+ type Result_4 =
32
+ variant {
33
+ err: text;
34
+ ok: TransactionVerificationSummary;
35
+ };
36
+ type Result_3 =
37
+ variant {
38
+ err: text;
39
+ ok: nat;
40
+ };
41
+ type Result_2 =
42
+ variant {
43
+ err: text;
44
+ ok: OfficialCopyVerification;
45
+ };
46
+ type Result_1 =
47
+ variant {
48
+ err: text;
49
+ ok: OSCertificateVerification;
50
+ };
10
51
  type Result =
11
52
  variant {
12
53
  err: text;
13
54
  ok: DocumentVerification;
14
55
  };
56
+ type PriorityStatus =
57
+ variant {
58
+ Active;
59
+ Expired;
60
+ ExpiringImminently;
61
+ Unknown;
62
+ };
63
+ type OscarVerificationInput =
64
+ record {
65
+ confidence: nat;
66
+ documentType: text;
67
+ extractedData: text;
68
+ issues: vec OscarIssue;
69
+ mismatches: vec DataMismatch;
70
+ requiresSolicitorReview: bool;
71
+ };
72
+ type OscarVerificationDetails =
73
+ record {
74
+ analysisTimestamp: Time;
75
+ confidence: nat;
76
+ documentType: text;
77
+ extractedData: text;
78
+ issues: vec OscarIssue;
79
+ mismatches: vec DataMismatch;
80
+ requiresSolicitorReview: bool;
81
+ };
82
+ type OscarIssue =
83
+ record {
84
+ code: text;
85
+ field: opt text;
86
+ message: text;
87
+ severity: variant {
88
+ error;
89
+ info;
90
+ warning;
91
+ };
92
+ };
93
+ type OfficialCopyVerification =
94
+ record {
95
+ copyType: LRDocumentType;
96
+ documentAge: nat;
97
+ hashVerified: bool;
98
+ isCurrent: bool;
99
+ issuedAt: int;
100
+ titleNumberMatches: bool;
101
+ verifiedAt: int;
102
+ verifiedBy: principal;
103
+ };
104
+ type OSCertificateVerification =
105
+ record {
106
+ advisoryEntries: vec text;
107
+ daysRemaining: opt int;
108
+ hashVerified: bool;
109
+ priorityExpiry: opt int;
110
+ priorityStatus: PriorityStatus;
111
+ registerChangedFlag: opt bool;
112
+ titleNumberMatches: bool;
113
+ verifiedAt: int;
114
+ verifiedBy: principal;
115
+ };
116
+ type LRDocumentType =
117
+ variant {
118
+ AP1Acknowledgement;
119
+ CompletionConfirmation;
120
+ LandChargesSearchK16;
121
+ LocalAuthoritySearch;
122
+ OfficialCopyRegister;
123
+ OfficialCopyTitlePlan;
124
+ OfficialSearchCertificate;
125
+ RegisterExtract;
126
+ RequisitionNotice;
127
+ SearchOfPartCertificate;
128
+ };
129
+ type LRDocumentSummary =
130
+ record {
131
+ documentType: LRDocumentType;
132
+ isCurrent: bool;
133
+ isVerified: bool;
134
+ landRegistryReference: opt text;
135
+ validUntil: opt int;
136
+ };
15
137
  type DocumentVerification =
16
138
  record {
17
139
  calculatedHash: text;
@@ -45,9 +167,17 @@ type DocumentMetadata =
45
167
  uploadedAt: Time;
46
168
  uploadedBy: principal;
47
169
  };
170
+ type DataMismatch =
171
+ record {
172
+ expected: text;
173
+ field: text;
174
+ found: text;
175
+ };
48
176
  type AuditLog =
49
177
  record {
50
178
  action: text;
179
+ actorType: ActorType;
180
+ delegatedBy: opt principal;
51
181
  details: text;
52
182
  documentId: nat;
53
183
  id: nat;
@@ -55,6 +185,12 @@ type AuditLog =
55
185
  success: bool;
56
186
  timestamp: Time;
57
187
  };
188
+ type ActorType =
189
+ variant {
190
+ agent;
191
+ systemActor;
192
+ user;
193
+ };
58
194
  service : {
59
195
  deleteDocument: (documentId: nat) -> (variant {
60
196
  err: text;
@@ -70,6 +206,8 @@ service : {
70
206
  getDocument: (id: nat) -> (opt DocumentMetadata) query;
71
207
  getDocumentVerifications: (documentId: nat) ->
72
208
  (vec DocumentVerification) query;
209
+ getOscarVerificationDetails: (verificationId: nat) ->
210
+ (opt OscarVerificationDetails) query;
73
211
  getPropertyDocuments: (propertyId: nat) -> (vec DocumentMetadata) query;
74
212
  getRecentAuditLogs: (limit: nat) -> (vec AuditLog) query;
75
213
  getStats: () ->
@@ -79,10 +217,16 @@ service : {
79
217
  totalVerifications: nat;
80
218
  verifiedDocuments: nat;
81
219
  }) query;
220
+ getTransactionVerificationSummary: (transactionId: text, titleNumber:
221
+ text) -> (Result_4);
82
222
  getUnverifiedDocuments: (propertyId: nat) -> (vec DocumentMetadata) query;
83
223
  getVerification: (verificationId: nat) -> (opt DocumentVerification) query;
224
+ getVerificationsByTransaction: (txId: nat) ->
225
+ (vec DocumentVerification) query;
84
226
  getVerificationsByVerifier: (verifier: principal) ->
85
227
  (vec DocumentVerification) query;
228
+ recordAuditEntry: (actorType: ActorType, delegatedBy: opt principal,
229
+ action: text, documentId: nat, details: text, success: bool) -> (Result_3);
86
230
  registerDocument: (propertyId: nat, transactionId: opt nat, documentType:
87
231
  text, documentHash: text, storageDocumentId: opt nat, fileName: opt text,
88
232
  fileSize: opt nat, contentType: opt text) -> (nat);
@@ -90,9 +234,15 @@ service : {
90
234
  setUserManagementCanister: (canisterId: principal) -> ();
91
235
  verifyDocument: (documentId: nat) -> (bool);
92
236
  verifyDocumentWithHash: (documentId: nat, notes: opt text) -> (Result);
237
+ verifyOfficialCopy: (documentId: nat, expectedTitleNumber: text,
238
+ maxAgeDays: nat) -> (Result_2);
239
+ verifyOfficialSearchCertificate: (documentId: nat, expectedTitleNumber:
240
+ text, _expectedTransactionId: opt text) -> (Result_1);
93
241
  verifyWithCommercialAPI: (_documentId: nat, _apiProvider: text,
94
242
  _verificationData: text) -> (Result);
95
243
  verifyWithDVLA: (_documentId: nat, _drivingLicenseNumber: text) -> (Result);
244
+ verifyWithOscar: (documentId: nat, oscarResult: OscarVerificationInput) ->
245
+ (Result);
96
246
  verifyWithPassportDCS: (_documentId: nat, _passportNumber: text) ->
97
247
  (Result);
98
248
  }