local-file-service

Notes

  • 2026-10-02 (entirely-api d683220): find_latest(record_id, category, suffix) is THE newest-by-mtime rule for “the current document on disk” (files directly in the category folder; subfolders such as INVOICES/supplemental excluded; traversal rejected by _project_dir). find_pdf (what send_invoice/resend_invoice attach) delegates to it, and both portal invoice preview routes serve find_latest(…, “INVOICES”, “.html”), so the reviewer sees the version that goes out. Never pick a version by sorting file names: “_v9” sorts after “_v10” (MAN-9209).