@tantainnovative/ndpr-toolkit 1.0.3 → 1.0.5

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 (110) hide show
  1. package/next-env.d.ts +5 -0
  2. package/package.json +1 -1
  3. package/packages/ndpr-toolkit/dist/components/breach/BreachNotificationManager.d.ts +62 -0
  4. package/packages/ndpr-toolkit/dist/components/breach/BreachReportForm.d.ts +66 -0
  5. package/packages/ndpr-toolkit/dist/components/breach/BreachRiskAssessment.d.ts +50 -0
  6. package/packages/ndpr-toolkit/dist/components/breach/RegulatoryReportGenerator.d.ts +94 -0
  7. package/packages/ndpr-toolkit/dist/components/consent/ConsentBanner.d.ts +79 -0
  8. package/packages/ndpr-toolkit/dist/components/consent/ConsentManager.d.ts +73 -0
  9. package/packages/ndpr-toolkit/dist/components/consent/ConsentStorage.d.ts +41 -0
  10. package/packages/ndpr-toolkit/dist/components/dpia/DPIAQuestionnaire.d.ts +70 -0
  11. package/packages/ndpr-toolkit/dist/components/dpia/DPIAReport.d.ts +40 -0
  12. package/packages/ndpr-toolkit/dist/components/dpia/StepIndicator.d.ts +64 -0
  13. package/packages/ndpr-toolkit/dist/components/dsr/DSRDashboard.d.ts +58 -0
  14. package/packages/ndpr-toolkit/dist/components/dsr/DSRRequestForm.d.ts +74 -0
  15. package/packages/ndpr-toolkit/dist/components/dsr/DSRTracker.d.ts +56 -0
  16. package/packages/ndpr-toolkit/dist/components/policy/PolicyExporter.d.ts +65 -0
  17. package/packages/ndpr-toolkit/dist/components/policy/PolicyGenerator.d.ts +54 -0
  18. package/packages/ndpr-toolkit/dist/components/policy/PolicyPreview.d.ts +71 -0
  19. package/packages/ndpr-toolkit/dist/hooks/useBreach.d.ts +97 -0
  20. package/packages/ndpr-toolkit/dist/hooks/useConsent.d.ts +63 -0
  21. package/packages/ndpr-toolkit/dist/hooks/useDPIA.d.ts +92 -0
  22. package/packages/ndpr-toolkit/dist/hooks/useDSR.d.ts +72 -0
  23. package/packages/ndpr-toolkit/dist/hooks/usePrivacyPolicy.d.ts +87 -0
  24. package/packages/ndpr-toolkit/dist/index.d.ts +31 -0
  25. package/packages/ndpr-toolkit/dist/index.esm.js +2 -0
  26. package/packages/ndpr-toolkit/dist/index.esm.js.map +1 -0
  27. package/packages/ndpr-toolkit/dist/index.js +2 -0
  28. package/packages/ndpr-toolkit/dist/index.js.map +1 -0
  29. package/packages/ndpr-toolkit/dist/setupTests.d.ts +2 -0
  30. package/packages/ndpr-toolkit/dist/types/breach.d.ts +239 -0
  31. package/packages/ndpr-toolkit/dist/types/consent.d.ts +95 -0
  32. package/packages/ndpr-toolkit/dist/types/dpia.d.ts +196 -0
  33. package/packages/ndpr-toolkit/dist/types/dsr.d.ts +162 -0
  34. package/packages/ndpr-toolkit/dist/types/privacy.d.ts +204 -0
  35. package/packages/ndpr-toolkit/dist/utils/breach.d.ts +14 -0
  36. package/packages/ndpr-toolkit/dist/utils/consent.d.ts +10 -0
  37. package/packages/ndpr-toolkit/dist/utils/dpia.d.ts +12 -0
  38. package/packages/ndpr-toolkit/dist/utils/dsr.d.ts +11 -0
  39. package/packages/ndpr-toolkit/dist/utils/privacy.d.ts +12 -0
  40. package/src/components/consent/ConsentBanner.tsx +82 -48
  41. package/src/components/data-subject-rights/DataSubjectRequestForm.tsx +240 -129
  42. package/src/components/dpia/DPIAQuestionnaire.tsx +162 -122
  43. package/src/components/privacy-policy/PolicyGenerator.tsx +5 -5
  44. package/src/components/privacy-policy/steps/CustomSectionsStep.tsx +103 -77
  45. package/src/components/privacy-policy/steps/PolicyPreviewStep.tsx +117 -63
  46. package/src/hooks/useConsent.ts +16 -10
  47. package/src/lib/consentService.ts +44 -37
  48. package/src/lib/dpiaQuestions.ts +139 -99
  49. package/src/lib/requestService.ts +21 -17
  50. package/src/types/index.ts +13 -8
  51. package/.claude/settings.local.json +0 -20
  52. package/.eslintrc.json +0 -10
  53. package/.github/workflows/ci.yml +0 -36
  54. package/.github/workflows/nextjs.yml +0 -104
  55. package/.husky/commit-msg +0 -4
  56. package/.husky/pre-commit +0 -4
  57. package/.lintstagedrc.js +0 -4
  58. package/.nvmrc +0 -1
  59. package/.versionrc +0 -17
  60. package/CLAUDE.md +0 -90
  61. package/commitlint.config.js +0 -36
  62. package/jest.config.js +0 -31
  63. package/jest.setup.js +0 -15
  64. package/packages/ndpr-toolkit/jest.config.js +0 -23
  65. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentBanner.test.tsx +0 -119
  66. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentManager.test.tsx +0 -122
  67. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentStorage.test.tsx +0 -270
  68. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRDashboard.test.tsx +0 -199
  69. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRRequestForm.test.tsx +0 -224
  70. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRTracker.test.tsx +0 -104
  71. package/packages/ndpr-toolkit/src/__tests__/hooks/useConsent.test.tsx +0 -161
  72. package/packages/ndpr-toolkit/src/__tests__/hooks/useDSR.test.tsx +0 -330
  73. package/packages/ndpr-toolkit/src/__tests__/utils/breach.test.ts +0 -149
  74. package/packages/ndpr-toolkit/src/__tests__/utils/consent.test.ts +0 -88
  75. package/packages/ndpr-toolkit/src/__tests__/utils/dpia.test.ts +0 -160
  76. package/packages/ndpr-toolkit/src/__tests__/utils/dsr.test.ts +0 -110
  77. package/packages/ndpr-toolkit/src/__tests__/utils/privacy.test.ts +0 -97
  78. package/src/__tests__/example.test.ts +0 -13
  79. package/src/__tests__/requestService.test.ts +0 -57
  80. package/src/app/docs/components/DocLayout.tsx +0 -267
  81. package/src/app/docs/components/breach-notification/page.tsx +0 -797
  82. package/src/app/docs/components/consent-management/page.tsx +0 -576
  83. package/src/app/docs/components/data-subject-rights/page.tsx +0 -511
  84. package/src/app/docs/components/dpia-questionnaire/layout.tsx +0 -15
  85. package/src/app/docs/components/dpia-questionnaire/metadata.ts +0 -31
  86. package/src/app/docs/components/dpia-questionnaire/page.tsx +0 -666
  87. package/src/app/docs/components/hooks/page.tsx +0 -305
  88. package/src/app/docs/components/page.tsx +0 -84
  89. package/src/app/docs/components/privacy-policy-generator/page.tsx +0 -634
  90. package/src/app/docs/guides/breach-notification-process/components/BestPractices.tsx +0 -123
  91. package/src/app/docs/guides/breach-notification-process/components/ImplementationSteps.tsx +0 -328
  92. package/src/app/docs/guides/breach-notification-process/components/Introduction.tsx +0 -28
  93. package/src/app/docs/guides/breach-notification-process/components/NotificationTimeline.tsx +0 -91
  94. package/src/app/docs/guides/breach-notification-process/components/Resources.tsx +0 -118
  95. package/src/app/docs/guides/breach-notification-process/page.tsx +0 -39
  96. package/src/app/docs/guides/conducting-dpia/page.tsx +0 -593
  97. package/src/app/docs/guides/data-subject-requests/page.tsx +0 -666
  98. package/src/app/docs/guides/managing-consent/page.tsx +0 -738
  99. package/src/app/docs/guides/ndpr-compliance-checklist/components/ComplianceChecklist.tsx +0 -296
  100. package/src/app/docs/guides/ndpr-compliance-checklist/components/ImplementationTools.tsx +0 -145
  101. package/src/app/docs/guides/ndpr-compliance-checklist/components/Introduction.tsx +0 -33
  102. package/src/app/docs/guides/ndpr-compliance-checklist/components/KeyRequirements.tsx +0 -99
  103. package/src/app/docs/guides/ndpr-compliance-checklist/components/Resources.tsx +0 -159
  104. package/src/app/docs/guides/ndpr-compliance-checklist/page.tsx +0 -38
  105. package/src/app/docs/guides/page.tsx +0 -67
  106. package/src/app/docs/layout.tsx +0 -15
  107. package/src/app/docs/metadata.ts +0 -31
  108. package/src/app/docs/page.tsx +0 -572
  109. package/src/components/docs/DocLayout.tsx +0 -289
  110. package/src/components/docs/index.ts +0 -2
