/**
 * Suppliers API Types
 *
 * These types mirror the backend Pydantic schemas exactly.
 * Backend schemas location: services/suppliers/app/schemas/
 *
 * @see services/suppliers/app/schemas/suppliers.py - Supplier, PO, Delivery schemas
 * @see services/suppliers/app/schemas/performance.py - Performance metrics, alerts, scorecards
 */

// ===== ENUMS =====
// Mirror: app/models/suppliers.py

export enum SupplierType {
  INGREDIENTS = 'ingredients',
  PACKAGING = 'packaging',
  EQUIPMENT = 'equipment',
  SERVICES = 'services',
  UTILITIES = 'utilities',
  MULTI = 'multi'
}

export enum SupplierStatus {
  ACTIVE = 'active',
 INACTIVE = 'inactive',
  PENDING_APPROVAL = 'pending_approval',
  SUSPENDED = 'suspended',
  BLACKLISTED = 'blacklisted'
}

export enum PaymentTerms {
  COD = 'cod',
  NET_15 = 'net_15',
  NET_30 = 'net_30',
  NET_45 = 'net_45',
  NET_60 = 'net_60',
  PREPAID = 'prepaid',
  CREDIT_TERMS = 'credit_terms'
}

export enum PurchaseOrderStatus {
  DRAFT = 'draft',
  PENDING_APPROVAL = 'pending_approval',
  APPROVED = 'approved',
  SENT_TO_SUPPLIER = 'sent_to_supplier',
  CONFIRMED = 'confirmed',
  PARTIALLY_RECEIVED = 'partially_received',
  COMPLETED = 'completed',
  CANCELLED = 'cancelled',
  DISPUTED = 'disputed'
}

export enum DeliveryStatus {
  SCHEDULED = 'scheduled',
  IN_TRANSIT = 'in_transit',
  OUT_FOR_DELIVERY = 'out_for_delivery',
  DELIVERED = 'delivered',
  PARTIALLY_DELIVERED = 'partially_delivered',
  FAILED_DELIVERY = 'failed_delivery',
  RETURNED = 'returned'
}

export enum QualityRating {
  EXCELLENT = 5,
  GOOD = 4,
  AVERAGE = 3,
  POOR = 2,
  VERY_POOR = 1
}

export enum DeliveryRating {
  EXCELLENT = 5,
  GOOD = 4,
  AVERAGE = 3,
  POOR = 2,
  VERY_POOR = 1
}

export enum InvoiceStatus {
  PENDING = 'pending',
  APPROVED = 'approved',
  PAID = 'paid',
  OVERDUE = 'overdue',
  DISPUTED = 'disputed',
  CANCELLED = 'cancelled'
}

export enum OrderPriority {
  NORMAL = 'normal',
  HIGH = 'high',
  URGENT = 'urgent'
}

export enum AlertSeverity {
  CRITICAL = 'CRITICAL',
  HIGH = 'HIGH',
  MEDIUM = 'MEDIUM',
  LOW = 'LOW',
  INFO = 'INFO'
}

export enum AlertType {
  POOR_QUALITY = 'POOR_QUALITY',
  LATE_DELIVERY = 'LATE_DELIVERY',
  PRICE_INCREASE = 'PRICE_INCREASE',
  LOW_PERFORMANCE = 'LOW_PERFORMANCE',
  CONTRACT_EXPIRY = 'CONTRACT_EXPIRY',
  COMPLIANCE_ISSUE = 'COMPLIANCE_ISSUE',
  FINANCIAL_RISK = 'FINANCIAL_RISK',
  COMMUNICATION_ISSUE = 'COMMUNICATION_ISSUE',
  CAPACITY_CONSTRAINT = 'CAPACITY_CONSTRAINT',
  CERTIFICATION_EXPIRY = 'CERTIFICATION_EXPIRY'
}

export enum AlertStatus {
  ACTIVE = 'ACTIVE',
 ACKNOWLEDGED = 'ACKNOWLEDGED',
  IN_PROGRESS = 'IN_PROGRESS',
  RESOLVED = 'RESOLVED',
  DISMISSED = 'DISMISSED'
}

