v0.4.5 — Alle Buttons und Funktionen verdrahtet
Fixes: - UpdatePlanEntry Stub/Hook: 7 Parameter → 4 (passend zu Go-Signatur) - AddPlanEntry: undefined → null für Go-Pointer-Parameter - Wails-Stubs (App.js/App.d.ts): Alle Signaturen an Go-Backend angepasst - ExportPDF: Go-Backend-Funktion hinzugefügt (Platzhalter mit Druckvorschau-Hinweis) - Version: 0.4.3 → 0.4.5 in Go-Konstante und InfoPage - Null-Safety: entries/special_days/products Arrays gegen null abgesichert - Allergen/Additive-Listen gegen null von Go abgesichert
This commit is contained in:
25
app.go
25
app.go
@@ -373,6 +373,31 @@ func (a *App) DownloadUpdate() (string, error) {
|
||||
return a.updater.DownloadUpdate(*info)
|
||||
}
|
||||
|
||||
// PDF EXPORT
|
||||
|
||||
// ExportPDF erstellt eine PDF-Datei des Wochenplans
|
||||
func (a *App) ExportPDF(weekPlanID int, outputPath string) (string, error) {
|
||||
// PDF-Export ist ein Platzhalter — in einer späteren Version wird hier
|
||||
// eine richtige PDF-Bibliothek (z.B. gofpdf) verwendet.
|
||||
// Vorerst geben wir eine Nachricht zurück.
|
||||
plan, err := a.getWeekPlanByID(weekPlanID)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Wochenplan nicht gefunden: %w", err)
|
||||
}
|
||||
return fmt.Sprintf("PDF-Export für KW %d/%d wird in einer zukünftigen Version unterstützt. Bitte nutzen Sie die Druckvorschau.", plan.Week, plan.Year), nil
|
||||
}
|
||||
|
||||
// getWeekPlanByID lädt einen Wochenplan anhand seiner ID
|
||||
func (a *App) getWeekPlanByID(id int) (*WeekPlan, error) {
|
||||
var plan WeekPlan
|
||||
query := "SELECT id, year, week, created_at FROM week_plans WHERE id = ?"
|
||||
err := db.Get(&plan, query, id)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get week plan by ID: %w", err)
|
||||
}
|
||||
return &plan, nil
|
||||
}
|
||||
|
||||
// HILFSFUNKTIONEN
|
||||
|
||||
// loadProductRelations lädt Allergene und Zusatzstoffe für ein Produkt
|
||||
|
||||
Reference in New Issue
Block a user