export type ReviewStatus = 'draft' | 'pending' | 'changes_requested' | 'approved'; export type ReviewRoundStatus = 'draft' | 'reviewing' | 'completed'; export type CollectionStatus = 'draft' | 'reviewing' | 'completed' | 'archived'; export type ProjectReviewStatus = 'draft' | 'reviewing' | 'completed' | 'archived'; export type UserRole = 'platform_admin' | 'group_admin' | 'operator'; export interface CurrentUser { id: number; group_id: number | null; group_name: string | null; username: string; display_name: string; role: UserRole; must_change_password: boolean; } export interface OperationGroup { id: number; name: string; status: 'active' | 'disabled'; user_count: number; active_user_count: number; operator_count: number; disabled_user_count: number; project_count: number; customer_link_count: number; group_admin_name: string | null; group_admin_status: 'active' | 'disabled' | null; created_at: string; } export interface ManagedUser { id: number; group_id: number | null; group_name: string | null; username: string; display_name: string; role: UserRole; status: 'active' | 'disabled'; must_change_password: boolean; last_login_at: string | null; last_operation_at: string | null; created_at: string; } export interface ManagedApiKey { id: number; group_id: number | null; project_id: number | null; project_name: string | null; name: string; key_prefix: string; scope: 'platform' | 'project'; status: 'active' | 'revoked'; created_by_name: string; last_used_at: string | null; created_at: string; } export interface StorageConfig { id: number; provider: 'tencent_cos'; region: string; bucket: string; public_base_url: string; cdn_domain: string; path_prefix: string; status: 'draft' | 'active' | 'archived'; test_status: 'untested' | 'passed' | 'failed'; test_message: string; last_tested_at: string | null; created_by_name: string; created_at: string; activated_at: string | null; has_credentials: boolean; } export interface AuditLogEntry { id: number; group_id: number | null; group_name: string | null; user_id: number | null; user_name: string | null; action: string; entity_type: string; entity_id: number | null; detail: Record; created_at: string; } export interface Project { id: number; group_id: number; group_name: string; name: string; slug: string; client_description: string; status: 'active' | 'closed' | 'archived'; review_status: ProjectReviewStatus; review_completed_at: string | null; customer_access_enabled: boolean; access_expires_at: string | null; has_access_password: boolean; collection_count: number; work_count: number; pending_count: number; changes_requested_count: number; approved_count: number; created_at: string; } export interface CustomerAccessState { project_name: string; client_description: string; enabled: boolean; expired: boolean; authenticated: boolean; reviewer_name: string | null; } export interface WorkCollection { id: number; project_id: number; name: string; client_description: string; status: CollectionStatus; work_count: number; approved_count: number; completed_at: string | null; created_at: string; } export interface Note { id: number; project_id: number; collection_id: number; external_id: string | null; title: string; description: string; tags: string[]; review_status: ReviewStatus; version_number: number; active_round_id: number | null; approved_version_number: number | null; cover_image: string; image_count: number; annotation_count: number; comment_count: number; created_at: string; } export interface NoteImage { id: number; note_id: number; url: string; width: number; height: number; order_index: number; storage_provider: 'local' | 'tencent_cos' | 'external'; storage_key: string; } export interface Annotation { id: number; image_id: number; x: number; y: number; content: string; author_name: string; author_role: 'client' | 'operator'; status: 'open' | 'resolved' | 'confirmed'; closure_reason: string; withdrawn_at: string | null; created_at: string; } export interface WorkComment { id: number; note_id: number; version_number: number; content: string; author_name: string; author_role: 'client' | 'operator'; status: 'open' | 'resolved' | 'confirmed'; closure_reason: string; withdrawn_at: string | null; created_at: string; } export interface TextAnnotation { id: number; note_id: number; version_number: number; target: 'title' | 'description' | 'tags'; start_offset: number; end_offset: number; selected_text: string; prefix_text: string; suffix_text: string; content: string; author_name: string; author_role: 'client' | 'operator'; status: 'open' | 'resolved' | 'confirmed'; closure_reason: string; withdrawn_at: string | null; created_at: string; } export type FeedbackType = 'image_annotation' | 'text_annotation' | 'comment'; export interface FeedbackReply { id: number; note_id: number; version_number: number; feedback_type: FeedbackType; feedback_id: number; content: string; author_name: string; author_role: 'client' | 'operator'; withdrawn_at: string | null; created_at: string; } export interface ImageWithAnnotations extends NoteImage { annotations: Annotation[]; } export interface NoteDetail extends Note { images: ImageWithAnnotations[]; text_annotations: TextAnnotation[]; comments: WorkComment[]; feedback_replies: FeedbackReply[]; project: Pick; rounds: WorkRound[]; review_events: ReviewEvent[]; } export interface WorkRound { version_number: number; review_round_id: number; round_number: number; round_status: ReviewRoundStatus; completion_reason: string; title: string; description: string; tags: string[]; review_status: ReviewStatus; created_at: string; } export interface ReviewRound { id: number; note_id: number; round_number: number; status: ReviewRoundStatus; selected_version_number: number | null; completed_at: string | null; completion_reason: string; created_at: string; } export interface ReviewEvent { id: number; version_number: number; event_type: 'submitted' | 'approved' | 'changes_requested' | 'reopened'; from_status: ReviewStatus | null; to_status: ReviewStatus; reason: string; actor_name: string; actor_role: 'client' | 'operator' | 'group_admin' | 'platform_admin'; created_at: string; } export interface CreateAnnotationRequest { x: number; y: number; content: string; author_name?: string; author_role?: 'client' | 'operator'; } export interface WorkFeedbackBundle { work_id: number; rounds: Array<{ round_number: number; version_number: number; image_annotations: Array; text_annotations: TextAnnotation[]; comments: WorkComment[]; feedback_replies: FeedbackReply[]; review_events: ReviewEvent[]; }>; } export interface NoteListQuery { sort?: 'created_at' | 'annotations'; order?: 'asc' | 'desc'; q?: string; collectionId?: number; status?: ReviewStatus; tag?: string; projectId?: number; groupId?: number; externalId?: string; }