# Walkthrough: Wiki Protection & Admin Purge

## Overview
This walkthrough covers the verification of:
1.  **Wiki Revision History**: View history and restore versions.
2.  **Soft Delete**: Move documents to trash instead of immediate deletion.
3.  **Admin Purge**: Permanently delete documents and history (Admin only).

## Verification Steps

### 1. Wiki Revision History
1.  Navigate to any Wiki document.
2.  Edit and save the document multiple times to create revisions.
3.  Click the **History** button (next to Delete).
4.  Verify list of revisions appears.
5.  Click **Restore** on an older version.
6.  Confirm the document content reverts to that version.

### 2. Administrator Purge (Permanent Delete)
> [!WARNING]
> This action is irreversible. Ensure you are logged in as an Admin (`jonghyuk.jeon@gmail.com` or `drumbrab@gmail.com`).

1.  **Soft Delete Verification**:
    - Click **Delete (Trash)** button on a document.
    - Confirm alert says "문서가 휴지통으로 이동되었습니다."
    - Verify document redirects to home.
    - Navigate back to the document URL (admin/author only).
    - Confirm **Deleted Banner** appears at the top.
    - Click **문서 복원하기** (Restore) button in the banner.
    - Confirm document is restored and banner disappears.

2.  **Purge Verification**:
    - Navigate back to the deleted document URL (e.g., `/docs/[docId]`).
    - Confirm the content is still visible (for Admin/Author).
    - If you are admin, a **영구 삭제 (Purge)** button should appear next to the Delete button.
    - Click **영구 삭제**.
    - Confirm alert "문서가 영구적으로 삭제되었습니다."
    - Verify redirection to home.
    - Attempt to access the URL again -> Should show 404 or "존재하지 않는 문서" alert.

## Troubleshooting
- If **Purge** button doesn't appear:
    - Ensure you are logged in with the correct Admin email.
    - Ensure the document was first **Soft Deleted**.
- If API error occurs:
    - Check browser console for `/api/admin/purge` response.
    - Ensure `firebase-admin` credentials are correct in server logs.
