export interface User {
  id: number;
  email: string;
  firstName: string;
  lastName: string;
  permissions: string[];
  customerId?: number;
  roles?: Role[];
  isCustomerPortal?: boolean;
  mustChangePassword?: boolean;
  representedCustomers?: CustomerSummary[];
  whatsappNumber?: string;
  telegramUsername?: string;
  signalNumber?: string;
}

// Zusammenfassung für Vertreter-Listen
export interface CustomerSummary {
  id: number;
  customerNumber: string;
  firstName: string;
  lastName: string;
  companyName?: string;
  type: 'PRIVATE' | 'BUSINESS';
  portalEnabled?: boolean;
}

// Werbung ("Geworben / angeworben")
export const REFERRAL_RELATIONSHIPS = [
  'Ehepartner/in',
  'Lebenspartner/in',
  'Kind',
  'Enkelkind',
  'Onkel/Tante',
  'Neffe',
  'Freund/Kumpel',
  'Eltern',
  'Bruder/Schwester',
  'Schwiegertochter/Schwiegersohn',
  'Schwiegermutter/Schwiegervater',
  'Oma/Opa',
  'Uroma/Uropa',
  'Bekannte',
  'sonstige',
] as const;

export interface ReferralEntry {
  id: number;
  relationship: string;
  customer: CustomerSummary;
}

export interface CustomerReferrals {
  /** Von wem dieser Kunde geworben wurde (max. 1). */
  recruitedBy: ReferralEntry | null;
  /** Welche Kunden dieser Kunde geworben hat (beliebig viele). */
  recruited: ReferralEntry[];
}

// ==================== GUTSCHRIFTEN (CREDIT NOTES) ====================

export type CreditNoteType = 'GELD' | 'SACHWERT';
export type CreditNoteCustomerType = 'PRIVAT' | 'FIRMA';
export type CreditNoteAmountBasis = 'NETTO' | 'BRUTTO';

export interface CreditNote {
  id: number;
  contractId: number;
  number: string | null;
  deliveryNoteNumber: string | null;
  type: CreditNoteType;
  sachwertDescription?: string | null;
  customerType: CreditNoteCustomerType;
  vatRelevant: boolean;
  amountBasis: CreditNoteAmountBasis;
  vatRate: number;
  amountNet: number;
  amountVat: number;
  amountGross: number;
  currency: string;
  creditDate: string;
  place?: string | null;
  signedAt?: string | null;
  goodsReceived: boolean;
  payoutBankCardId?: number | null;
  receiptPath?: string | null;
  pdfPath?: string | null;
  notes?: string | null;
  createdBy?: string | null;
  createdAt: string;
  updatedAt: string;
}

export interface CreditNotePayoutBankCard {
  id: number;
  iban: string;
  accountHolder: string;
  bankName?: string | null;
  description?: string | null;
}

export interface CreditNoteListItem extends CreditNote {
  contract: {
    id: number;
    contractNumber: string;
    type: string;
    customer: {
      id: number;
      customerNumber: string;
      firstName: string;
      lastName: string;
      companyName?: string | null;
    };
  };
}

export interface CreditNoteDefaults {
  customerType: CreditNoteCustomerType;
  vatRelevant: boolean;
  nextNumber: string;
  bankCards: CreditNotePayoutBankCard[];
  contractBankCardId: number | null;
  hasRecipientAddress: boolean;
}

export interface CreditNoteNumberRange {
  id: number;
  prefix: string;
  includeYear: boolean;
  separator: string;
  padding: number;
  nextNumber: number;
  resetYearly: boolean;
  currentYear: number | null;
  preview?: string;
}

export interface CompanyProfile {
  id: number;
  name: string;
  street: string;
  houseNumber: string;
  postalCode: string;
  city: string;
  country: string;
  vatId: string;
  taxNumber: string;
  commercialRegister: string;
  managingDirector: string;
  email: string;
  phone: string;
  website: string;
  iban: string;
  bic: string;
  bankName: string;
  logoPath?: string | null;
}

export interface RepresentativeAuthorization {
  id: number;
  customerId: number;
  representativeId: number;
  isGranted: boolean;
  grantedAt?: string;
  withdrawnAt?: string;
  source?: string;
  documentPath?: string;
  notes?: string;
  representative?: CustomerSummary;
  customer?: CustomerSummary;
  createdAt: string;
  updatedAt: string;
}

