/**
 * Strukturierte Adresse (Typ "S") - seit November 2025 obligatorisch
 */
export interface StructuredAddress {
  name: string;
  street?: string;
  buildingNumber?: string;
  postalCode: string;
  city: string;
  country: string;
}

/**
 * Referenz-Typen nach SIX Spezifikation
 */
export type ReferenceType = 'QRR' | 'SCOR' | 'NON';

/**
 * Währungen
 */
export type Currency = 'CHF' | 'EUR';

/**
 * Sprachen für den Zahlteil
 */
export type Language = 'de' | 'fr' | 'it' | 'en';

/**
 * Referenz
 */
export interface Reference {
  type: ReferenceType;
  value?: string;
}

/**
 * Zusätzliche Informationen
 */
export interface AdditionalInformation {
  message?: string;
  billingInformation?: string;
}

/**
 * Output-Optionen
 */
export interface OutputOptions {
  language?: Language;
  separate?: boolean;
}

/**
 * Hauptstruktur für QR-Invoice Request
 */
export interface QRInvoiceRequest {
  creditor: {
    iban: string;
    address: StructuredAddress;
  };
  amount?: number;
  currency: Currency;
  reference?: Reference;
  debtor?: {
    address: StructuredAddress;
  };
  additionalInformation?: AdditionalInformation;
  options?: OutputOptions;
}

/**
 * API Error Response
 */
export interface ApiErrorResponse {
  error: string;
  message: string;
  details?: Array<{
    path: string;
    message: string;
  }>;
}
