Skip to content

feat: Data export and deletion under Nigeria Data Protection Act - #602

Merged
adenueltech merged 3 commits into
The-Engineer-Network:mainfrom
Ade-Pheebs:feature/499-data-export-deletion
Oct 22, 2026
Merged

adenueltech merged 3 commits into
The-Engineer-Network:mainfrom
Ade-Pheebs:feature/499-data-export-deletion

Conversation

@Ade-Pheebs

Copy link
Copy Markdown
Contributor

closes #499

Description

This PR implements the data export and deletion functionality required by the Nigeria Data Protection Act (Issue #499).

Changes

  1. GET /v1/export - Produces a machine-readable JSON archive of user data:

    • User ID (hashed for privacy)
    • Generated timestamp
    • Asset balances (available and held amounts)
    • Optional: active holds ()
    • Optional: transaction history ()
  2. POST /v1/deletion-request - Processes user data deletion requests:

    • Anonymizes user profile by clearing the field
    • Optionally deletes transaction history ()
    • Keeps the double-entry ledger postings intact (append-only for audit/compliance)
    • Returns a processing status with a request ID

Implementation Details

  • The export endpoint follows the same money formatting patterns as the existing balances route
  • The deletion flow preserves ledger integrity - only entries are removed when requested, while remain append-only
  • Both endpoints are authenticated and follow existing codebase patterns
  • Tests include unit tests for the helper function

Verification

  • TypeScript typecheck passes
  • Existing npm tests pass
  • No merge conflicts with main branch

Ade-Pheebs and others added 2 commits October 22, 2026 03:21
- Add replica_database_url config option read from REPLICA_DATABASE_URL env var
- Add replica_database field to AppState
- Create DatabaseRouter struct with read_with_fallback and write_with_primary methods
- Update get_balances to use DatabaseRouter for replica-aware reads
- Write operations (transfers, deposits, etc.) always go to primary database

Co-Authored-By: Codebuff <noreply@codebuff.com>
…ion Act (closes The-Engineer-Network#499)

- Add GET /v1/export endpoint producing machine-readable JSON archive of user data
- Add POST /v1/deletion-request endpoint that anonymises personal data while keeping ledger history intact
- Ledger balances remain reconciled after deletion (append-only postings)
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@Ade-Pheebs is attempting to deploy a commit to the emmanuel adewunmi's projects Team on Vercel.

A member of the Team first needs to authorize it.

…work#490)

- Add frozen flag, reason, and actor to user_profiles table
- Check freeze status in transfers endpoint
- Check freeze status in withdrawals endpoint
- Check freeze status in conversions endpoint
- Check freeze status in naira/SEP-24 endpoints
- Check freeze status in payment requests endpoint
- Deposits still credited normally even when account frozen
@adenueltech
adenueltech merged commit 9225dc9 into The-Engineer-Network:main Oct 22, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data export and deletion under the Nigeria Data Protection Act

2 participants