getDepExportFile method

Future<DepExportFile> getDepExportFile(
  1. String exportId,
  2. String file, {
  3. Duration downloadTimeout = const Duration(minutes: 10),
  4. String? sha256,
})

Eine Datei eines fertigen Exports: file ist dep (JSON), protocol (PDF), items (CSV) oder zip.

Kleine Dateien kommen direkt, grosse als Lese-Link; dem Link folgt das Paket ohne Anmelde-Kopfzeilen (ID-Token und Kassen-Sitzung gehen nie an den Speicherdienst) und prueft Groesse und SHA-256. Mit sha256 (etwa DepExport.sha256 fuer dep) prueft es auch eine direkte Datei; eine Abweichung wirft KasseneckValidationError (kind: response). downloadTimeout gilt je fuer den Aufruf und fuer das Laden ueber den Link, nicht die Frist des Transports.

Implementation

Future<DepExportFile> getDepExportFile(
  String exportId,
  String file, {
  Duration downloadTimeout = const Duration(minutes: 10),
  String? sha256,
}) async {
  const name = Aufrufe.getDepExportFile;
  final bekannt = pruefeDepDateiEingabe(
    name,
    exportId: exportId,
    file: file,
    sha256: sha256,
    downloadTimeout: downloadTimeout,
  );
  final antwort = await transport.callRaw(
    name,
    params: {'exportId': exportId, 'file': file},
    timeout: downloadTimeout,
  );
  return depDateiAusAntwort(
    name,
    client: kassenHttpClient(transport),
    exportId: exportId,
    file: file,
    antwort: antwort,
    erfolgsHuelle: () => kassenErfolgsHuelle(name, antwort),
    frist: downloadTimeout,
    bekannt: bekannt,
  );
}