export enum PerformanceMetricType {
  DELIVERY_PERFORMANCE = 'DELIVERY_PERFORMANCE',
  QUALITY_SCORE = 'QUALITY_SCORE',
  PRICE_COMPETITIVENESS = 'PRICE_COMPETITIVENESS',
  COMMUNICATION_RATING = 'COMMUNICATION_RATING',
  ORDER_ACCURACY = 'ORDER_ACCURACY',
  RESPONSE_TIME = 'RESPONSE_TIME',
  COMPLIANCE_SCORE = 'COMPLIANCE_SCORE',
  FINANCIAL_STABILITY = 'FINANCIAL_STABILITY'
}

export enum PerformancePeriod {
  DAILY = 'DAILY',
  WEEKLY = 'WEEKLY',
  MONTHLY = 'MONTHLY',
  QUARTERLY = 'QUARTERLY',
  YEARLY = 'YEARLY'
}

// ===== SUPPLIER PRICE LIST SCHEMAS =====
export interface SupplierPriceListCreate {
  inventory_product_id: string;
  product_code?: string | null;  // max_length=100
  unit_price: number;  // gt=0
  unit_of_measure: string;  // max_length=20
  minimum_order_quantity?: number | null;  // ge=1
  price_per_unit: number;  // gt=0
  tier_pricing?: Record<string, any> | null;  // [{quantity: 100, price: 2.50}, ...]
  effective_date?: string;  // Default: now()
  expiry_date?: string | null;
  is_active?: boolean;  // Default: true
  brand?: string | null;  // max_length=100
  packaging_size?: string | null;  // max_length=50
 origin_country?: string | null;  // max_length=100
  shelf_life_days?: number | null;
  storage_requirements?: string | null;
  quality_specs?: Record<string, any> | null;
  allergens?: Record<string, any> | null;
}

export interface SupplierPriceListUpdate {
  unit_price?: number | null;  // gt=0
  unit_of_measure?: string | null;  // max_length=20
  minimum_order_quantity?: number | null;  // ge=1
  tier_pricing?: Record<string, any> | null;
  effective_date?: string | null;
  expiry_date?: string | null;
  is_active?: boolean | null;
 brand?: string | null;
  packaging_size?: string | null;
  origin_country?: string | null;
  shelf_life_days?: number | null;
  storage_requirements?: string | null;
  quality_specs?: Record<string, any> | null;
  allergens?: Record<string, any> | null;
}

export interface SupplierPriceListResponse {
  id: string;
  tenant_id: string;
  supplier_id: string;
  inventory_product_id: string;
  product_code: string | null;
  unit_price: number;
  unit_of_measure: string;
  minimum_order_quantity: number | null;
  price_per_unit: number;
  tier_pricing: Record<string, any> | null;
  effective_date: string;
  expiry_date: string | null;
  is_active: boolean;
  brand: string | null;
  packaging_size: string | null;
  origin_country: string | null;
  shelf_life_days: number | null;
  storage_requirements: string | null;
  quality_specs: Record<string, any> | null;
  allergens: Record<string, any> | null;
  created_at: string;
  updated_at: string;
  created_by: string;
  updated_by: string;
}

// ===== SUPPLIER SCHEMAS =====
// Mirror: SupplierCreate from suppliers.py:23

export interface SupplierCreate {
  name: string;  // min_length=1, max_length=255
  supplier_code?: string | null;  // max_length=50
  tax_id?: string | null;  // max_length=50
  registration_number?: string | null;  // max_length=100
  supplier_type: SupplierType;
  contact_person?: string | null;  // max_length=200
  email?: string | null;  // EmailStr
  phone?: string | null;  // max_length=30
  mobile?: string | null;  // max_length=30
  website?: string | null;  // max_length=255

  // Address
  address_line1?: string | null;  // max_length=255
  address_line2?: string | null;  // max_length=255
  city?: string | null;  // max_length=100
  state_province?: string | null;  // max_length=100
  postal_code?: string | null;  // max_length=20
  country?: string | null;  // max_length=100

  // Business terms
  payment_terms?: PaymentTerms;  // Default: net_30
  credit_limit?: number | null;  // ge=0
  currency?: string;  // Default: "EUR", max_length=3
  standard_lead_time?: number;  // Default: 3, ge=0, le=365
  minimum_order_amount?: number | null;  // ge=0
  delivery_area?: string | null;  // max_length=255

  // Additional information
  notes?: string | null;
  certifications?: Record<string, any> | null;
  business_hours?: Record<string, any> | null;
  specializations?: Record<string, any> | null;
}

