> ## Documentation Index
> Fetch the complete documentation index at: https://memberpulseptyltd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# UJ-M-029: Export My Personal Data

> Member exports all their personal data from the platform

## Journey Overview

| Attribute      | Value                                             |
| -------------- | ------------------------------------------------- |
| **Journey ID** | UJ-M-029                                          |
| **Actor**      | Member                                            |
| **Goal**       | Download a copy of all personal data held         |
| **Trigger**    | Member requests data export (GDPR/privacy rights) |
| **Outcome**    | Member receives complete data export              |

## Preconditions

* Member is authenticated
* Data export feature enabled
* Member has not exceeded export request limits

## Journey Flow

```mermaid theme={null}
flowchart TD
    A[Navigate to Data & Privacy] --> B[Click Export My Data]
    B --> C[Review data categories]
    C --> D[Confirm export request]
    D --> E[Request queued]
    E --> F[System compiles data]
    F --> G[Export ready notification]
    G --> H[Download export file]
```

## Detailed Steps

<Steps>
  <Step title="Access Data Export">
    Member navigates to data export:

    * Profile → Privacy & Data
    * Settings → Data Export
    * Account → Download My Data
  </Step>

  <Step title="Review Export Options">
    Data export page:

    ```
    ┌─────────────────────────────────────────────────────────────┐
    │ Export My Data                                              │
    ├─────────────────────────────────────────────────────────────┤
    │                                                             │
    │ You can download a copy of your personal data stored on     │
    │ this platform. This includes:                               │
    │                                                             │
    │ ☑ Profile Information                                       │
    │   Name, email, contact details, preferences                 │
    │                                                             │
    │ ☑ Membership History                                        │
    │   Plans, payments, invoices, renewal history                │
    │                                                             │
    │ ☑ Event Activity                                            │
    │   Registrations, attendance, tickets                        │
    │                                                             │
    │ ☑ Course Progress                                           │
    │   Enrollments, completions, certificates                    │
    │                                                             │
    │ ☑ CPD Records                                               │
    │   All CPD entries and certificates                          │
    │                                                             │
    │ ☑ Support History                                           │
    │   Support tickets and conversations                         │
    │                                                             │
    │ ☑ Activity Log                                              │
    │   Login history, actions taken                              │
    │                                                             │
    │ Format: [ZIP Archive ▼]                                     │
    │ Contains: JSON + readable summaries                         │
    │                                                             │
    │ [Request Data Export]                                       │
    │                                                             │
    │ Note: Export preparation may take up to 24 hours.           │
    │ You'll receive an email when it's ready.                    │
    │                                                             │
    └─────────────────────────────────────────────────────────────┘
    ```
  </Step>

  <Step title="Confirm Request">
    Confirmation step:

    ```
    ┌─────────────────────────────────────────────────────────────┐
    │ Confirm Data Export Request                                 │
    ├─────────────────────────────────────────────────────────────┤
    │                                                             │
    │ You are requesting a complete export of your personal data. │
    │                                                             │
    │ For security:                                               │
    │ • You'll receive an email when the export is ready          │
    │ • The download link will expire after 7 days                │
    │ • You can only request one export per 30 days               │
    │                                                             │
    │ Please confirm your password to continue:                   │
    │ [••••••••••••]                                              │
    │                                                             │
    │ [Cancel]  [Confirm & Request Export]                        │
    │                                                             │
    └─────────────────────────────────────────────────────────────┘
    ```
  </Step>

  <Step title="Request Queued">
    Confirmation shown:

    ```
    ┌─────────────────────────────────────────────────────────────┐
    │ ✅ Export Requested                                         │
    ├─────────────────────────────────────────────────────────────┤
    │                                                             │
    │ Your data export is being prepared.                         │
    │                                                             │
    │ Request ID: EXP-2025-12345                                  │
    │ Requested: March 15, 2025 at 10:30 AM                       │
    │ Estimated: Ready within 24 hours                            │
    │                                                             │
    │ We'll send an email to john@email.com when your             │
    │ export is ready for download.                               │
    │                                                             │
    └─────────────────────────────────────────────────────────────┘
    ```
  </Step>

  <Step title="Export Preparation">
    System compiles data:

    * All data categories collected
    * Data formatted for readability
    * ZIP archive created
    * Secure download link generated
    * Notification sent
  </Step>

  <Step title="Download Export">
    When ready, member receives email:

    **Email:**

    * Notification that export is ready
    * Secure download link
    * Link expiry notice (7 days)
    * Security reminder

    **Download:**

    * Click link (requires authentication)
    * Download ZIP file
    * File contains JSON + readable formats
  </Step>
</Steps>

## Export Contents

### File Structure

```
my-data-export-2025-03-15/
├── README.txt                    # Instructions and overview
├── profile/
│   ├── personal-info.json        # Profile data
│   └── personal-info.csv         # Readable format
├── membership/
│   ├── membership-history.json
│   ├── payment-history.json
│   └── invoices/                 # PDF invoices
├── events/
│   ├── registrations.json
│   ├── attendance.json
│   └── tickets/                  # PDF tickets
├── courses/
│   ├── enrollments.json
│   ├── progress.json
│   └── certificates/             # PDF certificates
├── cpd/
│   ├── cpd-records.json
│   └── cpd-certificates/
├── support/
│   └── tickets.json
└── activity/
    └── activity-log.json
```

### Data Included

| Category   | Data Points                                      |
| ---------- | ------------------------------------------------ |
| Profile    | Name, email, phone, address, preferences, photo  |
| Membership | Plan history, status, renewals, payments         |
| Payments   | Transaction history, invoices, receipts          |
| Events     | Registrations, attendance, tickets               |
| Courses    | Enrollments, progress, completions, certificates |
| CPD        | All CPD records, submissions, certificates       |
| Support    | Tickets, conversations                           |
| Activity   | Login history, major actions                     |

## Security Measures

* Password confirmation required
* Link expires after 7 days
* Authenticated download required
* Rate limited (1 per 30 days)
* Audit logged
* Secure file storage

## Related Journeys

* [UJ-M-017](/member/journeys/export-cpd)

## Acceptance Criteria

### Frontend

* [ ] Data export page with categories
* [ ] Category selection (all by default)
* [ ] Password confirmation
* [ ] Request confirmation
* [ ] Status tracking
* [ ] Download page (when ready)

### Backend

* [ ] `POST /api/member/data-export` - Request export
* [ ] `GET /api/member/data-export/{id}` - Check status
* [ ] `GET /api/member/data-export/{id}/download` - Download
* [ ] Background job for compilation
* [ ] Secure file storage
* [ ] Email notifications

### Permissions

* [ ] Members can only export their own data
* [ ] Authentication required for download

### Business Rules

* [ ] Rate limit: 1 export per 30 days
* [ ] Download link expires after 7 days
* [ ] All member data included
* [ ] Exported files deleted after expiry

### Error Handling

* [ ] Export compilation failure notification
* [ ] Expired link message
* [ ] Rate limit exceeded message
