@tantainnovative/ndpr-toolkit
Version:
Nigeria Data Protection Toolkit — enterprise-grade compliance components for the Nigeria Data Protection Act (NDPA) 2023
1 lines • 3.17 kB
JavaScript
import {a}from'./chunk-ZJYULEER.mjs';var y={ohl:200,ehl:1e3,uhl:5e3},N={UHL:25e4,EHL:1e5,OHL:1e4};function S(e,i={}){let t=a(a({},y),i.thresholds),r=a(a({},N),i.fees),a$1=e==null?void 0:e.dataSubjectsInSixMonths,l=typeof a$1=="number"&&a$1>0?Math.floor(a$1):0,n;l>t.uhl?n="UHL":l>=t.ehl?n="EHL":l>=t.ohl?n="OHL":e!=null&&e.isDesignated?n="listed":n="none";let u=n!=="none",c=n==="UHL"||n==="EHL"||n==="OHL"?r[n]:0,s=[];return n==="listed"&&s.push("Designated as a DCPMI below the volume tiers \u2014 confirm the applicable registration tier and fee with the NDPC."),u&&s.push(n==="OHL"?"OHL organisations renew their NDPC registration annually and are not required to file Compliance Audit Returns (CAR).":n==="listed"?"Confirm with the NDPC whether your designation falls under UHL/EHL (register once, file CAR annually) or OHL (renew registration annually).":"Register once with the NDPC, then file Compliance Audit Returns (CAR) annually."),s.push("Thresholds, fees, and filing dates follow the NDPC GAID 2025 baseline and can change \u2014 verify against current NDPC guidance before relying on them."),{tier:n,isDCPMI:u,annualFeeNGN:c,registration:{required:u,renewsAnnually:n==="OHL"},compliance:{auditReturnsAnnual:n==="UHL"||n==="EHL",initialAuditWithinMonths:15},notes:s,dataSubjectsConsidered:l}}function L(e){return String(e).padStart(2,"0")}function H(e){let[i,t,r]=e.split("-").map(Number);return new Date(Date.UTC(i,t-1,r))}function w(e){return e.toISOString().slice(0,10)}function R(e,i){let[t,r,a]=e.split("-").map(Number);return w(new Date(Date.UTC(t,r-1+i,a)))}function x(){return new Date().toISOString().slice(0,10)}function E(e,i={}){var C,f,g,b,p,M,P;let t=(C=e.asOf)!=null?C:x(),r=(f=i.initialAuditWithinMonths)!=null?f:15,a=(b=(g=i.annualDeadline)==null?void 0:g.month)!=null?b:3,l=(M=(p=i.annualDeadline)==null?void 0:p.day)!=null?M:31,n=(P=i.deadlineOverrides)!=null?P:{},u=e.tier===void 0?true:e.tier==="UHL"||e.tier==="EHL",c=R(e.commencementDate,r),s=I=>{var A;return (A=n[I])!=null?A:`${I}-${L(a)}-${L(l)}`},h=Number(t.slice(0,4)),D=s(h);t>D&&(h+=1,D=s(h));let O=Math.round((H(D).getTime()-H(t).getTime())/864e5),m=t>=c,o=[];return u?(o.push("File the Compliance Audit Return with the NDPC via the NDPC Information Management Portal (NIMP)."),m&&o.push("The initial compliance-audit window has elapsed \u2014 ensure the initial audit has been conducted.")):e.tier==="OHL"?o.push("OHL organisations renew their NDPC registration annually and are not required to file Compliance Audit Returns (CAR)."):e.tier==="listed"?o.push("Confirm with the NDPC whether your designation requires filing CAR (UHL/EHL) or annual registration renewal (OHL)."):o.push("Compliance Audit Returns apply to Data Controllers/Processors of Major Importance in the UHL and EHL categories."),o.push("Filing deadlines follow the NDPC GAID 2025 baseline and can be extended \u2014 verify the current deadline with the NDPC."),{applicable:u,schedule:{commencementDate:e.commencementDate,initialAuditWithinMonths:r,initialAuditDueDate:c,nextFilingDeadline:D,filingYear:h},status:{initialAuditDue:m,daysUntilNextDeadline:O},notes:o,asOf:t}}export{y as a,N as b,S as c,E as d};