// Mirror: SupplierUpdate from suppliers.py:59
export interface SupplierUpdate {
  name?: string | null;
  supplier_code?: string | null;
  tax_id?: string | null;
  registration_number?: string | null;
  supplier_type?: SupplierType | null;
  status?: SupplierStatus | null;
  contact_person?: string | null;
  email?: string | null;
  phone?: string | null;
  mobile?: string | null;
  website?: string | null;

  // Address
  address_line1?: string | null;
  address_line2?: string | null;
  city?: string | null;
  state_province?: string | null;
  postal_code?: string | null;
  country?: string | null;

  // Business terms
  payment_terms?: PaymentTerms | null;
  credit_limit?: number | null;
  currency?: string | null;
  standard_lead_time?: number | null;
  minimum_order_amount?: number | null;
  delivery_area?: string | null;

  // Additional information
  notes?: string | null;
  certifications?: Record<string, any> | null;
  business_hours?: Record<string, any> | null;
  specializations?: Record<string, any> | null;
}

// Mirror: SupplierApproval from suppliers.py:96
export interface SupplierApproval {
  action: 'approve' | 'reject';
  notes?: string | null;
}

// Mirror: SupplierResponse from suppliers.py:102
export interface SupplierResponse {
 id: string;
  tenant_id: string;
  name: string;
  supplier_code: string | null;
  tax_id: string | null;
  registration_number: string | null;
  supplier_type: SupplierType;
  status: SupplierStatus;
  contact_person: string | null;
  email: string | null;
  phone: string | null;
  mobile: string | null;
  website: string | null;

  // Address
  address_line1: string | null;
  address_line2: string | null;
  city: string | null;
  state_province: string | null;
  postal_code: string | null;
  country: string | null;

  // Business terms
 payment_terms: PaymentTerms;
  credit_limit: number | null;
  currency: string;
  standard_lead_time: number;
  minimum_order_amount: number | null;
  delivery_area: string | null;

  // Performance metrics
 quality_rating: number | null;
  delivery_rating: number | null;
  total_orders: number;
  total_amount: number;

  // Approval info
  approved_by: string | null;
  approved_at: string | null;
  rejection_reason: string | null;

  // Additional information
 notes: string | null;
  certifications: Record<string, any> | null;
  business_hours: Record<string, any> | null;
  specializations: Record<string, any> | null;

  // Audit fields
  created_at: string;
  updated_at: string;
  created_by: string;
  updated_by: string;
}

// Mirror: SupplierSummary from suppliers.py:161
export interface SupplierSummary {
  id: string;
  name: string;
  supplier_code: string | null;
  supplier_type: SupplierType;
  status: SupplierStatus;
  contact_person: string | null;
  email: string | null;
  phone: string | null;
  city: string | null;
  country: string | null;

  // Business terms - Added for list view
  payment_terms: PaymentTerms;
  standard_lead_time: number;
  minimum_order_amount: number | null;

  // Performance metrics
  quality_rating: number | null;
  delivery_rating: number | null;
  total_orders: number;
  total_amount: number;
  created_at: string;
}


// ===== DELIVERY SCHEMAS =====
// Mirror: DeliveryItemCreate from suppliers.py (inferred)

export interface DeliveryItemCreate {
  purchase_order_item_id: string;
  inventory_product_id: string;
  ordered_quantity: number;  // gt=0
  delivered_quantity: number;  // ge=0
  accepted_quantity: number;  // ge=0
  rejected_quantity?: number;  // Default: 0, ge=0

  // Quality tracking
  batch_lot_number?: string | null;  // max_length=100
  expiry_date?: string | null;
  quality_grade?: string | null;  // max_length=20

  // Issues
  quality_issues?: string | null;
  rejection_reason?: string | null;
  item_notes?: string | null;
}

// Mirror: DeliveryItemResponse from suppliers.py (inferred)
export interface DeliveryItemResponse extends DeliveryItemCreate {
  id: string;
  tenant_id: string;
  delivery_id: string;
  created_at: string;
  updated_at: string;
}

// Mirror: DeliveryCreate from suppliers.py (inferred)
export interface DeliveryCreate {
  purchase_order_id: string;
  supplier_id: string;
  items: DeliveryItemCreate[];  // min_items=1

