feat: Complete deletion requests management UI implementation

- Backend API:
  - Added DeletionRequestSerializer and DeletionRequestActionSerializer
  - Added DeletionRequestViewSet with approve/reject/pending_count actions
  - Added /api/deletion_requests/ route

- Frontend:
  - Created deletion-request data model
  - Created deletion-request.service.ts with full CRUD operations
  - Created DeletionRequestsComponent with status filtering (pending/approved/rejected/completed)
  - Created DeletionRequestDetailComponent with impact analysis display
  - Added /deletion-requests route with permissions guard
  - Implemented approve/reject modals with confirmation
  - Added status badges and pending request counter

- All code linted and built successfully

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-15 15:33:45 +00:00
parent 1b4bc75a80
commit 5edfbfc028
15 changed files with 22738 additions and 0 deletions

View file

@ -0,0 +1,50 @@
import { ObjectWithId } from './object-with-id'
export interface DeletionRequestDocument {
id: number
title: string
created: string
correspondent?: string
document_type?: string
tags: string[]
}
export interface DeletionRequestImpactSummary {
document_count: number
documents: DeletionRequestDocument[]
affected_tags: string[]
affected_correspondents: string[]
affected_types: string[]
date_range?: {
earliest: string
latest: string
}
}
export enum DeletionRequestStatus {
Pending = 'pending',
Approved = 'approved',
Rejected = 'rejected',
Cancelled = 'cancelled',
Completed = 'completed',
}
export interface DeletionRequest extends ObjectWithId {
created_at: string
updated_at: string
requested_by_ai: boolean
ai_reason: string
user: number
user_username: string
status: DeletionRequestStatus
documents: number[]
documents_detail: DeletionRequestDocument[]
document_count: number
impact_summary: DeletionRequestImpactSummary
reviewed_at?: string
reviewed_by?: number
reviewed_by_username?: string
review_comment?: string
completed_at?: string
completion_details?: any
}