Phase 7: the client link
Staff make a link for a person (or "+ New client": a record with only the name they know, and its link); the client fills in their own record from their phone without a login, and presses Send. - Links (src/links.rs, migrations/0006): the table keeps the SHA-256 of the token only, as sessions do; the link is shown once, to copy, to email (mailto with the person's address) or as a QR code (qrcode crate, inline SVG). It is open 14 days, until Send, or until staff close it; a new link closes the earlier one. States open, opened, sent, closed, expired. - The client's pages at /c/<token> (src/web/client.rs, client_*.html in a frame of their own, phone first): About you, Passport (the photo reader; a zone fills in the personal details still empty), Address in Thailand, Contact, Documents, Send. Each part is saved on its own, straight into the record. Forms carry the link's own token plus the same-site check. A passport with the same number is changed; an address unlike the current one is added beside it, so the current one and its TM.30 receipt stay; a second save changes what the link added. Uploads (passport page, photo, visa, arrival stamp, TDAC, work permit, other) go through the same checks and encrypted store as staff uploads, tied to the person's newest record of their kind. - Audit: the client's views and changes carry the actor `link <id>`; actions send and close and entity link are new. The person's page shows the newest links, when they were opened and sent, and each record the client changed, with the fields, to check. - Demo data: Erika sent her link an hour ago (phone and email changed), Jane opened hers. - documents::read_upload returns why it refused, so the client's pages answer in their own words. Checks: fmt, clippy; 101 unit and 54 integration tests (tests/client.rs: the link shown once and kept as a hash, a new client, the whole client flow with the login on, forged, closed, expired and made-up links); layout check light/dark desk/phone on the client pages, the person page and the new client form: no problems; the camera reader on the client's passport page with a fake camera filled the form and Send closed the link.
This commit is contained in:
1 parent
a6ebdfc89c
commit
43ed75d81b
32 files changed
+2706
-40
No files matched your search
@@ -18,7 +18,7 @@ view and change of a person's record goes into an append-only activity log
|
||||
that names the fields changed but never their values, as Thailand's Personal
|
||||
Data Protection Act (PDPA) asks.
|
||||
|
||||
## What works now (phases 1 to 6)
|
||||
## What works now (phases 1 to 7)
|
||||
|
||||
- The Deadlines page: every person's coming deadlines, the most urgent
|
||||
first, with a filter by employer. It covers the 90-day report with its
|
||||
@@ -28,9 +28,19 @@ Data Protection Act (PDPA) asks.
|
||||
- The passport's zone from a photo: on the new person and new passport
|
||||
forms, "Take a photo" opens a camera view with a frame for the photo page
|
||||
and a band for the two lines, says when there is glare or too little
|
||||
light, and takes the photo once the lines look readable; "Choose a
|
||||
light, and takes the photo once the lines have looked readable and held
|
||||
still for 2.5 seconds; "Choose a
|
||||
picture" reads any image. The reading happens in the browser, so the
|
||||
photo stays on the device, and the check digits catch a misread.
|
||||
- The client link: on a person's page, or with "+ New client" for a new
|
||||
record, staff make a link to give the client by email, chat or as a QR
|
||||
code. Without a login, from their phone, the client fills in their
|
||||
personal details, the passport (from a photo of the photo page), the
|
||||
address in Thailand and contact, uploads scans, and presses Send. Each
|
||||
part goes straight into the record, logged as the link's; the person's
|
||||
page shows what the client changed, for staff to check. The app keeps
|
||||
only a hash of the link, which works for 14 days, until Send, or until
|
||||
staff close it.
|
||||
- A list of people with a filter and each person's next deadline, and a
|
||||
page per person with six tabs: the overview with personal details,
|
||||
passports and addresses; "Visa and stay" with arrivals and departures,
|
||||
|
||||
Reference in new issue
Block a user