  // Delivery info
  supplier_delivery_note?: string | null;  // max_length=100
  scheduled_date?: string | null;
  estimated_arrival?: string | null;
  delivery_address?: string | null;
  delivery_contact?: string | null;  // max_length=200
  delivery_phone?: string | null;  // max_length=30

  // Tracking
 carrier_name?: string | null;  // max_length=200
  tracking_number?: string | null;  // max_length=100

  // Additional
  notes?: string | null;
}

// Mirror: DeliveryUpdate from suppliers.py (inferred)
export interface DeliveryUpdate {
 supplier_delivery_note?: string | null;
  scheduled_date?: string | null;
  estimated_arrival?: string | null;
  actual_arrival?: string | null;
  delivery_address?: string | null;
  delivery_contact?: string | null;
  delivery_phone?: string | null;
  carrier_name?: string | null;
  tracking_number?: string | null;
  inspection_passed?: boolean | null;
  inspection_notes?: string | null;
  quality_issues?: Record<string, any> | null;
  notes?: string | null;
}

// Mirror: DeliveryStatusUpdate from suppliers.py (inferred)
export interface DeliveryStatusUpdate {
  status: DeliveryStatus;
  notes?: string | null;
  update_timestamps?: boolean;  // Default: true
}

// Mirror: DeliveryReceiptConfirmation from suppliers.py (inferred)
export interface DeliveryReceiptConfirmation {
  inspection_passed?: boolean;  // Default: true
  inspection_notes?: string | null;
  quality_issues?: Record<string, any> | null;
  notes?: string | null;
}

// Mirror: DeliveryResponse from suppliers.py (inferred)
export interface DeliveryResponse {
  id: string;
  tenant_id: string;
  purchase_order_id: string;
  supplier_id: string;
  delivery_number: string;
  status: DeliveryStatus;

  // Timing
 scheduled_date: string | null;
  estimated_arrival: string | null;
 actual_arrival: string | null;
  completed_at: string | null;

  // Delivery info
 supplier_delivery_note: string | null;
  delivery_address: string | null;
  delivery_contact: string | null;
  delivery_phone: string | null;

  // Tracking
 carrier_name: string | null;
  tracking_number: string | null;

  // Quality
  inspection_passed: boolean | null;
  inspection_notes: string | null;
 quality_issues: Record<string, any> | null;

  // Receipt
  received_by: string | null;
  received_at: string | null;

  // Additional
  notes: string | null;
  photos: Record<string, any> | null;

  // Audit
 created_at: string;
  updated_at: string;
  created_by: string;

  // Related data
  supplier?: SupplierSummary | null;
  purchase_order?: PurchaseOrderSummary | null;
  items?: DeliveryItemResponse[] | null;
}

// Mirror: DeliverySummary from suppliers.py (inferred)
export interface DeliverySummary {
  id: string;
  delivery_number: string;
  supplier_id: string;
  supplier_name: string | null;
  purchase_order_id: string;
  po_number: string | null;
  status: DeliveryStatus;
  scheduled_date: string | null;
  actual_arrival: string | null;
  inspection_passed: boolean | null;
  created_at: string;
}

// ===== PERFORMANCE SCHEMAS =====
// Mirror: PerformanceMetricCreate from performance.py

export interface PerformanceMetricCreate {
  supplier_id: string;
 metric_type: PerformanceMetricType;
  period: PerformancePeriod;
  period_start: string;
  period_end: string;
  metric_value: number;  // ge=0, le=100
  target_value?: number | null;

  // Supporting data (all default=0)
  total_orders?: number;  // ge=0
  total_deliveries?: number;  // ge=0
  on_time_deliveries?: number;  // ge=0
  late_deliveries?: number;  // ge=0
  quality_issues?: number;  // ge=0
  total_amount?: number;  // ge=0

  // Additional
  notes?: string | null;
  metrics_data?: Record<string, any> | null;
  external_factors?: Record<string, any> | null;
}

// Mirror: PerformanceMetric from performance.py
export interface PerformanceMetric extends PerformanceMetricCreate {
  id: string;
  tenant_id: string;
  previous_value: number | null;
  trend_direction: string | null;  // improving, declining, stable
 trend_percentage: number | null;
  calculated_at: string;
}

// Mirror: AlertCreate from performance.py
export interface AlertCreate {
  supplier_id: string;
 alert_type: AlertType;
  severity: AlertSeverity;
  title: string;  // max_length=255
  message: string;
  description?: string | null;