@@ -1,666 +0,0 @@
1
- 'use client';
2
-
3
- import Link from 'next/link';
4
- import { DocLayout } from '@/components/docs/DocLayout';
5
- import { Button } from '@/components/ui/Button';
6
- import { Card, CardContent } from '@/components/ui/Card';
7
-
8
- export default function DataSubjectRequestsGuide() {
9
- return (
10
- <DocLayout
11
- title="Handling Data Subject Requests"
12
- description="Best practices for handling data subject rights requests with the NDPR Toolkit"
13
- >
14
- <div className="flex mb-6 space-x-2">
15
- <Button asChild variant="outline" size="sm">
16
- <Link href="/demo/data-subject-rights">
17
- View DSR Demo
18
- </Link>
19
- </Button>
20
- <Button asChild variant="outline" size="sm">
21
- <Link href="/docs/components/data-subject-rights">
22
- DSR Component Docs
23
- </Link>
24
- </Button>
25
- </div>
26
-
27
- <section id="introduction" className="mb-8">
28
- <h2 className="text-2xl font-bold mb-4">Introduction</h2>
29
- <p className="mb-4">
30
- The Nigeria Data Protection Regulation (NDPR) grants individuals (data subjects) specific rights regarding their personal data.
31
- Organizations must have processes in place to receive, verify, and respond to these requests within the timeframes
32
- specified by the regulation. This guide will help you implement a comprehensive system for handling data subject
33
- requests using the NDPR Toolkit.
34
- </p>
35
- <div className="bg-blue-50 dark:bg-blue-900/20 p-4 rounded-md">
36
- <h4 className="text-blue-800 dark:text-blue-200 font-medium mb-2">NDPR Data Subject Rights</h4>
37
- <p className="text-blue-700 dark:text-blue-300 text-sm mb-0">
38
- Under the NDPR, data subjects have the following rights:
39
- </p>
40
- <ul className="list-disc pl-6 mt-2 text-blue-700 dark:text-blue-300 text-sm">
41
- <li><strong>Right of Access:</strong> To obtain confirmation of whether their data is being processed and access to that data</li>
42
- <li><strong>Right to Rectification:</strong> To have inaccurate personal data corrected</li>
43
- <li><strong>Right to Erasure:</strong> To have their personal data deleted in certain circumstances</li>
44
- <li><strong>Right to Restrict Processing:</strong> To limit how their data is used</li>
45
- <li><strong>Right to Data Portability:</strong> To receive their data in a structured, commonly used format</li>
46
- <li><strong>Right to Object:</strong> To object to certain types of processing, such as direct marketing</li>
47
- </ul>
48
- </div>
49
- </section>
50
-
51
- <section id="dsr-process" className="mb-8">
52
- <h2 className="text-2xl font-bold mb-4">The Data Subject Request Process</h2>
53
- <p className="mb-4">
54
- A complete data subject request (DSR) system covers the entire lifecycle of a request, from submission to resolution.
55
- The NDPR Toolkit provides components for each stage of this process:
56
- </p>
57
-
58
- <div className="relative border-l-2 border-blue-500 pl-8 pb-8 space-y-10">
59
- <div className="relative">
60
- <div className="absolute -left-10 mt-1.5 h-6 w-6 rounded-full bg-blue-500 flex items-center justify-center">
61
- <span className="text-white font-bold text-sm">1</span>
62
- </div>
63
- <h3 className="text-xl font-bold">Request Submission</h3>
64
- <p className="text-gray-600 dark:text-gray-300 mt-2">
65
- The first step is providing a way for data subjects to submit their requests. The NDPR Toolkit&apos;s DSRRequestForm
66
- component is designed for this purpose.
67
- </p>
68
- <div className="mt-4 bg-gray-100 dark:bg-gray-800 p-4 rounded-md">
69
- <h4 className="font-medium mb-2">Code Example</h4>
70
- <div className="bg-gray-800 text-gray-200 p-4 rounded-md overflow-x-auto">
71
- <pre><code>{`import { DSRRequestForm } from '@tantainnovative/ndpr-toolkit';
72
-
73
- function DSRSubmissionPage() {
74
- const requestTypes = [
75
- { id: 'access', label: 'Access my data' },
76
- { id: 'rectification', label: 'Correct my data' },
77
- { id: 'erasure', label: 'Delete my data' },
78
- { id: 'restriction', label: 'Restrict processing of my data' },
79
- { id: 'portability', label: 'Data portability' },
80
- { id: 'objection', label: 'Object to processing' }
81
- ];
82
-
83
- const handleSubmitRequest = (requestData) => {
84
- // Save request to your backend
85
- console.log('Request submitted:', requestData);
86
-
87
- // Example: Send to backend API
88
- fetch('/api/dsr-requests', {
89
- method: 'POST',
90
- headers: {
91
- 'Content-Type': 'application/json',
92
- },
93
- body: JSON.stringify(requestData),
94
- })
95
- .then(response => response.json())
96
- .then(data => {
97
- // Show confirmation to user with reference number
98
- setRequestId(data.id);
99
- setSubmitted(true);
100
- });
101
- };
102
-
103
- const [submitted, setSubmitted] = useState(false);
104
- const [requestId, setRequestId] = useState(null);
105
-
106
- return (
107
- <div>
108
- <h1>Submit a Data Subject Request</h1>
109
-
110
- {!submitted ? (
111
- <>
112
- <p>
113
- Use this form to exercise your rights under the Nigeria Data Protection Regulation (NDPR).
114
- We will respond to your request within 30 days.
115
- </p>
116
-
117
- <DSRRequestForm
118
- onSubmit={handleSubmitRequest}
119
- requestTypes={requestTypes}
120
- />
121
- </>
122
- ) : (
123
- <div>
124
- <h2>Request Submitted</h2>
125
- <p>
126
- Your request has been submitted successfully. Your reference number is: <strong>{requestId}</strong>
127
- </p>
128
- <p>
129
- We will process your request and respond within 30 days. You can check the status of your request
130
- using your reference number.
131
- </p>
132
- </div>
133
- )}
134
- </div>
135
- );
136
- }`}</code></pre>
137
- </div>
138
- </div>
139
- </div>
140
-
141
- <div className="relative">
142
- <div className="absolute -left-10 mt-1.5 h-6 w-6 rounded-full bg-blue-500 flex items-center justify-center">
143
- <span className="text-white font-bold text-sm">2</span>
144
- </div>
145
- <h3 className="text-xl font-bold">Identity Verification</h3>
146
- <p className="text-gray-600 dark:text-gray-300 mt-2">
147
- Before processing a request, you must verify the identity of the data subject to ensure they are who they claim to be.
148
- The NDPR Toolkit provides utilities for identity verification.
149
- </p>
150
- <div className="mt-4 bg-gray-100 dark:bg-gray-800 p-4 rounded-md">
151
- <h4 className="font-medium mb-2">Implementation Tip</h4>
152
- <p className="text-sm">
153
- The level of identity verification should be proportionate to the sensitivity of the data and the potential
154
- harm that could result from unauthorized access. For example, requests for access to highly sensitive data
155
- may require more stringent verification than requests to update contact information.
156
- </p>
157
- </div>
158
- </div>
159
-
160
- <div className="relative">
161
- <div className="absolute -left-10 mt-1.5 h-6 w-6 rounded-full bg-blue-500 flex items-center justify-center">
162
- <span className="text-white font-bold text-sm">3</span>
163
- </div>
164
- <h3 className="text-xl font-bold">Request Assessment</h3>
165
- <p className="text-gray-600 dark:text-gray-300 mt-2">
166
- Once the identity of the data subject has been verified, you need to assess the request to determine what action is required.
167
- This includes identifying what data is involved, what systemsit&apos;s stored in, and what actions need to be taken.
168
- </p>
169
- <div className="mt-4 bg-gray-100 dark:bg-gray-800 p-4 rounded-md">
170
- <h4 className="font-medium mb-2">Code Example</h4>
171
- <div className="bg-gray-800 text-gray-200 p-4 rounded-md overflow-x-auto">
172
- <pre><code>{`import { DSRAssessment } from '@tantainnovative/ndpr-toolkit';
173
-
174
- function AssessRequest({ request }) {
175
- const handleAssessment = (assessment) => {
176
- // Save assessment to your backend
177
- console.log('Assessment completed:', assessment);
178
-
179
- // Example: Update request with assessment
180
- fetch(\`/api/dsr-requests/\${request.id}/assessment\`, {
181
- method: 'POST',
182
- headers: {
183
- 'Content-Type': 'application/json',
184
- },
185
- body: JSON.stringify(assessment),
186
- });
187
- };
188
-
189
- return (
190
- <div>
191
- <h2>Assess Request</h2>
192
- <p>Request ID: {request.id}</p>
193
- <p>Request Type: {request.type}</p>
194
-
195
- <DSRAssessment
196
- request={request}
197
- onComplete={handleAssessment}
198
- dataSystems={[
199
- { id: 'crm', name: 'CRM System' },
200
- { id: 'marketing', name: 'Marketing Platform' },
201
- { id: 'analytics', name: 'Analytics Tools' },
202
- { id: 'email', name: 'Email System' },
203
- { id: 'billing', name: 'Billing System' }
204
- ]}
205
- />
206
- </div>
207
- );
208
- }`}</code></pre>
209
- </div>
210
- </div>
211
- </div>
212
-
213
- <div className="relative">
214
- <div className="absolute -left-10 mt-1.5 h-6 w-6 rounded-full bg-blue-500 flex items-center justify-center">
215
- <span className="text-white font-bold text-sm">4</span>
216
- </div>
217
- <h3 className="text-xl font-bold">Request Fulfillment</h3>
218
- <p className="text-gray-600 dark:text-gray-300 mt-2">
219
- Based on the assessment, you need to fulfill the request by taking the appropriate action, such as providing a copy of the data,
220
- correcting inaccurate data, or deleting data. The NDPR Toolkit provides utilities for common fulfillment actions.
221
- </p>
222
- <div className="mt-4 bg-gray-100 dark:bg-gray-800 p-4 rounded-md">
223
- <h4 className="font-medium mb-2">Implementation Tip</h4>
224
- <p className="text-sm">
225
- For complex requests that involve multiple systems or departments, consider using a workflow management system
226
- to track the progress of the request and ensure all necessary actions are taken.
227
- </p>
228
- </div>
229
- </div>
230
-
231
- <div className="relative">
232
- <div className="absolute -left-10 mt-1.5 h-6 w-6 rounded-full bg-blue-500 flex items-center justify-center">
233
- <span className="text-white font-bold text-sm">5</span>
234
- </div>
235
- <h3 className="text-xl font-bold">Response to Data Subject</h3>
236
- <p className="text-gray-600 dark:text-gray-300 mt-2">
237
- Once the request has been fulfilled, you need to respond to the data subject with the outcome of their request.
238
- The NDPR Toolkit provides templates for common response types.
239
- </p>
240
- <div className="mt-4 bg-gray-100 dark:bg-gray-800 p-4 rounded-md">
241
- <h4 className="font-medium mb-2">Code Example</h4>
242
- <div className="bg-gray-800 text-gray-200 p-4 rounded-md overflow-x-auto">
243
- <pre><code>{`import { DSRResponse } from '@tantainnovative/ndpr-toolkit';
244
-
245
- function GenerateResponse({ request, assessment, fulfillment }) {
246
- const handleGenerateResponse = (response) => {
247
- // Save response to your backend
248
- console.log('Response generated:', response);
249
-
250
- // Example: Send response to data subject
251
- fetch(\`/api/dsr-requests/\${request.id}/response\`, {
252
- method: 'POST',
253
- headers: {
254
- 'Content-Type': 'application/json',
255
- },
256
- body: JSON.stringify(response),
257
- });
258
- };
259
-
260
- return (
261
- <div>
262
- <h2>Generate Response</h2>
263
- <p>Request ID: {request.id}</p>
264
- <p>Request Type: {request.type}</p>
265
-
266
- <DSRResponse
267
- request={request}
268
- assessment={assessment}
269
- fulfillment={fulfillment}
270
- onGenerate={handleGenerateResponse}
271
- responseTypes={[
272
- 'email',
273
- 'letter',
274
- 'portal'
275
- ]}
276
- />
277
- </div>
278
- );
279
- }`}</code></pre>
280
- </div>
281
- </div>
282
- </div>
283
-
284
- <div className="relative">
285
- <div className="absolute -left-10 mt-1.5 h-6 w-6 rounded-full bg-blue-500 flex items-center justify-center">
286
- <span className="text-white font-bold text-sm">6</span>
287
- </div>
288
- <h3 className="text-xl font-bold">Record Keeping</h3>
289
- <p className="text-gray-600 dark:text-gray-300 mt-2">
290
- For compliance purposes, you must maintain records of all data subject requests and your responses to them.
291
- The NDPR Toolkit provides utilities for maintaining detailed request records.
292
- </p>
293
- <div className="mt-4 bg-gray-100 dark:bg-gray-800 p-4 rounded-md">
294
- <h4 className="font-medium mb-2">Implementation Tip</h4>
295
- <p className="text-sm">
296
- Your record-keeping system should include the date of the request, the type of request, the actions taken,
297
- the date of the response, and any supporting documentation. This information may be needed to demonstrate
298
- compliance with the NDPR.
299
- </p>
300
- </div>
301
- </div>
302
- </div>
303
- </section>
304
-
305
- <section id="admin-dashboard" className="mb-8">
306
- <h2 className="text-2xl font-bold mb-4">Administrative Dashboard</h2>
307
- <p className="mb-4">
308
- To efficiently manage data subject requests, you need an administrative dashboard that provides an overview of all requests
309
- and their status. The NDPR Toolkit&apos;s DSRDashboard component is designed for this purpose.
310
- </p>
311
- <div className="bg-gray-800 text-gray-200 p-4 rounded-md overflow-x-auto">
312
- <pre><code>{`import { DSRDashboard } from '@tantainnovative/ndpr-toolkit';
313
-
314
- function AdminDashboard() {
315
- const [requests, setRequests] = useState([]);
316
-
317
- useEffect(() => {
318
- // Fetch requests from your backend
319
- fetch('/api/dsr-requests')
320
- .then(response => response.json())
321
- .then(data => setRequests(data));
322
- }, []);
323
-
324
- const handleUpdateStatus = (requestId, status) => {
325
- // Update request status in your backend
326
- fetch(\`/api/dsr-requests/\${requestId}/status\`, {
327
- method: 'PUT',
328
- headers: {
329
- 'Content-Type': 'application/json',
330
- },
331
- body: JSON.stringify({ status }),
332
- })
333
- .then(response => response.json())
334
- .then(data => {
335
- // Update local state
336
- setRequests(requests.map(request =>
337
- request.id === requestId ? { ...request, status } : request
338
- ));
339
- });
340
- };
341
-
342
- const handleAssignRequest = (requestId, assignee) => {
343
- // Assign request to staff member in your backend
344
- fetch(\`/api/dsr-requests/\${requestId}/assign\`, {
345
- method: 'PUT',
346
- headers: {
347
- 'Content-Type': 'application/json',
348
- },
349
- body: JSON.stringify({ assignee }),
350
- })
351
- .then(response => response.json())
352
- .then(data => {
353
- // Update local state
354
- setRequests(requests.map(request =>
355
- request.id === requestId ? { ...request, assignedTo: assignee } : request
356
- ));
357
- });
358
- };
359
-
360
- const handleAddNote = (requestId, note) => {
361
- // Add note to request in your backend
362
- fetch(\`/api/dsr-requests/\${requestId}/notes\`, {
363
- method: 'POST',
364
- headers: {
365
- 'Content-Type': 'application/json',
366
- },
367
- body: JSON.stringify({ note }),
368
- })
369
- .then(response => response.json())
370
- .then(data => {
371
- // Update local state
372
- setRequests(requests.map(request =>
373
- request.id === requestId ? {
374
- ...request,
375
- notes: [...request.notes, data]
376
- } : request
377
- ));
378
- });
379
- };
380
-
381
- return (
382
- <div>
383
- <h1>DSR Admin Dashboard</h1>
384
-
385
- <DSRDashboard
386
- requests={requests}
387
- onUpdateStatus={handleUpdateStatus}
388
- onAssignRequest={handleAssignRequest}
389
- onAddNote={handleAddNote}
390
- staff={[
391
- { id: 'john', name: 'John Doe' },
392
- { id: 'jane', name: 'Jane Smith' },
393
- { id: 'bob', name: 'Bob Johnson' }
394
- ]}
395
- statuses={[
396
- { id: 'pending', label: 'Pending', color: 'yellow' },
397
- { id: 'verifying', label: 'Verifying Identity', color: 'blue' },
398
- { id: 'processing', label: 'Processing', color: 'purple' },
399
- { id: 'completed', label: 'Completed', color: 'green' },
400
- { id: 'rejected', label: 'Rejected', color: 'red' }
401
- ]}
402
- />
403
- </div>
404
- );
405
- }`}</code></pre>
406
- </div>
407
- </section>
408
-
409
- <section id="request-tracking" className="mb-8">
410
- <h2 className="text-2xl font-bold mb-4">Request Tracking for Data Subjects</h2>
411
- <p className="mb-4">
412
- Data subjects should be able to track the status of their requests. The NDPR Toolkit&apos;s DSRTracker component
413
- provides a user interface for this purpose.
414
- </p>
415
- <div className="bg-gray-800 text-gray-200 p-4 rounded-md overflow-x-auto">
416
- <pre><code>{`import { DSRTracker } from '@tantainnovative/ndpr-toolkit';
417
-
418
- function RequestTrackingPage() {
419
- const [requestId, setRequestId] = useState('');
420
- const [email, setEmail] = useState('');
421
- const [request, setRequest] = useState(null);
422
- const [error, setError] = useState(null);
423
-
424
- const handleTrackRequest = () => {
425
- // Fetch request status from your backend
426
- fetch(\`/api/dsr-requests/track?id=\${requestId}&email=\${email}\`)
427
- .then(response => {
428
- if (!response.ok) {
429
- throw new Error('Request not found or email does not match');
430
- }
431
- return response.json();
432
- })
433
- .then(data => {
434
- setRequest(data);
435
- setError(null);
436
- })
437
- .catch(err => {
438
- setRequest(null);
439
- setError(err.message);
440
- });
441
- };
442
-
443
- return (
444
- <div>
445
- <h1>Track Your Request</h1>
446
- <p>
447
- Enter your request reference number and the email address you used to submit the request.
448
- </p>
449
-
450
- <div className="form-group">
451
- <label htmlFor="requestId">Request Reference Number</label>
452
- <input
453
- type="text"
454
- id="requestId"
455
- value={requestId}
456
- onChange={(e) => setRequestId(e.target.value)}
457
- />
458
- </div>
459
-
460
- <div className="form-group">
461
- <label htmlFor="email">Email Address</label>
462
- <input
463
- type="email"
464
- id="email"
465
- value={email}
466
- onChange={(e) => setEmail(e.target.value)}
467
- />
468
- </div>
469
-
470
- <button onClick={handleTrackRequest}>Track Request</button>
471
-
472
- {error && (
473
- <div className="error">
474
- {error}
475
- </div>
476
- )}
477
-
478
- {request && (
479
- <DSRTracker
480
- request={request}
481
- statusDescriptions={{
482
- 'pending': 'Your request has been received and is awaiting review.',
483
- 'verifying': 'We are verifying your identity to process your request.',
484
- 'processing': 'Your request is being processed.',
485
- 'completed': 'Your request has been completed.',
486
- 'rejected': 'Your request has been rejected. Please see the notes for more information.'
487
- }}
488
- />
489
- )}
490
- </div>
491
- );
492
- }`}</code></pre>
493
- </div>
494
- </section>
495
-
496
- <section id="best-practices" className="mb-8">
497
- <h2 className="text-2xl font-bold mb-4">Best Practices</h2>
498
- <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
499
- <Card>
500
- <CardContent className="p-6">
501
- <h3 className="font-bold text-lg mb-2">Clear Request Process</h3>
502
- <p className="text-gray-600 dark:text-gray-300 text-sm">
503
- Make it easy for data subjects to submit requests by providing a clear, accessible process.
504
- Include information about what to expect and how long the process will take.
505
- </p>
506
- </CardContent>
507
- </Card>
508
-
509
- <Card>
510
- <CardContent className="p-6">
511
- <h3 className="font-bold text-lg mb-2">Robust Identity Verification</h3>
512
- <p className="text-gray-600 dark:text-gray-300 text-sm">
513
- Implement appropriate identity verification measures to ensure you&apos;re providing data to the right person.
514
- This is crucial for preventing unauthorized access to personal data.
515
- </p>
516
- </CardContent>
517
- </Card>
518
-
519
- <Card>
520
- <CardContent className="p-6">
521
- <h3 className="font-bold text-lg mb-2">Timely Responses</h3>
522
- <p className="text-gray-600 dark:text-gray-300 text-sm">
523
- The NDPR requires organizations to respond to data subject requests within 30 days.
524
- Implement processes and systems that enable you to meet this deadline.
525
- </p>
526
- </CardContent>
527
- </Card>
528
-
529
- <Card>
530
- <CardContent className="p-6">
531
- <h3 className="font-bold text-lg mb-2">Comprehensive Data Mapping</h3>
532
- <p className="text-gray-600 dark:text-gray-300 text-sm">
533
- Maintain a comprehensive map of where personal data is stored in your organization.
534
- This will help you quickly locate and retrieve data when responding to access requests.
535
- </p>
536
- </CardContent>
537
- </Card>
538
-
539
- <Card>
540
- <CardContent className="p-6">
541
- <h3 className="font-bold text-lg mb-2">Staff Training</h3>
542
- <p className="text-gray-600 dark:text-gray-300 text-sm">
543
- Ensure that staff who handle data subject requests are trained on the NDPR requirements
544
- and your organization&apos;s processes. This includes understanding the different types of requests
545
- and how to respond to them.
546
- </p>
547
- </CardContent>
548
- </Card>
549
-
550
- <Card>
551
- <CardContent className="p-6">
552
- <h3 className="font-bold text-lg mb-2">Detailed Record Keeping</h3>
553
- <p className="text-gray-600 dark:text-gray-300 text-sm">
554
- Maintain detailed records of all data subject requests and your responses to them.
555
- This is essential for demonstrating compliance with the NDPR.
556
- </p>
557
- </CardContent>
558
- </Card>
559
- </div>
560
- </section>
561
-
562
- <section id="handling-specific-requests" className="mb-8">
563
- <h2 className="text-2xl font-bold mb-4">Handling Specific Types of Requests</h2>
564
-
565
- <h3 className="text-xl font-bold mb-4">Access Requests</h3>
566
- <p className="mb-4">
567
- When handling access requests, you should:
568
- </p>
569
- <ul className="list-disc pl-6 mb-6">
570
- <li>Verify the identity of the data subject</li>
571
- <li>Locate all personal data you hold about the data subject</li>
572
- <li>Provide a copy of the data in a commonly used electronic format</li>
573
- <li>Include information about the purposes of processing, categories of data, recipients, retention periods, and data subject rights</li>
574
- </ul>
575
-
576
- <h3 className="text-xl font-bold mb-4">Rectification Requests</h3>
577
- <p className="mb-4">
578
- When handling rectification requests, you should:
579
- </p>
580
- <ul className="list-disc pl-6 mb-6">
581
- <li>Verify the identity of the data subject</li>
582
- <li>Verify the accuracy of the new data provided</li>
583
- <li>Update the data in all systems whereit&apos;s stored</li>
584
- <li>Inform any third parties with whom you&apos;ve shared the data about the correction</li>
585
- </ul>
586
-
587
- <h3 className="text-xl font-bold mb-4">Erasure Requests</h3>
588
- <p className="mb-4">
589
- When handling erasure requests, you should:
590
- </p>
591
- <ul className="list-disc pl-6 mb-6">
592
- <li>Verify the identity of the data subject</li>
593
- <li>Determine if one of the grounds for erasure applies</li>
594
- <li>Delete the data from all systems whereit&apos;s stored</li>
595
- <li>Inform any third parties with whom you&apos;ve shared the data about the erasure</li>
596
- <li>Implement technical measures to ensure the data is permanently deleted</li>
597
- </ul>
598
-
599
- <h3 className="text-xl font-bold mb-4">Restriction Requests</h3>
600
- <p className="mb-4">
601
- When handling restriction requests, you should:
602
- </p>
603
- <ul className="list-disc pl-6 mb-6">
604
- <li>Verify the identity of the data subject</li>
605
- <li>Determine if one of the grounds for restriction applies</li>
606
- <li>Implement technical measures to restrict processing of the data</li>
607
- <li>Inform any third parties with whom you&apos;ve shared the data about the restriction</li>
608
- <li>Inform the data subject before lifting the restriction</li>
609
- </ul>
610
-
611
- <h3 className="text-xl font-bold mb-4">Portability Requests</h3>
612
- <p className="mb-4">
613
- When handling portability requests, you should:
614
- </p>
615
- <ul className="list-disc pl-6 mb-6">
616
- <li>Verify the identity of the data subject</li>
617
- <li>Extract the data in a structured, commonly used, machine-readable format</li>
618
- <li>Provide the data directly to the data subject or to another controller if requested and technically feasible</li>
619
- <li>Ensure the data includes only personal data provided by the data subject</li>
620
- </ul>
621
-
622
- <h3 className="text-xl font-bold mb-4">Objection Requests</h3>
623
- <p className="mb-4">
624
- When handling objection requests, you should:
625
- </p>
626
- <ul className="list-disc pl-6 mb-6">
627
- <li>Verify the identity of the data subject</li>
628
- <li>Stop processing the data unless you can demonstrate compelling legitimate grounds that override the interests of the data subject</li>
629
- <li>Inform the data subject of your decision and their right to complain to the supervisory authority</li>
630
- </ul>
631
- </section>
632
-
633
- <section id="resources" className="mb-8">
634
- <h2 className="text-2xl font-bold mb-4">Additional Resources</h2>
635
- <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
636
- <Card>
637
- <CardContent className="p-4">
638
- <h3 className="font-medium text-gray-900 dark:text-white mb-2">NDPR Implementation Framework</h3>
639
- <p className="text-gray-600 dark:text-gray-300 text-sm mb-3">
640
- Official guidance on implementing the NDPR, including data subject rights requirements.
641
- </p>
642
- <Button asChild variant="outline" size="sm">
643
- <a href="https://nitda.gov.ng/wp-content/uploads/2020/01/NDPR-Implementation-Framework.pdf" target="_blank" rel="noopener noreferrer">
644
- View Framework
645
- </a>
646
- </Button>
647
- </CardContent>
648
- </Card>
649
- <Card>
650
- <CardContent className="p-4">
651
- <h3 className="font-medium text-gray-900 dark:text-white mb-2">DSR Component Documentation</h3>
652
- <p className="text-gray-600 dark:text-gray-300 text-sm mb-3">
653
- Technical documentation for the Data Subject Rights components.
654
- </p>
655
- <Button asChild variant="outline" size="sm">
656
- <Link href="/docs/components/data-subject-rights">
657
- View Documentation
658
- </Link>
659
- </Button>
660
- </CardContent>
661
- </Card>
662
- </div>
663
- </section>
664
- </DocLayout>
665
- );
666
- }