highcourt-affidavit-elements 0.2.18 → 0.2.19
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/README.md +350 -221
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,315 +1,444 @@
|
|
|
1
|
-
# Federal High Court Affidavit Library
|
|
1
|
+
# Federal High Court Affidavit Library
|
|
2
|
+
## Angular Library & Web Components – Complete Integration Guide
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
---
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
## 1. Overview
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
The **Federal High Court Affidavit Library** is delivered in **two complementary integration models**:
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
+
1. **Angular Library (`highcourt-affidavit`)**
|
|
16
|
+
Designed for internal Angular applications that require:
|
|
17
|
+
- Tight framework integration
|
|
18
|
+
- Service-based API access
|
|
19
|
+
- Full TypeScript support
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
2. **Web Components (`highcourt-affidavit-elements`)**
|
|
22
|
+
Framework-agnostic custom elements for:
|
|
23
|
+
- Partner portals and MDAs
|
|
24
|
+
- Angular, React, Vue, or plain HTML
|
|
25
|
+
- CDN-based, copy‑paste integration
|
|
17
26
|
|
|
18
|
-
|
|
27
|
+
This document provides **complete documentation** for **both the Angular library and all Web Components**, including **all callback events**.
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
- Stylesheet: `styles.css`
|
|
22
|
-
- Static assets: `assets/` and `media/`
|
|
23
|
-
- Optional single-tag loader: `loader.js`
|
|
29
|
+
---
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
# PART A — ANGULAR LIBRARY (`highcourt-affidavit`)
|
|
32
|
+
|
|
33
|
+
## 2. Installation
|
|
26
34
|
|
|
27
35
|
```bash
|
|
28
|
-
npm
|
|
29
|
-
#
|
|
36
|
+
npm install highcourt-affidavit
|
|
37
|
+
# or
|
|
38
|
+
yarn add highcourt-affidavit
|
|
30
39
|
```
|
|
31
40
|
|
|
32
|
-
|
|
41
|
+
---
|
|
33
42
|
|
|
34
|
-
|
|
43
|
+
## 3. Module Setup
|
|
35
44
|
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
```ts
|
|
46
|
+
import { NgModule } from "@angular/core";
|
|
47
|
+
import { HighcourtAffidavitModule } from "highcourt-affidavit";
|
|
48
|
+
import { environment } from "../environments/environment";
|
|
49
|
+
|
|
50
|
+
@NgModule({
|
|
51
|
+
imports: [
|
|
52
|
+
HighcourtAffidavitModule.forRoot(
|
|
53
|
+
environment.affidavit_api_secret_key,
|
|
54
|
+
environment.mode
|
|
55
|
+
),
|
|
56
|
+
],
|
|
57
|
+
})
|
|
58
|
+
export class AppModule {}
|
|
50
59
|
```
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
> Ensure `affidavit_api_secret_key` and `affidavit_api_public_key` are defined in your environment files.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 4. Angular Components
|
|
66
|
+
|
|
67
|
+
### 4.1 `<highcourt-affidavit>` – Single Affidavit
|
|
53
68
|
|
|
54
69
|
```html
|
|
55
|
-
<
|
|
56
|
-
|
|
70
|
+
<highcourt-affidavit [templateId]="template_id"
|
|
71
|
+
(callBack)="onAffidavitCallback($event)">
|
|
72
|
+
</highcourt-affidavit>
|
|
57
73
|
```
|
|
58
74
|
|
|
59
|
-
|
|
75
|
+
**Events**
|
|
76
|
+
- `callBack` – affidavit application completed
|
|
77
|
+
- `paymentSuccess` – payment completed (if applicable)
|
|
78
|
+
- `overlayClose` – overlay closed by user/system
|
|
60
79
|
|
|
61
|
-
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### 4.2 `<e-affidavit-bulk-create-applications>` – Bulk Affidavits
|
|
62
83
|
|
|
63
84
|
```html
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
85
|
+
<e-affidavit-bulk-create-applications
|
|
86
|
+
[payload]="bulkPayload"
|
|
87
|
+
[affidavitTemplateId]="templateId"
|
|
88
|
+
[client_ref]="clientRef"
|
|
89
|
+
(callBack)="onBulkCallback($event)">
|
|
90
|
+
</e-affidavit-bulk-create-applications>
|
|
68
91
|
```
|
|
69
92
|
|
|
70
|
-
|
|
93
|
+
**Events**
|
|
94
|
+
- `callBack` – bulk workflow completed
|
|
95
|
+
- `overlayClose` – bulk workspace closed
|
|
71
96
|
|
|
72
|
-
|
|
97
|
+
---
|
|
73
98
|
|
|
74
|
-
|
|
99
|
+
## 5. Angular Services
|
|
75
100
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
101
|
+
### `HighcourtAffidavitLibraryService`
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
this.affidavitService.create(data).subscribe(...)
|
|
105
|
+
this.affidavitService.createBulk(data).subscribe(...)
|
|
106
|
+
...
|
|
79
107
|
```
|
|
80
108
|
|
|
81
|
-
|
|
109
|
+
Used for **headless / backend-driven** affidavit creation.
|
|
82
110
|
|
|
83
|
-
|
|
84
|
-
// main.ts / index.ts / bootstrap.js
|
|
85
|
-
import { defineCustomElements } from "highcourt-affidavit-elements/loader";
|
|
111
|
+
---
|
|
86
112
|
|
|
87
|
-
|
|
113
|
+
## 6. Angular Callback Contract
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
interface AngularAffidavitCallback {
|
|
117
|
+
status: "success" | "failed";
|
|
118
|
+
reference?: string;
|
|
119
|
+
data: any;
|
|
120
|
+
}
|
|
88
121
|
```
|
|
89
122
|
|
|
90
|
-
|
|
123
|
+
---
|
|
91
124
|
|
|
92
|
-
|
|
93
|
-
<highcourt-affidavit-app token="FHC_sk_xxxxxx" mode="test" app-id="AFF-12345" template-id="TEMPLATE-01"></highcourt-affidavit-app>
|
|
94
|
-
```
|
|
125
|
+
# PART B — WEB COMPONENTS (`highcourt-affidavit-elements`)
|
|
95
126
|
|
|
96
|
-
|
|
127
|
+
## 7. What Are the Web Components?
|
|
97
128
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
129
|
+
Web Components are **native browser custom elements** built with Angular Elements.
|
|
130
|
+
They encapsulate:
|
|
131
|
+
- UI & validation
|
|
132
|
+
- Workflow orchestration
|
|
133
|
+
- Payment initiation
|
|
134
|
+
- Secure API calls
|
|
135
|
+
- Event emission
|
|
101
136
|
|
|
102
|
-
|
|
137
|
+
They **do not require Angular/React/Vuejs** in the consuming app.
|
|
103
138
|
|
|
104
|
-
|
|
139
|
+
---
|
|
105
140
|
|
|
106
|
-
|
|
141
|
+
## 8. Available Web Components
|
|
107
142
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
</script>
|
|
118
|
-
</head>
|
|
119
|
-
<body>
|
|
120
|
-
<highcourt-affidavit-app token="FHC_sk_xxxxxx" mode="test" app-id="AFF-12345" template-id="TEMPLATE-01"></highcourt-affidavit-app>
|
|
121
|
-
</body>
|
|
122
|
-
</html>
|
|
123
|
-
```
|
|
143
|
+
| Component | Tag | Purpose |
|
|
144
|
+
|--------|-----|--------|
|
|
145
|
+
| Affidavit Application | `<highcourt-affidavit>` | Create & submit affidavits |
|
|
146
|
+
| Payment | `<pay-affidavit>` | Pay for an existing affidavit |
|
|
147
|
+
| Bulk Workspace | `<bulk-create-applications>` | Manage multiple affidavits |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 9. Distribution (CDN – Recommended)
|
|
124
152
|
|
|
125
|
-
|
|
153
|
+
```html
|
|
154
|
+
<link rel="stylesheet"
|
|
155
|
+
href="https://cdn.jsdelivr.net/npm/highcourt-affidavit-elements@0.x.x/dist/affidavit-library/browser/styles.css" />
|
|
126
156
|
|
|
127
|
-
|
|
157
|
+
<script src="https://cdn.jsdelivr.net/npm/highcourt-affidavit-elements@0.x.x/dist/affidavit-library/browser/polyfills.js" type="module"></script>
|
|
158
|
+
<script src="https://cdn.jsdelivr.net/npm/highcourt-affidavit-elements@0.x.x/dist/affidavit-library/browser/scripts.js" defer></script>
|
|
159
|
+
<script src="https://cdn.jsdelivr.net/npm/highcourt-affidavit-elements@0.x.x/dist/affidavit-library/browser/main.js" type="module"></script>
|
|
160
|
+
```
|
|
128
161
|
|
|
162
|
+
### Alternatively
|
|
129
163
|
```html
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<head>
|
|
133
|
-
<meta charset="utf-8" />
|
|
134
|
-
<title>Affidavit CDN Demo</title>
|
|
135
|
-
<script type="module">
|
|
136
|
-
import { defineCustomElements } from "https://cdn.jsdelivr.net/npm/highcourt-affidavit-elements@0.2.3/dist/affidavit-library/browser/loader.js";
|
|
137
|
-
defineCustomElements(window);
|
|
138
|
-
</script>
|
|
139
|
-
</head>
|
|
140
|
-
<body>
|
|
141
|
-
<highcourt-affidavit-app token="FHC_sk_xxxxxx" mode="test" app-id="AFF-12345" template-id="TEMPLATE-01"></highcourt-affidavit-app>
|
|
142
|
-
</body>
|
|
143
|
-
</html>
|
|
164
|
+
<script src="https://cdn.jsdelivr.net/npm/highcourt-affidavit-elements@0.x.x/dist/affidavit-library/browser/loader.js" ></script>
|
|
165
|
+
|
|
144
166
|
```
|
|
167
|
+
---
|
|
145
168
|
|
|
146
|
-
|
|
169
|
+
## 10. `<highcourt-affidavit>` – Web Component
|
|
147
170
|
|
|
148
|
-
###
|
|
171
|
+
### Attributes
|
|
149
172
|
|
|
150
|
-
|
|
151
|
-
|
|
173
|
+
| Attribute | Required | Description |
|
|
174
|
+
|--------|----------|-------------|
|
|
175
|
+
| `token` | ❌ | API key |
|
|
176
|
+
| `mode` | ❌ | `development` or `production` |
|
|
177
|
+
| `template-id` | ❌ | Affidavit template |
|
|
178
|
+
| `templateId` | ❌ | Affidavit template |
|
|
179
|
+
| `client-ref` | ❌ | Client reference |
|
|
180
|
+
| `clientRef` | ❌ | Client reference |
|
|
181
|
+
| `payload` | ❌ | Prefilled data (JSON) |
|
|
152
182
|
|
|
153
|
-
|
|
183
|
+
### Callbacks
|
|
154
184
|
|
|
155
|
-
|
|
185
|
+
| Event | Description |
|
|
186
|
+
|-----|------------|
|
|
187
|
+
| `callBack` | Application submitted |
|
|
188
|
+
| `on-payment-success` / `paymentSuccess` | Payment completed |
|
|
189
|
+
| `overlay-close` / `overlayClose` | Overlay closed |
|
|
156
190
|
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
npm install
|
|
160
|
-
npm run build:elements
|
|
161
|
-
```
|
|
162
|
-
2. (Optional) inspect the package contents:
|
|
163
|
-
```bash
|
|
164
|
-
npm pack
|
|
165
|
-
tar -tf highcourt-affidavit-elements-0.2.3.tgz
|
|
166
|
-
```
|
|
167
|
-
3. Publish a new version:
|
|
168
|
-
```bash
|
|
169
|
-
npm login
|
|
170
|
-
npm version patch # or minor / major
|
|
171
|
-
npm publish --access public
|
|
172
|
-
```
|
|
173
|
-
4. Tag the release in git:
|
|
174
|
-
```bash
|
|
175
|
-
git tag v0.2.3
|
|
176
|
-
git push origin v0.2.3
|
|
177
|
-
```
|
|
191
|
+
---
|
|
178
192
|
|
|
179
|
-
|
|
193
|
+
## 11. `<pay-affidavit>` – Web Component
|
|
180
194
|
|
|
181
|
-
###
|
|
195
|
+
### Attributes
|
|
182
196
|
|
|
183
|
-
|
|
197
|
+
| Attribute | Required | Description |
|
|
198
|
+
|--------|----------|-------------|
|
|
199
|
+
| `token` | ✅ | API key |
|
|
200
|
+
| `app-no` | ✅ | Application number |
|
|
201
|
+
| `should-display-details` | ❌ | Show payment breakdown |
|
|
184
202
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
203
|
+
### Callbacks
|
|
204
|
+
|
|
205
|
+
| Event | Description |
|
|
206
|
+
|-----|------------|
|
|
207
|
+
| `handlePayment` | Payment processed (success/failure) |
|
|
208
|
+
| `overlayClose` | Payment overlay closed |
|
|
209
|
+
|
|
210
|
+
```js
|
|
211
|
+
payElement.addEventListener("handlePayment", (e) => {
|
|
212
|
+
console.log("Payment status:", e.detail.status);
|
|
213
|
+
});
|
|
189
214
|
```
|
|
190
215
|
|
|
191
|
-
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## 12. `<bulk-create-applications>` – Web Component
|
|
192
219
|
|
|
193
|
-
|
|
220
|
+
### Attributes
|
|
194
221
|
|
|
195
|
-
|
|
222
|
+
| Attribute | Required | Description |
|
|
223
|
+
|--------|----------|-------------|
|
|
224
|
+
| `token` | ❌ | API key |
|
|
225
|
+
| `mode` | ❌ | Environment |
|
|
226
|
+
| `affidavit-template-id` | ✅ | Template ID |
|
|
227
|
+
| `client-ref` | ❌ | Bulk session reference |
|
|
228
|
+
| `page` | ❌ | new | review | details | summary |
|
|
196
229
|
|
|
197
|
-
|
|
198
|
-
npm install highcourt-affidavit
|
|
199
|
-
```
|
|
230
|
+
### Callbacks
|
|
200
231
|
|
|
201
|
-
|
|
232
|
+
| Event | Description |
|
|
233
|
+
|-----|------------|
|
|
234
|
+
| `callBack` | Bulk submission completed |
|
|
235
|
+
| `overlayClose` | Workspace closed |
|
|
236
|
+
| `error` | Bulk workflow error |
|
|
202
237
|
|
|
203
|
-
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 13. Unified Web Component Callback Contract
|
|
204
241
|
|
|
205
242
|
```ts
|
|
206
|
-
|
|
243
|
+
interface WebComponentCallback {
|
|
244
|
+
component: "highcourt-affidavit" | "pay-affidavit" | "bulk-create-applications";
|
|
245
|
+
action:
|
|
246
|
+
| "application_submitted"
|
|
247
|
+
| "payment_completed"
|
|
248
|
+
| "bulk_completed"
|
|
249
|
+
| "overlay_closed"
|
|
250
|
+
status: "success" | "pending" | "failed" | "cancelled";
|
|
251
|
+
reference?: string;
|
|
252
|
+
data: any;
|
|
253
|
+
timestamp: string;
|
|
254
|
+
}
|
|
255
|
+
```
|
|
207
256
|
|
|
208
|
-
|
|
209
|
-
...
|
|
257
|
+
---
|
|
210
258
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
})
|
|
217
|
-
export class AppModule {}
|
|
218
|
-
// make sure to set the affidavit_api_secret_key and also affidavit_api_public_key in your environment files
|
|
259
|
+
## 14. Global Callback Listener
|
|
260
|
+
|
|
261
|
+
```js
|
|
262
|
+
document.addEventListener("callBack", (event) => {
|
|
263
|
+
console.log("Global callback:", event.detail);
|
|
264
|
+
});
|
|
219
265
|
```
|
|
220
266
|
|
|
221
|
-
|
|
267
|
+
---
|
|
222
268
|
|
|
223
|
-
|
|
269
|
+
## 15. Using Web Components in Angular Apps
|
|
224
270
|
|
|
225
|
-
|
|
271
|
+
```ts
|
|
272
|
+
import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
|
|
226
273
|
|
|
227
|
-
|
|
274
|
+
@NgModule({
|
|
275
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
276
|
+
})
|
|
277
|
+
export class AppModule {}
|
|
278
|
+
```
|
|
228
279
|
|
|
229
280
|
```html
|
|
230
|
-
<
|
|
281
|
+
<div class="mb-4" *ngIf="showAffidavitOverlay">
|
|
282
|
+
<h4>📝 Affidavit Application Component</h4>
|
|
283
|
+
<highcourt-affidavit [appNo]="appNo" [templateId]="templateId"
|
|
284
|
+
[payload]="payload" [appNo]="appNo"
|
|
285
|
+
(callBack)="onAffidavitCallback($event)" [clientRef]="clientRef"
|
|
286
|
+
(overlayClose)="onAffidavitOverlayClose($event)"
|
|
287
|
+
(paymentSuccess)="onAffidavitPaymentSuccess($event)">
|
|
288
|
+
</highcourt-affidavit>
|
|
289
|
+
</div>
|
|
231
290
|
```
|
|
232
291
|
|
|
233
292
|
```ts
|
|
293
|
+
import { Component, OnInit } from '@angular/core';
|
|
234
294
|
|
|
235
|
-
|
|
236
|
-
|
|
295
|
+
|
|
296
|
+
@Component({
|
|
297
|
+
selector: 'app-root',
|
|
298
|
+
templateUrl: './app.component.html',
|
|
299
|
+
styleUrl: './app.component.scss',
|
|
300
|
+
standalone: false
|
|
301
|
+
})
|
|
302
|
+
export class AppComponent implements OnInit {
|
|
303
|
+
// Configuration
|
|
304
|
+
token = 'FHC-INTEG-pk_f0a01636119a45d218c2016758e368be';
|
|
305
|
+
mode = 'test';
|
|
306
|
+
templateId = 96;
|
|
307
|
+
appNo = 'APP-1768501941-0004';
|
|
308
|
+
clientRef = 'APP-SESSION-01';
|
|
309
|
+
showAffidavitOverlay = true;
|
|
310
|
+
|
|
311
|
+
// Payload data for pre-filling the affidavit form
|
|
312
|
+
payload = {
|
|
313
|
+
affidavit_type_name: 'Affidavit of Ownership',
|
|
314
|
+
deponent_name: 'Ahmad Ibrahim',
|
|
315
|
+
deponent_nin: 12345678912,
|
|
316
|
+
town_native: 'Gusau',
|
|
317
|
+
town_resident: 'Gusau',
|
|
318
|
+
occupation: 'Software Developer',
|
|
319
|
+
gender: 'Male',
|
|
320
|
+
religion: 'Islam',
|
|
321
|
+
applicant_email: 'applicant@mail.com',
|
|
322
|
+
applicant_phone: '07066666666',
|
|
323
|
+
adult_minor: 'adult',
|
|
324
|
+
affidavit_template_id: 96,
|
|
325
|
+
state_id: 1,
|
|
326
|
+
court_id: 1,
|
|
327
|
+
formEntries: [
|
|
328
|
+
{
|
|
329
|
+
placeholder: "deponent_company_position",
|
|
330
|
+
provided_value: "CEO"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
placeholder: "contractor_company_name",
|
|
334
|
+
provided_value: "Centaur info Systems",
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
placeholder: "mda_authority_name",
|
|
338
|
+
provided_value: "FGN",
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
placeholder: "rc_number",
|
|
342
|
+
provided_value: "343434",
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
placeholder: "lot_number",
|
|
346
|
+
provided_value: "343434",
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
placeholder: "lot_title",
|
|
350
|
+
provided_value: "Purchase of 50 CNG Buses",
|
|
351
|
+
},
|
|
352
|
+
],
|
|
353
|
+
clauseEntries: [],
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
constructor() { }
|
|
357
|
+
|
|
358
|
+
ngOnInit(): void {
|
|
359
|
+
this.ensureAffidavitWebComponentLoaded();
|
|
237
360
|
}
|
|
238
|
-
```
|
|
239
361
|
|
|
240
|
-
|
|
362
|
+
private ensureAffidavitWebComponentLoaded(): Promise<void> {
|
|
363
|
+
try {
|
|
364
|
+
// Already registered
|
|
365
|
+
if (typeof window !== 'undefined' && window.customElements?.get('highcourt-affidavit')) {
|
|
366
|
+
return Promise.resolve();
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// Loader already injected
|
|
370
|
+
const existing = document.getElementById('highcourt-affidavit-loader');
|
|
371
|
+
if (existing) return Promise.resolve();
|
|
372
|
+
|
|
373
|
+
return new Promise<void>((resolve, reject) => {
|
|
374
|
+
const script = document.createElement('script');
|
|
375
|
+
script.id = 'highcourt-affidavit-loader';
|
|
376
|
+
script.src =
|
|
377
|
+
'https://cdn.jsdelivr.net/npm/highcourt-affidavit-elements@0.2.18/dist/affidavit-library/browser/loader.js';
|
|
378
|
+
script.async = true;
|
|
379
|
+
script.onload = () => resolve();
|
|
380
|
+
script.onerror = () => reject(new Error('Failed to load highcourt-affidavit web component loader'));
|
|
381
|
+
document.head.appendChild(script);
|
|
382
|
+
});
|
|
383
|
+
} catch {
|
|
384
|
+
// If we can't access DOM (edge case), just no-op.
|
|
385
|
+
return Promise.resolve();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
241
388
|
|
|
242
|
-
|
|
389
|
+
ngOnDestroy(): void {
|
|
390
|
+
// Clean up any injected loader script so it can't leak global CSS/JS across routes.
|
|
391
|
+
try {
|
|
392
|
+
const loader = document.getElementById('highcourt-affidavit-loader');
|
|
393
|
+
loader?.remove();
|
|
394
|
+
} catch {
|
|
395
|
+
// no-op
|
|
396
|
+
}
|
|
397
|
+
}
|
|
243
398
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
399
|
+
// Highcourt Affidavit Component Event Handlers
|
|
400
|
+
onAffidavitCallback(evt: any) {
|
|
401
|
+
const anyEvt = evt as any;
|
|
402
|
+
const detail = anyEvt?.detail ?? null;
|
|
248
403
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
createAffidavit() {
|
|
257
|
-
const affidavitData = {
|
|
258
|
-
affidavit_type_name: 'Affidavit of Ownership',
|
|
259
|
-
deponent_name: 'Ahmad Ibrahim',
|
|
260
|
-
deponent_nin: 12345678912,
|
|
261
|
-
town_native: 'Gusau',
|
|
262
|
-
town_resident: 'Gusau',
|
|
263
|
-
occupation: 'Software Developer',
|
|
264
|
-
gender: 'Male',
|
|
265
|
-
religion: 'Islam',
|
|
266
|
-
signature_file: 'signature.png', //should be provided in binary
|
|
267
|
-
passport_photo_file: 'passport.jpg', //should be provided in binary
|
|
268
|
-
identity_photo_file: 'id-card.jpeg', //should be provided in binary
|
|
269
|
-
applicant_email: 'applicant@mail.com',
|
|
270
|
-
applicant_phone: '07066666666',
|
|
271
|
-
adult_minor: 'adult',
|
|
272
|
-
affidavit_template_id: 1,
|
|
273
|
-
lga_id: 1,
|
|
274
|
-
court_id: 1,
|
|
275
|
-
formEntries: [
|
|
276
|
-
{ placeholder: 'fullName', label: 'Full Name', provided_value: 'Ahmad Ibrahim' },
|
|
277
|
-
],
|
|
278
|
-
clauseEntries: [{ entry: 'Affidavit Clause' }],
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
this.affidavitService.create(affidavitData).subscribe({
|
|
282
|
-
next: (response) => console.log('Affidavit Created:', response),
|
|
283
|
-
error: (error) => console.error('Affidavit Creation Failed:', error),
|
|
284
|
-
});
|
|
404
|
+
console.log('[highcourt-affidavit] event received:', evt);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
onAffidavitPaymentSuccess(data: any) {
|
|
408
|
+
console.log('APP Affidavit Payment Success:', data);
|
|
409
|
+
|
|
410
|
+
// Handle payment success - e.g., update application status, show success message, etc.
|
|
285
411
|
}
|
|
286
|
-
}
|
|
287
412
|
|
|
413
|
+
onAffidavitOverlayClose(data: boolean) {
|
|
414
|
+
console.log('APP Affidavit Overlay Closed:', data);
|
|
415
|
+
if (data) {
|
|
416
|
+
this.showAffidavitOverlay = false;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
288
419
|
|
|
289
|
-
|
|
420
|
+
}
|
|
290
421
|
```
|
|
291
422
|
|
|
292
|
-
|
|
423
|
+
---
|
|
293
424
|
|
|
294
|
-
|
|
425
|
+
## 16. Security & Compliance
|
|
295
426
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
@import url("https://fonts.googleapis.com/css?family=Comfortaa");
|
|
302
|
-
```
|
|
427
|
+
- Never expose live API keys
|
|
428
|
+
- Always validate payments server-side
|
|
429
|
+
- Enforce HTTPS
|
|
430
|
+
- Rotate credentials periodically
|
|
431
|
+
- Do not trust client-only callbacks
|
|
303
432
|
|
|
304
|
-
|
|
433
|
+
---
|
|
305
434
|
|
|
306
|
-
|
|
435
|
+
## 17. Support
|
|
307
436
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
437
|
+
📧 support@centuryinformationsystems.com
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
## 18. License
|
|
442
|
+
|
|
443
|
+
MIT License
|
|
444
|
+
© 2026 ECMS
|