  // Context
 trigger_value?: number | null;
  threshold_value?: number | null;
  metric_type?: PerformanceMetricType | null;

  // Related entities
  purchase_order_id?: string | null;
  delivery_id?: string | null;
  performance_metric_id?: string | null;

  // Actions
  recommended_actions?: Array<Record<string, any>> | null;
  auto_resolve?: boolean;  // Default: false
  priority_score?: number;  // ge=1, le=100, Default: 50
  business_impact?: string | null;
  tags?: string[] | null;
}

// Mirror: Alert from performance.py
export interface Alert extends Omit<AlertCreate, 'auto_resolve'> {
  id: string;
  tenant_id: string;
  status: AlertStatus;
  triggered_at: string;
  acknowledged_at: string | null;
  acknowledged_by: string | null;
  resolved_at: string | null;
  resolved_by: string | null;
  actions_taken: Array<Record<string, any>> | null;
 resolution_notes: string | null;
  escalated: boolean;
  escalated_at: string | null;
  notification_sent: boolean;
  created_at: string;
}

// Mirror: ScorecardCreate from performance.py
export interface ScorecardCreate {
  supplier_id: string;
  scorecard_name: string;  // max_length=255
  period: PerformancePeriod;
  period_start: string;
  period_end: string;

  // Overall scores (all float, ge=0, le=100)
  overall_score: number;
  quality_score: number;
  delivery_score: number;
  cost_score: number;
  service_score: number;

  // Performance breakdown
  on_time_delivery_rate: number;  // ge=0, le=100
  quality_rejection_rate: number;  // ge=0, le=100
  order_accuracy_rate: number;  // ge=0, le=100
  response_time_hours: number;  // ge=0
  cost_variance_percentage: number;

  // Business metrics (all default=0)
  total_orders_processed?: number;  // ge=0
  total_amount_processed?: number;  // ge=0
  average_order_value?: number;  // ge=0
  cost_savings_achieved?: number;

  // Recommendations
  strengths?: string[] | null;
  improvement_areas?: string[] | null;
  recommended_actions?: Array<Record<string, any>> | null;
  notes?: string | null;
}

// Mirror: Scorecard from performance.py
export interface Scorecard extends ScorecardCreate {
  id: string;
  tenant_id: string;
  overall_rank: number | null;
  category_rank: number | null;
  total_suppliers_evaluated: number | null;
  score_trend: string | null;
  score_change_percentage: number | null;
  is_final: boolean;
  approved_by: string | null;
  approved_at: string | null;
  attachments: Record<string, any> | null;
  generated_at: string;
  generated_by: string | null;
}

// ===== STATISTICS AND ANALYTICS =====

export interface SupplierStatistics {
  total_suppliers: number;
  active_suppliers: number;
  pending_suppliers: number;
  avg_quality_rating: number;
 avg_delivery_rating: number;
  total_spend: number;
}


export interface DeliveryPerformanceStats {
  total_deliveries: number;
  on_time_deliveries: number;
  late_deliveries: number;
  failed_deliveries: number;
  on_time_percentage: number;
  avg_delay_hours: number;
  quality_pass_rate: number;
}

export interface DeliverySummaryStats {
  todays_deliveries: number;
  this_week_deliveries: number;
  overdue_deliveries: number;
  in_transit_deliveries: number;
}

export interface PerformanceDashboardSummary {
  total_suppliers: number;
  active_suppliers: number;
  suppliers_above_threshold: number;
  suppliers_below_threshold: number;
  average_overall_score: number;
  average_delivery_rate: number;
  average_quality_rate: number;
  total_active_alerts: number;
  critical_alerts: number;
 high_priority_alerts: number;
  recent_scorecards_generated: number;
  cost_savings_this_month: number;
  performance_trend: string;
  delivery_trend: string;
 quality_trend: string;
  detected_business_model: string;
  model_confidence: number;
  business_model_metrics: Record<string, any>;
}

export interface SupplierPerformanceInsights {
  supplier_id: string;
  supplier_name: string;
  current_overall_score: number;
  previous_score: number | null;
  score_change_percentage: number | null;
  performance_rank: number | null;
  delivery_performance: number;
  quality_performance: number;
  cost_performance: number;
  service_performance: number;
  orders_last_30_days: number;
  average_delivery_time: number;
  quality_issues_count: number;
  cost_variance: number;
  active_alerts: number;
  resolved_alerts_last_30_days: number;
  alert_trend: string;
  performance_category: string;
  risk_level: string;
  top_strengths: string[];
  improvement_priorities: string[];
  recommended_actions: Array<Record<string, any>>;
}

