# CR-11 — Documents tab: show whose document each row is

Requirements by the BA (Fable), 2026-09-02, from the client's instruction:
"Documents tab in booking edit and view screen show actual document who's
persone name add customer or co owner name inside Name field whatever person
document." Plus: "Please don't create test cases and policies."

A display-only change to the **bookings module (CR-8)** — that module's §0
client overrides stand (no lang files, no policies, no new test files;
existing pinned tests may be minimally updated to keep the suite green).

## 1. Context (verified)

- `customer_docs.customer_id` already records WHOSE document each row is —
  the main customer or the co-owner picked in the upload screen's
  Co-Applicant select (migration `2026_08_31_130003`, its docblock's "two
  owning foreign keys" section). Nothing about who owns a document changes;
  the tab simply never displayed it.
- The tab is ONE shared partial,
  `resources/views/bookings/partials/documents.blade.php`, included by both
  `bookings/edit.blade.php` and `bookings/show.blade.php` — so one edit
  covers both screens the client named.
- `CustomerDoc::customer()` BelongsTo exists; the person's name column is
  `customers.name`.
- The wireframe's documents table (edit-booking.html ~line 364) has NO person
  column — this is a client addition beyond the wireframe, slotted into the
  existing table language.

## 2. The change

1. **New column "Name"** in the documents table, positioned between
   "Document Type" and "File Name" (D2). Cell:
   `{{ $document->customer?->name ?? '—' }}` — escaped, em-dash blank if the
   customer row is somehow gone. Plain name only, no co-applicant badge or
   suffix (D1: the client asked for the name, nothing more — main customer
   and co-owner render identically).
2. **Eager load** `documents.customer:id,name` added to BOTH controller
   eager-load lists that feed the partial (`BookingController::show()`
   ~line 162-167 and `::edit()` ~line 191-196) so the new cell costs no N+1.
   The partial runs no queries of its own today; keep it that way.
3. Nothing else moves: header/footer, empty state, actions, permissions,
   cancelled-booking behavior, upload screen, and the standalone Customer
   Documents section (future CR) are all untouched.

## 3. Decisions

- **D1** Name only — no "(Co-Applicant)" marker. The upload screen already
  distinguishes; the client asked for "customer or co owner name", not a
  role label.
- **D2** (BA) Column position: after Document Type, before File Name — the
  row reads "what kind, whose, which file".
- **D3** No schema, route, service, or JS change. No policy, no new tests
  (client). If an existing pinned test asserts the documents table's header
  row, update it minimally; add no new test files.

## 4. Definition of Done

Run with `C:\wamp64\bin\php\php8.3.28\php.exe`: full `artisan test`
FOREGROUND green (1097 expected, 4 pre-existing skips),
phpstan level 6 = 0, `pint --test --dirty` clean (ignore the pre-existing
corrupt `tests/Feature/Projects/ProjectCrudTest.php`, never touch it).
Commit NOTHING; run no git write commands.
