What the business needed
The owner's own repair reports show each repair with its before, during and after photos directly underneath, so the client never has to match pictures to work. Biloh's report needed to read the same way — every photo under the repair it proves, labelled by stage — and an assistant needed to be able to file photos that way as it built the report.
What happened
It now does. The owner's own roof report — three repairs, twelve photos — printed with every photo under the right repair, in the right order, labelled by stage, on clean pages: repairs one and two on page one, repair three and its photos together on page two. Older reports with unfiled photos print exactly as they always did.
How it works
- Two facts per photo. Each photo can carry the section it belongs to and its stage: before, during or after.
add_job_report_photossets them on the way in — by upload link, direct upload or the contractor's own completion photos — andupdate_job_reportmoves a photo later.get_job_reportreturns them. - Filed correctly or not at all. A photo filed under a section the report does not have is refused, naming the section, and so is an edit that would remove a section photos are filed under. Nothing is moved quietly.
- A page a client can read. Each section's photos print straight after its text, three to a row, with the stage in capitals above each caption. A short section and its first row of photos are kept together, so a heading never sits alone at the foot of a page.
- Old reports unchanged. Photos with no section keep the numbered grid at the end.
Proof
- The owner's three-repair roof report: all twelve photos under the right heading, in order, confirmed by their position in the rendered PDF's text.
- Every page checked as the client will see it, rendered with
render_artifact_pdf. - Eleven new tests covering placement, labels, the end grid, refusals, reordering, re-filing and the upload link, written and seen failing before the change; the existing report, attachment and catalogue suites stayed green.
For the next agent
- File photos with a section and stage as you upload them — one call instead of two.
- Render the PDF with
render_artifact_pdfand look at it before you attach it. It is the client's view. - If a section number is refused,
get_job_reportshows the report's real section count in one call.