export interface Role {
  id: number;
  name: string;
  description?: string;
}

export interface StressfreiEmail {
  id: number;
  customerId: number;
  email: string;
  platform?: string;
  notes?: string;
  isActive: boolean;
  hasMailbox: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface Customer {
  id: number;
  customerNumber: string;
  type: 'PRIVATE' | 'BUSINESS';
  salutation?: string;
  useInformalAddress?: boolean;
  autoBirthdayGreeting?: boolean;
  autoBirthdayChannel?: string | null;
  firstName: string;
  lastName: string;
  companyName?: string;
  foundingDate?: string;
  birthDate?: string;
  birthPlace?: string;
  email?: string;
  phone?: string;
  mobile?: string;
  taxNumber?: string;
  vatExempt?: boolean;
  businessRegistrationPath?: string;
  commercialRegisterPath?: string;
  commercialRegisterNumber?: string;
  privacyPolicyPath?: string;
  notes?: string;
  // Portal-Felder
  portalEnabled?: boolean;
  portalEmail?: string;
  portalLastLogin?: string;
  addresses?: Address[];
  bankCards?: BankCard[];
  identityDocuments?: IdentityDocument[];
  meters?: Meter[];
  stressfreiEmails?: StressfreiEmail[];
  contracts?: Contract[];
  createdAt: string;
  updatedAt: string;
}

// Portal-Einstellungen
export interface PortalSettings {
  id: number;
  portalEnabled: boolean;
  portalEmail?: string;
  portalLastLogin?: string;
  hasPassword: boolean;
}

// Vertreter-Beziehung
export interface CustomerRepresentative {
  id: number;
  customerId: number;
  customer?: CustomerSummary;
  representativeId: number;
  representative?: CustomerSummary;
  notes?: string;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface Address {
  id: number;
  customerId: number;
  type: 'DELIVERY_RESIDENCE' | 'BILLING';
  street: string;
  houseNumber: string;
  postalCode: string;
  city: string;
  country: string;
  isDefault: boolean;
  // Marktlokations-IDs (MaLo) je Sparte – gehören zur (Liefer-)Adresse
  maloIdElectricity?: string;
  maloIdGas?: string;
  // Eigentümer (leer = Kunde ist selbst Eigentümer)
  ownerCompany?: string;
  ownerFirstName?: string;
  ownerLastName?: string;
  ownerStreet?: string;
  ownerHouseNumber?: string;
  ownerPostalCode?: string;
  ownerCity?: string;
  ownerPhone?: string;
  ownerMobile?: string;
  ownerEmail?: string;
}

export interface BankCard {
  id: number;
  customerId: number;
  accountHolder: string;
  iban: string;
  cardNumber?: string;
  bic?: string;
  bankName?: string;
  expiryDate?: string;
  documentPath?: string;
  description?: string;
  isActive: boolean;
}

export interface IdentityDocument {
  id: number;
  customerId: number;
  type: 'ID_CARD' | 'PASSPORT' | 'DRIVERS_LICENSE' | 'OTHER';
  documentNumber: string;
  issuingAuthority?: string;
  issueDate?: string;
  expiryDate?: string;
  documentPath?: string;
  isActive: boolean;
  // Führerschein-spezifische Felder
  licenseClasses?: string;
  licenseIssueDate?: string;
}

export interface ContractDocument {
  id: number;
  contractId: number;
  documentType: string;
  documentPath: string;
  originalName: string;
  notes?: string;
  uploadedBy?: string;
  createdAt: string;
}

export interface PdfTemplate {
  id: number;
  name: string;
  description?: string;
  providerName?: string;
  templatePath: string;
  originalName: string;
  fieldMapping: string;
  phoneFieldPrefix?: string;
  maxPhoneFields?: number;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface PdfField {
  name: string;
  type: string;
  page: number;
  y: number;
}

export interface CrmField {
  path: string;
  label: string;
  group: string;
}

export type MeterTariffModel = 'SINGLE' | 'DUAL';

export interface Meter {
  id: number;
  customerId: number;
  meterNumber: string;
  type: 'ELECTRICITY' | 'GAS';
  tariffModel: MeterTariffModel;
  location?: string;
  isActive: boolean;
  // Lieferadresse, an der der Zähler hängt. Optional, weil Bestandszähler
  // (vor Einführung dieses Feldes) noch ohne Adresse existieren können.
  addressId?: number | null;
  address?: Address;
  readings?: MeterReading[];
  // Verträge, die diesen Zähler aktuell als Hauptzähler nutzen
  energyDetails?: Array<{
    id: number;
    contractId: number;
    contract?: {
      id: number;
      contractNumber: string;
      status: ContractStatus;
      type: string;
      providerName?: string;
    };
  }>;
  // Verträge, in denen der Zähler in der ContractMeter-Kette steht
  // (Vorgänger oder Nachfolger über Zählerwechsel)
  contractMeters?: Array<{
    id: number;
    energyContractDetailsId: number;
    position: number;
    installedAt?: string;
    removedAt?: string;
    energyContractDetails?: {
      id: number;
      contractId: number;
      contract?: {
        id: number;
        contractNumber: string;
        status: ContractStatus;
        type: string;
        providerName?: string;
      };
    };
  }>;
}

export interface ContractMeter {
  id: number;
  energyContractDetailsId: number;
  meterId: number;
  meter?: Meter;
  position: number;
  installedAt?: string;
  removedAt?: string;
  finalReading?: number;
}

export type MeterReadingStatus = 'RECORDED' | 'REPORTED' | 'TRANSFERRED';

export interface MeterReading {
  id: number;
  meterId: number;
  readingDate: string;
  value: number;
  valueNt?: number;     // NT-Wert (nur bei Zweitarifzähler)
  unit: string;
  notes?: string;
  reportedBy?: string;
  status: MeterReadingStatus;
  transferredAt?: string;
  transferredBy?: string;
}

export type InvoiceType = 'INTERIM' | 'FINAL' | 'NOT_AVAILABLE';

export interface Invoice {
  id: number;
  energyContractDetailsId: number;
  invoiceDate: string;
  invoiceType: InvoiceType;
  documentPath?: string;
  notes?: string;
  createdAt: string;
  updatedAt: string;
}

export type ContractTaskStatus = 'OPEN' | 'COMPLETED';

export interface ContractTaskSubtask {
  id: number;
  taskId: number;
  title: string;
  status: ContractTaskStatus;
  createdBy?: string;
  completedAt?: string;
  createdAt: string;
  updatedAt: string;
}

export interface ContractTaskContract {
  id: number;
  contractNumber: string;
  customerId: number;
  customer?: {
    id: number;
    firstName: string;
    lastName: string;
    companyName?: string;
    customerNumber: string;
  };
  provider?: {
    id: number;
    name: string;
  };
  tariff?: {
    id: number;
    name: string;
  };
  providerName?: string;
  tariffName?: string;
}

export interface ContractTask {
  id: number;
  contractId: number | null;
  title: string;
  description?: string;
  status: ContractTaskStatus;
  visibleInPortal: boolean;
  createdBy?: string;
  completedAt?: string;
  subtasks?: ContractTaskSubtask[];
  contract?: ContractTaskContract;
  createdAt: string;
  updatedAt: string;
}

export interface ContractHistoryEntry {
  id: number;
  contractId: number;
  title: string;
  description?: string;
  isAutomatic: boolean;
  createdBy: string;
  createdAt: string;
}

export interface SalesPlatform {
  id: number;
  name: string;
  contactInfo?: string;
  isActive: boolean;
}

export interface CancellationPeriod {
  id: number;
  code: string;
  description: string;
  isActive: boolean;
}

export interface ContractDuration {
  id: number;
  code: string;
  description: string;
  isActive: boolean;
}

export interface ContractCategory {
  id: number;
  code: string;
  name: string;
  icon?: string;
  color?: string;
  sortOrder: number;
  isActive: boolean;
  _count?: {
    contracts: number;
  };
}

export interface Provider {
  id: number;
  name: string;
  portalUrl?: string;
  usernameFieldName?: string;
  passwordFieldName?: string;
  contactEmail?: string;
  contactPhone?: string;
  contactFax?: string;
  contactAddress?: string;
  cancellationEmail?: string;
  cancellationFax?: string;
  cancellationAddress?: string;
  isActive: boolean;
  tariffs?: Tariff[];
  _count?: {
    contracts: number;
    tariffs: number;
  };
}

export interface Tariff {
  id: number;
  providerId: number;
  provider?: Provider;
  name: string;
  isActive: boolean;
  _count?: {
    contracts: number;
  };
}

export type ContractType = 'ELECTRICITY' | 'GAS' | 'DSL' | 'CABLE' | 'FIBER' | 'MOBILE' | 'TV' | 'CAR_INSURANCE';
export type ContractStatus = 'DRAFT' | 'PENDING' | 'ACTIVE' | 'CANCELLED' | 'CANCELLED_CONFIRMED' | 'EXPIRED' | 'DEACTIVATED' | 'ONGOING';

export interface Contract {
  id: number;
  contractNumber: string;
  customerId: number;
  customer?: Customer;
  type: ContractType;
  status: ContractStatus;
  addressId?: number;
  address?: Address;
  billingAddressId?: number;
  billingAddress?: Address;
  bankCardId?: number;
  bankCard?: BankCard;
  identityDocumentId?: number;
  identityDocument?: IdentityDocument;
  salesPlatformId?: number;
  salesPlatform?: SalesPlatform;
  previousContractId?: number;
  previousContract?: Contract;
  // Altanbieter (nur wenn kein Vorgängervertrag)
  previousProviderId?: number;
  previousProvider?: Provider;
  previousCustomerNumber?: string;
  previousContractNumber?: string;
  providerId?: number;
  provider?: Provider;
  tariffId?: number;
  tariff?: Tariff;
  contractCategoryId?: number;
  contractCategory?: ContractCategory;
  stressfreiEmailId?: number;
  stressfreiEmail?: StressfreiEmail;
  providerName?: string;
  tariffName?: string;
  customerNumberAtProvider?: string;
  contractNumberAtProvider?: string;
  orderNumberAtSalesPlatform?: string;
  customerNumberAtSalesPlatform?: string;
  contractNumberAtSalesPlatform?: string;
  priceFirst12Months?: string;
  priceFrom13Months?: string;
  priceAfter24Months?: string;
  startDate?: string;
  endDate?: string;
  cancellationPeriodId?: number;
  cancellationPeriod?: CancellationPeriod;
  contractDurationId?: number;
  contractDuration?: ContractDuration;
  commission?: number;
  portalUsername?: string;
  /** Backend liefert nur ein Bool-Flag – der verschlüsselte Wert selbst
   *  bleibt server-seitig (sanitizeContract strippt `portalPasswordEncrypted`).
   *  Entschlüsselter Wert kommt über `GET /contracts/:id/password`. */
  hasPortalPassword?: boolean;
  /** Opt-out: Anbieter hat kein Portal / Kunde bekommt keine Zugangsdaten.
   *  Wenn true, unterdrückt das Cockpit die „Portal-Zugangsdaten fehlen"-Warnung. */
  portalCredentialsNotRequired?: boolean;
  notes?: string;
  // Kündigungsdokumente
  cancellationLetterPath?: string;
  cancellationConfirmationPath?: string;
  cancellationLetterOptionsPath?: string;
  cancellationConfirmationOptionsPath?: string;
  // Kündigungsdaten
  cancellationConfirmationDate?: string;
  cancellationConfirmationOptionsDate?: string;
  wasSpecialCancellation?: boolean;
  energyDetails?: EnergyContractDetails;
  internetDetails?: InternetContractDetails;
  mobileDetails?: MobileContractDetails;
  tvDetails?: TvContractDetails;
  carInsuranceDetails?: CarInsuranceDetails;
  invoices?: Invoice[];
  documents?: ContractDocument[];
  // Snooze: Vertrag zurückstellen
  nextReviewDate?: string;
  followUpContract?: {
    id: number;
    contractNumber: string;
    status: ContractStatus;
  };
  createdAt: string;
  updatedAt: string;
}

export interface EnergyContractDetails {
  id: number;
  contractId: number;
  meterId?: number;
  meter?: Meter;
  maloId?: string;                 // Marktlokations-ID
  annualConsumption?: number;      // kWh für Strom, m³ für Gas
  annualConsumptionKwh?: number;   // kWh für Gas (zusätzlich zu m³)
  basePrice?: number;              // €/Monat
  unitPrice?: number;              // €/kWh (Arbeitspreis) - bei HT/NT: HT-Preis
  unitPriceNt?: number;            // €/kWh NT-Preis (nur bei Zweitarifzähler)
  instantBonus?: number;           // Sofort-Bonus
  newCustomerBonus?: number;       // Neukunden-Bonus
  noBonusDesired?: boolean;        // Kunde wünscht keine Bonis
  previousProviderName?: string;
  previousCustomerNumber?: string;
  invoices?: Invoice[];            // Rechnungen
  contractMeters?: ContractMeter[];  // Zähler-Zuordnungen (inkl. Folgezähler)
}

export interface InternetContractDetails {
  id: number;
  contractId: number;
  downloadSpeed?: number;
  uploadSpeed?: number;
  routerModel?: string;
  routerSerialNumber?: string;
  installationDate?: string;
  // Internet-Zugangsdaten
  internetUsername?: string;
  internetPasswordEncrypted?: string;
  // Objekt & Lage
  propertyType?: string;
  propertyLocation?: string;
  connectionLocation?: string;
  // Glasfaser-spezifisch
  homeId?: string;
  // Vodafone DSL/Kabel spezifisch
  activationCode?: string;
  phoneNumbers?: PhoneNumber[];
}

export interface PhoneNumber {
  id: number;
  // Komplette Nummer (Vorwahl + Anschluss). Bleibt für bestehende
  // Listen/Suchen die Quelle der Wahrheit. Vorwahl zusätzlich separat
  // gepflegt, damit Wechselauftrag-PDFs sie verlässlich befüllen.
  phoneNumber: string;
  areaCode?: string;
  isMain: boolean;
  // SIP-Zugangsdaten
  sipUsername?: string;
  sipPasswordEncrypted?: string;
  sipServer?: string;
}

export interface SimCard {
  id: number;
  mobileDetailsId: number;
  phoneNumber?: string;
  simCardNumber?: string;
  pin?: string;  // verschlüsselt
  puk?: string;  // verschlüsselt
  isMultisim: boolean;
  isMain: boolean;
  isEsim: boolean;
  // Tatsächlicher Nutzer der Karte (z.B. Mitarbeiter bei Firmenvertrag,
  // Kind bei Eltern-Vertrag) – optional, kann vom Vertragsinhaber abweichen.
  cardUser?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface MobileContractDetails {
  id: number;
  contractId: number;
  requiresMultisim?: boolean;
  /** Physisches Mobilfunknetz: TELEKOM | VODAFONE | TELEFONICA (oder null). */
  mobileNetwork?: string | null;
  dataVolume?: number;
  includedMinutes?: number;
  includedSMS?: number;
  deviceModel?: string;
  deviceImei?: string;
  simCards?: SimCard[];
  // Legacy-Felder
  phoneNumber?: string;
  simCardNumber?: string;
}

export interface TvContractDetails {
  id: number;
  contractId: number;
  receiverModel?: string;
  smartcardNumber?: string;
  package?: string;
}

export interface CarInsuranceDetails {
  id: number;
  contractId: number;
  licensePlate?: string;
  hsn?: string;
  tsn?: string;
  vin?: string;
  vehicleType?: string;
  firstRegistration?: string;
  noClaimsClass?: string;
  insuranceType: 'LIABILITY' | 'PARTIAL' | 'FULL';
  deductiblePartial?: number;
  deductibleFull?: number;
  policyNumber?: string;
  previousInsurer?: string;
}

export interface ApiResponse<T> {
  success: boolean;
  data?: T;
  message?: string;
  error?: string;
  pagination?: {
    page: number;
    limit: number;
    total: number;
    totalPages: number;
  };
}

// ==================== VERTRAGS-COCKPIT ====================

export type CockpitUrgencyLevel = 'critical' | 'warning' | 'ok' | 'none';

export interface CockpitIssue {
  type: string;
  label: string;
  urgency: CockpitUrgencyLevel;
  daysRemaining?: number;
  details?: string;
}

export interface CockpitContract {
  id: number;
  contractNumber: string;
  type: ContractType;
  status: ContractStatus;
  customer: {
    id: number;
    customerNumber: string;
    name: string;
  };
  provider?: {
    id: number;
    name: string;
  };
  tariff?: {
    id: number;
    name: string;
  };
  providerName?: string;
  tariffName?: string;
  issues: CockpitIssue[];
  highestUrgency: CockpitUrgencyLevel;
}

export interface CockpitSummary {
  totalContracts: number;
  criticalCount: number;
  warningCount: number;
  okCount: number;
  byCategory: {
    cancellationDeadlines: number;
    contractEnding: number;
    missingCredentials: number;
    missingData: number;
    missingInvoices: number;
    openTasks: number;
    pendingContracts: number;
    reviewDue: number;
    missingConsents: number;
  };
}

export interface DocumentAlert {
  id: number;
  type: string;
  documentNumber: string;
  expiryDate: string;
  daysUntilExpiry: number;
  urgency: CockpitUrgencyLevel;
  customer: {
    id: number;
    customerNumber: string;
    name: string;
  };
}

export interface ReportedMeterReading {
  id: number;
  readingDate: string;
  value: number;
  unit: string;
  notes?: string;
  reportedBy?: string;
  createdAt: string;
  meter: { id: number; meterNumber: string; type: string };
  customer: { id: number; customerNumber: string; name: string };
  contract?: { id: number; contractNumber: string };
  providerPortal?: {
    providerName: string;
    portalUrl: string;
    portalUsername?: string;
  };
}

export interface CockpitResult {
  contracts: CockpitContract[];
  cancellationConfirmations: CockpitContract[];
  documentAlerts: DocumentAlert[];
  reportedReadings: ReportedMeterReading[];
  summary: CockpitSummary;
  thresholds: {
    criticalDays: number;
    warningDays: number;
    okDays: number;
  };
}

// ==================== AUDIT-LOGGING & DSGVO ====================

export type AuditAction = 'CREATE' | 'READ' | 'UPDATE' | 'DELETE' | 'EXPORT' | 'ANONYMIZE' | 'LOGIN' | 'LOGOUT' | 'LOGIN_FAILED' | 'TOKEN_REFRESH';
export type AuditSensitivity = 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
export type ConsentType = 'DATA_PROCESSING' | 'MARKETING_EMAIL' | 'MARKETING_PHONE' | 'DATA_SHARING_PARTNER';
export type ConsentStatus = 'GRANTED' | 'WITHDRAWN' | 'PENDING';
export type DeletionRequestStatus = 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'PARTIALLY_COMPLETED' | 'REJECTED';

export interface AuditLog {
  id: number;
  userId?: number;
  userEmail: string;
  userRole?: string;
  customerId?: number;
  isCustomerPortal: boolean;
  action: AuditAction;
  sensitivity: AuditSensitivity;
  resourceType: string;
  resourceId?: string;
  resourceLabel?: string;
  endpoint: string;
  httpMethod: string;
  ipAddress: string;
  userAgent?: string;
  changesBefore?: string;
  changesAfter?: string;
  changesEncrypted: boolean;
  dataSubjectId?: number;
  legalBasis?: string;
  success: boolean;
  errorMessage?: string;
  durationMs?: number;
  createdAt: string;
  hash?: string;
  previousHash?: string;
}

export interface CustomerConsent {
  id: number | null;
  customerId: number;
  consentType: ConsentType;
  status: ConsentStatus;
  grantedAt?: string;
  withdrawnAt?: string;
  source?: string;
  documentPath?: string;
  version?: string;
  ipAddress?: string;
  createdBy?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface DataDeletionRequest {
  id: number;
  customerId: number;
  customer?: {
    id: number;
    customerNumber: string;
    firstName: string;
    lastName: string;
    email?: string;
  };
  status: DeletionRequestStatus;
  requestedAt: string;
  requestSource: string;
  requestedBy: string;
  processedAt?: string;
  processedBy?: string;
  deletedData?: string;
  retainedData?: string;
  retentionReason?: string;
  proofDocument?: string;
  createdAt: string;
  updatedAt: string;
}

export interface AuditRetentionPolicy {
  id: number;
  resourceType: string;
  sensitivity?: AuditSensitivity;
  retentionDays: number;
  description?: string;
  legalBasis?: string;
  isActive: boolean;
}

export interface GDPRDashboardStats {
  deletionRequests: {
    pending: number;
    completedLast30Days: number;
  };
  dataExports: {
    last30Days: number;
  };
  consents: {
    granted: number;
    withdrawn: number;
    pending: number;
  };
}

export interface ConsentTypeLabel {
  label: string;
  description: string;
}
