/**
 * Shared type definitions for edge functions
 * Provides type safety across all backend operations
 */

export interface SubmissionUpdateData {
  status?: 'approved' | 'rejected' | 'pending';
  reviewer_id?: string;
  reviewed_at?: string;
  reviewer_notes?: string;
}

export interface PhotoSubmissionUpdateData {
  status?: 'approved' | 'rejected' | 'pending';
  reviewed_by?: string;
  reviewed_at?: string;
  reviewer_notes?: string;
}

export interface ReviewUpdateData {
  is_approved?: boolean;
  approved_by?: string;
  approved_at?: string;
  reviewer_notes?: string;
}

export interface EntityData {
  id?: string;
  name?: string;
  slug?: string;
  description?: string;
  [key: string]: unknown;
}

export interface LocationData {
  country?: string;
  state_province?: string;
  city?: string;
  latitude?: number;
  longitude?: number;
}

export interface SubscriberData {
  subscriberId: string;
  email?: string;
  firstName?: string;
  lastName?: string;
  phone?: string;
  avatar?: string;
  data?: Record<string, unknown>;
}

export interface NotificationPayload {
  workflowId: string;
  subscriberId?: string;
  topicKey?: string;
  payload: Record<string, unknown>;
  overrides?: Record<string, unknown>;
}

export interface ApprovalRequest {
  submissionId: string;
  itemIds: string[];
  action: 'approve' | 'reject';
  notes?: string;
}

export interface ValidationResult {
  valid: boolean;
  errors: string[];
}

export interface StrictValidationResult {
  valid: boolean;
  blockingErrors: string[];
  warnings: string[];
}
