Skip to content

Conversation

@sersery88
Copy link
Owner

Summary

This PR contains the complete Invoice Converter codebase for initial review.

What this app does

Rust-based Windows desktop application that converts complex Pink Travel AG invoices (PDFs) into simplified TUI-style invoices.

Key Components

  • Parser (src/parser/): PDF text extraction and regex-based data parsing
  • Generator (src/generator/): PDF generation with printpdf
  • UI (src/ui/): eframe/egui native GUI with drag & drop
  • Models (src/models/): Invoice, Customer, Flight, Pricing data structures
  • Export (src/export/): Excel and CSV export functionality

Review Focus Areas

  1. Parser robustness - The PDF text extraction handles different formats
  2. Error handling - Proper error propagation and user feedback
  3. Code structure - Idiomatic Rust patterns
  4. Security - File handling and user input validation

Please review the entire codebase for bugs, security issues, and best practices.


Pull Request opened by Augment Code with guidance from the PR author

@sersery88
Copy link
Owner Author

augment review

Please perform a comprehensive review of the entire codebase, focusing on:

  • Bug detection and logic errors
  • Security vulnerabilities
  • Rust best practices and idiomatic code
  • Error handling patterns
  • Cross-system issues

@augmentcode
Copy link

augmentcode bot commented Dec 17, 2025

🤖 Augment PR Summary

Summary: Adds an initial README.md describing the Invoice Converter app and its intended functionality.

Changes: Documents key features and provides a basic Cargo release build command for getting started.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Comment augment review to trigger a new review at any time.

- Verschiedene Templates

## Build
\\\ash
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build code block delimiter \\\�ash appears to include an unintended backspace escape (\b) and won’t render as a Markdown fenced code block; consider using standard triple-backticks (both opening and closing) so the build command displays correctly.

🤖 Was this useful? React with 👍 or 👎

@sersery88
Copy link
Owner Author

sersery88 commented Dec 17, 2025

augment review

Known Issues - Parser Not Working Correctly

The converter currently produces incomplete/wrong output. Here are the symptoms:

Expected Output (from source PDF):

  • Rechnungsnummer: 21639
  • Auftragsnummer: 315047
  • Kundennummer: 21736
  • Rechnungsdatum: 17.12.2025
  • Traveler: Frau Pusphamma Thadathil
  • Ticketnummer: 2760995628
  • Flugpreis: 201.00 CHF
  • Tax: 330.15 CHF
  • Serviceentgelt: 10.00 CHF
  • Gesamtbetrag: 541.15 CHF
  • 4 Flights: ZRH→DXB→COK→DXB→ZRH

Actual Output:

  • Nachname shows "L" instead of "Thadathil"
  • Gesamtbetrag shows "10.00 CHF" instead of "541.15 CHF"
  • Flights: 0 found (should be 4)
  • Many fields missing or wrong

Debug Log Shows:

Normalized text: Auftragsnummer:315047 Kundennummer:21736 Rechnungsdatum:17.12.2025
Traveler pattern did not match!
Price validation mismatch: 0 + 0 + 330.15 = 330.15 vs total 10
Flights: 0 found

Root Cause Analysis Needed:

  1. Text extraction inconsistency: pdf_oxide extracts text as Auftragsnummer:315047 (no space), but Python PyMuPDF extracts as 315047 Auftragsnummer: (value before label)
  2. Regex patterns in src/parser/extractor.rs may not handle both formats correctly
  3. Flight segment parsing regex doesn't match the normalized text format
  4. Traveler extraction pattern fails completely
  5. Price extraction assigns wrong values to wrong fields

Files to Review:

  • src/parser/extractor.rs - Main extraction logic with regex patterns
  • src/parser/mod.rs - PDF text extraction using pdf_oxide
  • src/generator/pdf_builder.rs - PDF generation (logo not rendering)

Please analyze why the regex patterns in extractor.rs fail to match and suggest fixes.

@sersery88
Copy link
Owner Author

augment review

The converter currently produces incomplete/wrong output. Here are the symptoms:

Expected Output (from source PDF):
Rechnungsnummer: 21639
Auftragsnummer: 315047
Kundennummer: 21736
Rechnungsdatum: 17.12.2025
Traveler: Frau Pusphamma Thadathil
Ticketnummer: 2760995628
Flugpreis: 201.00 CHF
Tax: 330.15 CHF
Serviceentgelt: 10.00 CHF
Gesamtbetrag: 541.15 CHF
4 Flights: ZRH→DXB→COK→DXB→ZRH
Actual Output:
Nachname shows "L" instead of "Thadathil"
Gesamtbetrag shows "10.00 CHF" instead of "541.15 CHF"
Flights: 0 found (should be 4)
Many fields missing or wrong
Debug Log Shows:
Normalized text: Auftragsnummer:315047 Kundennummer:21736 Rechnungsdatum:17.12.2025
Traveler pattern did not match!
Price validation mismatch: 0 + 0 + 330.15 = 330.15 vs total 10
Flights: 0 found
Root Cause Analysis Needed:
Text extraction inconsistency: pdf_oxide extracts text as Auftragsnummer:315047 (no space), but Python PyMuPDF extracts as 315047 Auftragsnummer: (value before label)
Regex patterns in src/parser/extractor.rs may not handle both formats correctly
Flight segment parsing regex doesn't match the normalized text format
Traveler extraction pattern fails completely
Price extraction assigns wrong values to wrong fields
Files to Review:
src/parser/extractor.rs - Main extraction logic with regex patterns
src/parser/mod.rs - PDF text extraction using pdf_oxide
src/generator/pdf_builder.rs - PDF generation (logo not rendering)
Please analyze why the regex patterns in extractor.rs fail to match and suggest fixes.

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants