{{--
Upload New Document — docs/wireframes-v12/add-upload-document.html
(the card at ~lines 79-217).
## Shape
ONE `.card`: a Reference section, a Document Details section with an "Add
More" button and a repeater, a Remark Notes section, and the footer.
## Deliberate differences from the wireframe
* **Customer is a fixed display, not a select** (decision D11). The
wireframe's free customer dropdown belongs to the standalone Customer
Documents module, which uploads against any customer; this screen is
reached from ONE booking and uploads against that booking's party, so
offering a choice of customer would offer a choice that cannot be
honoured.
* **The Booking Type chip is always shown**, not revealed by choosing a
customer: there is nothing to choose, so there is nothing to wait for.
It is the wireframe's own `fa-tag` pill, class for class.
* **The Document Type select lists only the PENDING types for the selected
person** — the types mapped to this booking's booking type and still
active, minus the ones that person already holds, minus the ones the
other rows have chosen. See "The pending set" below.
* **The wireframe's eleven hard-coded options are mock data.** The real
list is the CR-7 pivot, and a booking type that maps none never reaches
this screen at all — BookingController sends it to the booking instead.
## The pending set, and where the arithmetic lives (CR-15.1 items E1/E2)
The client's instruction is verbatim: *"Bookings -> Customer Document upload
time show only pending document types."* That is one rule with two halves,
and both halves are already written down once for the standalone module:
* the FIRST draw is server-rendered here, out of the cascade payload
BookingDocumentController::create() embeds — because no `change` event
fires on a freshly drawn page and the client module therefore never runs
there (CR-5 §15.4's lesson);
* every LATER draw — a co-applicant chosen or cleared, a row added or
removed, a sibling row's type picked — is nrems-customer-document-form.js
recomputing from the same payload, in the browser, with no request.
So this screen hosts the standalone module's own upload half rather than
carrying a second copy of its arithmetic: the root below wears the id that
module looks for, its `data-role` markers and its `data-strings`. What it
does NOT wear is `data-search-url` / `data-options-url` — there is no
Customer select to search and no booking to fetch, because this screen is
reached from one — so the module's select2 and cascade-fetch halves stand
down and its availability, repeater, file-panel and required-field halves
are what run.
**The script pushed at the foot of this file changed with it.** It was
nrems-booking-form.js, whose document half is a strict subset of what the
shared module does (add, remove, renumber) — keeping both would have bound
Add More twice.
## "All document already uploaded" (item E2)
Decision D11's state, verbatim wording and all, on this screen too: a person
with nothing left to file gets the message after the Booking Type chip, the
Document Details and Remark sections disappear, and the submit is disabled.
A booking type that maps no documents at all is a different thing and shows
nothing — that is a configuration gap, not a completed set.
## No lang file (CR-8 §0.1)
Every string on this screen is written here, on the client's instruction —
including the ones the client module puts on screen, which come in through
one JSON `data-strings` attribute rather than living in Javascript.
## The file inputs
`accept` is a filter and not a control — it decides what the picker offers
and nothing else. StoreCustomerDocRequest's `mimetypes:` + `max:` and its
extension closure are what actually decide, and both lists are built from the
same constants on BookingDocumentService, so the picker and the rules cannot
drift.
--}}
@extends('layouts.app')
@section('title', 'Upload New Document')
@section('breadcrumbs')