export interface PerformanceAnalytics {
  period_start: string;
  period_end: string;
  total_suppliers_analyzed: number;
  performance_distribution: Record<string, number>;
  score_ranges: Record<string, number[]>;
  overall_trend: Record<string, number>;
  delivery_trends: Record<string, number>;
  quality_trends: Record<string, number>;
  cost_trends: Record<string, number>;
  top_performers: SupplierPerformanceInsights[];
  underperformers: SupplierPerformanceInsights[];
  most_improved: SupplierPerformanceInsights[];
  biggest_declines: SupplierPerformanceInsights[];
  high_risk_suppliers: Array<Record<string, any>>;
  contract_renewals_due: Array<Record<string, any>>;
  certification_expiries: Array<Record<string, any>>;
  total_procurement_value: number;
  cost_savings_achieved: number;
  cost_avoidance: number;
  financial_risk_exposure: number;
}

// ===== FILTER SCHEMAS =====

export interface SupplierSearchParams {
  search_term?: string | null;  // max_length=100
  supplier_type?: SupplierType | null;
  status?: SupplierStatus | null;
  limit?: number;  // Default: 50, ge=1, le=1000
  offset?: number;  // Default: 0, ge=0
}

// ⚠️ DEPRECATED: Use PurchaseOrderSearchParams from '@/api/services/purchase_orders' instead
// Duplicate definition - use the one from purchase_orders service

export interface DeliverySearchParams {
  supplier_id?: string | null;
  status?: DeliveryStatus | null;
  date_from?: string | null;
  date_to?: string | null;
  search_term?: string | null;
  limit?: number;
  offset?: number;
}

export interface DashboardFilter {
  supplier_ids?: string[] | null;
  supplier_categories?: string[] | null;
  performance_categories?: string[] | null;
  date_from?: string | null;
  date_to?: string | null;
  include_inactive?: boolean;  // Default: false
}

export interface AlertFilter {
  alert_types?: AlertType[] | null;
  severities?: AlertSeverity[] | null;
  statuses?: AlertStatus[] | null;
  supplier_ids?: string[] | null;
  date_from?: string | null;
  date_to?: string | null;
  metric_types?: PerformanceMetricType[] | null;
}

// ===== BUSINESS MODEL DETECTION =====

export interface BusinessModelInsights {
  detected_model: string;  // individual_bakery, central_bakery, hybrid
  confidence_score: number;
  model_characteristics: Record<string, any>;
  supplier_diversity_score: number;
  procurement_volume_patterns: Record<string, any>;
  delivery_frequency_patterns: Record<string, any>;
  order_size_patterns: Record<string, any>;
  optimization_opportunities: Array<Record<string, any>>;
  recommended_supplier_mix: Record<string, any>;
  cost_optimization_potential: number;
  risk_mitigation_suggestions: string[];
  industry_comparison: Record<string, number>;
  peer_comparison: Record<string, number> | null;
}

// ===== REPORTING =====

export interface PerformanceReportRequest {
  report_type: 'scorecard' | 'analytics' | 'alerts' | 'comprehensive';
  format: 'pdf' | 'excel' | 'csv' | 'json';
  period: PerformancePeriod;
  date_from: string;
  date_to: string;
  supplier_ids?: string[] | null;
  include_charts?: boolean;  // Default: true
  include_recommendations?: boolean;  // Default: true
  include_benchmarks?: boolean;  // Default: true
  custom_metrics?: string[] | null;
}

export interface ExportDataResponse {
  export_id: string;
  format: string;
  file_url: string | null;
  file_size_bytes: number | null;
  generated_at: string;
  expires_at: string;
  status: 'generating' | 'ready' | 'expired' | 'failed';
  error_message: string | null;
}

// ===== DELETION =====

export interface SupplierDeletionSummary {
  supplier_name: string;
  deleted_price_lists: number;
 deleted_quality_reviews: number;
  deleted_performance_metrics: number;
  deleted_alerts: number;
  deleted_scorecards: number;
  deletion_timestamp: string;
}
