Files
InvoiceShelf/tests/Feature/Admin
Darko Gjorgjijoski 01da03624d fix(seeder): assign unique_hash to seeded documents (#698)
RealisticDemoSeeder builds invoices, payments and estimates with
Model::create(), which bypasses both paths that normally set unique_hash
— the factories set it directly, and InvoiceService and friends encode it
from the id after insert. Nothing assigned it here, so every seeded
document had it NULL.

The PDF routes bind on that column, so the frontend built
`/invoices/pdf/` with an empty segment. That 404s, and the only symptom
is "Unable to load document preview" in the UI with nothing written to
the log, which makes it a genuinely slow thing to track down. Anyone who
seeds realistic demo data and opens a document hits it.

Production is unaffected: documents created through the app go through
the service layer, which assigns the hash. Existing seeded databases
need a backfill, encoding each id the same way the services do.

Uses Hashids, as the services do, rather than the factories' str_random,
so demo data matches what the app itself would have produced.
2026-07-29 10:41:45 +02:00
..
2024-06-05 11:33:52 +02:00
2024-06-05 11:33:52 +02:00
2024-06-05 11:33:52 +02:00
2024-06-05 11:33:52 +02:00
2024-06-05 11:33:52 +02:00
2025-01-12 18:37:08 +01:00